summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDocumentVariables.cxx9
-rw-r--r--Source/cmLocalGenerator.cxx22
2 files changed, 31 insertions, 0 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 02f1d6a..27afd92 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1097,6 +1097,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"This is a list of file extensions that may be "
"part of a project for a given language but are not compiled. ",false,
"Variables for Languages");
+
+ cm->DefineProperty
+ ("CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES", cmProperty::VARIABLE,
+ "Directories implicitly searched by the compiler for header files.",
+ "CMake does not explicitly specify these directories on compiler "
+ "command lines for language <LANG>. "
+ "This prevents system include directories from being treated as user "
+ "include directories on some compilers.", false,
+ "Variables for Languages");
cm->DefineProperty
("CMAKE_<LANG>_LINKER_PREFERENCE", cmProperty::VARIABLE,
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b2788ae..70e5760 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1186,6 +1186,23 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
{
return this->LanguageToIncludeFlags[lang].c_str();
}
+
+ // Load implicit include directories for this language.
+ std::set<cmStdString> impDirs;
+ std::string impDirVar = "CMAKE_";
+ impDirVar += lang;
+ impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
+ if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
+ {
+ std::vector<std::string> impDirVec;
+ cmSystemTools::ExpandListArgument(value, impDirVec);
+ for(std::vector<std::string>::const_iterator i = impDirVec.begin();
+ i != impDirVec.end(); ++i)
+ {
+ impDirs.insert(*i);
+ }
+ }
+
cmOStringStream includeFlags;
std::vector<std::string> includes;
this->GetIncludeDirectories(includes);
@@ -1233,6 +1250,11 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
#endif
for(i = includes.begin(); i != includes.end(); ++i)
{
+ // Skip implicit include directories.
+ if(impDirs.find(*i) != impDirs.end())
+ {
+ continue;
+ }
#ifdef __APPLE__
if(cmSystemTools::IsPathToFramework(i->c_str()))
{