diff options
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r-- | Source/cmFindCommon.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 954558f..c6b9049 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 |