diff options
author | Brad King <brad.king@kitware.com> | 2019-11-06 14:32:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-06 14:32:22 (GMT) |
commit | ce7408514c98d39612c7f1e1d85929c223f71068 (patch) | |
tree | 9ae345da07644e300e23d35c58cbd409da90718a /Source/cmGeneratorTarget.cxx | |
parent | 0ff5bdd4c99824bb6e4b1c19f6f9f9e47ee96088 (diff) | |
parent | a0e2e0ca9725996c5ff4662f84d9bca8ea4edd35 (diff) | |
download | CMake-ce7408514c98d39612c7f1e1d85929c223f71068.zip CMake-ce7408514c98d39612c7f1e1d85929c223f71068.tar.gz CMake-ce7408514c98d39612c7f1e1d85929c223f71068.tar.bz2 |
Merge topic 'install-name-dir-genex'
a0e2e0ca97 Help: Add documentation and release notes for INSTALL_NAME_DIR genex
deeab72aae Tests: Add tests for INSTALL_NAME_DIR
3c85f11fed INSTALL_NAME_DIR: Add support for generator expressions
2ec1156b80 Refactor: Generalize cmExportInstallFileGenerator::ReplaceInstallPrefix()
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3989
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 41f1df9..d4cbfae 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) { |