summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-10 13:21:51 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-10 13:22:02 (GMT)
commitf4e66b41d8de32ff4194207759d46fa9f15ce13c (patch)
treebd1f8ab4ba0164f3150648c49454c32f13ec3448 /Source
parent03469889f6ff62e1cdfd69eba316fd943746f17d (diff)
parent578d95f87d2c77498d1bbdd46bf5c1ad8095c31d (diff)
downloadCMake-f4e66b41d8de32ff4194207759d46fa9f15ce13c.zip
CMake-f4e66b41d8de32ff4194207759d46fa9f15ce13c.tar.gz
CMake-f4e66b41d8de32ff4194207759d46fa9f15ce13c.tar.bz2
Merge topic 'find-package_root-disable'
578d95f8 find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1116
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFindBase.cxx2
-rw-r--r--Source/cmFindCommon.cxx7
-rw-r--r--Source/cmFindCommon.h3
-rw-r--r--Source/cmFindPackageCommand.cxx2
4 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index e378208..10c6fe4 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -68,6 +68,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
}
this->AlreadyInCache = false;
+ this->SelectDefaultNoPackageRootPath();
+
// Find the current root path mode.
this->SelectDefaultRootPathMode();
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index fd0e317..4ef0f3e 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -88,6 +88,13 @@ void cmFindCommon::InitializeSearchPathGroups()
std::make_pair(PathLabel::Guess, cmSearchPath(this)));
}
+void cmFindCommon::SelectDefaultNoPackageRootPath()
+{
+ if (!this->Makefile->IsOn("__UNDOCUMENTED_CMAKE_FIND_PACKAGE_ROOT")) {
+ this->NoPackageRootPath = true;
+ }
+}
+
void cmFindCommon::SelectDefaultRootPathMode()
{
// Check the policy variable for this find command type.
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 7954267..72dcd35 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -84,6 +84,9 @@ protected:
/** Compute final search path list (reroot + trailing slash). */
void ComputeFinalPaths();
+ /** Decide whether to enable the PACKAGE_ROOT search entries. */
+ void SelectDefaultNoPackageRootPath();
+
/** Compute the current default root path mode. */
void SelectDefaultRootPathMode();
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index ca47535..7797700 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -209,6 +209,8 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
this->SortDirection = strcmp(sd, "ASC") == 0 ? Asc : Dec;
}
+ this->SelectDefaultNoPackageRootPath();
+
// Find the current root path mode.
this->SelectDefaultRootPathMode();