summaryrefslogtreecommitdiffstats
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-15 17:03:31 (GMT)
committerBrad King <brad.king@kitware.com>2021-10-15 17:04:19 (GMT)
commit14d98bcfe6fa1dd2f4220e50e99ec099939496d5 (patch)
tree98137c1b2c2d5b92caca0dff5d03a67e5998e5e1 /Source/cmExportFileGenerator.cxx
parent7df0541055167d556d866000f8da4b0e7f186b92 (diff)
downloadCMake-14d98bcfe6fa1dd2f4220e50e99ec099939496d5.zip
CMake-14d98bcfe6fa1dd2f4220e50e99ec099939496d5.tar.gz
CMake-14d98bcfe6fa1dd2f4220e50e99ec099939496d5.tar.bz2
export: Propagate IMPORTED_NO_SYSTEM target property to consumers
Enabling `IMPORTED_NO_SYSTEM` on a target built within the project has no effect on the build system, but it is still a useful way to set the property on imported targets generated by `install(EXPORT)` and `export()`. Issue: #17364
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index c0a4cdc..0eda92c 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -1072,6 +1072,12 @@ void cmExportFileGenerator::GenerateImportTargetCode(
os << "set_property(TARGET " << targetName << " PROPERTY DEPRECATION "
<< cmExportFileGeneratorEscape(target->GetDeprecation()) << ")\n";
}
+
+ if (target->GetPropertyAsBool("IMPORTED_NO_SYSTEM")) {
+ os << "set_property(TARGET " << targetName
+ << " PROPERTY IMPORTED_NO_SYSTEM 1)\n";
+ }
+
os << "\n";
}