summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackDragNDropGenerator.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2014-09-18 17:59:40 (GMT)
committerBrad King <brad.king@kitware.com>2015-11-13 13:42:49 (GMT)
commit47302038c1021f0b6b0d9977f5bccaa795045805 (patch)
tree8545303996570b1f2a343f19a965bf789f7bb902 /Source/CPack/cmCPackDragNDropGenerator.cxx
parent7387f06586f0b01dd3c1c4f66339c89f2e985e82 (diff)
downloadCMake-47302038c1021f0b6b0d9977f5bccaa795045805.zip
CMake-47302038c1021f0b6b0d9977f5bccaa795045805.tar.gz
CMake-47302038c1021f0b6b0d9977f5bccaa795045805.tar.bz2
CPack/DragNDrop: Use source file extension for background image
Instead of blindly copying the `CPACK_DMG_BACKGROUND_IMAGE` file to `background.png`, we instead use the same file extension as the source image. This is needed for proper support of multi resolution `tif` backgrounds.
Diffstat (limited to 'Source/CPack/cmCPackDragNDropGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 208a64c..3d1e4ea 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -399,13 +399,17 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
}
// Optionally add a custom background image ...
+ // Make sure the background file type is the same as the custom image
if(!cpack_dmg_background_image.empty())
{
+ const std::string extension =
+ cmSystemTools::GetFilenameLastExtension(cpack_dmg_background_image);
std::ostringstream package_background_source;
package_background_source << cpack_dmg_background_image;
std::ostringstream package_background_destination;
- package_background_destination << staging.str() << "/background.png";
+ package_background_destination << staging.str()
+ << "/background" << extension;
if(!this->CopyFile(package_background_source,
package_background_destination))