summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-24 12:48:59 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-24 14:52:23 (GMT)
commit7195aca54f40778f41894c9e62649afe09e71d6c (patch)
tree9c8791d0650348d2f532e4112b6150404303a8a4 /Source
parentec22a9b5217c2110db9af1791a61a7552144f028 (diff)
downloadCMake-7195aca54f40778f41894c9e62649afe09e71d6c.zip
CMake-7195aca54f40778f41894c9e62649afe09e71d6c.tar.gz
CMake-7195aca54f40778f41894c9e62649afe09e71d6c.tar.bz2
Make platform information files specific to the CMake version
At the top of a build tree we configure inside the CMakeFiles directory files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to save information detected about the system and compilers in use. The method of detection and the exact results store varies across CMake versions as things improve. This leads to problems when loading files configured by a different version of CMake. Previously we ignored such existing files only if the major.minor part of the CMake version component changed, and depended on the CMakeCache.txt to tell us the last version of CMake that wrote the files. This led to problems if the user deletes the CMakeCache.txt or we add required information to the files in a patch-level release of CMake (still a "feature point" release by modern CMake versioning convention). Ensure that we always have version-consistent platform information files by storing them in a subdirectory named with the CMake version. Every version of CMake will do its own system and compiler identification checks even when a build tree has already been configured by another version of CMake. Stored results will not clobber those from other versions of CMake which may be run again on the same tree in the future. Loaded results will match what the system and language modules expect. Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to CMAKE_PLATFORM_INFO_DIR to clarify its purpose. The new variable points at the version-specific directory while the old variable did not.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx13
-rw-r--r--Source/cmake.cxx3
2 files changed, 4 insertions, 12 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 52b451c..578fa9e 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -315,9 +315,11 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
{
rootBin = this->ConfiguredFilesPath;
}
+ rootBin += "/";
+ rootBin += cmVersion::GetCMakeVersion();
// set the dir for parent files so they can be used by modules
- mf->AddDefinition("CMAKE_PLATFORM_ROOT_BIN",rootBin.c_str());
+ mf->AddDefinition("CMAKE_PLATFORM_INFO_DIR",rootBin.c_str());
// find and make sure CMAKE_MAKE_PROGRAM is defined
this->FindMakeProgram(mf);
@@ -386,14 +388,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
// If the existing build tree was already configured with this
// version of CMake then try to load the configured file first
// to avoid duplicate compiler tests.
- unsigned int cacheMajor = mf->GetCacheMajorVersion();
- unsigned int cacheMinor = mf->GetCacheMinorVersion();
- unsigned int selfMajor = cmVersion::GetMajorVersion();
- unsigned int selfMinor = cmVersion::GetMinorVersion();
- if((this->CMakeInstance->GetIsInTryCompile() ||
- (cacheMajor == 0 && cacheMinor == 0) ||
- (selfMajor == cacheMajor && selfMinor == cacheMinor)) &&
- cmSystemTools::FileExists(fpath.c_str()))
+ if(cmSystemTools::FileExists(fpath.c_str()))
{
if(!mf->ReadListFile(0,fpath.c_str()))
{
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 75aa471..f2a0226 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2438,9 +2438,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
this->PreLoadCMakeFiles();
- std::string systemFile = this->GetHomeOutputDirectory();
- systemFile += "/CMakeSystem.cmake";
-
if ( noconfigure )
{
return 0;