diff options
author | Brad King <brad.king@kitware.com> | 2017-08-08 17:08:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-08-10 13:27:19 (GMT) |
commit | 8c0afd2c75af14bbd2355a6f3df729ebeaf6fc25 (patch) | |
tree | 033ffde8073365704357e191e0b75cea223c8886 /Source | |
parent | 2610c1a73321df6c18f0082aa527dbcad951cdbc (diff) | |
parent | 578d95f87d2c77498d1bbdd46bf5c1ad8095c31d (diff) | |
download | CMake-8c0afd2c75af14bbd2355a6f3df729ebeaf6fc25.zip CMake-8c0afd2c75af14bbd2355a6f3df729ebeaf6fc25.tar.gz CMake-8c0afd2c75af14bbd2355a6f3df729ebeaf6fc25.tar.bz2 |
Merge branch 'find-package_root-disable' into release-3.9
Merge-request: !1116
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFindBase.cxx | 2 | ||||
-rw-r--r-- | Source/cmFindCommon.cxx | 7 | ||||
-rw-r--r-- | Source/cmFindCommon.h | 3 | ||||
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 2 |
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(); |