You have discovered the magic of Windows. Again.<div><br></div><div>CMake is a 32-bit process. When Windows launches a 32-bit process on a Win64 machine, it gives the 32-bit process &quot;C:\ProgramFiles (x86)&quot; as the value of the env var &quot;ProgramFiles&quot;. But you are testing it from a 64-bit program, the default cmd.exe on Win64.<br>
<br></div><div>You can also test if from the 32-bit cmd.exe, which is available at C:\WINDOWS\SysWow64\cmd.exe:</div><div><br></div><div>(default 64-bit cmd.exe results)</div><div><div>C:\&gt;set ProgramFiles</div><div>ProgramFiles=C:\Program Files</div>
<div>ProgramFiles(x86)=C:\Program Files (x86)</div><div><br></div><div>(explicit 32-bit cmd.exe results -- same as what cmake gets as a 32-bit app)</div><div></div><div>C:\&gt;C:\WINDOWS\SysWow64\cmd.exe</div><div>Microsoft Windows [Version 5.2.3790]</div>
<div>(C) Copyright 1985-2003 Microsoft Corp.</div><div><br></div><div>C:\&gt;set ProgramFiles</div><div>ProgramFiles=C:\Program Files (x86)</div><div>ProgramFiles(x86)=C:\Program Files (x86)</div><div><br></div><div>C:\&gt;exit</div>
<div><br></div><div>C:\&gt;</div><div><br></div><div><br></div><div>So..... cmake is not wrong. Windows is not wrong. It just is what it is. ProgramFiles is a &quot;special&quot; env var. Adapt accordingly, I guess, is the best advice I have for you... :-)</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br></div><div><br></div><div class="gmail_quote">On Mon, Nov 10, 2008 at 5:04 PM, Eric (Brad) Lemings <span dir="ltr">&lt;<a href="mailto:brad@rebit.com">brad@rebit.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Consider the following:<br>
<br>
 &nbsp; &nbsp;C:\Users\myself\Test&gt;type CMakeLists.txt<br>
 &nbsp; &nbsp;cmake_minimum_required(VERSION 2.6)<br>
 &nbsp; &nbsp;project (Test)<br>
 &nbsp; &nbsp;message (STATUS ENV{ProgramFiles}=$ENV{ProgramFiles})<br>
<br>
 &nbsp; &nbsp;C:\Users\myself\Test&gt;set ProgramFiles<br>
 &nbsp; &nbsp;ProgramFiles=C:\Program Files<br>
 &nbsp; &nbsp;ProgramFiles(x86)=C:\Program Files (x86)<br>
<br>
 &nbsp; &nbsp;C:\Users\myself\Test&gt;cmake -G &quot;NMake Makefiles&quot;<br>
 &nbsp; &nbsp;-- ENV{ProgramFiles}=C:\Program Files (x86)<br>
 &nbsp; &nbsp;-- Configuring done<br>
 &nbsp; &nbsp;-- Generating done<br>
 &nbsp; &nbsp;-- Build files have been written to:<br>
C:/Users/elemings/Developer/Test/CMake/test05<br>
<br>
A.) Why is CMake intentionally using the wrong value for ProgramFiles,<br>
and B.) should this be corrected?<br>
<br>
Thanks,<br>
Eric.<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>