diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index b1bbd905d..7953dd9ea 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -633,59 +633,57 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, } } - // the include directories for this target - std::set uniqIncludeDirs; + // the include directories for this target + std::set uniqIncludeDirs; - cmGeneratorTarget *gtgt = this->GlobalGenerator - ->GetGeneratorTarget(target); - std::vector includes; - target->GetMakefile()->GetLocalGenerator()-> - GetIncludeDirectories(includes, gtgt); - for(std::vector::const_iterator dirIt=includes.begin(); - dirIt != includes.end(); + std::vector includes; + target->GetMakefile()->GetLocalGenerator()-> + GetIncludeDirectories(includes, gtgt); + for(std::vector::const_iterator dirIt=includes.begin(); + dirIt != includes.end(); + ++dirIt) + { + uniqIncludeDirs.insert(*dirIt); + } + + std::string systemIncludeDirs = makefile->GetSafeDefinition( + "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); + if (!systemIncludeDirs.empty()) + { + std::vector dirs; + cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs); + for(std::vector::const_iterator dirIt=dirs.begin(); + dirIt != dirs.end(); ++dirIt) { uniqIncludeDirs.insert(*dirIt); } + } - std::string systemIncludeDirs = makefile->GetSafeDefinition( - "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); - if (!systemIncludeDirs.empty()) - { - std::vector dirs; - cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs); - for(std::vector::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 dirs; - cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs); - for(std::vector::const_iterator dirIt=dirs.begin(); - dirIt != dirs.end(); - ++dirIt) - { - uniqIncludeDirs.insert(*dirIt); - } - } - - for(std::set::const_iterator dirIt=uniqIncludeDirs.begin(); - dirIt != uniqIncludeDirs.end(); + systemIncludeDirs = makefile->GetSafeDefinition( + "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS"); + if (!systemIncludeDirs.empty()) + { + std::vector dirs; + cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs); + for(std::vector::const_iterator dirIt=dirs.begin(); + dirIt != dirs.end(); ++dirIt) { - fout <<" c_str() << "\" />\n"; + uniqIncludeDirs.insert(*dirIt); } - - fout<<" \n"; } - else // e.g. all and the GLOBAL and UTILITY targets + + for(std::set::const_iterator dirIt=uniqIncludeDirs.begin(); + dirIt != uniqIncludeDirs.end(); + ++dirIt) + { + fout <<" c_str() << "\" />\n"; + } + + fout<<" \n"; + } + else // e.g. all and the GLOBAL and UTILITY targets { fout<<"