diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-14 20:35:50 (GMT) |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-14 20:35:50 (GMT) |
commit | 56ae40cc59b74d7d4cf4c00cf35badec6aea2274 (patch) | |
tree | e0fb95e0d167a6a6060ef097315fc3596701f19a /Tests/TryCompile | |
parent | c3e68020d61ae306261b4f953947483a960edf32 (diff) | |
download | CMake-56ae40cc59b74d7d4cf4c00cf35badec6aea2274.zip CMake-56ae40cc59b74d7d4cf4c00cf35badec6aea2274.tar.gz CMake-56ae40cc59b74d7d4cf4c00cf35badec6aea2274.tar.bz2 |
try_compile: Add PROJECT keyword-dispatched signature
Introduce a new signature for the project flavor of try_compile (and
try_run) which removes the `bindir` argument and adds a required PROJECT
tag. This is similar to the SOURCES flavor added by commit aa9220d3
(try_compile: Add keyword-dispatched signature, 2022-09-02).
Diffstat (limited to 'Tests/TryCompile')
-rw-r--r-- | Tests/TryCompile/CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index a53dd93..8ebb00a 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -65,7 +65,7 @@ set(try_compile_run_output_var RUN_OUTPUT) include(old_and_new_signature_tests.cmake) # try to compile a project (old signature) -message("Testing try_compile project mode") +message("Testing try_compile project mode (old signature)") try_compile(TEST_INNER ${TryCompile_BINARY_DIR}/CMakeFiles/Inner ${TryCompile_SOURCE_DIR}/Inner @@ -73,6 +73,15 @@ try_compile(TEST_INNER OUTPUT_VARIABLE output) TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}") +# try to compile a project (new signature) +message("Testing try_compile project mode (new signature)") +try_compile(TEST_INNER + PROJECT TryCompileInner + SOURCE_DIR ${TryCompile_SOURCE_DIR}/Inner + TARGET innerexe + OUTPUT_VARIABLE output) +TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}") + add_executable(TryCompile pass.c) ####################################################################### |