diff options
author | Erlend E. Aasland <erlend.aasland@innova.no> | 2021-10-08 11:15:30 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-10-14 13:06:19 (GMT) |
commit | 761b6e24666884f26fd229b83dce884ba02c190d (patch) | |
tree | cd1e4756aa7f0867e8cc6eb3a12f750994f0e9e9 /Source/CPack/IFW | |
parent | 315fc296e3c1ecddbf59a2144b0dff9a05c715ed (diff) | |
download | CMake-761b6e24666884f26fd229b83dce884ba02c190d.zip CMake-761b6e24666884f26fd229b83dce884ba02c190d.tar.gz CMake-761b6e24666884f26fd229b83dce884ba02c190d.tar.bz2 |
CPackIFW: Avoid colliding names for icons / logos
Fixes: #16515
Diffstat (limited to 'Source/CPack/IFW')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index d356f7d..7a58457 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -371,7 +371,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); @@ -405,19 +407,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); |