[CMake] Windows 64: $ENV{PROGRAMFILES}

Stephane Rouleau (Consultant) stephane.rouleau at autodesk.com
Fri Jun 1 16:58:24 EDT 2007


Hi Georg,

Looks like you are running a 32 bits version of cmake, correct?  So this
behavior would be 'expected'.  You can see this by launching the cmd.exe
that's under the "Syswow64"  folder instead of the regular "System32"
folder:

System32\cmd.exe:
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)

Syswow64\cmd.exe:
ProgramFiles=C:\Program Files (x86)
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files

You can check for the 'ProgramW6432' environment variable instead, and
if it's not defined fall back to 'programfiles'

HTH

Stephane

-----Original Message-----
From: cmake-bounces+stephane.rouleau=autodesk.com at cmake.org
[mailto:cmake-bounces+stephane.rouleau=autodesk.com at cmake.org] On Behalf
Of Georg Richter
Sent: June 1, 2007 4:34 PM
To: cmake at cmake.org
Subject: [CMake] Windows 64: $ENV{PROGRAMFILES}

Hello,

just detected some strange behaviour on Windows64, when using the
$ENV{PROGRAMFILES} variable.

an echo %PROGRAMFILES% in shell shows a path to C:\Program Files inside
CMake $ENV{PROGRAMFILES} returns C:\Program Files(x86).

Any hints how to solve this? According to the documentation ENV returns
the value of environment variables. There is another environment
variable PROGRAMFILES(X86), obviously CMake returns it content.

/Georg
_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list