MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0013815 | CMake | CMake | public | 2012-12-26 19:10 | 2016-06-10 14:31 |
Reporter | Stephen McCracken | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | Visual Studio 11 Win64 | OS | Windows | OS Version | 7 |
Product Version | CMake 2.8.10.2 | ||||
Target Version | Fixed in Version | ||||
Summary | 0013815: CMake uses compiler settings under CMakeFiles without verifying that they match the current generator. | ||||
Description | The first time you run CMake in a clean directory, the enable_language(C) and enable_language(CXX) commands test the compilers for the currently-selected generator (say 32-bit Visual Studio 11) and caches the results in the files CMakeFiles/CMakeCCompiler.cmake and CMakeFiles/CMakeCXXCompiler.cmake. If you then delete CMakeCache.txt and switch the generator to 64-bit Visual Studio 11 Win64, CMake will not re-test the compiler, and it will proceed with the incorrect cached results for the old (32-bit) generator. This behavior can be very confusing when debugging CMake errors. In my case, find_package( PythonLibs 2.7 ) was failing because I was trying to use a 64-bit Python 2.7.3 installation with the 32-bit Visual Studio 11 generator. However, when I switched to 64-bit and deleted CMakeCache.txt (but not the CMakeFiles directory), PythonLibs still was not found because CMake was reading CMAKE_SIZEOF_VOID_P=4 from the CMakeFiles directory, which make it look for 32-bit registry settings for the Python installation directory. | ||||
Steps To Reproduce | 1) Create a simple CMakeLists.txt file with the following 2 lines: enable_language( CXX ) message( STATUS "CMAKE_SIZEOF_VOID_P=${CMAKE_SIZEOF_VOID_P}" ) 2) Run cmake-gui with the Visual Studio 11 generator, and observe the output: CMAKE_SIZEOF_VOID_P=4 3) Delete the CMakeCache.txt file. 4) Run cmake-gui again from the same directory, but choose the Visual Studio 11 Win64 generator. Observe the incorrect output value: CMAKE_SIZEOF_VOID_P=4 | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-12-26 19:10 | Stephen McCracken | New Issue | |||
2012-12-27 04:04 | Rolf Eike Beer | Note Added: 0031944 | |||
2012-12-27 08:47 | David Cole | Note Added: 0031945 | |||
2012-12-27 13:21 | Stephen McCracken | Note Added: 0031949 | |||
2016-06-10 14:28 | Kitware Robot | Note Added: 0042184 | |||
2016-06-10 14:28 | Kitware Robot | Status | new => resolved | ||
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot | ||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|