diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-08-05 17:07:03 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-10 09:03:48 (GMT) |
commit | e73916992c6893572f24ee4fa631b33445d6cdf6 (patch) | |
tree | c569a4a8b11ad4dd716f14862e2e3990b9241613 /Source/cmTarget.cxx | |
parent | c5718217ad242ca0fc6e6b15f4ee670e4a332c93 (diff) | |
download | CMake-e73916992c6893572f24ee4fa631b33445d6cdf6.zip CMake-e73916992c6893572f24ee4fa631b33445d6cdf6.tar.gz CMake-e73916992c6893572f24ee4fa631b33445d6cdf6.tar.bz2 |
cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index dd1d405..0b2d9fc 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2178,118 +2178,6 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const } //---------------------------------------------------------------------------- -bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const -{ - bool install_name_is_rpath = false; - bool macosx_rpath = false; - - if(!this->IsImportedTarget) - { - if(this->GetType() != cmTarget::SHARED_LIBRARY) - { - return false; - } - const char* install_name = this->GetProperty("INSTALL_NAME_DIR"); - bool use_install_name = - this->GetPropertyAsBool("BUILD_WITH_INSTALL_RPATH"); - if(install_name && use_install_name && - std::string(install_name) == "@rpath") - { - install_name_is_rpath = true; - } - else if(install_name && use_install_name) - { - return false; - } - if(!install_name_is_rpath) - { - macosx_rpath = this->MacOSXRpathInstallNameDirDefault(); - } - } - else - { - // Lookup the imported soname. - if(cmTarget::ImportInfo const* info = this->GetImportInfo(config)) - { - if(!info->NoSOName && !info->SOName.empty()) - { - if(info->SOName.find("@rpath/") == 0) - { - install_name_is_rpath = true; - } - } - else - { - std::string install_name; - cmSystemTools::GuessLibraryInstallName(info->Location, install_name); - if(install_name.find("@rpath") != std::string::npos) - { - install_name_is_rpath = true; - } - } - } - } - - if(!install_name_is_rpath && !macosx_rpath) - { - return false; - } - - if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG")) - { - std::ostringstream w; - w << "Attempting to use"; - if(macosx_rpath) - { - w << " MACOSX_RPATH"; - } - else - { - w << " @rpath"; - } - w << " without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being set."; - w << " This could be because you are using a Mac OS X version"; - w << " less than 10.5 or because CMake's platform configuration is"; - w << " corrupt."; - cmake* cm = this->Makefile->GetCMakeInstance(); - cm->IssueMessage(cmake::FATAL_ERROR, w.str(), this->GetBacktrace()); - } - - return true; -} - -//---------------------------------------------------------------------------- -bool cmTarget::MacOSXRpathInstallNameDirDefault() const -{ - // we can't do rpaths when unsupported - if(!this->Makefile->IsSet("CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG")) - { - return false; - } - - const char* macosx_rpath_str = this->GetProperty("MACOSX_RPATH"); - if(macosx_rpath_str) - { - return this->GetPropertyAsBool("MACOSX_RPATH"); - } - - cmPolicies::PolicyStatus cmp0042 = this->GetPolicyStatusCMP0042(); - - if(cmp0042 == cmPolicies::WARN) - { - this->Makefile->GetGlobalGenerator()-> - AddCMP0042WarnTarget(this->GetName()); - } - - if(cmp0042 == cmPolicies::NEW) - { - return true; - } - - return false; -} - -//---------------------------------------------------------------------------- bool cmTarget::IsImportedSharedLibWithoutSOName( const std::string& config) const { |