diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2019-10-31 13:16:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-11-04 15:31:16 (GMT) |
commit | 55df3954d33913727fa7a5871ea1f336b1cbe85c (patch) | |
tree | 02ef0cceda03d44ebbaa5a169b2ed3e536d9feda /Source/cmFindPackageCommand.cxx | |
parent | c1d5d5eb11e0260ffadda0851ac844ab46b6b179 (diff) | |
download | CMake-55df3954d33913727fa7a5871ea1f336b1cbe85c.zip CMake-55df3954d33913727fa7a5871ea1f336b1cbe85c.tar.gz CMake-55df3954d33913727fa7a5871ea1f336b1cbe85c.tar.bz2 |
find_package: Add support for CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
Extend the change from commit 1d00ba9ccf (Find: find_package prefers
variable CMAKE_FIND_USE_REGISTRY, 2018-11-13, v3.16.0-rc1~461^2~1)
to cover the system package registry too.
Fixes: #19890
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index ea936cf..2b11b62 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -201,7 +201,13 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args) } // Check if System Package Registry should be disabled - if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY")) { + // The `CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY` has + // priority over the deprecated CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY + if (const char* def = this->Makefile->GetDefinition( + "CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY")) { + this->NoSystemRegistry = !cmIsOn(def); + } else if (this->Makefile->IsOn( + "CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY")) { this->NoSystemRegistry = true; } |