[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.1 1.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Aug 3 13:37:38 EDT 2009
Update of /cvsroot/CMake/CMake/Tests/TryCompile/Inner
In directory public:/mounts/ram/cvs-serv32431/Tests/TryCompile/Inner
Modified Files:
CMakeLists.txt
Log Message:
Fix recursive try_compile calls
When building an entire source tree with try_compile instead of just a
single source file, it is possible that the CMakeLists.txt file in the
try-compiled project invokes try_compile. This commit fixes propagation
of language-initialization results from the outer-most project into any
number of try-compile levels.
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/TryCompile/Inner/CMakeLists.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** CMakeLists.txt 3 Aug 2009 17:37:28 -0000 1.1
--- CMakeLists.txt 3 Aug 2009 17:37:36 -0000 1.2
***************
*** 2,4 ****
--- 2,13 ----
project(TryCompileInner C)
+ try_compile(SHOULD_PASS
+ ${TryCompileInner_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompileInner_SOURCE_DIR}/../pass.c
+ OUTPUT_VARIABLE TRY_OUT
+ )
+ if(NOT SHOULD_PASS)
+ message(FATAL_ERROR "Inner try-compile SHOULD_PASS failed!")
+ endif()
+
add_executable(inner ../pass.c)
More information about the Cmake-commits
mailing list