title: cmake : Set environment variables from a script
body: <p>I have a script that sets all variables needed for the cross-compilation. Here is just part of it :</p>
  
  <pre><code>export CONFIG_SITE=~/workspace/eldk-5.4/powerpc/site-config-powerpc-linux
  export CC="powerpc-linux-gcc  -m32 -mhard-float --sysroot=~/workspace/eldk-5.4/powerpc/sysroots/powerpc-linux"
  export CXX="powerpc-linux-g++  -m32 -mhard-float --sysroot=~/workspace/eldk-5.4/powerpc/sysroots/powerpc-linux"
  export CPP="powerpc-linux-gcc -E  -m32 -mhard-float --sysroot=~/workspace/eldk-5.4/powerpc/sysroots/powerpc-linux"
  export AS="powerpc-linux-as "
  export LD="powerpc-linux-ld  --sysroot=~/workspace/eldk-5.4/powerpc/sysroots/powerpc-linux"
  export GDB=powerpc-linux-gdb
  </code></pre>
  
  <p>If I do <code>source environment-setup-powerpc-linux</code>, all environment variables are imported into the current shell session, and I can compile my example.</p>
  
  <p>Is it possible to import these variables in cmake? If yes, how?</p>
  
  <hr>
  
  <p>A bit more details :</p>
  
  <ol>
  <li>I am using <a href="http://www.denx.de/wiki/ELDK-5" rel="noreferrer">ELDK v 5.4</a>, and it's install script generates a script which sets all environment variables</li>
  <li>I found <a href="http://www.cmake.org/Wiki/CmakeEldk" rel="noreferrer">this tutorial</a>, which explains how to manually set for cross-compilation, but not how to use the script, which sets everything</li>
  <li>if I call the script before setting cmake, all works fine, and I can cross-compile, but I'd like that cmake calls the script</li>
  </ol>