diff options
author | Brad King <brad.king@kitware.com> | 2009-08-03 17:37:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-08-03 17:37:36 (GMT) |
commit | 73de2362ddfcef151709e2162c0e384623da8890 (patch) | |
tree | 99c6a15307d8be45792c194ab8cbab0ea3585936 /Tests/TryCompile | |
parent | 1a159bbf331104fe680d3f37b703916a910a69f9 (diff) | |
download | CMake-73de2362ddfcef151709e2162c0e384623da8890.zip CMake-73de2362ddfcef151709e2162c0e384623da8890.tar.gz CMake-73de2362ddfcef151709e2162c0e384623da8890.tar.bz2 |
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.
Diffstat (limited to 'Tests/TryCompile')
-rw-r--r-- | Tests/TryCompile/Inner/CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/TryCompile/Inner/CMakeLists.txt b/Tests/TryCompile/Inner/CMakeLists.txt index b604426..41b94ae 100644 --- a/Tests/TryCompile/Inner/CMakeLists.txt +++ b/Tests/TryCompile/Inner/CMakeLists.txt @@ -1,4 +1,13 @@ cmake_minimum_required(VERSION 2.6) 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) |