summaryrefslogtreecommitdiffstats
path: root/Source/cmIncludeDirectoryCommand.cxx
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/cmIncludeDirectoryCommand.cxx
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/cmIncludeDirectoryCommand.cxx')
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index eaaf64d..caec67d 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -5,6 +5,7 @@
#include <algorithm>
#include <set>
+#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
@@ -69,11 +70,6 @@ bool cmIncludeDirectoryCommand::InitialPass(
return true;
}
-static bool StartsWithGeneratorExpression(const std::string& input)
-{
- return input[0] == '$' && input[1] == '<';
-}
-
// do a lot of cleanup on the arguments because this is one place where folks
// sometimes take the output of a program and pass it directly into this
// command not thinking that a single argument could be filled with spaces
@@ -124,7 +120,7 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string& inc)
cmSystemTools::ConvertToUnixSlashes(inc);
if (!cmSystemTools::FileIsFullPath(inc)) {
- if (!StartsWithGeneratorExpression(inc)) {
+ if (!cmGeneratorExpression::StartsWithGeneratorExpression(inc)) {
std::string tmp = this->Makefile->GetCurrentSourceDirectory();
tmp += "/";
tmp += inc;