summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-09-03 15:30:00 (GMT)
committervvs31415 <vvs31415@users.noreply.github.com>2020-09-03 15:36:54 (GMT)
commit1380b4376408a1ec97bc23f521c067a83dc58680 (patch)
treee51d8351d2b61d08a6798fa3a71578c75fba458d /Source/cmGeneratorTarget.cxx
parentca5babfd7a1da8e32f927ad086fdd91c2b09853b (diff)
downloadCMake-1380b4376408a1ec97bc23f521c067a83dc58680.zip
CMake-1380b4376408a1ec97bc23f521c067a83dc58680.tar.gz
CMake-1380b4376408a1ec97bc23f521c067a83dc58680.tar.bz2
Refactor: Use cmToCStr()
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 05c8cc8..b75aa63 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4775,12 +4775,11 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames(
// The library's soname.
this->ComputeVersionedName(targetNames.SharedObject, prefix,
targetNames.Base, suffix, targetNames.Output,
- (soversion ? soversion->c_str() : nullptr));
+ cmToCStr(soversion));
// The library's real name on disk.
this->ComputeVersionedName(targetNames.Real, prefix, targetNames.Base,
- suffix, targetNames.Output,
- (version ? version->c_str() : nullptr));
+ suffix, targetNames.Output, cmToCStr(version));
}
// The import library name.
@@ -4816,10 +4815,7 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames(
const char* version = nullptr;
#else
// Check for executable version properties.
- const char* version = nullptr;
- if (cmProp p = this->GetProperty("VERSION")) {
- version = p->c_str();
- }
+ const char* version = cmToCStr(this->GetProperty("VERSION"));
if (this->GetType() != cmStateEnums::EXECUTABLE ||
this->Makefile->IsOn("XCODE")) {
version = nullptr;
@@ -5536,7 +5532,7 @@ const char* getTypedProperty<const char*>(
cmProp value = tgt->GetProperty(prop);
if (genexInterpreter == nullptr) {
- return value ? value->c_str() : nullptr;
+ return cmToCStr(value);
}
return genexInterpreter->Evaluate(value ? *value : "", prop).c_str();
@@ -5550,7 +5546,7 @@ std::string getTypedProperty<std::string>(
cmProp value = tgt->GetProperty(prop);
if (genexInterpreter == nullptr) {
- return valueAsString(value ? value->c_str() : nullptr);
+ return valueAsString(cmToCStr(value));
}
return genexInterpreter->Evaluate(value ? *value : "", prop);