diff options
author | Brad King <brad.king@kitware.com> | 2006-10-05 12:55:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-10-05 12:55:59 (GMT) |
commit | c11cf31c9b70b21ba171bb2682ea5304e8d00de8 (patch) | |
tree | 3d6aaf2ef210a0a725346db4b708240d06edc06f /Source/cmLocalGenerator.cxx | |
parent | e36eb719135b8c5ce6ff317614df5e0d961718f2 (diff) | |
download | CMake-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.cxx | 21 |
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()); |