summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-05 12:55:59 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-05 12:55:59 (GMT)
commitc11cf31c9b70b21ba171bb2682ea5304e8d00de8 (patch)
tree3d6aaf2ef210a0a725346db4b708240d06edc06f /Source/cmLocalGenerator.cxx
parente36eb719135b8c5ce6ff317614df5e0d961718f2 (diff)
downloadCMake-c11cf31c9b70b21ba171bb2682ea5304e8d00de8.zip
CMake-c11cf31c9b70b21ba171bb2682ea5304e8d00de8.tar.gz
CMake-c11cf31c9b70b21ba171bb2682ea5304e8d00de8.tar.bz2
ENH: Adding SYSTEM option to INCLUDE_DIRECTORIES command. This addresses bug #3462.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3436d6f..890e905 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1044,6 +1044,17 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
// given once i.e. -classpath a:b:c
repeatFlag = false;
}
+
+ // Support special system include flag if it is available and the
+ // normal flag is repeated for each directory.
+ std::string sysFlagVar = "CMAKE_INCLUDE_SYSTEM_FLAG_";
+ sysFlagVar += lang;
+ const char* sysIncludeFlag = 0;
+ if(repeatFlag)
+ {
+ sysIncludeFlag = this->Makefile->GetDefinition(sysFlagVar.c_str());
+ }
+
bool flagUsed = false;
std::set<cmStdString> emitted;
for(i = includes.begin(); i != includes.end(); ++i)
@@ -1066,7 +1077,15 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
std::string include = *i;
if(!flagUsed || repeatFlag)
{
- includeFlags << includeFlag;
+ if(sysIncludeFlag &&
+ this->Makefile->IsSystemIncludeDirectory(i->c_str()))
+ {
+ includeFlags << sysIncludeFlag;
+ }
+ else
+ {
+ includeFlags << includeFlag;
+ }
flagUsed = true;
}
std::string includePath = this->ConvertToOutputForExisting(i->c_str());