summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2017-07-17 13:43:16 (GMT)
committerChuck Atkins <chuck.atkins@kitware.com>2017-07-28 14:49:13 (GMT)
commitc5d2b99c027337a03f7b2b9f2cea28bb5c9bb995 (patch)
tree0eec4e72ad44cbf60b2cb03c590197d48e1d3ae2 /Source/cmFindPackageCommand.cxx
parentf15cfd891d1e01247ed285320ae32b6c3182ac8f (diff)
downloadCMake-c5d2b99c027337a03f7b2b9f2cea28bb5c9bb995.zip
CMake-c5d2b99c027337a03f7b2b9f2cea28bb5c9bb995.tar.gz
CMake-c5d2b99c027337a03f7b2b9f2cea28bb5c9bb995.tar.bz2
find_package: Add missing PACKAGE_ROOT_PATH search path implementation.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index f291f9d..ca47535 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1090,6 +1090,9 @@ void cmFindPackageCommand::AppendSuccessInformation()
void cmFindPackageCommand::ComputePrefixes()
{
if (!this->NoDefaultPath) {
+ if (!this->NoPackageRootPath) {
+ this->FillPrefixesPackageRoot();
+ }
if (!this->NoCMakePath) {
this->FillPrefixesCMakeVariable();
}
@@ -1117,6 +1120,23 @@ void cmFindPackageCommand::ComputePrefixes()
this->ComputeFinalPaths();
}
+void cmFindPackageCommand::FillPrefixesPackageRoot()
+{
+ cmSearchPath& paths = this->LabeledPaths[PathLabel::PackageRoot];
+
+ // Add package specific search prefixes
+ // NOTE: This should be using const_reverse_iterator but HP aCC and
+ // Oracle sunCC both currently have standard library issues
+ // with the reverse iterator APIs.
+ for (std::deque<std::string>::reverse_iterator pkg =
+ this->Makefile->FindPackageModuleStack.rbegin();
+ pkg != this->Makefile->FindPackageModuleStack.rend(); ++pkg) {
+ std::string varName = *pkg + "_ROOT";
+ paths.AddCMakePath(varName);
+ paths.AddEnvPath(varName);
+ }
+}
+
void cmFindPackageCommand::FillPrefixesCMakeEnvironment()
{
cmSearchPath& paths = this->LabeledPaths[PathLabel::CMakeEnvironment];