diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-01-25 08:26:35 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-02-07 09:03:30 (GMT) |
commit | 1714c27a74c1616e5998a1a51fe42848a1f1c389 (patch) | |
tree | 8bf6e0dd9228f7acc50697ea75c1c8fd941b9c23 /Source/cmMakefile.cxx | |
parent | 2ce7231f56807b62917e6da1336f033d5386694a (diff) | |
download | CMake-1714c27a74c1616e5998a1a51fe42848a1f1c389.zip CMake-1714c27a74c1616e5998a1a51fe42848a1f1c389.tar.gz CMake-1714c27a74c1616e5998a1a51fe42848a1f1c389.tar.bz2 |
Process generator expressions for 'system' include directories.
Since commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property., 2012-09-18), it is possible to use
generator expressions with the include_directories command.
As that command can also have a SYSTEM argument, ensure that the
result of using that argument with generator expressions gives a
sane result.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e7a1500..58e3f8e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -23,6 +23,7 @@ #include "cmListFileCache.h" #include "cmCommandArgumentParserHelper.h" #include "cmDocumentCompileDefinitions.h" +#include "cmGeneratorExpression.h" #include "cmTest.h" #ifdef CMAKE_BUILD_WITH_CMAKE # include "cmVariableWatch.h" @@ -1665,10 +1666,24 @@ cmMakefile::AddSystemIncludeDirectories(const std::set<cmStdString> &incs) } //---------------------------------------------------------------------------- -bool cmMakefile::IsSystemIncludeDirectory(const char* dir) +bool cmMakefile::IsSystemIncludeDirectory(const char* dir, const char *config) { - return (this->SystemIncludeDirectories.find(dir) != - this->SystemIncludeDirectories.end()); + for (std::set<cmStdString>::const_iterator + it = this->SystemIncludeDirectories.begin(); + it != this->SystemIncludeDirectories.end(); ++it) + { + cmListFileBacktrace lfbt; + cmGeneratorExpression ge(lfbt); + + std::vector<std::string> incs; + cmSystemTools::ExpandListArgument(ge.Parse(*it) + ->Evaluate(this, config, false), incs); + if (std::find(incs.begin(), incs.end(), dir) != incs.end()) + { + return true; + } + } + return false; } void cmMakefile::AddDefinition(const char* name, const char* value) |