diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-09-15 17:42:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-18 14:00:21 (GMT) |
commit | 7235334a2f1b9a627cc1cdbc701ae0768b6e32c3 (patch) | |
tree | 36675c9df0477e6ecdb027979cfce0dbbdab2d15 /Modules/CMakeDetermineCompilerId.cmake | |
parent | cda189356e7e0a897377c3d7ed02ea3a3ad1de5a (diff) | |
download | CMake-7235334a2f1b9a627cc1cdbc701ae0768b6e32c3.zip CMake-7235334a2f1b9a627cc1cdbc701ae0768b6e32c3.tar.gz CMake-7235334a2f1b9a627cc1cdbc701ae0768b6e32c3.tar.bz2 |
Project: Determine default language dialect for the compiler.
Use the __cplusplus and __STDC_VERSION__ macros to automatically
determine the default dialect for the compiler while determining its
id and version.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index c699315..81f4ae6 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -102,6 +102,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) + set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE) endfunction() include(CMakeCompilerIdDetection) @@ -487,6 +488,9 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) if("${info}" MATCHES "INFO:qnxnto\\[\\]") set(COMPILER_QNXNTO 1) endif() + if("${info}" MATCHES "INFO:dialect_default\\[([^]\"]*)\\]") + set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_MATCH_1}") + endif() endforeach() # Construct compiler version from components if needed. @@ -590,6 +594,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE) set(COMPILER_QNXNTO "${COMPILER_QNXNTO}" PARENT_SCOPE) + set(CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT "${CMAKE_${lang}_STANDARD_COMPUTED_DEFAULT}" PARENT_SCOPE) endfunction() #----------------------------------------------------------------------------- |