On Wednesday 18 February 2009 12:31:25 Mike Arthur wrote:
> Please review the attached patch for inclusion.
>
> It adds support to the bundle generator to allow customisation of the
> volume name and hdiutil compression type used to create the DMG.
A new version of this patch against the DND generator (due to changes in CMake 
CVS) is attached to this email and to the bug report at:
http://www.cmake.org/Bug/view.php?id=8759

I welcome any feedback!

-- 
Cheers,
Mike Arthur
http://mikearthur.co.uk/
--- Source/CPack/cmCPackDragNDropGenerator.cxx	24 Feb 2009 14:34:03 -0000	1.5
+++ Source/CPack/cmCPackDragNDropGenerator.cxx	18 Mar 2009 15:38:31 -0000
@@ -173,6 +173,15 @@
   const std::string cpack_package_icon = this->GetOption("CPACK_PACKAGE_ICON") 
     ? this->GetOption("CPACK_PACKAGE_ICON") : "";
   
+  const std::string cpack_dmg_volume_name =
+    this->GetOption("CPACK_DMG_VOLUME_NAME")
+    ? this->GetOption("CPACK_DMG_VOLUME_NAME")
+        : this->GetOption("CPACK_PACKAGE_FILE_NAME");
+
+  const std::string cpack_dmg_format =
+    this->GetOption("CPACK_DMG_FORMAT")
+    ? this->GetOption("CPACK_DMG_FORMAT") : "UDZO";
+
   // Get optional arguments ...
   std::string cpack_license_file = 
     this->GetOption("CPACK_RESOURCE_FILE_LICENSE") ? 
@@ -226,7 +235,7 @@
   temp_image_command << " -ov";
   temp_image_command << " -srcfolder \"" << staging.str() << "\"";
   temp_image_command << " -volname \""
-    << this->GetOption("CPACK_PACKAGE_FILE_NAME") << "\"";
+    << cpack_dmg_volume_name << "\"";
   temp_image_command << " -format UDRW";
   temp_image_command << " \"" << temp_image << "\"";
 
@@ -394,7 +403,8 @@
   cmOStringStream final_image_command;
   final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
   final_image_command << " convert \"" << temp_image << "\"";
-  final_image_command << " -format UDZO";
+  final_image_command << " -format ";
+  final_image_command << cpack_dmg_format;
   final_image_command << " -imagekey";
   final_image_command << " zlib-level=9";
   final_image_command << " -o \"" << outFileName << "\"";
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to