summaryrefslogtreecommitdiff
path: root/Source/cmAddLibraryCommand.cxx
diff options
context:
space:
mode:
authorJohn Parent <john.parent@kitware.com>2022-03-10 12:43:50 -0500
committerJohn Parent <john.parent@kitware.com>2022-03-10 12:44:36 -0500
commit2f1ffa003c07d5fe7ca10c4ee06e81dd55f5e415 (patch)
treeeb92cb82fda9a3bcd1ad58cf6b1d2654a2527c35 /Source/cmAddLibraryCommand.cxx
parent3a37fda6a2b4f28fdd7efe58f4a0b7570404a7d4 (diff)
downloadcmake-2f1ffa003c07d5fe7ca10c4ee06e81dd55f5e415.tar.gz
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 'Source/cmAddLibraryCommand.cxx')
-rw-r--r--Source/cmAddLibraryCommand.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index a5d1f6a07f..29fc09bd2b 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -131,6 +131,10 @@ bool cmAddLibraryCommand(std::vector<std::string> const& args,
}
}
+ if (importTarget && !importGlobal) {
+ importGlobal = mf.IsImportedTargetGlobalScope();
+ }
+
if (type == cmStateEnums::INTERFACE_LIBRARY) {
if (importGlobal && !importTarget) {
status.SetError(