cmRulePlaceholderExpander: expand `<TARGET_SUPPORT_DIR>` placeholders
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9ad7f08..78dcda5 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx
@@ -2358,6 +2358,7 @@ vars.Object = sfVars.ObjectFileDir.c_str(); vars.ObjectDir = sfVars.ObjectDir.c_str(); vars.ObjectFileDir = sfVars.ObjectFileDir.c_str(); + vars.TargetSupportDir = sfVars.TargetSupportDir.c_str(); vars.Flags = PlaceholderFlags.c_str(); vars.DependencyFile = sfVars.DependencyFile.c_str(); vars.DependencyTarget = sfVars.DependencyTarget.c_str(); @@ -2438,12 +2439,16 @@ // Object settings. { + std::string const targetSupportDir = lg->MaybeRelativeToTopBinDir( + gg->ConvertToOutputPath(this->GetCMFSupportDirectory())); std::string const objectDir = gg->ConvertToOutputPath( cmStrCat(this->GetSupportDirectory(), gg->GetConfigDirectory(config))); std::string const objectFileName = this->GetObjectName(sf); std::string const objectFilePath = cmStrCat(objectDir, '/', objectFileName); + vars.TargetSupportDir = + lg->ConvertToOutputFormat(targetSupportDir, cmOutputConverter::SHELL); vars.ObjectDir = lg->ConvertToOutputFormat(objectDir, cmOutputConverter::SHELL); vars.ObjectFileDir =
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 34b66f7..6e9f92f 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h
@@ -566,6 +566,7 @@ std::string TargetPDB; std::string TargetCompilePDB; std::string ObjectDir; + std::string TargetSupportDir; std::string ObjectFileDir; std::string DependencyFile; std::string DependencyTarget;
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx index 01b6a66..4892b7c 100644 --- a/Source/cmRulePlaceholderExpander.cxx +++ b/Source/cmRulePlaceholderExpander.cxx
@@ -77,6 +77,11 @@ return this->ReplaceValues->Object; } } + if (this->ReplaceValues->TargetSupportDir) { + if (variable == "TARGET_SUPPORT_DIR") { + return this->ReplaceValues->TargetSupportDir; + } + } if (this->ReplaceValues->ObjectDir) { if (variable == "OBJECT_DIR") { return this->ReplaceValues->ObjectDir;
diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h index 598a8ed..d0c3687 100644 --- a/Source/cmRulePlaceholderExpander.h +++ b/Source/cmRulePlaceholderExpander.h
@@ -48,6 +48,7 @@ char const* DynDepFile = nullptr; char const* Output = nullptr; char const* Object = nullptr; + char const* TargetSupportDir = nullptr; char const* ObjectDir = nullptr; char const* ObjectFileDir = nullptr; char const* Flags = nullptr;