diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-08-02 01:46:39 +0200 |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-08-02 01:46:39 +0200 |
commit | e2e8c0a41225f5449a8139a1ce0219940f902665 (patch) | |
tree | a62a704f398e37765df0a50361b58b5f41be9471 /Source/cmExtraCodeBlocksGenerator.cxx | |
parent | 92c0dc50fc73dd9866f48c521b0aff7473eb3a59 (diff) | |
download | cmake-e2e8c0a41225f5449a8139a1ce0219940f902665.tar.gz |
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.cxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 7db91c78ee..c7fe8f90a1 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 |