diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-05-28 11:51:22 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-06-02 15:11:47 (GMT) |
commit | 056489d567b657bd1ebeae8bf78f4937f900b2e0 (patch) | |
tree | d3800c8fdf726c1e04cf73e463b68861efe6abd3 /Help/prop_tgt | |
parent | 254f2b9058f814e952ef0178e13b3f98e8d216a1 (diff) | |
download | CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.zip CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.tar.gz CMake-056489d567b657bd1ebeae8bf78f4937f900b2e0.tar.bz2 |
add_library/add_executable: allow local alias to imported targets
Fixes: #20641
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r-- | Help/prop_tgt/ALIAS_GLOBAL.rst | 17 | ||||
-rw-r--r-- | Help/prop_tgt/IMPORTED_GLOBAL.rst | 16 |
2 files changed, 29 insertions, 4 deletions
diff --git a/Help/prop_tgt/ALIAS_GLOBAL.rst b/Help/prop_tgt/ALIAS_GLOBAL.rst new file mode 100644 index 0000000..8854f57 --- /dev/null +++ b/Help/prop_tgt/ALIAS_GLOBAL.rst @@ -0,0 +1,17 @@ +ALIAS_GLOBAL +------------ + +Read-only property indicating of whether an :ref:`ALIAS target <Alias Targets>` +is globally visible. + +The boolean value of this property is ``TRUE`` for aliases to +:ref:`IMPORTED targets <Imported Targets>` created +with the ``GLOBAL`` options to :command:`add_executable()` or +:command:`add_library()`, ``FALSE`` otherwise. It is undefined for +targets built within the project. + +.. note:: + + Promoting an :ref:`IMPORTED target <Imported Targets>` from ``LOCAL`` + to ``GLOBAL`` scope by changing the value or :prop_tgt:`IMPORTED_GLOBAL` + target property do not change the scope of local aliases. diff --git a/Help/prop_tgt/IMPORTED_GLOBAL.rst b/Help/prop_tgt/IMPORTED_GLOBAL.rst index 1feca04..1a9129f 100644 --- a/Help/prop_tgt/IMPORTED_GLOBAL.rst +++ b/Help/prop_tgt/IMPORTED_GLOBAL.rst @@ -16,7 +16,15 @@ 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. +.. note:: + + 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. + +.. note:: + + Local :ref:`ALIAS targets <Alias Targets>` created before promoting an + :ref:`IMPORTED target <Imported Targets>` from ``LOCAL`` to ``GLOBAL``, keep + their initial scope (see :prop_tgt:`ALIAS_GLOBAL` target property). |