[cmake-commits] king committed CMakeForceCompiler.cmake 1.6 1.7 CMakeTestCCompiler.cmake 1.24 1.25 CMakeTestCXXCompiler.cmake 1.18 1.19

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Feb 14 10:50:45 EST 2008


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

Modified Files:
	CMakeForceCompiler.cmake CMakeTestCCompiler.cmake 
	CMakeTestCXXCompiler.cmake 
Log Message:
ENH: Remove unnecessary compiler force macros.  The compiler ID can now be detected without linking an executable.


Index: CMakeTestCCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeTestCCompiler.cmake,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- CMakeTestCCompiler.cmake	4 Feb 2008 15:04:23 -0000	1.24
+++ CMakeTestCCompiler.cmake	14 Feb 2008 15:50:43 -0000	1.25
@@ -43,7 +43,7 @@
   SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
 
   IF(CMAKE_C_COMPILER_FORCED)
-    # The compiler was forced by the CMAKE_FORCE_C_COMPILER macro.
+    # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
   ELSE(CMAKE_C_COMPILER_FORCED)
     # Try to identify the ABI and configure it into CMakeCCompiler.cmake

Index: CMakeTestCXXCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeTestCXXCompiler.cmake,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- CMakeTestCXXCompiler.cmake	4 Feb 2008 15:04:23 -0000	1.18
+++ CMakeTestCXXCompiler.cmake	14 Feb 2008 15:50:43 -0000	1.19
@@ -36,7 +36,7 @@
   SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
 
   IF(CMAKE_CXX_COMPILER_FORCED)
-    # The compiler was forced by the CMAKE_FORCE_CXX_COMPILER macro.
+    # The compiler configuration was forced by the user.
     # Assume the user has configured all compiler information.
   ELSE(CMAKE_CXX_COMPILER_FORCED)
     # Try to identify the ABI and configure it into CMakeCXXCompiler.cmake

Index: CMakeForceCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeForceCompiler.cmake,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- CMakeForceCompiler.cmake	3 Feb 2008 22:24:50 -0000	1.6
+++ CMakeForceCompiler.cmake	14 Feb 2008 15:50:43 -0000	1.7
@@ -1,63 +1,27 @@
+MESSAGE(FATAL_ERROR
+  "Do not include the CMakeForceCompiler module.  "
+  "It is no longer necessary.  "
+  "Update your toolchain file as follows.
 
-# These are macros intended to be used only when crosscompiling in the 
-# toolchain-file and only if the compiler is not able to link an 
-# executable by default (usually because they need user-specific 
-# linker files which describe the layout of the target memory).
-#
-# It offers the following macros:
-#
-# macro CMAKE_FORCE_SYSTEM(name version processor)
-#   Set CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_VERSION and CMAKE_SYSTEM_PROCESSOR
-#
-# macro CMAKE_FORCE_C_COMPILER(compiler compiler_id sizeof_void_p)
-#   Set CMAKE_C_COMPILER to the given compiler and set CMAKE_C_COMPILER_ID
-#   to the given compiler_id. This Id is used by cmake to construct the filename
-#   of the system-compiler.cmake file. For C also the size of a void-pointer
-#   has to be predefined.
-#
-# macro CMAKE_FORCE_CXX_COMPILER(compiler compiler_id)
-#   The same as CMAKE_FORCE_C_COMPILER, but for CXX. Here the size of 
-#   the void pointer is not requried.
-#
-# So a simple toolchain file could look like this:
-#
-# INCLUDE (CMakeForceCompiler)
-# CMAKE_FORCE_SYSTEM ("Generic"   "0.0"   "hc12")
-# CMAKE_FORCE_C_COMPILER   (chc12 FreescaleCHC12  2)
-# CMAKE_FORCE_CXX_COMPILER (chc12 FreescaleCHC12)
-
+Use of the CMAKE_FORCE_SYSTEM macro:
 
-MACRO(CMAKE_FORCE_SYSTEM name version proc)
-   SET(CMAKE_SYSTEM_NAME "${name}")
-   SET(CMAKE_SYSTEM_VERSION "${version}")
-   SET(CMAKE_SYSTEM_PROCESSOR "${proc}")
-ENDMACRO(CMAKE_FORCE_SYSTEM)
+  CMAKE_FORCE_SYSTEM(\"<name>\" \"<version>\" \"<processor>\")
 
-MACRO(CMAKE_FORCE_C_COMPILER compiler id sizeof_void)
-  SET(CMAKE_C_COMPILER "${compiler}")
-  SET(CMAKE_C_COMPILER_ID_RUN TRUE)
-  SET(CMAKE_C_COMPILER_ID ${id})
-  SET(CMAKE_C_COMPILER_WORKS TRUE)
-  SET(CMAKE_C_COMPILER_FORCED TRUE)
+may be replaced by just
 
-  # Set old compiler and platform id variables.
-  IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUCC 1)
-  ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
+  SET(CMAKE_SYSTEM_NAME \"<name>\")
+  SET(CMAKE_SYSTEM_VERSION \"<version>\")
+  SET(CMAKE_SYSTEM_PROCESSOR \"<processor>\")
 
-  SET(CMAKE_C_SIZEOF_DATA_PTR ${sizeof_void})
-ENDMACRO(CMAKE_FORCE_C_COMPILER)
+Use of the CMAKE_FORCE_C_COMPILER and CMAKE_FORCE_CXX_COMPILER macros:
 
-MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
-  SET(CMAKE_CXX_COMPILER "${compiler}")
-  SET(CMAKE_CXX_COMPILER_ID_RUN TRUE)
-  SET(CMAKE_CXX_COMPILER_ID ${id})
-  SET(CMAKE_CXX_COMPILER_WORKS TRUE)
-  SET(CMAKE_CXX_COMPILER_FORCED TRUE)
+  CMAKE_FORCE_C_COMPILER   (/path/to/cc <id> <sizeof_void_p>)
+  CMAKE_FORCE_CXX_COMPILER (/path/to/CC <id>)
 
-  IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-    SET(CMAKE_COMPILER_IS_GNUCXX 1)
-  ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+may be replaced by just
 
-ENDMACRO(CMAKE_FORCE_CXX_COMPILER)
+  SET(CMAKE_C_COMPILER /path/to/cc)
+  SET(CMAKE_CXX_COMPILER /path/to/CC)
 
+CMake will automatically detect known compiler IDs and sizeof(void*).
+")



More information about the Cmake-commits mailing list