summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index f606002..e996327 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1114,12 +1114,10 @@ bool cmFindPackageCommand::ReadListFile(const std::string& f,
void cmFindPackageCommand::AppendToFoundProperty(bool found)
{
std::vector<std::string> foundContents;
- const char* foundProp =
+ cmProp foundProp =
this->Makefile->GetState()->GetGlobalProperty("PACKAGES_FOUND");
- if (foundProp && *foundProp) {
- std::string tmp = foundProp;
-
- cmExpandList(tmp, foundContents, false);
+ if (foundProp && !foundProp->empty()) {
+ cmExpandList(*foundProp, foundContents, false);
auto nameIt =
std::find(foundContents.begin(), foundContents.end(), this->Name);
if (nameIt != foundContents.end()) {
@@ -1128,12 +1126,10 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found)
}
std::vector<std::string> notFoundContents;
- const char* notFoundProp =
+ cmProp notFoundProp =
this->Makefile->GetState()->GetGlobalProperty("PACKAGES_NOT_FOUND");
- if (notFoundProp && *notFoundProp) {
- std::string tmp = notFoundProp;
-
- cmExpandList(tmp, notFoundContents, false);
+ if (notFoundProp && !notFoundProp->empty()) {
+ cmExpandList(*notFoundProp, notFoundContents, false);
auto nameIt =
std::find(notFoundContents.begin(), notFoundContents.end(), this->Name);
if (nameIt != notFoundContents.end()) {