title: Setting a NEW environment variable with CMake?
body: <p>I am trying to set a new environment variable with CMake. Said environment variable does not exist prior to calling <code>cmake</code> and I don't need it to exist after my script has run. The problem is that I can modify existing environment variables, but I cannot create a new environment variable. </p>
  
  <p>Here's a test I did:</p>
  
  <pre><code>$ echo $LD_LIBRARY_PATH
  </code></pre>
  
  <p>No output.</p>
  
  <p>In CMake script:</p>
  
  <pre><code>message(STATUS "$ENV{LD_LIBRARY_PATH}")
  </code></pre>
  
  <p>No output.</p>
  
  <p>In shell:</p>
  
  <pre><code>$ echo $LANGUAGE
  en_CA:en
  </code></pre>
  
  <p>In CMake script:</p>
  
  <pre><code>message(STATUS "$ENV{LANGUAGE}")
  en_CA:en
  </code></pre>
  
  <p>Obviously I can display an existing variable without issues, the problem is when I try to add a new one. Here's the second test I did:</p>
  
  <p>In CMake script:</p>
  
  <pre><code>set(ENV{'LD_LIBRARY_PATH'} "potato")
  message(STATUS "$ENV{LD_LIBRARY_PATH}")
  </code></pre>
  
  <p>No output</p>
  
  <p>In CMake script:</p>
  
  <pre><code>set(ENV{'LANGUAGE'} "$ENV{LANGUAGE}:potato")
  message(STATUS "$ENV{LANGUAGE}")
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>en_CA:en:potato
  </code></pre>
  
  <p>This is problematic to me. How can I go about setting a NEW environment variable?</p>