summaryrefslogtreecommitdiff
path: root/Source/cmFindCommon.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r--Source/cmFindCommon.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 3401effa7c..dee91d75d4 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -11,6 +11,7 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -182,9 +183,9 @@ void cmFindCommon::SelectDefaultSearchModes()
};
for (auto& path : search_paths) {
- const char* def = this->Makefile->GetDefinition(path.second);
+ cmProp def = this->Makefile->GetDefinition(path.second);
if (def) {
- path.first = !cmIsOn(def);
+ path.first = !cmIsOn(*def);
}
}
}
@@ -202,12 +203,11 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
return;
}
- const char* sysroot = this->Makefile->GetDefinition("CMAKE_SYSROOT");
- const char* sysrootCompile =
+ cmProp sysroot = this->Makefile->GetDefinition("CMAKE_SYSROOT");
+ cmProp sysrootCompile =
this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE");
- const char* sysrootLink =
- this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK");
- const char* rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH");
+ cmProp sysrootLink = this->Makefile->GetDefinition("CMAKE_SYSROOT_LINK");
+ cmProp rootPath = this->Makefile->GetDefinition("CMAKE_FIND_ROOT_PATH");
const bool noSysroot = !cmNonempty(sysroot);
const bool noCompileSysroot = !cmNonempty(sysrootCompile);
const bool noLinkSysroot = !cmNonempty(sysrootLink);
@@ -219,23 +219,22 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
// Construct the list of path roots with no trailing slashes.
std::vector<std::string> roots;
if (rootPath) {
- cmExpandList(rootPath, roots);
+ cmExpandList(*rootPath, roots);
}
if (sysrootCompile) {
- roots.emplace_back(sysrootCompile);
+ roots.emplace_back(*sysrootCompile);
}
if (sysrootLink) {
- roots.emplace_back(sysrootLink);
+ roots.emplace_back(*sysrootLink);
}
if (sysroot) {
- roots.emplace_back(sysroot);
+ roots.emplace_back(*sysroot);
}
for (std::string& r : roots) {
cmSystemTools::ConvertToUnixSlashes(r);
}
- const char* stagePrefix =
- this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
+ cmProp stagePrefix = this->Makefile->GetDefinition("CMAKE_STAGING_PREFIX");
// Copy the original set of unrooted paths.
std::vector<std::string> unrootedPaths = paths;
@@ -248,7 +247,7 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
// a user home directory or is empty.
std::string rootedDir;
if (cmSystemTools::IsSubDirectory(up, r) ||
- (stagePrefix && cmSystemTools::IsSubDirectory(up, stagePrefix))) {
+ (stagePrefix && cmSystemTools::IsSubDirectory(up, *stagePrefix))) {
rootedDir = up;
} else if (!up.empty() && up[0] != '~') {
// Start with the new root.