summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpression.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-09-22 12:25:21 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-09-25 13:46:56 (GMT)
commit5ca130e22394978814a9e59418529a7a3e1a61bd (patch)
tree86e885acf97be74ae4a7b3cfb572e67a338aa67a /Source/cmGeneratorExpression.h
parent1fea56c3bd99be6c7a6bfaa1454ba67e7a04da72 (diff)
downloadCMake-5ca130e22394978814a9e59418529a7a3e1a61bd.zip
CMake-5ca130e22394978814a9e59418529a7a3e1a61bd.tar.gz
CMake-5ca130e22394978814a9e59418529a7a3e1a61bd.tar.bz2
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 8176d5c..9c05f60 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;
};