diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-01 21:37:59 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-04 17:01:05 (GMT) |
commit | 3c85f11fedf55c5072cd00deb129a0782130d78c (patch) | |
tree | 7e3f97d3052b8edff775467c01d36124706d009c /Source/cmGeneratorTarget.cxx | |
parent | 2ec1156b80485fedba5b6d9b0802c21e1cbc2d8f (diff) | |
download | CMake-3c85f11fedf55c5072cd00deb129a0782130d78c.zip CMake-3c85f11fedf55c5072cd00deb129a0782130d78c.tar.gz CMake-3c85f11fedf55c5072cd00deb129a0782130d78c.tar.bz2 |
INSTALL_NAME_DIR: Add support for generator expressions
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index d5e58b0..d750d96 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2125,7 +2125,9 @@ std::string cmGeneratorTarget::GetInstallNameDirForBuildTree( // If building directly for installation then the build tree install_name // is the same as the install tree. if (this->MacOSXUseInstallNameDir()) { - return this->GetInstallNameDirForInstallTree(); + std::string installPrefix = + this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX"); + return this->GetInstallNameDirForInstallTree(config, installPrefix); } // Use the build tree directory for the target. @@ -2143,7 +2145,8 @@ std::string cmGeneratorTarget::GetInstallNameDirForBuildTree( return ""; } -std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const +std::string cmGeneratorTarget::GetInstallNameDirForInstallTree( + const std::string& config, const std::string& installPrefix) const { if (this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { std::string dir; @@ -2151,7 +2154,13 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const if (this->CanGenerateInstallNameDir(INSTALL_NAME_FOR_INSTALL)) { if (install_name_dir && *install_name_dir) { - dir = cmStrCat(install_name_dir, '/'); + dir = install_name_dir; + cmGeneratorExpression::ReplaceInstallPrefix(dir, installPrefix); + dir = + cmGeneratorExpression::Evaluate(dir, this->LocalGenerator, config); + if (!dir.empty()) { + dir = cmStrCat(dir, '/'); + } } } if (!install_name_dir) { |