ENH: provide the xxx_FIND_QUIETLY, xxx_FIND_REQUIRED and xxx_FIND_VERSION_ variables
also in Config mode, so the xxxConfig.cmake files can e.g. test the QUIETLY parameter and print something or not Alex
This commit is contained in:
parent
6f8bdd276c
commit
8903f88b36
@ -411,7 +411,7 @@ bool cmFindPackageCommand
|
|||||||
{
|
{
|
||||||
// Set a variable telling the find script this component
|
// Set a variable telling the find script this component
|
||||||
// is required.
|
// is required.
|
||||||
std::string req_var = Name + "_FIND_REQUIRED_" + args[i];
|
std::string req_var = this->Name + "_FIND_REQUIRED_" + args[i];
|
||||||
this->Makefile->AddDefinition(req_var.c_str(), "1");
|
this->Makefile->AddDefinition(req_var.c_str(), "1");
|
||||||
|
|
||||||
// Append to the list of required components.
|
// Append to the list of required components.
|
||||||
@ -480,9 +480,7 @@ bool cmFindPackageCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the list of components.
|
this->SetModuleVariables(components);
|
||||||
std::string components_var = Name + "_FIND_COMPONENTS";
|
|
||||||
this->Makefile->AddDefinition(components_var.c_str(), components.c_str());
|
|
||||||
|
|
||||||
// See if there is a Find<package>.cmake module.
|
// See if there is a Find<package>.cmake module.
|
||||||
if(!this->NoModule)
|
if(!this->NoModule)
|
||||||
@ -533,15 +531,14 @@ bool cmFindPackageCommand
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool cmFindPackageCommand::FindModule(bool& found)
|
bool cmFindPackageCommand::SetModuleVariables(const std::string& components)
|
||||||
{
|
{
|
||||||
std::string module = "Find";
|
// Store the list of components.
|
||||||
module += this->Name;
|
std::string components_var = this->Name + "_FIND_COMPONENTS";
|
||||||
module += ".cmake";
|
this->Makefile->AddDefinition(components_var.c_str(), components.c_str());
|
||||||
std::string mfile = this->Makefile->GetModulesFile(module.c_str());
|
|
||||||
if ( mfile.size() )
|
|
||||||
{
|
|
||||||
if(this->Quiet)
|
if(this->Quiet)
|
||||||
{
|
{
|
||||||
// Tell the module that is about to be read that it should find
|
// Tell the module that is about to be read that it should find
|
||||||
@ -594,7 +591,18 @@ bool cmFindPackageCommand::FindModule(bool& found)
|
|||||||
this->Makefile->AddDefinition(exact.c_str(),
|
this->Makefile->AddDefinition(exact.c_str(),
|
||||||
this->VersionExact? "1":"0");
|
this->VersionExact? "1":"0");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
bool cmFindPackageCommand::FindModule(bool& found)
|
||||||
|
{
|
||||||
|
std::string module = "Find";
|
||||||
|
module += this->Name;
|
||||||
|
module += ".cmake";
|
||||||
|
std::string mfile = this->Makefile->GetModulesFile(module.c_str());
|
||||||
|
if ( mfile.size() )
|
||||||
|
{
|
||||||
// Load the module we found.
|
// Load the module we found.
|
||||||
found = true;
|
found = true;
|
||||||
return this->ReadListFile(mfile.c_str());
|
return this->ReadListFile(mfile.c_str());
|
||||||
|
@ -73,6 +73,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void AppendSuccessInformation();
|
void AppendSuccessInformation();
|
||||||
void AppendToProperty(const char* propertyName);
|
void AppendToProperty(const char* propertyName);
|
||||||
|
bool SetModuleVariables(const std::string& components);
|
||||||
bool FindModule(bool& found);
|
bool FindModule(bool& found);
|
||||||
bool HandlePackageMode();
|
bool HandlePackageMode();
|
||||||
void FindConfig();
|
void FindConfig();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user