diff options
Diffstat (limited to 'Modules/CMakeCXXInformation.cmake')
-rw-r--r-- | Modules/CMakeCXXInformation.cmake | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index ef1b07e..d966f12 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -3,19 +3,23 @@ # It also loads the available platform file for the system-compiler # if it exists. -GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) -# since the gnu compiler has several names force g++ -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_BASE_NAME g++) -ENDIF(CMAKE_COMPILER_IS_GNUCXX) -IF(CMAKE_CXX_COMPILER_ID) - IF(EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX.cmake) - SET(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER_ID}-CXX) - ENDIF(EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX.cmake) -ENDIF(CMAKE_CXX_COMPILER_ID) -SET(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE - ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) -INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) +IF(NOT CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE) + GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) + # since the gnu compiler has several names force g++ + IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_BASE_NAME g++) + ENDIF(CMAKE_COMPILER_IS_GNUCXX) + IF(CMAKE_CXX_COMPILER_ID) + IF(EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX.cmake) + SET(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER_ID}-CXX) + ENDIF(EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX.cmake) + ENDIF(CMAKE_CXX_COMPILER_ID) + SET(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE + ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) +ENDIF(NOT CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE) + +INCLUDE(${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE} OPTIONAL) + # This should be included before the _INIT variables are # used to initialize the cache. Since the rule variables # have if blocks on them, users can still define them here. |