cmExtraCodeBlocksGenerator: Do not shuffle include directories

Report include directories in a sensible order. Do not shuffle them
when trying to make them unique.
This commit is contained in:
Tobias Hunger 2016-06-14 17:16:57 +02:00 committed by Brad King
parent 9d81f1b3aa
commit 76b462eacb
1 changed files with 11 additions and 7 deletions

View File

@ -578,19 +578,20 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
} }
// the include directories for this target // the include directories for this target
std::set<std::string> uniqIncludeDirs; std::vector<std::string> allIncludeDirs;
std::vector<std::string> includes; std::vector<std::string> includes;
lg->GetIncludeDirectories(includes, target, "C", buildType); lg->GetIncludeDirectories(includes, target, "C", buildType);
uniqIncludeDirs.insert(includes.begin(), includes.end()); allIncludeDirs.insert(allIncludeDirs.end(), includes.begin(),
includes.end());
std::string systemIncludeDirs = makefile->GetSafeDefinition( std::string systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
if (!systemIncludeDirs.empty()) { if (!systemIncludeDirs.empty()) {
std::vector<std::string> dirs; std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs); cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
uniqIncludeDirs.insert(dirs.begin(), dirs.end()); allIncludeDirs.insert(allIncludeDirs.end(), dirs.begin(), dirs.end());
} }
systemIncludeDirs = makefile->GetSafeDefinition( systemIncludeDirs = makefile->GetSafeDefinition(
@ -598,13 +599,16 @@ void cmExtraCodeBlocksGenerator::AppendTarget(
if (!systemIncludeDirs.empty()) { if (!systemIncludeDirs.empty()) {
std::vector<std::string> dirs; std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs); cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs);
uniqIncludeDirs.insert(dirs.begin(), dirs.end()); allIncludeDirs.insert(allIncludeDirs.end(), dirs.begin(), dirs.end());
} }
for (std::set<std::string>::const_iterator dirIt = uniqIncludeDirs.begin(); std::vector<std::string>::const_iterator end =
dirIt != uniqIncludeDirs.end(); ++dirIt) { cmRemoveDuplicates(allIncludeDirs);
for (std::vector<std::string>::const_iterator i = allIncludeDirs.begin();
i != end; ++i) {
xml.StartElement("Add"); xml.StartElement("Add");
xml.Attribute("directory", *dirIt); xml.Attribute("directory", *i);
xml.EndElement(); xml.EndElement();
} }