summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-07-09 23:32:40 +0000
committerKitware Robot <kwrobot@kitware.com>2019-07-09 19:32:54 -0400
commitf7eb76501224a028c2e2bcacaef6018ece7b3738 (patch)
treea9789c4759728e3fd3a3c634bfdd567d4907e5de /Source/cmFindPackageCommand.cxx
parentf374ffb14b3e55bbee8e7bb0eb3e5a33ee3612f1 (diff)
parent447a96f5905ed1fb0ef17a8732cac7014da99cf6 (diff)
downloadcmake-f7eb76501224a028c2e2bcacaef6018ece7b3738.tar.gz
Merge topic 'add_cmake_find_use_package_registry'
447a96f590 vim: Update cmake.vim to include the CMAKE_FIND_USE variables 1d00ba9ccf Find: find_package prefers variable CMAKE_FIND_USE_REGISTRY 704e3a2ca8 Find: Correct spelling and layout issues in CMAKE_FIND_USE_ docs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3487
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 557069bfef..50ae6a93f7 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -188,7 +188,12 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
}
// Check if User Package Registry should be disabled
- if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
+ // The `CMAKE_FIND_USE_PACKAGE_REGISTRY` has
+ // priority over the deprecated CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
+ if (const char* def =
+ this->Makefile->GetDefinition("CMAKE_FIND_USE_PACKAGE_REGISTRY")) {
+ this->NoUserRegistry = !cmSystemTools::IsOn(def);
+ } else if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY")) {
this->NoUserRegistry = true;
}