summaryrefslogtreecommitdiff
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-15 13:03:31 -0400
committerBrad King <brad.king@kitware.com>2021-10-15 13:04:19 -0400
commit14d98bcfe6fa1dd2f4220e50e99ec099939496d5 (patch)
tree98137c1b2c2d5b92caca0dff5d03a67e5998e5e1 /Source/cmExportFileGenerator.cxx
parent7df0541055167d556d866000f8da4b0e7f186b92 (diff)
downloadcmake-14d98bcfe6fa1dd2f4220e50e99ec099939496d5.tar.gz
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 c0a4cdc338..0eda92c190 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";
}