summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2013-08-22 03:09:32 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2013-08-22 03:09:51 (GMT)
commit78cd8842966efb6d54668d47ee92bdeed35cc79e (patch)
tree8cc3d5c184091c3762f3b631fef8f9aee8bcbd99
parent84698abb514b665c5db5111ecf247d44b9979844 (diff)
downloadCMake-78cd8842966efb6d54668d47ee92bdeed35cc79e.zip
CMake-78cd8842966efb6d54668d47ee92bdeed35cc79e.tar.gz
CMake-78cd8842966efb6d54668d47ee92bdeed35cc79e.tar.bz2
OSX: Allow an empty INSTALL_NAME_DIR to override MACOSX_RPATH.
With this, projects can enable MACOSX_RPATH by default, but still have a way to install libraries with no install name dirs into locations such as /usr/local/lib by setting INSTALL_NAME_DIR="".
-rw-r--r--Source/cmTarget.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b9dc423..dd1bdde 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1615,7 +1615,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->IsApple = this->Makefile->IsOn("APPLE");
// Setup default property values.
- this->SetPropertyDefault("INSTALL_NAME_DIR", "");
+ this->SetPropertyDefault("INSTALL_NAME_DIR", 0);
this->SetPropertyDefault("INSTALL_RPATH", "");
this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF");
this->SetPropertyDefault("SKIP_BUILD_RPATH", "OFF");
@@ -4541,6 +4541,10 @@ bool cmTarget::HasMacOSXRpath(const char* config)
{
install_name_is_rpath = true;
}
+ else if(install_name && use_install_name)
+ {
+ return false;
+ }
}
else
{
@@ -5273,18 +5277,18 @@ std::string cmTarget::GetInstallNameDirForInstallTree()
if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME"))
{
std::string dir;
+ const char* install_name_dir = this->GetProperty("INSTALL_NAME_DIR");
if(!this->Makefile->IsOn("CMAKE_SKIP_RPATH") &&
!this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH"))
{
- const char* install_name_dir = this->GetProperty("INSTALL_NAME_DIR");
if(install_name_dir && *install_name_dir)
{
dir = install_name_dir;
dir += "/";
}
}
- if(dir.empty() && this->GetPropertyAsBool("MACOSX_RPATH"))
+ if(!install_name_dir && this->GetPropertyAsBool("MACOSX_RPATH"))
{
dir = "@rpath/";
}