MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0009992 | CMake | CMake | public | 2009-12-02 12:00 | 2010-11-09 22:57 | |||||
Reporter | Ryan Pavlik | |||||||||
Assigned To | David Cole | |||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||||
Status | closed | Resolution | fixed | |||||||
Platform | OS | OS Version | ||||||||
Product Version | CMake-2-8 | |||||||||
Target Version | CMake 2.8.3 | Fixed in Version | CMake 2.8.3 | |||||||
Summary | 0009992: Install dir on Win64 always starts with c:/program files (x86)/ regardless of architecture of build | |||||||||
Description | The issue here is that CMAKE_INSTALL_PREFIX seems to be using the %ProgramFiles% environment variable to set this, which is problematic: on win64 machines, the WOW64 subsystem transparently changes this environment variable to point to the program files dir that matches the architecture of the running application (in this case, CMake-Gui though I presume cmake itself has the same issue). When building a 64-bit application (using a 64-bit generator), this results in an incorrect install prefix and potentially broken/weird installers. Here's the logic and comments I wrote in a CMake module related to this that describes the solution - _PROGFILESDIR at the end of this code contains the correct "prefix" for the install prefix: # caution - ENV{ProgramFiles} on Win64 is adjusted to point to the arch of the running executable # which, since CMake is 32-bit on Windows as I write this, will always be = $ENV{ProgramFiles(x86)} # so we only use this environment variable if we figure out we're on win32 file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _PROG_FILES) # 32-bit dir on win32, useless to us on win64 file(TO_CMAKE_PATH "$ENV{ProgramFiles(x86)}" _PROG_FILES_X86) # 32-bit dir: only set on win64 file(TO_CMAKE_PATH "$ENV{ProgramW6432}" _PROG_FILES_W6432) # 64-bit dir: only set on win64 if(CMAKE_SIZEOF_VOID_P MATCHES "8") # 64-bit build on win64 set(_PROGFILESDIR "${_PROG_FILES_W6432}") else() if(_PROG_FILES_W6432) # 32-bit build on win64 set(_PROGFILESDIR "${_PROG_FILES_X86}") else() # 32-bit build on win32 set(_PROGFILESDIR "${_PROG_FILES}") endif() endif() | |||||||||
Steps To Reproduce | ||||||||||
Additional Information | This bug also exists in CMake 2.6. | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | 20100115-install-prefix.zip (3,066) 2010-01-15 11:01 https://public.kitware.com/Bug/file/2773/20100115-install-prefix.zip | |||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2009-12-02 12:00 | Ryan Pavlik | New Issue | ||||||||
2009-12-02 12:08 | Bill Hoffman | Status | new => assigned | |||||||
2009-12-02 12:08 | Bill Hoffman | Assigned To | => David Cole | |||||||
2010-01-15 11:01 | Ryan Pavlik | File Added: 20100115-install-prefix.zip | ||||||||
2010-01-15 11:02 | Ryan Pavlik | Note Added: 0019150 | ||||||||
2010-04-19 12:04 | David Cole | Relationship added | related to 0006363 | |||||||
2010-04-19 13:00 | Ryan Pavlik | Note Added: 0020256 | ||||||||
2010-08-25 07:35 | David Cole | Note Added: 0021942 | ||||||||
2010-08-25 08:55 | Rolf Eike Beer | Note Added: 0021949 | ||||||||
2010-08-25 12:57 | David Cole | Note Added: 0021958 | ||||||||
2010-08-25 13:35 | Rolf Eike Beer | Note Added: 0021960 | ||||||||
2010-08-31 17:57 | David Cole | Target Version | => CMake 2.8.3 | |||||||
2010-09-09 12:38 | David Cole | Note Added: 0022163 | ||||||||
2010-09-09 12:38 | David Cole | Status | assigned => resolved | |||||||
2010-09-09 12:38 | David Cole | Resolution | open => fixed | |||||||
2010-10-06 14:15 | David Cole | Fixed in Version | => CMake 2.8.3 | |||||||
2010-11-09 22:57 | Philip Lowman | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|