diff options
author | Deniz Bahadir <dbahadir@benocs.com> | 2017-09-05 15:32:32 (GMT) |
---|---|---|
committer | Deniz Bahadir <dbahadir@benocs.com> | 2017-11-07 14:08:41 (GMT) |
commit | 6a3922bebea607dcc23944b1fe79b7b613a893d1 (patch) | |
tree | 11e8021e6e744f444f87dfb2b6a8e602c9ad582c /Help/prop_tgt | |
parent | 854e482a59d6696bbb6988a045ac701e26bb038a (diff) | |
download | CMake-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 'Help/prop_tgt')
-rw-r--r-- | Help/prop_tgt/IMPORTED_GLOBAL.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Help/prop_tgt/IMPORTED_GLOBAL.rst b/Help/prop_tgt/IMPORTED_GLOBAL.rst new file mode 100644 index 0000000..1feca04 --- /dev/null +++ b/Help/prop_tgt/IMPORTED_GLOBAL.rst @@ -0,0 +1,22 @@ +IMPORTED_GLOBAL +--------------- + +Indication of whether an :ref:`IMPORTED target <Imported Targets>` is +globally visible. + +The boolean value of this property is True for targets created with the +``IMPORTED`` ``GLOBAL`` options to :command:`add_executable()` or +:command:`add_library()`. It is always False for targets built within the +project. + +For targets created with the ``IMPORTED`` option to +:command:`add_executable()` or :command:`add_library()` but without the +additional option ``GLOBAL`` this is False, too. However, setting this +property for such a locally ``IMPORTED`` target to True promotes that +target to global scope. This promotion can only be done in the same +directory where that ``IMPORTED`` target was created in the first place. + +Once an imported target has been made global, it cannot be changed back to +non-global. Therefore, if a project sets this property, it may only +provide a value of True. CMake will issue an error if the project tries to +set the property to a non-True value, even if the value was already False. |