diff options
author | Brad King <brad.king@kitware.com> | 2016-10-24 14:16:40 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-10-24 14:16:40 (GMT) |
commit | b899c0a92f6833c4996276d86d9e0fb3d42df77c (patch) | |
tree | 4a21fd3a3ac03ec9d5ae9a9acd9d7f7e0ee1af23 /Source/cmFindPackageCommand.cxx | |
parent | 3d5ec790eea47a91c6f70d172c42839db02b8467 (diff) | |
parent | 569509f4bfbf44c67e237a01f957fdfe52223cfa (diff) | |
download | CMake-b899c0a92f6833c4996276d86d9e0fb3d42df77c.zip CMake-b899c0a92f6833c4996276d86d9e0fb3d42df77c.tar.gz CMake-b899c0a92f6833c4996276d86d9e0fb3d42df77c.tar.bz2 |
Merge topic 'separate-compilation'
569509f4 Fix newly discovered clang-tidy issues
6c9b3b5c cmCommand: implement functions in cxx file
8483dab8 bootstrap: Sort source files lexicographically
4fb70919 Create all commands from a single function
608afd4f Separate compilation for commands included in cmBootstrapCommands2
64f9c282 Separate compilation for commands included in cmBootstrapCommands1
f69e768d Separate compilation for commands included in cmCommands
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 029d422..373b728 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -4,9 +4,12 @@ #include "cmAlgorithms.h" #include "cmState.h" +#include "cmVersion.h" + #include <cmSystemTools.h> #include <cmsys/Directory.hxx> #include <cmsys/Encoding.hxx> +#include <cmsys/FStream.hxx> #include <cmsys/RegularExpression.hxx> #ifdef CMAKE_BUILD_WITH_CMAKE @@ -670,8 +673,8 @@ bool cmFindPackageCommand::HandlePackageMode() bool configFileSetFOUNDFalse = false; if (fileFound) { - if ((this->Makefile->IsDefinitionSet(foundVar)) && - (this->Makefile->IsOn(foundVar) == false)) { + if (this->Makefile->IsDefinitionSet(foundVar) && + !this->Makefile->IsOn(foundVar)) { // by removing Foo_FOUND here if it is FALSE, we don't really change // the situation for the Config file which is about to be included, // but we make it possible to detect later on whether the Config file @@ -690,8 +693,8 @@ bool cmFindPackageCommand::HandlePackageMode() found = true; // Check whether the Config file has set Foo_FOUND to FALSE: - if ((this->Makefile->IsDefinitionSet(foundVar)) && - (this->Makefile->IsOn(foundVar) == false)) { + if (this->Makefile->IsDefinitionSet(foundVar) && + !this->Makefile->IsOn(foundVar)) { // we get here if the Config file has set Foo_FOUND actively to FALSE found = false; configFileSetFOUNDFalse = true; @@ -1413,8 +1416,7 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file) // Look for foo-config-version.cmake std::string version_file = version_file_base; version_file += "-version.cmake"; - if ((haveResult == false) && - (cmSystemTools::FileExists(version_file.c_str(), true))) { + if (!haveResult && cmSystemTools::FileExists(version_file.c_str(), true)) { result = this->CheckVersionFile(version_file, version); haveResult = true; } @@ -1422,14 +1424,13 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file) // Look for fooConfigVersion.cmake version_file = version_file_base; version_file += "Version.cmake"; - if ((haveResult == false) && - (cmSystemTools::FileExists(version_file.c_str(), true))) { + if (!haveResult && cmSystemTools::FileExists(version_file.c_str(), true)) { result = this->CheckVersionFile(version_file, version); haveResult = true; } // If no version was requested a versionless package is acceptable. - if ((haveResult == false) && (this->Version.empty())) { + if (!haveResult && this->Version.empty()) { result = true; } |