[cmake-commits] alex committed CheckCSourceRuns.cmake 1.6 1.7 CheckCXXSourceRuns.cmake 1.2 1.3 FindThreads.cmake 1.13 1.14 TestBigEndian.cmake 1.12 1.13

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Jun 1 11:16:32 EDT 2007


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

Modified Files:
	CheckCSourceRuns.cmake CheckCXXSourceRuns.cmake 
	FindThreads.cmake TestBigEndian.cmake 
Log Message:

ENH: improve TRY_RUN() for crosscompiling: instead of just failing, it now
creates two cache variables, one for the RUN_RESULT, one for the RUN_OUTPUT
(if required), which can be set or preset by the user. It has now also two
new arguments: RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE (the old
OUTPUT_VARIABLE merges both), so if only COMPILE_OUTPUT_VARIABLE is used the
run time output of the TRY_RUN is unused and the user doesn't have to care
about the output when crosscompiling. This is now used in FindThreads.cmake,
CheckC/CXXSourceRuns.cmake and TestBigEndian.cmake, which used the output
only for the logfile (compile output is still there). Test/TryCompile/ now
also tests the behaviour of OUTPUT_VARIABLE, RUN_OUTPUT_VARIABLE and
COMPILE_OUTPUT_VARIABLE.

Alex


Index: CheckCXXSourceRuns.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CheckCXXSourceRuns.cmake,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- CheckCXXSourceRuns.cmake	21 Aug 2006 14:10:28 -0000	1.2
+++ CheckCXXSourceRuns.cmake	1 Jun 2007 15:16:29 -0000	1.3
@@ -2,7 +2,7 @@
 # CHECK_CXX_SOURCE_RUNS(SOURCE VAR)
 # - macro which checks if the source code compiles
 #  SOURCE - source code to try to compile
-#  VAR    - variable to store size if the type exists.
+#  VAR    - variable to store the result, 1 for success, empty for failure
 #
 # The following variables may be set before calling this macro to
 # modify the way the check is run:
@@ -39,7 +39,8 @@
       CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
       "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
       "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
-      OUTPUT_VARIABLE OUTPUT)
+      COMPILE_OUTPUT_VARIABLE OUTPUT)
+
     # if it did not compile make the return value fail code of 1
     IF(NOT ${VAR}_COMPILED)
       SET(${VAR} 1)

Index: FindThreads.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindThreads.cmake,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- FindThreads.cmake	14 Jun 2006 16:28:29 -0000	1.13
+++ FindThreads.cmake	1 Jun 2007 15:16:29 -0000	1.14
@@ -56,7 +56,7 @@
           ${CMAKE_BINARY_DIR}
           ${CMAKE_ROOT}/Modules/CheckForPthreads.c
           CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
-          OUTPUT_VARIABLE OUTPUT)
+          COMPILE_OUTPUT_VARIABLE OUTPUT)
         IF(THREADS_HAVE_PTHREAD_ARG)
           IF(THREADS_PTHREAD_ARG MATCHES "^2$")
             MESSAGE(STATUS "Check if compiler accepts -pthread - yes")

Index: CheckCSourceRuns.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CheckCSourceRuns.cmake,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- CheckCSourceRuns.cmake	4 Apr 2007 19:59:22 -0000	1.6
+++ CheckCSourceRuns.cmake	1 Jun 2007 15:16:29 -0000	1.7
@@ -2,7 +2,7 @@
 # CHECK_C_SOURCE_RUNS(SOURCE VAR)
 # - macro which checks if the source code runs
 #  SOURCE   - source code to try to compile
-#  VAR - variable to store size if the type exists.
+#  VAR      - variable to store the result, 1 for success, empty for failure
 #
 # The following variables may be set before calling this macro to
 # modify the way the check is run:
@@ -39,7 +39,7 @@
       CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
       "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
       "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
-      OUTPUT_VARIABLE OUTPUT)
+      COMPILE_OUTPUT_VARIABLE OUTPUT)
     # if it did not compile make the return value fail code of 1
     IF(NOT ${VAR}_COMPILED)
       SET(${VAR} 1)

Index: TestBigEndian.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/TestBigEndian.cmake,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- TestBigEndian.cmake	24 May 2007 12:33:05 -0000	1.12
+++ TestBigEndian.cmake	1 Jun 2007 15:16:29 -0000	1.13
@@ -11,7 +11,7 @@
     TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_ROOT}/Modules/TestBigEndian.c
-      OUTPUT_VARIABLE OUTPUT)
+      COMPILE_OUTPUT_VARIABLE OUTPUT)
     IF("${VARIABLE}" STREQUAL "FAILED_TO_RUN")
       MESSAGE(SEND_ERROR "TestBigEndian Failed to run with output: ${OUTPUT}")
     ENDIF("${VARIABLE}" STREQUAL "FAILED_TO_RUN")



More information about the Cmake-commits mailing list