summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-08-24 14:04:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-08-24 14:05:00 (GMT)
commit71bf838cf35fabc27ff009f2901eeffc786fa753 (patch)
treeab4cfd3f1eda197230aaf037fe9906c29c40b8dd /Source/cmGeneratorTarget.cxx
parentcf90aa5595eac39029f7516e0bc5790fe398ea3d (diff)
parent5a2a275bb41e04891c2541a8e185b6daed259b0b (diff)
downloadCMake-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/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 4208689..3201ae3 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4962,11 +4962,11 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetLibraryNames(
// The library's soname.
this->ComputeVersionedName(targetNames.SharedObject, prefix,
targetNames.Base, suffix, targetNames.Output,
- cmToCStr(soversion));
+ soversion);
// The library's real name on disk.
this->ComputeVersionedName(targetNames.Real, prefix, targetNames.Base,
- suffix, targetNames.Output, cmToCStr(version));
+ suffix, targetNames.Output, version);
}
// The import library name.
@@ -4999,10 +4999,10 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames(
// This versioning is supported only for executables and then only
// when the platform supports symbolic links.
#if defined(_WIN32) && !defined(__CYGWIN__)
- const char* version = nullptr;
+ cmProp version;
#else
// Check for executable version properties.
- const char* version = cmToCStr(this->GetProperty("VERSION"));
+ cmProp version = this->GetProperty("VERSION");
if (this->GetType() != cmStateEnums::EXECUTABLE ||
this->Makefile->IsOn("XCODE")) {
version = nullptr;
@@ -5026,7 +5026,7 @@ cmGeneratorTarget::Names cmGeneratorTarget::GetExecutableNames(
#endif
if (version) {
targetNames.Real += "-";
- targetNames.Real += version;
+ targetNames.Real += *version;
}
#if defined(__CYGWIN__)
targetNames.Real += suffix;
@@ -6290,17 +6290,14 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const
return "A";
}
-void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
- std::string const& prefix,
- std::string const& base,
- std::string const& suffix,
- std::string const& name,
- const char* version) const
+void cmGeneratorTarget::ComputeVersionedName(
+ std::string& vName, std::string const& prefix, std::string const& base,
+ std::string const& suffix, std::string const& name, cmProp version) const
{
vName = this->Makefile->IsOn("APPLE") ? (prefix + base) : name;
if (version) {
vName += ".";
- vName += version;
+ vName += *version;
}
vName += this->Makefile->IsOn("APPLE") ? suffix : std::string();
}