summaryrefslogtreecommitdiffstats
path: root/Source/cmStateDirectory.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2018-09-19 12:12:35 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-09-25 13:59:59 (GMT)
commitf9717725f9d4c7f4a1da52b0184365cd757bc076 (patch)
treeee805f2e0fbd53cc0b2b72728e08496f0df57372 /Source/cmStateDirectory.cxx
parentb5915744ebccd086891f1fab0ae91af54deb3a86 (diff)
downloadCMake-f9717725f9d4c7f4a1da52b0184365cd757bc076.zip
CMake-f9717725f9d4c7f4a1da52b0184365cd757bc076.tar.gz
CMake-f9717725f9d4c7f4a1da52b0184365cd757bc076.tar.bz2
link_directories(): enhance capabilities
Diffstat (limited to 'Source/cmStateDirectory.cxx')
-rw-r--r--Source/cmStateDirectory.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 5160f51..f94e714 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -417,6 +417,33 @@ void cmStateDirectory::AppendLinkDirectoriesEntry(
this->DirectoryState->LinkDirectoriesBacktraces,
this->Snapshot_.Position->LinkDirectoriesPosition, vec, lfbt);
}
+void cmStateDirectory::PrependLinkDirectoriesEntry(
+ const std::string& vec, const cmListFileBacktrace& lfbt)
+{
+ std::vector<std::string>::iterator entryEnd =
+ this->DirectoryState->LinkDirectories.begin() +
+ this->Snapshot_.Position->LinkDirectoriesPosition;
+
+ std::vector<std::string>::reverse_iterator rend =
+ this->DirectoryState->LinkDirectories.rend();
+ std::vector<std::string>::reverse_iterator rbegin =
+ cmMakeReverseIterator(entryEnd);
+ rbegin = std::find(rbegin, rend, cmPropertySentinal);
+
+ std::vector<std::string>::iterator entryIt = rbegin.base();
+ std::vector<std::string>::iterator entryBegin =
+ this->DirectoryState->LinkDirectories.begin();
+
+ std::vector<cmListFileBacktrace>::iterator btIt =
+ this->DirectoryState->LinkDirectoriesBacktraces.begin() +
+ std::distance(entryBegin, entryIt);
+
+ this->DirectoryState->LinkDirectories.insert(entryIt, vec);
+ this->DirectoryState->LinkDirectoriesBacktraces.insert(btIt, lfbt);
+
+ this->Snapshot_.Position->LinkDirectoriesPosition =
+ this->DirectoryState->LinkDirectories.size();
+}
void cmStateDirectory::SetLinkDirectories(const std::string& vec,
const cmListFileBacktrace& lfbt)