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 "C:\ProgramFiles (x86)" as the value of the env var "ProgramFiles". 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:\>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:\>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:\>set ProgramFiles</div><div>ProgramFiles=C:\Program Files (x86)</div><div>ProgramFiles(x86)=C:\Program Files (x86)</div><div><br></div><div>C:\>exit</div>
<div><br></div><div>C:\></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 "special" 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"><<a href="mailto:brad@rebit.com">brad@rebit.com</a>></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>
C:\Users\myself\Test>type CMakeLists.txt<br>
cmake_minimum_required(VERSION 2.6)<br>
project (Test)<br>
message (STATUS ENV{ProgramFiles}=$ENV{ProgramFiles})<br>
<br>
C:\Users\myself\Test>set ProgramFiles<br>
ProgramFiles=C:\Program Files<br>
ProgramFiles(x86)=C:\Program Files (x86)<br>
<br>
C:\Users\myself\Test>cmake -G "NMake Makefiles"<br>
-- ENV{ProgramFiles}=C:\Program Files (x86)<br>
-- Configuring done<br>
-- Generating done<br>
-- 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>