summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineSystem.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-09 18:45:23 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-09 18:45:23 (GMT)
commit176fe63d151d60e90edd4bd01eaac7d1b74241cd (patch)
treed6967d87757696ce05396c62f75e98da63f9b91c /Modules/CMakeDetermineSystem.cmake
parent9bd32386c266c906c1a4c02964dfa68292c4ab12 (diff)
downloadCMake-176fe63d151d60e90edd4bd01eaac7d1b74241cd.zip
CMake-176fe63d151d60e90edd4bd01eaac7d1b74241cd.tar.gz
CMake-176fe63d151d60e90edd4bd01eaac7d1b74241cd.tar.bz2
ENH: UNIX, CYGWIN, WIN32, APPLE, QNXNTO and BEOS are not longer set in
cmMakefile.cxx, but now in the platform files and are now valid for the target platform, not the host platform. New variables CMAKE_HOST_WIN32, CMAKE_HOST_UNIX, CMAKE_HOST_APPLE and CMAKE_HOST_CYGWIN have been added in cmMakefile.cxx (...and have now to be used in all cmake files which are executed before CMakeSystemSpecificInformation.cmake is loaded). For compatibility the old set is set to the new one in CMakeDetermineSystem.cmake and reset before the system platform files are loaded, so custom language or compiler modules which use these should still work. Alex
Diffstat (limited to 'Modules/CMakeDetermineSystem.cmake')
-rw-r--r--Modules/CMakeDetermineSystem.cmake23
1 files changed, 18 insertions, 5 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 09752ee..7e6a6dd 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -28,7 +28,7 @@
# find out on which system cmake runs
-IF(UNIX)
+IF(CMAKE_HOST_UNIX)
FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
IF(CMAKE_UNAME)
EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
@@ -53,12 +53,25 @@ IF(UNIX)
STRING(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
STRING(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
ENDIF(CMAKE_UNAME)
-ELSE(UNIX)
- IF(WIN32)
+ELSE(CMAKE_HOST_UNIX)
+ IF(CMAKE_HOST_WIN32)
SET (CMAKE_HOST_SYSTEM_NAME "Windows")
SET (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
- ENDIF(WIN32)
-ENDIF(UNIX)
+ ENDIF(CMAKE_HOST_WIN32)
+ENDIF(CMAKE_HOST_UNIX)
+
+# this is for compatibility
+# with cmake 2.4 these variables were compiled in
+# now that cmake has to separate between host and target platform
+# two sets are needed. For compatibility the old set of variables is here
+# set to the compiled-in values, so they still work in custom
+# language or compiler modules where they might be used.
+# After that they are reset in CMakeSystemSpecificInformation.cmake
+# and then set according to the current target platform in the Modules/${CMAKE_SYSTEM_NAME}.cmake file
+SET(APPLE ${CMAKE_HOST_APPLE})
+SET(UNIX ${CMAKE_HOST_UNIX})
+SET(CYGWIN ${CMAKE_HOST_CYGWIN})
+SET(WIN32 ${CMAKE_HOST_WIN32})
# if a toolchain file is used, the user wants to cross compile.
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*