diff options
author | Brad King <brad.king@kitware.com> | 2012-08-24 12:48:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-24 14:52:23 (GMT) |
commit | 7195aca54f40778f41894c9e62649afe09e71d6c (patch) | |
tree | 9c8791d0650348d2f532e4112b6150404303a8a4 /Modules/CMakeTestCXXCompiler.cmake | |
parent | ec22a9b5217c2110db9af1791a61a7552144f028 (diff) | |
download | CMake-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 'Modules/CMakeTestCXXCompiler.cmake')
-rw-r--r-- | Modules/CMakeTestCXXCompiler.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake index 5ed826b..f62c0e0 100644 --- a/Modules/CMakeTestCXXCompiler.cmake +++ b/Modules/CMakeTestCXXCompiler.cmake @@ -37,8 +37,8 @@ if(NOT CMAKE_CXX_COMPILER_WORKS) # if the compiler is broken make sure to remove the platform file # since Windows-cl configures both c/cxx files both need to be removed # when c or c++ fails - file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake ) - file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake ) + file(REMOVE ${CMAKE_PLATFORM_INFO_DIR}/CMakeCPlatform.cmake ) + file(REMOVE ${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXPlatform.cmake ) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the CXX compiler works failed with " "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") @@ -64,10 +64,10 @@ else() CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp) configure_file( ${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake + ${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 ) - include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake) + include(${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake) endif() if(CMAKE_CXX_SIZEOF_DATA_PTR) foreach(f ${CMAKE_CXX_ABI_FILES}) |