summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmMakefile.cxx9
-rw-r--r--Source/cmTarget.cxx5
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index cdb699ebb0..62904121d1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1648,6 +1648,15 @@ void cmMakefile::AddIncludeDirectory(const char* inc, bool before)
cmProperty *prop =
this->GetProperties().GetOrCreateProperty("INCLUDE_DIRECTORIES");
AddStringToProperty(prop, "INCLUDE_DIRECTORIES", inc, before);
+
+ // Property on each target:
+ for (cmTargets::iterator l = this->Targets.begin();
+ l != this->Targets.end(); ++l)
+ {
+ cmTarget &t = l->second;
+ prop = t.GetProperties().GetOrCreateProperty("INCLUDE_DIRECTORIES");
+ AddStringToProperty(prop, "INCLUDE_DIRECTORIES", inc, before);
+ }
}
//----------------------------------------------------------------------------
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 5c902e1536..cd816a6990 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1279,6 +1279,11 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// Save the backtrace of target construction.
this->Makefile->GetBacktrace(this->Internal->Backtrace);
+ // Initialize the INCLUDE_DIRECTORIES property based on the current value
+ // of the same directory property:
+ this->SetProperty("INCLUDE_DIRECTORIES",
+ this->Makefile->GetProperty("INCLUDE_DIRECTORIES"));
+
// Record current policies for later use.
this->PolicyStatusCMP0003 =
this->Makefile->GetPolicyStatus(cmPolicies::CMP0003);