summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/get_property
diff options
context:
space:
mode:
authorDeniz Bahadir <dbahadir@benocs.com>2017-09-05 15:32:32 (GMT)
committerDeniz Bahadir <dbahadir@benocs.com>2017-11-07 14:08:41 (GMT)
commit6a3922bebea607dcc23944b1fe79b7b613a893d1 (patch)
tree11e8021e6e744f444f87dfb2b6a8e602c9ad582c /Tests/RunCMake/get_property
parent854e482a59d6696bbb6988a045ac701e26bb038a (diff)
downloadCMake-6a3922bebea607dcc23944b1fe79b7b613a893d1.zip
CMake-6a3922bebea607dcc23944b1fe79b7b613a893d1.tar.gz
CMake-6a3922bebea607dcc23944b1fe79b7b613a893d1.tar.bz2
Add new target-property `IMPORTED_GLOBAL`.
The purpose of this new `IMPORTED_GLOBAL` target-property is to prolong the lifetime and scope of `IMPORTED` targets in such a way as if they had been created with the keyword `GLOBAL` in the first place. * It can only be set to `TRUE`. That means, a local `IMPORTED` target can be promoted to global scope but a global `IMPORTED` target cannot be degraded to local scope! * Setting it to `TRUE` only succeeds if done from within the same directory in which the `IMPORTED` target was created in the first place. Fixes #17256.
Diffstat (limited to 'Tests/RunCMake/get_property')
-rw-r--r--Tests/RunCMake/get_property/target_properties-stderr.txt8
-rw-r--r--Tests/RunCMake/get_property/target_properties.cmake7
2 files changed, 14 insertions, 1 deletions
diff --git a/Tests/RunCMake/get_property/target_properties-stderr.txt b/Tests/RunCMake/get_property/target_properties-stderr.txt
index 6b3c6ca..df7a2f1 100644
--- a/Tests/RunCMake/get_property/target_properties-stderr.txt
+++ b/Tests/RunCMake/get_property/target_properties-stderr.txt
@@ -7,4 +7,10 @@ get_property: --><--
get_target_property: -->(.*)/Tests/RunCMake/get_property<--
get_property: -->(.*)/Tests/RunCMake/get_property<--
get_target_property: -->(.*)/Tests/RunCMake/get_property/target_properties-build<--
-get_property: -->(.*)/Tests/RunCMake/get_property/target_properties-build<--$
+get_property: -->(.*)/Tests/RunCMake/get_property/target_properties-build<--
+get_target_property: -->FALSE<--
+get_property: -->FALSE<--
+get_target_property: -->FALSE<--
+get_property: -->FALSE<--
+get_target_property: -->TRUE<--
+get_property: -->TRUE<--$
diff --git a/Tests/RunCMake/get_property/target_properties.cmake b/Tests/RunCMake/get_property/target_properties.cmake
index 9ff833a..321d5b5 100644
--- a/Tests/RunCMake/get_property/target_properties.cmake
+++ b/Tests/RunCMake/get_property/target_properties.cmake
@@ -16,3 +16,10 @@ check_target_property(tgt custom)
check_target_property(tgt noexist)
check_target_property(tgt SOURCE_DIR)
check_target_property(tgt BINARY_DIR)
+
+add_library(imported_local_tgt SHARED IMPORTED)
+add_library(imported_global_tgt SHARED IMPORTED GLOBAL)
+
+check_target_property(tgt IMPORTED_GLOBAL)
+check_target_property(imported_local_tgt IMPORTED_GLOBAL)
+check_target_property(imported_global_tgt IMPORTED_GLOBAL)