diff options
author | Christoph GrĂ¼ninger <foss@grueninger.de> | 2017-05-09 05:13:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-23 19:27:42 (GMT) |
commit | d0b9d1cceb37a58bc953385e7a33c6dff543a14b (patch) | |
tree | 3d906ec83643baa984769e8238d115784992671c /Source/cmFindPackageCommand.cxx | |
parent | d9df805f6a9433e579bc292c65b59efa5a87bceb (diff) | |
download | CMake-d0b9d1cceb37a58bc953385e7a33c6dff543a14b.zip CMake-d0b9d1cceb37a58bc953385e7a33c6dff543a14b.tar.gz CMake-d0b9d1cceb37a58bc953385e7a33c6dff543a14b.tar.bz2 |
find_package: shorten output for missing package in config mode
If CONFIG or MODULE is given and the package is not REQUIRED,
output a one-liner instead of the full warning.
Update Tests/RunCMake/find_package expected output to match.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 1fbb97b..8f74ba8 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -729,8 +729,9 @@ bool cmFindPackageCommand::HandlePackageMode() // package not found if (result && !found) { - // warn if package required and not quiet - if (!this->Quiet || this->Required) { + // warn if package required or neither quiet nor in config mode + if (this->Required || + !(this->Quiet || (this->UseConfigFiles && !this->UseFindModules))) { // The variable is not set. std::ostringstream e; std::ostringstream aw; @@ -832,6 +833,13 @@ bool cmFindPackageCommand::HandlePackageMode() this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, aw.str()); } } + // output result if in config mode but not in quiet mode + else if (!this->Quiet) { + std::ostringstream aw; + aw << "Could NOT find " << this->Name << " (missing: " << this->Name + << "_DIR)"; + this->Makefile->DisplayStatus(aw.str().c_str(), -1); + } } // Set a variable marking whether the package was found. |