diff options
author | Brad King <brad.king@kitware.com> | 2016-06-17 15:06:37 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-06-17 15:06:37 (GMT) |
commit | 9ef7ccdcf990d711d99794855e219d37d1713f59 (patch) | |
tree | dadbe703c0a0829a00173315553974cbf71f5553 | |
parent | d4283ca18b75a218642b8d446ba52be08e135852 (diff) | |
parent | 76b462eacba7fd66608a0956dbf89dab4457b8ba (diff) | |
download | CMake-9ef7ccdcf990d711d99794855e219d37d1713f59.zip CMake-9ef7ccdcf990d711d99794855e219d37d1713f59.tar.gz CMake-9ef7ccdcf990d711d99794855e219d37d1713f59.tar.bz2 |
Merge topic 'CodeBlocks-include-order'
76b462ea cmExtraCodeBlocksGenerator: Do not shuffle include directories
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 8c656b9..7bd0012 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -578,19 +578,20 @@ void cmExtraCodeBlocksGenerator::AppendTarget( } // the include directories for this target - std::set<std::string> uniqIncludeDirs; + std::vector<std::string> allIncludeDirs; std::vector<std::string> includes; 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( "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); if (!systemIncludeDirs.empty()) { std::vector<std::string> dirs; cmSystemTools::ExpandListArgument(systemIncludeDirs, dirs); - uniqIncludeDirs.insert(dirs.begin(), dirs.end()); + allIncludeDirs.insert(allIncludeDirs.end(), dirs.begin(), dirs.end()); } systemIncludeDirs = makefile->GetSafeDefinition( @@ -598,13 +599,16 @@ void cmExtraCodeBlocksGenerator::AppendTarget( if (!systemIncludeDirs.empty()) { std::vector<std::string> 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(); - dirIt != uniqIncludeDirs.end(); ++dirIt) { + std::vector<std::string>::const_iterator end = + cmRemoveDuplicates(allIncludeDirs); + + for (std::vector<std::string>::const_iterator i = allIncludeDirs.begin(); + i != end; ++i) { xml.StartElement("Add"); - xml.Attribute("directory", *dirIt); + xml.Attribute("directory", *i); xml.EndElement(); } |