diff options
author | Craig Scott <craig.scott@crascit.com> | 2018-12-23 22:19:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-12-23 22:19:57 (GMT) |
commit | 170fcebf2e866ce5266067716025a57c7e7e6ec4 (patch) | |
tree | 1a15da7e27a0b1ef1b73e2470772588347e7f5e2 /Tests/RunCMake | |
parent | 2cc78b962331c776810b3bc15039813a1589cf4f (diff) | |
parent | 25cae1e85d501c463141388e4eb580bdfae6ed2f (diff) | |
download | CMake-170fcebf2e866ce5266067716025a57c7e7e6ec4.zip CMake-170fcebf2e866ce5266067716025a57c7e7e6ec4.tar.gz CMake-170fcebf2e866ce5266067716025a57c7e7e6ec4.tar.bz2 |
Merge topic 'install-code-script-genex'
25cae1e85d install: Teach CODE,SCRIPT modes to evaluate generator expressions
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2688
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/install/CMP0087-NEW-check.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/install/CMP0087-NEW.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/install/CMP0087-OLD-check.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/install/CMP0087-OLD.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/install/CMP0087-WARN-stderr.txt | 5 | ||||
-rw-r--r-- | Tests/RunCMake/install/CMP0087-WARN.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/install/RunCMakeTest.cmake | 3 |
9 files changed, 44 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/CMP0087-NEW-check.cmake b/Tests/RunCMake/install/CMP0087-NEW-check.cmake new file mode 100644 index 0000000..422c532 --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-NEW-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/CMP0087-NEW.cmake b/Tests/RunCMake/install/CMP0087-NEW.cmake new file mode 100644 index 0000000..0177960 --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-NEW.cmake @@ -0,0 +1,3 @@ +# Need a new directory scope, not just a new policy scope +# to test this correctly +add_subdirectory(CMP0087-NEW) diff --git a/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt new file mode 100644 index 0000000..07b4589 --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt @@ -0,0 +1,7 @@ +# Note that it is the policy settings at the end of the directory +# scope that will be used when deciding whether or not generator +# expressions should be evaluated in the installed code. +cmake_policy(VERSION 3.13) +cmake_policy(SET CMP0087 NEW) +add_library( codegenexlib INTERFACE ) +install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")") diff --git a/Tests/RunCMake/install/CMP0087-OLD-check.cmake b/Tests/RunCMake/install/CMP0087-OLD-check.cmake new file mode 100644 index 0000000..c5984bc --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-OLD-check.cmake @@ -0,0 +1,8 @@ +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: .*-- \\$<TARGET_PROPERTY:codegenexlib,NAME>") + string(REGEX REPLACE "\n" "\n " out " ${out}") + string(APPEND RunCMake_TEST_FAILED + "\"-- $<TARGET_PROPERTY:codegenexlib,NAME>\" was not found:\n${out}") +endif() diff --git a/Tests/RunCMake/install/CMP0087-OLD.cmake b/Tests/RunCMake/install/CMP0087-OLD.cmake new file mode 100644 index 0000000..e7ed4ee --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-OLD.cmake @@ -0,0 +1,3 @@ +# Need a new directory scope, not just a new policy scope +# to test this correctly +add_subdirectory(CMP0087-OLD) diff --git a/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt new file mode 100644 index 0000000..b1d4e2e --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt @@ -0,0 +1,6 @@ +# Note that it is the policy settings at the end of the directory +# scope that will be used when deciding whether or not generator +# expressions should be evaluated in the installed code. +cmake_policy(VERSION 3.13) +cmake_policy(SET CMP0087 OLD) +install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")") diff --git a/Tests/RunCMake/install/CMP0087-WARN-stderr.txt b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt new file mode 100644 index 0000000..75fbf2c --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt @@ -0,0 +1,5 @@ +CMake Warning (dev) in CMakeLists.txt: + Policy CMP0087 is not set: Install CODE|SCRIPT allow the use of generator + expressions. Run "cmake --help-policy CMP0087" for policy details. Use + the cmake_policy command to set the policy and suppress this warning. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/install/CMP0087-WARN.cmake b/Tests/RunCMake/install/CMP0087-WARN.cmake new file mode 100644 index 0000000..3b8513d --- /dev/null +++ b/Tests/RunCMake/install/CMP0087-WARN.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 f7e1dee..28e8ec4 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -63,6 +63,9 @@ run_cmake(EXPORT-OldIFace) run_cmake(CMP0062-OLD) run_cmake(CMP0062-NEW) run_cmake(CMP0062-WARN) +run_cmake(CMP0087-OLD) +run_cmake(CMP0087-NEW) +run_cmake(CMP0087-WARN) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-all) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc) run_cmake(FILES-DESTINATION-TYPE) |