diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-04 17:19:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-08-05 16:20:47 (GMT) |
commit | d560bfd2739f2594119c49d82485b99bb4fbbe1f (patch) | |
tree | 88787d2a552094cb6b44a7a1e56ed42462d8c49e /Source/cmGeneratorTarget.cxx | |
parent | 89e2a080e977b9632fa13c627b6a5370250d6ed5 (diff) | |
download | CMake-d560bfd2739f2594119c49d82485b99bb4fbbe1f.zip CMake-d560bfd2739f2594119c49d82485b99bb4fbbe1f.tar.gz CMake-d560bfd2739f2594119c49d82485b99bb4fbbe1f.tar.bz2 |
cmGeneratorTarget: Move GetInstallNameDir* from cmTarget.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 45577e5..2de3c77 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -891,6 +891,73 @@ std::string cmGeneratorTarget::GetSOName(const std::string& config) const } //---------------------------------------------------------------------------- +std::string +cmGeneratorTarget::GetInstallNameDirForBuildTree( + const std::string& config) const +{ + // If building directly for installation then the build tree install_name + // is the same as the install tree. + if(this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH")) + { + return this->GetInstallNameDirForInstallTree(); + } + + // Use the build tree directory for the target. + if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME") && + !this->Makefile->IsOn("CMAKE_SKIP_RPATH") && + !this->GetPropertyAsBool("SKIP_BUILD_RPATH")) + { + std::string dir; + if(this->Target->MacOSXRpathInstallNameDirDefault()) + { + dir = "@rpath"; + } + else + { + dir = this->Target->GetDirectory(config); + } + dir += "/"; + return dir; + } + else + { + return ""; + } +} + +//---------------------------------------------------------------------------- +std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const +{ + 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")) + { + if(install_name_dir && *install_name_dir) + { + dir = install_name_dir; + dir += "/"; + } + } + if(!install_name_dir) + { + if(this->Target->MacOSXRpathInstallNameDirDefault()) + { + dir = "@rpath/"; + } + } + return dir; + } + else + { + return ""; + } +} + +//---------------------------------------------------------------------------- void cmGeneratorTarget::GetFullNameComponents(std::string& prefix, std::string& base, std::string& suffix, |