[cmake-commits] alex committed CMakeDetermineCCompiler.cmake 1.47 1.48 CMakeDetermineCXXCompiler.cmake 1.40 1.41

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jul 18 10:52:55 EDT 2007


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

Modified Files:
	CMakeDetermineCCompiler.cmake CMakeDetermineCXXCompiler.cmake 
Log Message:

ENH: if CMAKE_(C|CXX)_COMPILER is preset to a list of two elements, use the
first one as the compiler and the second one as ARG1 for the compiler

Alex


Index: CMakeDetermineCXXCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCXXCompiler.cmake,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- CMakeDetermineCXXCompiler.cmake	2 Jul 2007 17:29:36 -0000	1.40
+++ CMakeDetermineCXXCompiler.cmake	18 Jul 2007 14:52:53 -0000	1.41
@@ -59,6 +59,15 @@
 # we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
 # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
 #
+# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as 
+# CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
+
+  LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
+  IF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
+    LIST(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
+    LIST(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
+  ENDIF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
+
 # if a compiler was specified by the user but without path, 
 # now try to find it with the full path
 # if it is found, force it into the cache, 

Index: CMakeDetermineCCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineCCompiler.cmake,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- CMakeDetermineCCompiler.cmake	2 Jul 2007 17:29:36 -0000	1.47
+++ CMakeDetermineCCompiler.cmake	18 Jul 2007 14:52:53 -0000	1.48
@@ -59,7 +59,15 @@
 
   # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
   # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
-  #
+  # if CMAKE_C_COMPILER is a list of length 2, use the first item as 
+  # CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1
+
+  LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
+  IF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
+    LIST(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
+    LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
+  ENDIF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
+
   # if a compiler was specified by the user but without path, 
   # now try to find it with the full path
   # if it is found, force it into the cache, 



More information about the Cmake-commits mailing list