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/cmGeneratorExpressionNode.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/cmGeneratorExpressionNode.cxx')
-rw-r--r-- | Source/cmGeneratorExpressionNode.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index 9f761ed..2b21b91 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -306,10 +306,7 @@ static const struct InListNode : public cmGeneratorExpressionNode break; } - return std::find(values.cbegin(), values.cend(), parameters.front()) == - values.cend() - ? "0" - : "1"; + return cmContains(values, parameters.front()) ? "1" : "0"; } } inListNode; @@ -915,9 +912,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode if (const char* mapValue = context->CurrentTarget->GetProperty(mapProp)) { cmExpandList(cmSystemTools::UpperCase(mapValue), mappedConfigs); - return std::find(mappedConfigs.begin(), mappedConfigs.end(), - cmSystemTools::UpperCase(parameters.front())) != - mappedConfigs.end() + return cmContains(mappedConfigs, + cmSystemTools::UpperCase(parameters.front())) ? "1" : "0"; } @@ -1510,8 +1506,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode const char* standardDefault = context->LG->GetMakefile()->GetDefinition( "CMAKE_" + lit.first + "_STANDARD_DEFAULT"); for (std::string const& it : lit.second) { - if (std::find(langAvailable.begin(), langAvailable.end(), it) == - langAvailable.end()) { + if (!cmContains(langAvailable, it)) { return "0"; } if (standardDefault && !*standardDefault) { |