diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2013-02-25 15:14:36 (GMT) |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2013-02-25 15:14:36 (GMT) |
commit | add8d22acc9417cb144a0b497f4f5ef330bfc680 (patch) | |
tree | 241cd161cc7a5b2bed2d63b2f51bed0359ce0ea0 /Modules/CMakeDetermineSystem.cmake | |
parent | e597ba29288db609d0c3c797848fa7649851b1ee (diff) | |
download | CMake-add8d22acc9417cb144a0b497f4f5ef330bfc680.zip CMake-add8d22acc9417cb144a0b497f4f5ef330bfc680.tar.gz CMake-add8d22acc9417cb144a0b497f4f5ef330bfc680.tar.bz2 |
properly detect processor architecture on Windows
CMake is usually run as a 32 bit process even on 64 bit Windows, so the
PROCESSOR_ARCHITECTURE environment variable would always return x86. This post
gives a description on how to do it properly:
http://blogs.msdn.com/b/david.wang/archive/2006/03/26/howto-detect-process-bitness.aspx
Diffstat (limited to 'Modules/CMakeDetermineSystem.cmake')
-rw-r--r-- | Modules/CMakeDetermineSystem.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index c7f9c32..20c1541 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -73,7 +73,11 @@ if(CMAKE_HOST_UNIX) else() if(CMAKE_HOST_WIN32) set (CMAKE_HOST_SYSTEM_NAME "Windows") - set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") + if (ENV{PROCESSOR_ARCHITEW6432}) + set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}") + else() + set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") + endif() endif() endif() |