summaryrefslogtreecommitdiffstats
path: root/Source/cmFindCommon.cxx
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2017-05-03 17:56:03 (GMT)
committerChuck Atkins <chuck.atkins@kitware.com>2017-05-16 19:19:40 (GMT)
commitef3d360a3de4a290c92c34827a3b68a8ce160840 (patch)
treef999d696f387ba6b0d71ebf9b013ca0723bb2989 /Source/cmFindCommon.cxx
parent836cb52e9aec83f88841cb5b45abb1d32bb02214 (diff)
downloadCMake-ef3d360a3de4a290c92c34827a3b68a8ce160840.zip
CMake-ef3d360a3de4a290c92c34827a3b68a8ce160840.tar.gz
CMake-ef3d360a3de4a290c92c34827a3b68a8ce160840.tar.bz2
find_*: Add a new PackageRoot search path group
The new PackageRoot search path group allows the PackageName_ROOT cmake and environment variables to be used as search prefixes for all find_* commands called from within a find module
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r--Source/cmFindCommon.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index df57a1b..e8ae20f 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -10,6 +10,8 @@
#include "cmSystemTools.h"
cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL");
+cmFindCommon::PathLabel cmFindCommon::PathLabel::PackageRoot(
+ "PacakgeName_ROOT");
cmFindCommon::PathLabel cmFindCommon::PathLabel::CMake("CMAKE");
cmFindCommon::PathLabel cmFindCommon::PathLabel::CMakeEnvironment(
"CMAKE_ENVIRONMENT");
@@ -23,6 +25,7 @@ cmFindCommon::cmFindCommon()
{
this->FindRootPathMode = RootPathModeBoth;
this->NoDefaultPath = false;
+ this->NoPackageRootPath = false;
this->NoCMakePath = false;
this->NoCMakeEnvironmentPath = false;
this->NoSystemEnvironmentPath = false;
@@ -57,6 +60,7 @@ void cmFindCommon::InitializeSearchPathGroups()
// All search paths
labels = &this->PathGroupLabelMap[PathGroup::All];
+ labels->push_back(PathLabel::PackageRoot);
labels->push_back(PathLabel::CMake);
labels->push_back(PathLabel::CMakeEnvironment);
labels->push_back(PathLabel::Hints);
@@ -69,6 +73,8 @@ void cmFindCommon::InitializeSearchPathGroups()
// Create the idividual labeld search paths
this->LabeledPaths.insert(
+ std::make_pair(PathLabel::PackageRoot, cmSearchPath(this)));
+ this->LabeledPaths.insert(
std::make_pair(PathLabel::CMake, cmSearchPath(this)));
this->LabeledPaths.insert(
std::make_pair(PathLabel::CMakeEnvironment, cmSearchPath(this)));
@@ -271,10 +277,12 @@ bool cmFindCommon::CheckCommonArgument(std::string const& arg)
{
if (arg == "NO_DEFAULT_PATH") {
this->NoDefaultPath = true;
- } else if (arg == "NO_CMAKE_ENVIRONMENT_PATH") {
- this->NoCMakeEnvironmentPath = true;
+ } else if (arg == "NO_PACKAGE_ROOT_PATH") {
+ this->NoPackageRootPath = true;
} else if (arg == "NO_CMAKE_PATH") {
this->NoCMakePath = true;
+ } else if (arg == "NO_CMAKE_ENVIRONMENT_PATH") {
+ this->NoCMakeEnvironmentPath = true;
} else if (arg == "NO_SYSTEM_ENVIRONMENT_PATH") {
this->NoSystemEnvironmentPath = true;
} else if (arg == "NO_CMAKE_SYSTEM_PATH") {