find_package: rename NoModule to UseFindModules

...positive logic is easier to handle

Alex
This commit is contained in:
Alex Neundorf 2012-02-17 21:31:08 +01:00 committed by Brad King
parent b3f9fe42f9
commit 978d89b99d
2 changed files with 15 additions and 15 deletions

View File

@ -57,7 +57,7 @@ cmFindPackageCommand::cmFindPackageCommand()
this->NoUserRegistry = false; this->NoUserRegistry = false;
this->NoSystemRegistry = false; this->NoSystemRegistry = false;
this->NoBuilds = false; this->NoBuilds = false;
this->NoModule = false; this->UseFindModules = true;
this->DebugMode = false; this->DebugMode = false;
this->UseLib64Paths = false; this->UseLib64Paths = false;
this->PolicyScope = true; this->PolicyScope = true;
@ -425,7 +425,7 @@ bool cmFindPackageCommand
} }
else if(args[i] == "NO_MODULE") else if(args[i] == "NO_MODULE")
{ {
this->NoModule = true; this->UseFindModules = false;
doing = DoingNone; doing = DoingNone;
} }
else if(args[i] == "REQUIRED") else if(args[i] == "REQUIRED")
@ -440,31 +440,31 @@ bool cmFindPackageCommand
} }
else if(args[i] == "NAMES") else if(args[i] == "NAMES")
{ {
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingNames; doing = DoingNames;
} }
else if(args[i] == "PATHS") else if(args[i] == "PATHS")
{ {
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingPaths; doing = DoingPaths;
} }
else if(args[i] == "HINTS") else if(args[i] == "HINTS")
{ {
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingHints; doing = DoingHints;
} }
else if(args[i] == "PATH_SUFFIXES") else if(args[i] == "PATH_SUFFIXES")
{ {
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingPathSuffixes; doing = DoingPathSuffixes;
} }
else if(args[i] == "CONFIGS") else if(args[i] == "CONFIGS")
{ {
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingConfigs; doing = DoingConfigs;
} }
@ -477,27 +477,27 @@ bool cmFindPackageCommand
else if(args[i] == "NO_CMAKE_PACKAGE_REGISTRY") else if(args[i] == "NO_CMAKE_PACKAGE_REGISTRY")
{ {
this->NoUserRegistry = true; this->NoUserRegistry = true;
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingNone; doing = DoingNone;
} }
else if(args[i] == "NO_CMAKE_SYSTEM_PACKAGE_REGISTRY") else if(args[i] == "NO_CMAKE_SYSTEM_PACKAGE_REGISTRY")
{ {
this->NoSystemRegistry = true; this->NoSystemRegistry = true;
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingNone; doing = DoingNone;
} }
else if(args[i] == "NO_CMAKE_BUILDS_PATH") else if(args[i] == "NO_CMAKE_BUILDS_PATH")
{ {
this->NoBuilds = true; this->NoBuilds = true;
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingNone; doing = DoingNone;
} }
else if(this->CheckCommonArgument(args[i])) else if(this->CheckCommonArgument(args[i]))
{ {
this->NoModule = true; this->UseFindModules = false;
this->Compatibility_1_6 = false; this->Compatibility_1_6 = false;
doing = DoingNone; doing = DoingNone;
} }
@ -636,7 +636,7 @@ bool cmFindPackageCommand
this->SetModuleVariables(components); this->SetModuleVariables(components);
// See if there is a Find<package>.cmake module. // See if there is a Find<package>.cmake module.
if(!this->NoModule) if(this->UseFindModules)
{ {
bool foundModule = false; bool foundModule = false;
if(!this->FindModule(foundModule)) if(!this->FindModule(foundModule))
@ -913,12 +913,12 @@ bool cmFindPackageCommand::HandlePackageMode()
else else
{ {
e << "Could not find "; e << "Could not find ";
if(!this->NoModule) if(this->UseFindModules)
{ {
e << "module Find" << this->Name << ".cmake or "; e << "module Find" << this->Name << ".cmake or ";
} }
e << "a configuration file for package " << this->Name << ".\n"; e << "a configuration file for package " << this->Name << ".\n";
if(!this->NoModule) if(this->UseFindModules)
{ {
e << "Adjust CMAKE_MODULE_PATH to find Find" e << "Adjust CMAKE_MODULE_PATH to find Find"
<< this->Name << ".cmake or set "; << this->Name << ".cmake or set ";

View File

@ -133,7 +133,7 @@ private:
bool Quiet; bool Quiet;
bool Required; bool Required;
bool Compatibility_1_6; bool Compatibility_1_6;
bool NoModule; bool UseFindModules;
bool NoUserRegistry; bool NoUserRegistry;
bool NoSystemRegistry; bool NoSystemRegistry;
bool NoBuilds; bool NoBuilds;