summaryrefslogtreecommitdiff
path: root/Source/cmExportFileGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-09-14 17:48:20 +0200
committerCraig Scott <craig.scott@crascit.com>2018-09-25 23:59:58 +1000
commita71caab46b205c2b0367c2b11c12a9b55b09bcca (patch)
treeb19ad25b6e8b87bc0e35eb7c93df8afcb6fde594 /Source/cmExportFileGenerator.cxx
parent5ca130e22394978814a9e59418529a7a3e1a61bd (diff)
downloadcmake-a71caab46b205c2b0367c2b11c12a9b55b09bcca.tar.gz
LINK_DIRECTORIES: Add new properties and commands
These new capabilities enable to manage link directories Two new properties: * target properties: LINK_DIRECTORIES and INTERFACE_LINK_DIRECTORIES One new command * target_link_directories(): to populate target properties Fixes: #17215
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r--Source/cmExportFileGenerator.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index d6573b8d80..4cf9dd7a9e 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -451,6 +451,37 @@ void cmExportFileGenerator::PopulateLinkDependsInterface(
}
}
+void cmExportFileGenerator::PopulateLinkDirectoriesInterface(
+ cmTargetExport* tei, cmGeneratorExpression::PreprocessContext preprocessRule,
+ ImportPropertyMap& properties, std::vector<std::string>& missingTargets)
+{
+ cmGeneratorTarget* gt = tei->Target;
+ assert(preprocessRule == cmGeneratorExpression::InstallInterface);
+
+ const char* propName = "INTERFACE_LINK_DIRECTORIES";
+ const char* input = gt->GetProperty(propName);
+
+ if (!input) {
+ return;
+ }
+
+ if (!*input) {
+ properties[propName].clear();
+ return;
+ }
+
+ std::string prepro =
+ cmGeneratorExpression::Preprocess(input, preprocessRule, true);
+ if (!prepro.empty()) {
+ this->ResolveTargetsInGeneratorExpressions(prepro, gt, missingTargets);
+
+ if (!checkInterfaceDirs(prepro, gt, propName)) {
+ return;
+ }
+ properties[propName] = prepro;
+ }
+}
+
void cmExportFileGenerator::PopulateInterfaceProperty(
const std::string& propName, cmGeneratorTarget* target,
cmGeneratorExpression::PreprocessContext preprocessRule,