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 <name>.framework/Versions/<version>/<name> for
installed frameworks.
This commit is contained in:
David Cole 2009-12-14 17:46:29 -05:00
parent 68374fe078
commit 19839e96f6
1 changed files with 14 additions and 7 deletions

View File

@ -3476,14 +3476,20 @@ std::string cmTarget::GetInstallNameDirForBuildTree(const char* config,
std::string cmTarget::GetInstallNameDirForInstallTree(const char* config, std::string cmTarget::GetInstallNameDirForInstallTree(const char* config,
bool for_xcode) bool for_xcode)
{ {
// Lookup the target property. if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
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)
{ {
std::string dir = install_name_dir; std::string dir;
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) if(this->IsFrameworkOnApple() && !for_xcode)
{ {
dir += this->GetFullName(config, false); dir += this->GetFullName(config, false);
@ -3491,6 +3497,7 @@ std::string cmTarget::GetInstallNameDirForInstallTree(const char* config,
dir += this->GetFrameworkVersion(); dir += this->GetFrameworkVersion();
dir += "/"; dir += "/";
} }
return dir; return dir;
} }
else else