diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 24b7138df..f95c68a39 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -393,26 +393,7 @@ void cmOrderDirectories::CollectOriginalDirectories() // Add user directories specified for inclusion. These should be // indexed first so their original order is preserved as much as // possible subject to the constraints. - for(std::vector::const_iterator - di = this->UserDirectories.begin(); - di != this->UserDirectories.end(); ++di) - { - // We never explicitly specify implicit link directories. - if(this->ImplicitDirectories.find(*di) != - this->ImplicitDirectories.end()) - { - continue; - } - - // Skip the empty string. - if(di->empty()) - { - continue; - } - - // Add this directory. - this->AddOriginalDirectory(*di); - } + this->AddOriginalDirectories(this->UserDirectories); // Add directories containing constraints. for(unsigned int i=0; i < this->ConstraintEntries.size(); ++i) @@ -438,6 +419,32 @@ int cmOrderDirectories::AddOriginalDirectory(std::string const& dir) return i->second; } +//---------------------------------------------------------------------------- +void +cmOrderDirectories +::AddOriginalDirectories(std::vector const& dirs) +{ + for(std::vector::const_iterator di = dirs.begin(); + di != dirs.end(); ++di) + { + // We never explicitly specify implicit link directories. + if(this->ImplicitDirectories.find(*di) != + this->ImplicitDirectories.end()) + { + continue; + } + + // Skip the empty string. + if(di->empty()) + { + continue; + } + + // Add this directory. + this->AddOriginalDirectory(*di); + } +} + //---------------------------------------------------------------------------- struct cmOrderDirectoriesCompare { diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 54077334b..6d05f9327 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -66,6 +66,7 @@ private: std::vector DirectoryVisited; void CollectOriginalDirectories(); int AddOriginalDirectory(std::string const& dir); + void AddOriginalDirectories(std::vector const& dirs); void FindConflicts(); void FindImplicitConflicts(); void OrderDirectories();