summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCXXInformation.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeCXXInformation.cmake')
-rw-r--r--Modules/CMakeCXXInformation.cmake45
1 files changed, 31 insertions, 14 deletions
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index d966f12..8557d9d 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -2,23 +2,40 @@
# This file sets the basic flags for the C++ language in CMake.
# It also loads the available platform file for the system-compiler
# if it exists.
-
-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)
+# It also loads a system - compiler - processor (or target hardware)
+# specific file, which is mainly useful for crosscompiling and embedded systems.
+
+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_SYSTEM_AND_CXX_COMPILER_INFO_FILE)
+ INCLUDE(${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE} OPTIONAL)
+ELSE(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE)
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)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
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)
+ IF (NOT _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+ ENDIF (NOT _INCLUDED_FILE)
+ENDIF(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE)
+
+
+IF(CMAKE_SYSTEM_AND_CXX_COMPILER_AND_PROCESSOR_INFO_FILE)
+ INCLUDE(${CMAKE_SYSTEM_AND_CXX_COMPILER_AND_PROCESSOR_INFO_FILE} OPTIONAL)
+ELSE(CMAKE_SYSTEM_AND_CXX_COMPILER_AND_PROCESSOR_INFO_FILE)
+ IF(CMAKE_SYSTEM_PROCESSOR)
+ IF(CMAKE_CXX_COMPILER_ID)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ ENDIF(CMAKE_CXX_COMPILER_ID)
+ IF (NOT _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+ ENDIF (NOT _INCLUDED_FILE)
+ ENDIF(CMAKE_SYSTEM_PROCESSOR)
+ENDIF(CMAKE_SYSTEM_AND_CXX_COMPILER_AND_PROCESSOR_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