install(CODE|SCRIPT): Support $<INSTALL_PREFIX> genex

Fixes: #24534
This commit is contained in:
Kyle Edwards
2023-02-24 10:17:45 -05:00
parent 35ca2d524b
commit 18e02ace5b
9 changed files with 36 additions and 16 deletions

View File

@@ -56,12 +56,12 @@ bool cmInstallScriptGenerator::Compute(cmLocalGenerator* lg)
std::string cmInstallScriptGenerator::GetScript(
std::string const& config) const
{
std::string script;
std::string script = this->Script;
if (this->AllowGenex && this->ActionsPerConfig) {
script = cmGeneratorExpression::Evaluate(this->Script,
this->LocalGenerator, config);
} else {
script = this->Script;
cmGeneratorExpression::ReplaceInstallPrefix(script,
"${CMAKE_INSTALL_PREFIX}");
script =
cmGeneratorExpression::Evaluate(script, this->LocalGenerator, config);
}
return script;
}