diff options
author | Brad King <brad.king@kitware.com> | 2021-08-24 14:04:33 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-08-24 14:05:00 (GMT) |
commit | 71bf838cf35fabc27ff009f2901eeffc786fa753 (patch) | |
tree | ab4cfd3f1eda197230aaf037fe9906c29c40b8dd /Source/cmGetDirectoryPropertyCommand.cxx | |
parent | cf90aa5595eac39029f7516e0bc5790fe398ea3d (diff) | |
parent | 5a2a275bb41e04891c2541a8e185b6daed259b0b (diff) | |
download | CMake-71bf838cf35fabc27ff009f2901eeffc786fa753.zip CMake-71bf838cf35fabc27ff009f2901eeffc786fa753.tar.gz CMake-71bf838cf35fabc27ff009f2901eeffc786fa753.tar.bz2 |
Merge topic 'refactor-reduce-cmToCStr-usage'
5a2a275bb4 Refactor: reduce cmToCStr usage
2984df9100 Refactor: cmHasPrefix and cmHasSuffix accept now cmProp
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6455
Diffstat (limited to 'Source/cmGetDirectoryPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetDirectoryPropertyCommand.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 7fbd479..d98f95c 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -13,6 +13,8 @@ namespace { void StoreResult(cmMakefile& makefile, std::string const& variable, const char* prop); +void StoreResult(cmMakefile& makefile, std::string const& variable, + cmProp prop); } // cmGetDirectoryPropertyCommand @@ -76,7 +78,6 @@ bool cmGetDirectoryPropertyCommand(std::vector<std::string> const& args, return false; } - const char* prop = nullptr; if (*i == "DEFINITIONS") { switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0059)) { case cmPolicies::WARN: @@ -94,8 +95,7 @@ bool cmGetDirectoryPropertyCommand(std::vector<std::string> const& args, break; } } - prop = cmToCStr(dir->GetProperty(*i)); - StoreResult(status.GetMakefile(), variable, prop); + StoreResult(status.GetMakefile(), variable, dir->GetProperty(*i)); return true; } @@ -105,4 +105,9 @@ void StoreResult(cmMakefile& makefile, std::string const& variable, { makefile.AddDefinition(variable, prop ? prop : ""); } +void StoreResult(cmMakefile& makefile, std::string const& variable, + cmProp prop) +{ + makefile.AddDefinition(variable, prop); +} } |