summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraCodeBlocksGenerator.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2011-08-01 23:46:39 (GMT)
committerAlex Neundorf <neundorf@kde.org>2011-08-01 23:46:39 (GMT)
commite2e8c0a41225f5449a8139a1ce0219940f902665 (patch)
treea62a704f398e37765df0a50361b58b5f41be9471 /Source/cmExtraCodeBlocksGenerator.cxx
parent92c0dc50fc73dd9866f48c521b0aff7473eb3a59 (diff)
downloadCMake-e2e8c0a41225f5449a8139a1ce0219940f902665.zip
CMake-e2e8c0a41225f5449a8139a1ce0219940f902665.tar.gz
CMake-e2e8c0a41225f5449a8139a1ce0219940f902665.tar.bz2
Also put builtin include dirs into CodeBlocks project file
Refactor code from CMakeFindEclipseCDT4.cmake so it can be used alkso for CodeBlocks, and move it into new file CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake. Alex
Diffstat (limited to 'Source/cmExtraCodeBlocksGenerator.cxx')
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx38
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 7db91c7..c7fe8f9 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -590,14 +590,52 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
}
// the include directories for this target
+ std::set<std::string> uniqIncludeDirs;
const std::vector<std::string>& incDirs =
target->GetMakefile()->GetIncludeDirectories();
for(std::vector<std::string>::const_iterator dirIt=incDirs.begin();
dirIt != incDirs.end();
++dirIt)
{
+ uniqIncludeDirs.insert(*dirIt);
+ }
+
+
+ std::string systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
+ ++dirIt)
+ {
+ uniqIncludeDirs.insert(*dirIt);
+ }
+ }
+
+ systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
+ ++dirIt)
+ {
+ uniqIncludeDirs.insert(*dirIt);
+ }
+ }
+
+ for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
+ dirIt != uniqIncludeDirs.end();
+ ++dirIt)
+ {
fout <<" <Add directory=\"" << dirIt->c_str() << "\" />\n";
}
+
fout<<" </Compiler>\n";
}
else // e.g. all and the GLOBAL and UTILITY targets