summaryrefslogtreecommitdiffstats
path: root/Source/cmOrderDirectories.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-01 16:55:37 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-01 17:39:18 (GMT)
commitb1a37362b87c24d409f4037cd59c33056468c11b (patch)
tree2837db9ae6c91e2c07af41eb2ddc0bdc32a33a28 /Source/cmOrderDirectories.cxx
parent2b1cdd85b8943059e5f2b27735df261743749342 (diff)
downloadCMake-b1a37362b87c24d409f4037cd59c33056468c11b.zip
CMake-b1a37362b87c24d409f4037cd59c33056468c11b.tar.gz
CMake-b1a37362b87c24d409f4037cd59c33056468c11b.tar.bz2
cmOrderDirectories: Factor out implicit directory check
Diffstat (limited to 'Source/cmOrderDirectories.cxx')
-rw-r--r--Source/cmOrderDirectories.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 7744a5a..d93debe 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -287,8 +287,7 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath,
}
}
- if (this->ImplicitDirectories.find(dir) !=
- this->ImplicitDirectories.end()) {
+ if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
new cmOrderDirectoriesConstraintSOName(this, fullPath, soname));
return;
@@ -316,8 +315,7 @@ void cmOrderDirectories::AddLinkLibrary(std::string const& fullPath)
// Implicit link directories need special handling.
if (!this->ImplicitDirectories.empty()) {
std::string dir = cmSystemTools::GetFilenamePath(fullPath);
- if (this->ImplicitDirectories.find(dir) !=
- this->ImplicitDirectories.end()) {
+ if (this->IsImplicitDirectory(dir)) {
this->ImplicitDirEntries.push_back(
new cmOrderDirectoriesConstraintLibrary(this, fullPath));
return;
@@ -350,6 +348,12 @@ void cmOrderDirectories::SetImplicitDirectories(
this->ImplicitDirectories = implicitDirs;
}
+bool cmOrderDirectories::IsImplicitDirectory(std::string const& dir)
+{
+ return this->ImplicitDirectories.find(dir) !=
+ this->ImplicitDirectories.end();
+}
+
void cmOrderDirectories::SetLinkExtensionInfo(
std::vector<std::string> const& linkExtensions,
std::string const& removeExtRegex)
@@ -394,8 +398,7 @@ void cmOrderDirectories::AddOriginalDirectories(
for (std::vector<std::string>::const_iterator di = dirs.begin();
di != dirs.end(); ++di) {
// We never explicitly specify implicit link directories.
- if (this->ImplicitDirectories.find(*di) !=
- this->ImplicitDirectories.end()) {
+ if (this->IsImplicitDirectory(*di)) {
continue;
}