summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-23 11:30:43 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-07-23 11:30:53 (GMT)
commit5396c5fce4eae4f4b0a9b974e0a0304c7afda459 (patch)
treeea6b29048aba2ecbb003632a745560ad09687a6a /Tests
parent6f476a41697eab23c46a33d93f5a17138c79dad2 (diff)
parent680a3c63bb3a6485a1774a457f3f2a63ad96b728 (diff)
downloadCMake-5396c5fce4eae4f4b0a9b974e0a0304c7afda459.zip
CMake-5396c5fce4eae4f4b0a9b974e0a0304c7afda459.tar.gz
CMake-5396c5fce4eae4f4b0a9b974e0a0304c7afda459.tar.bz2
Merge topic 'make-imported-targets-more-equal'
680a3c63bb target_*: Allow setting INTERFACE properties of UNKNOWN IMPORTED targets 62b5d1e4ad cmTargetPropCommandBase: Order target type condition by order in enum Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3581
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake11
3 files changed, 13 insertions, 1 deletions
diff --git a/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt b/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt
index e332281..838992b 100644
--- a/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt
+++ b/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at UNKNOWNwithOnlyObjectSources.cmake:[0-9]+ \(target_sources\):
- target_sources called with non-compilable target type
+ target_sources may only set INTERFACE properties on IMPORTED targets
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)$
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()