Pārlūkot izejas kodu

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.
Robert Maynard 11 gadi atpakaļ
vecāks
revīzija
47302038c1
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      Source/CPack/cmCPackDragNDropGenerator.cxx

+ 5 - 1
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))