diff options
author | Brad King <brad.king@kitware.com> | 2019-08-21 15:51:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-21 15:52:06 (GMT) |
commit | bfe0ea2d98944e3668439b6fb2b05e82a5dca60e (patch) | |
tree | a00b27258b23a20c13a81d9525843af2d95faf0d /Source/cmMakefile.cxx | |
parent | 2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197 (diff) | |
parent | 2dfc52675c3ea732bd389852675e680e296415cb (diff) | |
download | CMake-bfe0ea2d98944e3668439b6fb2b05e82a5dca60e.zip CMake-bfe0ea2d98944e3668439b6fb2b05e82a5dca60e.tar.gz CMake-bfe0ea2d98944e3668439b6fb2b05e82a5dca60e.tar.bz2 |
Merge topic 'cm-contains'
2dfc52675c cmAlgorithms: Add cmContains
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Merge-request: !3700
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 3c1bc38..0af32eb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1589,7 +1589,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; } @@ -4018,7 +4018,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); @@ -4385,8 +4385,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\"" @@ -4655,31 +4654,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); } } @@ -4779,19 +4778,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); } } |