summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/target_compile_definitions
diff options
context:
space:
mode:
authorAvraham Shukron <avraham.shukron@gmail.com>2019-07-19 19:50:59 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-22 14:23:39 (GMT)
commit680a3c63bb3a6485a1774a457f3f2a63ad96b728 (patch)
tree91804953565e546801f09ec7166b19e3e4bebcb2 /Tests/RunCMake/target_compile_definitions
parent62b5d1e4adf4f21a953557edf6552e3a81f47c07 (diff)
downloadCMake-680a3c63bb3a6485a1774a457f3f2a63ad96b728.zip
CMake-680a3c63bb3a6485a1774a457f3f2a63ad96b728.tar.gz
CMake-680a3c63bb3a6485a1774a457f3f2a63ad96b728.tar.bz2
target_*: Allow setting INTERFACE properties of UNKNOWN IMPORTED targets
Extend the change made by commit fe4b25ec2f (Teach target_* commands to set INTERFACE properties of IMPORTED targets, 2017-09-18, v3.11.0-rc1~433^2~2) to work with imported targets of type `UNKNOWN`. Fixes: #19434
Diffstat (limited to 'Tests/RunCMake/target_compile_definitions')
-rw-r--r--Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake11
2 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
index b67c598..a419cc9 100644
--- a/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(empty_keyword_args)
+run_cmake(unknown_imported_target)
diff --git a/Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake b/Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake
new file mode 100644
index 0000000..4ae1c0d
--- /dev/null
+++ b/Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake
@@ -0,0 +1,11 @@
+# Test that target_compile_definitions works on UNKNOWN IMPORTED target
+add_library(imported UNKNOWN IMPORTED)
+target_compile_definitions(imported INTERFACE FOO)
+
+get_target_property(IMPORTED_INTERFACE_CDS imported INTERFACE_COMPILE_DEFINITIONS)
+
+if (NOT FOO IN_LIST IMPORTED_INTERFACE_CDS)
+ message(
+ FATAL_ERROR "FOO should be in INTERFACE_COMPILE_DEFINITIONS.\n"
+ "Actual INTERFACE_COMPILE_DEFINITIONS: " ${IMPORTED_INTERFACE_CDS})
+endif()