MantisBT - CMake | ||||||||||||||||||||
View Issue Details | ||||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||||||||||
0014294 | CMake | CMake | public | 2013-07-15 20:17 | 2015-01-05 08:39 | |||||||||||||||
Reporter | Greg Coombe | |||||||||||||||||||
Assigned To | Brad King | |||||||||||||||||||
Priority | normal | Severity | major | Reproducibility | always | |||||||||||||||
Status | closed | Resolution | fixed | |||||||||||||||||
Platform | Linux | OS | Ubuntu | OS Version | 12.04 | |||||||||||||||
Product Version | CMake 2.8.11.2 | |||||||||||||||||||
Target Version | CMake 3.1 | Fixed in Version | CMake 3.1 | |||||||||||||||||
Summary | 0014294: Specifying CMAKE_CXX_COMPILER=g++ after first run deletes all cached values | |||||||||||||||||||
Description | If I specify a command-line option using the "option()" function and provide it on the command line along with CMAKE_<lang>_COMPILER option (specified without full path), it is overwritten. | |||||||||||||||||||
Steps To Reproduce | 1. Make a small CMakeLists.txt: cmake_minimum_required(VERSION 2.8.11) option(RERUN_TEST "Re-run me!" OFF) message(STATUS "Re-run test variable is " ${RERUN_TEST}) 2. Run twice with both the option specified, as well as the compiler: $ cmake -D RERUN_TEST=ON -D CMAKE_CXX_COMPILER=g++ CMakeLists.txt -- The C compiler identification is GNU 4.6.3 -- The CXX compiler identification is GNU 4.6.3 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/g++ -- Check for working CXX compiler: /usr/bin/g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Re-run test variable is ON -- Configuring done -- Generating done $ cmake -D RERUN_TEST=ON -D CMAKE_CXX_COMPILER=g++ CMakeLists.txt -- Re-run test variable is ON -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_CXX_COMPILER= g++ -- The C compiler identification is GNU 4.6.3 -- The CXX compiler identification is GNU 4.6.3 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/g++ -- Check for working CXX compiler: /usr/bin/g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Re-run test variable is OFF -- Configuring done -- Generating done So now we've built the project without the command-line option. 3. Interestingly, note that using the full path of the compiler doesn't have the same behavior: $ cmake -D RERUN_TEST=ON -D CMAKE_CXX_COMPILER=/usr/bin/g++ CMakeLists.txt -- Re-run test variable is ON -- Configuring done -- Generating done | |||||||||||||||||||
Additional Information | Speculation: It appears that CMake is writing the CMAKE_<lang>_COMPILER value to the cache before expanding it, then interpreting the different value as requiring a re-run. This re-run ignores the command-line options (maybe because the cache is nuked: http://public.kitware.com/Bug/view.php?id=13756 [^]). | |||||||||||||||||||
Tags | No tags attached. | |||||||||||||||||||
Relationships |
| |||||||||||||||||||
Attached Files | CMakeLists.txt (131) 2013-07-15 20:17 https://public.kitware.com/Bug/file/4818/CMakeLists.txt | |||||||||||||||||||
Issue History | ||||||||||||||||||||
Date Modified | Username | Field | Change | |||||||||||||||||
2013-07-15 20:17 | Greg Coombe | New Issue | ||||||||||||||||||
2013-07-15 20:17 | Greg Coombe | File Added: CMakeLists.txt | ||||||||||||||||||
2013-07-16 08:39 | Brad King | Relationship added | related to 0006102 | |||||||||||||||||
2013-07-16 08:39 | Brad King | Relationship added | related to 0013756 | |||||||||||||||||
2013-07-16 08:43 | Brad King | Status | new => backlog | |||||||||||||||||
2013-07-16 08:43 | Brad King | Summary | Command-line options overwritten by re-run => Specifying CMAKE_CXX_COMPILER=g++ after first run deletes all cached values | |||||||||||||||||
2013-07-16 08:43 | Brad King | Note Added: 0033549 | ||||||||||||||||||
2013-07-16 08:48 | Brad King | Note Added: 0033550 | ||||||||||||||||||
2014-07-24 13:46 | Brad King | Relationship added | duplicate of 0014366 | |||||||||||||||||
2014-07-24 13:49 | Brad King | Note Added: 0036455 | ||||||||||||||||||
2014-07-24 13:50 | Brad King | Assigned To | => Brad King | |||||||||||||||||
2014-07-24 13:50 | Brad King | Status | backlog => assigned | |||||||||||||||||
2014-07-24 13:50 | Brad King | Target Version | => CMake 3.1 | |||||||||||||||||
2014-07-28 10:52 | Brad King | Status | assigned => resolved | |||||||||||||||||
2014-07-28 10:52 | Brad King | Resolution | open => fixed | |||||||||||||||||
2014-07-28 10:52 | Brad King | Fixed in Version | => CMake 3.1 | |||||||||||||||||
2015-01-05 08:39 | Robert Maynard | Note Added: 0037594 | ||||||||||||||||||
2015-01-05 08:39 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|