summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-08 15:27:51 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-08 15:27:51 (GMT)
commit6eafe843ca632eadd896cca95c42420b48e2a9a2 (patch)
treed2de32f2a5dadc92de59ea1e6631682e7aecb33f /Modules/CMakeDetermineCompilerId.cmake
parentd02e58c4709c76bd19aeeac29cb845dc91aebf11 (diff)
parent3b59f8b7c68127c649fd72983e6f0a24cbb51427 (diff)
downloadCMake-6eafe843ca632eadd896cca95c42420b48e2a9a2.zip
CMake-6eafe843ca632eadd896cca95c42420b48e2a9a2.tar.gz
CMake-6eafe843ca632eadd896cca95c42420b48e2a9a2.tar.bz2
Merge topic 'compiler-id-refactor'
3b59f8b7 Project: Refactor C compiler determination into multiple files. 8896501b CompilerId: Allow specifying a prefix for preprocessor defines. 23f451bb CompilerId: Guard the platform-default compiler code with a parameter. 30a99f5c CompilerId: Add option to generate compiler-id-specific defines. 36ed5894 CompilerId: Allow specifying the compiler-specific components to generate. 9a083bce Project: Split the compiler id detection into a separate function. 9d285600 Project: Generate the CXX compiler Id test from multiple files.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 17f27b3..025d296 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -97,11 +97,20 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE)
endfunction()
+include(CMakeCompilerIdDetection)
+
#-----------------------------------------------------------------------------
# Function to write the compiler id source file.
function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
find_file(src_in ${src}.in PATHS ${CMAKE_ROOT}/Modules ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
file(READ ${src_in} ID_CONTENT_IN)
+
+ compiler_id_detection(CMAKE_${lang}_COMPILER_ID_CONTENT ${lang}
+ ID_STRING
+ VERSION_STRINGS
+ PLATFORM_DEFAULT_COMPILER
+ )
+
unset(src_in CACHE)
string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")