summaryrefslogtreecommitdiff
path: root/Source/cmGeneratorExpression.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-09-22 14:25:21 +0200
committerCraig Scott <craig.scott@crascit.com>2018-09-25 23:46:56 +1000
commit5ca130e22394978814a9e59418529a7a3e1a61bd (patch)
tree86e885acf97be74ae4a7b3cfb572e67a338aa67a /Source/cmGeneratorExpression.h
parent1fea56c3bd99be6c7a6bfaa1454ba67e7a04da72 (diff)
downloadcmake-5ca130e22394978814a9e59418529a7a3e1a61bd.tar.gz
Refactoring: introduce function to check if a string is a generator expression
Diffstat (limited to 'Source/cmGeneratorExpression.h')
-rw-r--r--Source/cmGeneratorExpression.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 8176d5c073..9c05f60c82 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -63,6 +63,15 @@ public:
static std::string StripEmptyListElements(const std::string& input);
+ static inline bool StartsWithGeneratorExpression(const std::string& input)
+ {
+ return input.length() >= 2 && input[0] == '$' && input[1] == '<';
+ }
+ static inline bool StartsWithGeneratorExpression(const char* input)
+ {
+ return input != nullptr && input[0] == '$' && input[1] == '<';
+ }
+
private:
cmListFileBacktrace Backtrace;
};