summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineSystem.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-21 15:26:40 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-05-21 15:26:40 (GMT)
commit71359f5b9dcbf2404fab4e201961d2ddc7f52ee7 (patch)
tree352431a82c46d84b1ab5a99210f8d87d6fd95805 /Modules/CMakeDetermineSystem.cmake
parentc8dd1caff941ac4f56bf7422437fc0982ab6043b (diff)
downloadCMake-71359f5b9dcbf2404fab4e201961d2ddc7f52ee7.zip
CMake-71359f5b9dcbf2404fab4e201961d2ddc7f52ee7.tar.gz
CMake-71359f5b9dcbf2404fab4e201961d2ddc7f52ee7.tar.bz2
STYLE: use a separate source file for generating CMakeSystem.cmake if CMAKE_TOOLCHAIN_FILE is used
Alex
Diffstat (limited to 'Modules/CMakeDetermineSystem.cmake')
-rw-r--r--Modules/CMakeDetermineSystem.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 311a21d..5a91a30 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -26,6 +26,10 @@
# cygwin CYGWIN_NT-5.1
# MacOSX Darwin
+
+#set the source file which will be configured to become CMakeSystem.cmake
+SET(_CMAKE_SYSTEM_TEMPLATE_FILE ${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in )
+
IF(CMAKE_TOOLCHAIN_FILE)
# at first try to load it as path relative to the directory from which cmake has been run
INCLUDE("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
@@ -40,6 +44,9 @@ IF(CMAKE_TOOLCHAIN_FILE)
MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
ENDIF(_INCLUDED_TOOLCHAIN_FILE)
+ # use a different source file for CMakeSystem.cmake, since it has to hold a bit more information
+ SET(_CMAKE_SYSTEM_TEMPLATE_FILE ${CMAKE_ROOT}/Modules/CMakeSystemWithToolchainFile.cmake.in )
+
IF(NOT DEFINED CMAKE_CROSSCOMPILING)
SET(CMAKE_CROSSCOMPILING TRUE)
ENDIF(NOT DEFINED CMAKE_CROSSCOMPILING)
@@ -105,8 +112,8 @@ ENDIF(CMAKE_SYSTEM_VERSION)
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
-# configure variables set in this file for fast reload
-CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
+# configure variables set in this file for fast reload, the template file is defined at the top of this file
+CONFIGURE_FILE(${_CMAKE_SYSTEM_TEMPLATE_FILE}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
IMMEDIATE @ONLY)