summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-25 13:34:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-05-25 13:34:24 (GMT)
commit916d52533ea354d8945c0cba44f65ee34d0e7cd5 (patch)
tree542f15a19985aea192718b20c44bf04782a4140a /Source/cmGlobalGenerator.cxx
parent8cd007fee664e4c7d1e3a1e50dba5b3fe973e3cf (diff)
parentc13408279f035c8261b530e26040cf4b8f01fdab (diff)
downloadCMake-916d52533ea354d8945c0cba44f65ee34d0e7cd5.zip
CMake-916d52533ea354d8945c0cba44f65ee34d0e7cd5.tar.gz
CMake-916d52533ea354d8945c0cba44f65ee34d0e7cd5.tar.bz2
Merge topic 'standard-include-directories'
c1340827 Add a variable to specify language-wide system include directories 44199097 cmMakefile: Optimize AddSystemIncludeDirectories for empty set a896043b GHS: Compute include directories consistently with other generators
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ec8e77c..249a3b6 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1385,6 +1385,9 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
void cmGlobalGenerator::FinalizeTargetCompileInfo()
{
+ std::vector<std::string> const langs =
+ this->CMakeInstance->GetState()->GetEnabledLanguages();
+
// Construct per-target generator information.
for (unsigned int i = 0; i < this->Makefiles.size(); ++i) {
cmMakefile* mf = this->Makefiles[i];
@@ -1429,6 +1432,23 @@ void cmGlobalGenerator::FinalizeTargetCompileInfo()
}
}
}
+
+ // The standard include directories for each language
+ // should be treated as system include directories.
+ std::set<std::string> standardIncludesSet;
+ for (std::vector<std::string>::const_iterator li = langs.begin();
+ li != langs.end(); ++li) {
+ std::string const standardIncludesVar =
+ "CMAKE_" + *li + "_STANDARD_INCLUDE_DIRECTORIES";
+ std::string const standardIncludesStr =
+ mf->GetSafeDefinition(standardIncludesVar);
+ std::vector<std::string> standardIncludesVec;
+ cmSystemTools::ExpandListArgument(standardIncludesStr,
+ standardIncludesVec);
+ standardIncludesSet.insert(standardIncludesVec.begin(),
+ standardIncludesVec.end());
+ }
+ mf->AddSystemIncludeDirectories(standardIncludesSet);
}
}