diff options
author | Brad King <brad.king@kitware.com> | 2003-07-24 15:32:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2003-07-24 15:32:41 (GMT) |
commit | 78367fbc1b52b157961ec3bd9af4de760b4683b5 (patch) | |
tree | d020139ea303b26319e25cb6e21e6a9fb3e832c3 /Source/cmFindPackageCommand.cxx | |
parent | 185c82b6adbf8f7186ff63eea27e06ed319aaa6e (diff) | |
download | CMake-78367fbc1b52b157961ec3bd9af4de760b4683b5.zip CMake-78367fbc1b52b157961ec3bd9af4de760b4683b5.tar.gz CMake-78367fbc1b52b157961ec3bd9af4de760b4683b5.tar.bz2 |
ENH: Implemented QUIET argument propagation to FOO_FIND_QUIETLY setting in FindFOO.cmake module that is found.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8881929..6a8dd7b 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -55,7 +55,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args) // See if there is a Find<name>.cmake module. bool foundModule = false; - if(!this->FindModule(foundModule)) + if(!this->FindModule(foundModule, quiet)) { return false; } @@ -124,7 +124,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args) } //---------------------------------------------------------------------------- -bool cmFindPackageCommand::FindModule(bool& found) +bool cmFindPackageCommand::FindModule(bool& found, bool quiet) { // Search the CMAKE_MODULE_PATH for a Find<name>.cmake module. found = false; @@ -157,6 +157,17 @@ bool cmFindPackageCommand::FindModule(bool& found) if(cmSystemTools::FileExists(module.c_str())) { found = true; + + if(quiet) + { + // Tell the module that is about to be read that it should find + // quietly. + std::string quietly = this->Name; + quietly += "_FIND_QUIETLY"; + m_Makefile->AddDefinition(quietly.c_str(), "1"); + } + + // Load the module we found. return this->ReadListFile(module.c_str()); } } |