summaryrefslogtreecommitdiff
path: root/Source/cmFindCommon.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-06-12 16:04:22 -0400
committerBrad King <brad.king@kitware.com>2019-06-21 11:06:39 -0400
commit02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f (patch)
tree91222ea7bb0386155dd7a4f673bf1164918ed5ea /Source/cmFindCommon.cxx
parentf0a89149bc569020e281c5908733bf4b7eeddf15 (diff)
downloadcmake-02f527c66a6f9f0fa0d3fd4a816ea2bd9e3ba35f.tar.gz
Find: Provide global controls for the `NO_[]_PATH` call options
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r--Source/cmFindCommon.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 954558f4dc..c6b9049f41 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -3,6 +3,7 @@
#include "cmFindCommon.h"
#include <algorithm>
+#include <array>
#include <string.h>
#include <utility>
@@ -144,6 +145,26 @@ void cmFindCommon::SelectDefaultMacMode()
}
}
+void cmFindCommon::SelectDefaultSearchModes()
+{
+ const std::array<std::pair<bool&, std::string>, 5> search_paths = {
+ { { this->NoPackageRootPath, "CMAKE_FIND_USE_PACAKGE_ROOT_PATH" },
+ { this->NoCMakePath, "CMAKE_FIND_USE_CMAKE_PATH" },
+ { this->NoCMakeEnvironmentPath,
+ "CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH" },
+ { this->NoSystemEnvironmentPath,
+ "CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH" },
+ { this->NoCMakeSystemPath, "CMAKE_FIND_USE_CMAKE_SYSTEM_PATH" } }
+ };
+
+ for (auto& path : search_paths) {
+ const char* def = this->Makefile->GetDefinition(path.second);
+ if (def) {
+ path.first = !cmSystemTools::IsOn(def);
+ }
+ }
+}
+
void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
{
#if 0