Browse Source

CMakeDetermineSystem: Load platform-specific helper modules

Once CMAKE_SYSTEM_NAME is known, load a platform-specific

  Platform/<os>-Determine

module in order to enable custom determination of the other settings
needed for the CMakeSystem module (e.g. CMAKE_SYSTEM_PROCESSOR).  Also
add a hook in Modules/CMakeSystem.cmake.in to allow platform-specific
information to be saved.
Brad King 9 years ago
parent
commit
c148803a57
2 changed files with 2 additions and 1 deletions
  1. 1 0
      Modules/CMakeDetermineSystem.cmake
  2. 1 1
      Modules/CMakeSystem.cmake.in

+ 1 - 0
Modules/CMakeDetermineSystem.cmake

@@ -131,6 +131,7 @@ else()
   set(PRESET_CMAKE_SYSTEM_NAME FALSE)
 endif()
 
+include(Platform/${CMAKE_SYSTEM_NAME}-Determine OPTIONAL)
 
 macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
   if(NOT ${_PREFIX}_NAME)

+ 1 - 1
Modules/CMakeSystem.cmake.in

@@ -9,7 +9,7 @@ set(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
 set(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
 set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
 set(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
-
+@CMAKE_SYSTEM_CUSTOM_CODE@
 set(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
 
 set(CMAKE_SYSTEM_LOADED 1)