summaryrefslogtreecommitdiffstats
path: root/Source/cmFindCommon.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-08-01 19:00:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-09-02 11:27:32 (GMT)
commit11425041f04fd0945480b8f9e9933d1549b93981 (patch)
tree9cafffd6774513f686440b31795cbb3b5e38b65c /Source/cmFindCommon.cxx
parent99b21e58e020fedc6d09a619c1a8dc2e9ea7e2c5 (diff)
downloadCMake-11425041f04fd0945480b8f9e9933d1549b93981.zip
CMake-11425041f04fd0945480b8f9e9933d1549b93981.tar.gz
CMake-11425041f04fd0945480b8f9e9933d1549b93981.tar.bz2
cmMakefile::GetDefinition: return cmProp
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 3401eff..dee91d7 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.