Merge topic 'fix-genex-RPATH-handling'

dcb5907 Fix RPATH information when only a genex is used as a link library.
This commit is contained in:
Brad King 2013-03-04 15:40:20 -05:00 committed by CMake Topic Stage
commit e6b4641bfa
3 changed files with 11 additions and 6 deletions

View File

@ -1816,7 +1816,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
(outputRuntime && this->Target->HaveInstallTreeRPATH() && (outputRuntime && this->Target->HaveInstallTreeRPATH() &&
linking_for_install); linking_for_install);
bool use_build_rpath = bool use_build_rpath =
(outputRuntime && this->Target->HaveBuildTreeRPATH() && (outputRuntime && this->Target->HaveBuildTreeRPATH(this->Config) &&
!linking_for_install); !linking_for_install);
bool use_link_rpath = bool use_link_rpath =
outputRuntime && linking_for_install && outputRuntime && linking_for_install &&

View File

@ -4253,10 +4253,15 @@ void cmTarget::SetPropertyDefault(const char* property,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::HaveBuildTreeRPATH() bool cmTarget::HaveBuildTreeRPATH(const char *config)
{ {
return (!this->GetPropertyAsBool("SKIP_BUILD_RPATH") && if (this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
!this->LinkLibraries.empty()); {
return false;
}
std::vector<std::string> libs;
this->GetDirectLinkLibraries(config, libs, this);
return !libs.empty();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -4327,7 +4332,7 @@ bool cmTarget::NeedRelinkBeforeInstall(const char* config)
// If either a build or install tree rpath is set then the rpath // If either a build or install tree rpath is set then the rpath
// will likely change between the build tree and install tree and // will likely change between the build tree and install tree and
// this target must be relinked. // this target must be relinked.
return this->HaveBuildTreeRPATH() || this->HaveInstallTreeRPATH(); return this->HaveBuildTreeRPATH(config) || this->HaveInstallTreeRPATH();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -401,7 +401,7 @@ public:
*/ */
bool NeedRelinkBeforeInstall(const char* config); bool NeedRelinkBeforeInstall(const char* config);
bool HaveBuildTreeRPATH(); bool HaveBuildTreeRPATH(const char *config);
bool HaveInstallTreeRPATH(); bool HaveInstallTreeRPATH();
/** Return true if builtin chrpath will work for this target */ /** Return true if builtin chrpath will work for this target */