View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007084CMakeCMakepublic2008-05-23 11:362008-09-09 14:21
Reporterkentwilliams 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0007084: Re-running CMake twice on the same directory corrupts CMakeCache.txt
DescriptionFound with a complicated batch build system.

If the build directory does not exist (or if you delete the CMakeCache.txt) the build works fine.

If you run CMake a second time with the same command line parameters it writes a new CMakeCache.txt file, but with incorrect values for important CMAKE variables like CMAKE_INSTALL_PREFIX

Clue: The second cmake produces this error message:

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_C_COMPILER= gcc
CMAKE_CXX_COMPILER= g++
Additional InformationThe attached tar file demonstrates the problem:

Untar CMakeTestBatchBuild.tar.gz
cd CMakeTestBatchBuild
sh testscript
TagsNo tags attached.
Attached Filesgz file icon CMakeTestBatchBuild.tar.gz [^] (3,443 bytes) 2008-05-23 11:36

 Relationships

  Notes
(0012277)
Bill Hoffman (manager)
2008-06-06 11:18

This because CMake thinks the compilers are changing on it, and the cache is cleared, but the cache clearing clears the -D options at the same time. The fix should be to clear all, and then put back the -D option stuff. Or to not see this as a compiler change which it really isn't. But if there was a compiler change, then the -D stuff would still get cleared.
(0012278)
Bill Hoffman (manager)
2008-06-06 11:18

The work around for now, is to use CC,CXX environment variables to pick the compiler and not -D.

 Issue History
Date Modified Username Field Change
2008-05-23 11:36 kentwilliams New Issue
2008-05-23 11:36 kentwilliams File Added: CMakeTestBatchBuild.tar.gz
2008-06-06 11:18 Bill Hoffman Note Added: 0012277
2008-06-06 11:18 Bill Hoffman Note Added: 0012278
2008-06-06 11:19 Bill Hoffman Status new => assigned
2008-06-06 11:19 Bill Hoffman Assigned To => Bill Hoffman
2008-09-09 14:21 Bill Hoffman Status assigned => closed
2008-09-09 14:21 Bill Hoffman Resolution open => won't fix


Copyright © 2000 - 2018 MantisBT Team