summaryrefslogtreecommitdiff
path: root/Source/cmFindCommon.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-08 11:22:17 -0400
committerBrad King <brad.king@kitware.com>2017-08-08 11:52:28 -0400
commit578d95f87d2c77498d1bbdd46bf5c1ad8095c31d (patch)
tree574f50edde4397174ee61b54ce91824212417632 /Source/cmFindCommon.cxx
parent4a207116908c20caba4969120b1148adff391348 (diff)
downloadcmake-578d95f87d2c77498d1bbdd46bf5c1ad8095c31d.tar.gz
find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9
Disable the feature added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and remove documentation added by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). Unfortunately the name `<pkg>_ROOT` may already be set by projects for their own incompatible purposes. Disable the behavior change for now to fix the regression for CMake 3.9. We can restore it later with a policy. In order to keep the implementation and tests working, add an undocumented variable we can use in the tests to enable the behavior before the policy is introduced. Fixes: #17144
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r--Source/cmFindCommon.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index fd0e317019..4ef0f3ec1c 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.