summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-09-18 11:57:07 (GMT)
committerBrad King <brad.king@kitware.com>2012-09-28 12:50:10 (GMT)
commit08cb4fa4c0378468fc2757666701617f6fe8270e (patch)
treeac312dd92d2e60419b9d02836b03ac2ffcfd73c4 /Source
parent0ef091d98677253c340d4045413057c50566a528 (diff)
downloadCMake-08cb4fa4c0378468fc2757666701617f6fe8270e.zip
CMake-08cb4fa4c0378468fc2757666701617f6fe8270e.tar.gz
CMake-08cb4fa4c0378468fc2757666701617f6fe8270e.tar.bz2
Process generator expressions in the INCLUDE_DIRECTORIES property.
This use of generator expressions, like all others to come which operate on target properties, must initalize the dag checker.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx22
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx7
2 files changed, 26 insertions, 3 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3f58433..9093613 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -17,6 +17,8 @@
#include "cmComputeLinkInformation.h"
#include "cmGlobalGenerator.h"
#include "cmSourceFile.h"
+#include "cmGeneratorExpression.h"
+#include "cmGeneratorExpressionDAGChecker.h"
#include <assert.h>
@@ -289,11 +291,27 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories()
{
std::vector<std::string> includes;
const char *prop = this->Target->GetProperty("INCLUDE_DIRECTORIES");
- if(prop)
+ if(!prop)
{
- cmSystemTools::ExpandListArgument(prop, includes);
+ return includes;
}
+ const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ cmListFileBacktrace lfbt;
+ cmGeneratorExpression ge(lfbt);
+
+ cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ this->GetName(),
+ "INCLUDE_DIRECTORIES", 0, 0);
+
+ cmSystemTools::ExpandListArgument(ge.Parse(prop)
+ .Evaluate(this->Makefile,
+ config,
+ false,
+ this,
+ &dagChecker),
+ includes);
+
std::set<std::string> uniqueIncludes;
std::vector<std::string> orderedAndUniqueIncludes;
for(std::vector<std::string>::const_iterator
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 11c5f4e..ba81849 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -55,6 +55,11 @@ bool cmIncludeDirectoryCommand
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
@@ -105,7 +110,7 @@ void cmIncludeDirectoryCommand::AddDirectory(const char *i,
cmSystemTools::ConvertToUnixSlashes(ret);
if(!cmSystemTools::FileIsFullPath(ret.c_str()))
{
- if(ret[0] != '$' && ret[1] != '<')
+ if(!StartsWithGeneratorExpression(ret))
{
std::string tmp = this->Makefile->GetStartDirectory();
tmp += "/";