summaryrefslogtreecommitdiffstats
path: root/Source/CPack/IFW
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-10-15 12:38:40 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-10-15 12:38:58 (GMT)
commitc5ae200d94333600117fc93e50c66bdd50994bbc (patch)
tree9c1249e2254310d0a7e37a6d52972dd2ebb24a7f /Source/CPack/IFW
parent014075b117b739138ece54dd20b99743c16976ec (diff)
parent761b6e24666884f26fd229b83dce884ba02c190d (diff)
downloadCMake-c5ae200d94333600117fc93e50c66bdd50994bbc.zip
CMake-c5ae200d94333600117fc93e50c66bdd50994bbc.tar.gz
CMake-c5ae200d94333600117fc93e50c66bdd50994bbc.tar.bz2
Merge topic 'ifw-installer-icon-filenames'
761b6e2466 CPackIFW: Avoid colliding names for icons / logos Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6613
Diffstat (limited to 'Source/CPack/IFW')
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 465c38d..0948a84 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -381,7 +381,9 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
// Logo
if (!this->Logo.empty()) {
- std::string name = cmSystemTools::GetFilenameName(this->Logo);
+ std::string srcName = cmSystemTools::GetFilenameName(this->Logo);
+ std::string suffix = cmSystemTools::GetFilenameLastExtension(srcName);
+ std::string name = "cm_logo." + suffix;
std::string path = this->Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(this->Logo, path);
xout.Element("Logo", name);
@@ -415,19 +417,25 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
if (!this->IsVersionLess("1.4")) {
// ApplicationIcon
if (!this->InstallerApplicationIcon.empty()) {
- std::string name =
+ std::string srcName =
cmSystemTools::GetFilenameName(this->InstallerApplicationIcon);
+ std::string suffix = cmSystemTools::GetFilenameLastExtension(srcName);
+ std::string name = "cm_appicon." + suffix;
std::string path = this->Directory + "/config/" + name;
- name = cmSystemTools::GetFilenameWithoutExtension(name);
cmsys::SystemTools::CopyFileIfDifferent(this->InstallerApplicationIcon,
path);
+ // The actual file is looked up by attaching a '.icns' (macOS),
+ // '.ico' (Windows). No functionality on Unix.
+ name = cmSystemTools::GetFilenameWithoutExtension(name);
xout.Element("InstallerApplicationIcon", name);
}
// WindowIcon
if (!this->InstallerWindowIcon.empty()) {
- std::string name =
+ std::string srcName =
cmSystemTools::GetFilenameName(this->InstallerWindowIcon);
+ std::string suffix = cmSystemTools::GetFilenameLastExtension(srcName);
+ std::string name = "cm_winicon." + suffix;
std::string path = this->Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(this->InstallerWindowIcon, path);
xout.Element("InstallerWindowIcon", name);