summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2014-04-02 16:32:54 +0200
committerBrad King <brad.king@kitware.com>2014-05-12 09:50:01 -0400
commitbe8ae96098c58cf96ed71badba94e7b45f273f3c (patch)
treebeac603dc9dbfe83ec71db2b8aae5bc54ccce8d6 /Source/cmFindPackageCommand.cxx
parentd09fda5d91e92155ef674dde97a66547cc750e9f (diff)
downloadcmake-be8ae96098c58cf96ed71badba94e7b45f273f3c.tar.gz
Allow the Package Registry to be disabled (#14849)
When a project is packaged for redistribution the local package registries should not be updated or consulted. They are for developers. Add variables to disable use of package registries globally: * CMAKE_EXPORT_NO_PACKAGE_REGISTRY that disables the export(PACKAGE) command * CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY that disables the User Package Registry in all the find_package calls. * CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY that disables the System Package Registry in all the find_package calls. Update documentation and unit tests.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index a790e00407..55a61f5b1f 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -90,6 +90,18 @@ bool cmFindPackageCommand
this->UseLib64Paths = true;
}
+ // Check if User Package Registry should be disabled
+ if(this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY"))
+ {
+ this->NoUserRegistry = true;
+ }
+
+ // Check if System Package Registry should be disabled
+ if(this->Makefile->IsOn("CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY"))
+ {
+ this->NoSystemRegistry = true;
+ }
+
// Find the current root path mode.
this->SelectDefaultRootPathMode();