[cmake-commits] alex committed CMakeDetermineCompilerId.cmake 1.10 1.11 CMakeDetermineSystem.cmake 1.25 1.26 CMakeSystemSpecificInformation.cmake 1.38 1.39

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Aug 9 14:45:25 EDT 2007


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv23745/Modules

Modified Files:
	CMakeDetermineCompilerId.cmake CMakeDetermineSystem.cmake 
	CMakeSystemSpecificInformation.cmake 
Log Message:

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


Index: CMakeDetermineSystem.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineSystem.cmake,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- CMakeDetermineSystem.cmake	24 Jul 2007 14:00:26 -0000	1.25
+++ CMakeDetermineSystem.cmake	9 Aug 2007 18:45:23 -0000	1.26
@@ -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 @@
     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_*

Index: CMakeSystemSpecificInformation.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeSystemSpecificInformation.cmake,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- CMakeSystemSpecificInformation.cmake	2 Jul 2007 17:29:36 -0000	1.38
+++ CMakeSystemSpecificInformation.cmake	9 Aug 2007 18:45:23 -0000	1.39
@@ -3,6 +3,17 @@
 # It is included after the compiler has been determined, so
 # we know things like the compiler name and if the compiler is gnu.
 
+# before cmake 2.6 these variables were compiled-in in cmake
+# now they are set in the Modules/${CMAKE_SYSTEM_NAME}.cmake file
+# In order to keep custom language or compiler files working which might use
+# these variables, they are set to the value of the compiled-in variables in
+# CMakeDetermineSystem.cmake and reset here.
+SET(APPLE  )
+SET(UNIX   )
+SET(CYGWIN )
+SET(WIN32  )
+
+
 # include Generic system information
 INCLUDE(CMakeGenericSystem)
 

Index: CMakeDetermineCompilerId.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCompilerId.cmake,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- CMakeDetermineCompilerId.cmake	27 Jun 2007 18:55:42 -0000	1.10
+++ CMakeDetermineCompilerId.cmake	9 Aug 2007 18:45:23 -0000	1.11
@@ -6,13 +6,13 @@
 MACRO(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
   # Store the compiler identification source file.
   SET(CMAKE_${lang}_COMPILER_ID_SRC "${src}")
-  IF(WIN32 AND NOT CYGWIN)
+  IF(CMAKE_HOST_WIN32 AND NOT CMAKE_HOST_CYGWIN)
     # This seems to escape spaces:
     #FILE(TO_NATIVE_PATH "${CMAKE_${lang}_COMPILER_ID_SRC}"
     #  CMAKE_${lang}_COMPILER_ID_SRC)
     STRING(REGEX REPLACE "/" "\\\\" CMAKE_${lang}_COMPILER_ID_SRC
       "${CMAKE_${lang}_COMPILER_ID_SRC}")
-  ENDIF(WIN32 AND NOT CYGWIN)
+  ENDIF(CMAKE_HOST_WIN32 AND NOT CMAKE_HOST_CYGWIN)
 
   # Make sure user-specified compiler flags are used.
   IF(CMAKE_${lang}_FLAGS)



More information about the Cmake-commits mailing list