summaryrefslogtreecommitdiffstats
path: root/Source/cmDepends.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmDepends.cxx')
-rw-r--r--Source/cmDepends.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 19558fa..9296d4c 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -260,12 +260,27 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
//----------------------------------------------------------------------------
void cmDepends::SetIncludePathFromLanguage(const char* lang)
{
+ // Look for the new per "TARGET_" variant first:
+ const char * includePath = 0;
std::string includePathVar = "CMAKE_";
includePathVar += lang;
- includePathVar += "_INCLUDE_PATH";
+ includePathVar += "_TARGET_INCLUDE_PATH";
cmMakefile* mf = this->LocalGenerator->GetMakefile();
- if(const char* includePath = mf->GetDefinition(includePathVar.c_str()))
+ includePath = mf->GetDefinition(includePathVar.c_str());
+ if(includePath)
{
cmSystemTools::ExpandListArgument(includePath, this->IncludePath);
}
+ else
+ {
+ // Fallback to the old directory level variable if no per-target var:
+ includePathVar = "CMAKE_";
+ includePathVar += lang;
+ includePathVar += "_INCLUDE_PATH";
+ includePath = mf->GetDefinition(includePathVar.c_str());
+ if(includePath)
+ {
+ cmSystemTools::ExpandListArgument(includePath, this->IncludePath);
+ }
+ }
}