diff options
author | Jon Chronopoulos <patches@crondog.com> | 2018-05-29 11:37:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-06-07 17:18:23 (GMT) |
commit | 6dad812143ae50df5ed0de4c5c2d433b6d59aea2 (patch) | |
tree | 9a20cd5510a8275bbef5405c8342fd316392ca90 /Tests | |
parent | acaaca968c512fa420f3564649be1f49acfa6a6a (diff) | |
download | CMake-6dad812143ae50df5ed0de4c5c2d433b6d59aea2.zip CMake-6dad812143ae50df5ed0de4c5c2d433b6d59aea2.tar.gz CMake-6dad812143ae50df5ed0de4c5c2d433b6d59aea2.tar.bz2 |
install: Teach CODE,SCRIPT modes to evaluate generator expressions
Fixes: #15785
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/install/CODE-genex-bad-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/install/CODE-genex-bad-stderr.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/install/CODE-genex-bad.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/install/CODE-genex-check.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/install/CODE-genex.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/install/RunCMakeTest.cmake | 2 |
6 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/CODE-genex-bad-result.txt b/Tests/RunCMake/install/CODE-genex-bad-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/CODE-genex-bad-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/CODE-genex-bad-stderr.txt b/Tests/RunCMake/install/CODE-genex-bad-stderr.txt new file mode 100644 index 0000000..9844158 --- /dev/null +++ b/Tests/RunCMake/install/CODE-genex-bad-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<NOTAGENEX> + + Expression did not evaluate to a known generator expression diff --git a/Tests/RunCMake/install/CODE-genex-bad.cmake b/Tests/RunCMake/install/CODE-genex-bad.cmake new file mode 100644 index 0000000..1663b39 --- /dev/null +++ b/Tests/RunCMake/install/CODE-genex-bad.cmake @@ -0,0 +1 @@ +install(CODE "message(\"$<NOTAGENEX>\")") diff --git a/Tests/RunCMake/install/CODE-genex-check.cmake b/Tests/RunCMake/install/CODE-genex-check.cmake new file mode 100644 index 0000000..422c532 --- /dev/null +++ b/Tests/RunCMake/install/CODE-genex-check.cmake @@ -0,0 +1,7 @@ +execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake + OUTPUT_VARIABLE out ERROR_VARIABLE err) +if(NOT out MATCHES "-- Install configuration: .*-- codegenexlib") + string(REGEX REPLACE "\n" "\n " out " ${out}") + string(APPEND RunCMake_TEST_FAILED + "\"-- codegenexlib\" was not found:\n${out}") +endif() diff --git a/Tests/RunCMake/install/CODE-genex.cmake b/Tests/RunCMake/install/CODE-genex.cmake new file mode 100644 index 0000000..3b8513d --- /dev/null +++ b/Tests/RunCMake/install/CODE-genex.cmake @@ -0,0 +1,2 @@ +add_library( codegenexlib INTERFACE ) +install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")") diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index f004ce9..f0c02d8 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -65,6 +65,8 @@ run_cmake(CMP0062-NEW) run_cmake(CMP0062-WARN) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-all) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc) +run_cmake(CODE-genex) +run_cmake(CODE-genex-bad) if(NOT RunCMake_GENERATOR STREQUAL "Xcode" OR NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]") run_install_test(FILES-TARGET_OBJECTS) |