From 19839e96f61f215fb0f5de2a3d752bb0661fb1f1 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 14 Dec 2009 17:46:29 -0500 Subject: Fix issue #9054 - ensure a valid install name for frameworks. When the INSTALL_NAME_DIR property is empty, still use a name of the form .framework/Versions// for installed frameworks. --- Source/cmTarget.cxx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 35876c5..0c8f14a 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3476,14 +3476,20 @@ std::string cmTarget::GetInstallNameDirForBuildTree(const char* config, std::string cmTarget::GetInstallNameDirForInstallTree(const char* config, bool for_xcode) { - // Lookup the target property. - const char* install_name_dir = this->GetProperty("INSTALL_NAME_DIR"); - if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME") && - !this->Makefile->IsOn("CMAKE_SKIP_RPATH") && - install_name_dir && *install_name_dir) + if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { - std::string dir = install_name_dir; - dir += "/"; + std::string dir; + + if(!this->Makefile->IsOn("CMAKE_SKIP_RPATH")) + { + const char* install_name_dir = this->GetProperty("INSTALL_NAME_DIR"); + if(install_name_dir && *install_name_dir) + { + dir = install_name_dir; + dir += "/"; + } + } + if(this->IsFrameworkOnApple() && !for_xcode) { dir += this->GetFullName(config, false); @@ -3491,6 +3497,7 @@ std::string cmTarget::GetInstallNameDirForInstallTree(const char* config, dir += this->GetFrameworkVersion(); dir += "/"; } + return dir; } else -- cgit v0.12