diff options
author | John Parent <john.parent@kitware.com> | 2022-03-10 17:43:50 (GMT) |
---|---|---|
committer | John Parent <john.parent@kitware.com> | 2022-03-10 17:44:36 (GMT) |
commit | 2f1ffa003c07d5fe7ca10c4ee06e81dd55f5e415 (patch) | |
tree | eb92cb82fda9a3bcd1ad58cf6b1d2654a2527c35 /Help/command | |
parent | 3a37fda6a2b4f28fdd7efe58f4a0b7570404a7d4 (diff) | |
download | CMake-2f1ffa003c07d5fe7ca10c4ee06e81dd55f5e415.zip CMake-2f1ffa003c07d5fe7ca10c4ee06e81dd55f5e415.tar.gz CMake-2f1ffa003c07d5fe7ca10c4ee06e81dd55f5e415.tar.bz2 |
find_package: Add support for default GLOBAL imported targets
Allow find package to promote scope of imported targets by specifying
an argument to `find_package` or by specifying a CMake variable.
* Add support for CMAKE_GLOBAL_IMPORT_SCOPE variable
* Add support for GLOBAL argument to find_package
Additionally add testing for above features.
Diffstat (limited to 'Help/command')
-rw-r--r-- | Help/command/find_package.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst index 1a79a8a..4a381fb 100644 --- a/Help/command/find_package.rst +++ b/Help/command/find_package.rst @@ -79,7 +79,8 @@ Basic Signature find_package(<PackageName> [version] [EXACT] [QUIET] [MODULE] [REQUIRED] [[COMPONENTS] [components...]] [OPTIONAL_COMPONENTS components...] - [NO_POLICY_SCOPE]) + [NO_POLICY_SCOPE] + [GLOBAL]) The basic signature is supported by both Module and Config modes. The ``MODULE`` keyword implies that only Module mode can be used to find @@ -115,6 +116,11 @@ define what occurs in such cases. Common arrangements include assuming it should find all components, no components or some well-defined subset of the available components. +Specifying the ``GLOBAL`` keyword will promote all imported targets to +a global scope in the importing project. Alternatively this functionality +can be enabled by setting the variable +:variable:`CMAKE_FIND_PACKAGE_TARGETS_GLOBAL` + .. _FIND_PACKAGE_VERSION_FORMAT: The ``[version]`` argument requests a version with which the package found |