diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-08-19 12:31:52 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-08-19 18:01:39 (GMT) |
commit | 2dfc52675c3ea732bd389852675e680e296415cb (patch) | |
tree | 23ff56e62d180ef60fe92b9e9d01878f9a96c36a /Source/cmMakefile.cxx | |
parent | c41c79285b5ebb7dd914a6e714aa553bb5078641 (diff) | |
download | CMake-2dfc52675c3ea732bd389852675e680e296415cb.zip CMake-2dfc52675c3ea732bd389852675e680e296415cb.tar.gz CMake-2dfc52675c3ea732bd389852675e680e296415cb.tar.bz2 |
cmAlgorithms: Add cmContains
Also, use the new function where applicable.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 657c3bf..53816d2 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1583,7 +1583,7 @@ void cmMakefile::Configure() allowedCommands.insert("message"); isProblem = false; for (cmListFileFunction const& func : listFile.Functions) { - if (allowedCommands.find(func.Name.Lower) == allowedCommands.end()) { + if (!cmContains(allowedCommands, func.Name.Lower)) { isProblem = true; break; } @@ -4012,7 +4012,7 @@ cmTarget* cmMakefile::FindTargetToUse(const std::string& name, bool cmMakefile::IsAlias(const std::string& name) const { - if (this->AliasTargets.find(name) != this->AliasTargets.end()) { + if (cmContains(this->AliasTargets, name)) { return true; } return this->GetGlobalGenerator()->IsAlias(name); @@ -4379,8 +4379,7 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target, std::vector<std::string> availableFeatures; cmExpandList(features, availableFeatures); - if (std::find(availableFeatures.begin(), availableFeatures.end(), feature) == - availableFeatures.end()) { + if (!cmContains(availableFeatures, feature)) { std::ostringstream e; e << "The compiler feature \"" << feature << "\" is not known to " << lang << " compiler\n\"" @@ -4649,31 +4648,31 @@ void cmMakefile::CheckNeededCxxLanguage(const std::string& feature, this->GetDefinition("CMAKE_CXX98_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propCxx98, props); - needCxx98 = std::find(props.begin(), props.end(), feature) != props.end(); + needCxx98 = cmContains(props, feature); } if (const char* propCxx11 = this->GetDefinition("CMAKE_CXX11_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propCxx11, props); - needCxx11 = std::find(props.begin(), props.end(), feature) != props.end(); + needCxx11 = cmContains(props, feature); } if (const char* propCxx14 = this->GetDefinition("CMAKE_CXX14_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propCxx14, props); - needCxx14 = std::find(props.begin(), props.end(), feature) != props.end(); + needCxx14 = cmContains(props, feature); } if (const char* propCxx17 = this->GetDefinition("CMAKE_CXX17_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propCxx17, props); - needCxx17 = std::find(props.begin(), props.end(), feature) != props.end(); + needCxx17 = cmContains(props, feature); } if (const char* propCxx20 = this->GetDefinition("CMAKE_CXX20_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propCxx20, props); - needCxx20 = std::find(props.begin(), props.end(), feature) != props.end(); + needCxx20 = cmContains(props, feature); } } @@ -4773,19 +4772,19 @@ void cmMakefile::CheckNeededCLanguage(const std::string& feature, this->GetDefinition("CMAKE_C90_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propC90, props); - needC90 = std::find(props.begin(), props.end(), feature) != props.end(); + needC90 = cmContains(props, feature); } if (const char* propC99 = this->GetDefinition("CMAKE_C99_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propC99, props); - needC99 = std::find(props.begin(), props.end(), feature) != props.end(); + needC99 = cmContains(props, feature); } if (const char* propC11 = this->GetDefinition("CMAKE_C11_COMPILE_FEATURES")) { std::vector<std::string> props; cmExpandList(propC11, props); - needC11 = std::find(props.begin(), props.end(), feature) != props.end(); + needC11 = cmContains(props, feature); } } |