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.
-- 
Mike Arthur
Software Engineer
Mendeley Ltd.
--- Source/CPack/cmCPackBundleGenerator.cxx	22 Jan 2009 18:56:13 -0000	1.9
+++ Source/CPack/cmCPackBundleGenerator.cxx	18 Feb 2009 11:43:15 -0000
@@ -105,6 +105,16 @@
     this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") 
     ? this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") : "";
 
+  const std::string cpack_bundle_dmg_volume_name =
+	this->GetOption("CPACK_BUNDLE_DMG_VOLUME_NAME")
+	? this->GetOption("CPACK_BUNDLE_DMG_VOLUME_NAME")
+	  : this->GetOption("CPACK_PACKAGE_FILE_NAME");
+
+  const std::string cpack_bundle_dmg_format =
+	this->GetOption("CPACK_BUNDLE_DMG_FORMAT")
+	? this->GetOption("CPACK_BUNDLE_DMG_FORMAT")
+	  : "UDZO";
+
   // The staging directory contains everything that will end-up inside the
   // final disk image ...
   cmOStringStream staging;
@@ -212,7 +222,7 @@
   temp_image_command << " -ov";
   temp_image_command << " -srcfolder \"" << staging.str() << "\"";
   temp_image_command << " -volname \""
-    << this->GetOption("CPACK_PACKAGE_FILE_NAME") << "\"";
+    << cpack_bundle_dmg_volume_name << "\"";
   temp_image_command << " -format UDRW";
   temp_image_command << " \"" << temp_image.str() << "\"";
 
@@ -282,7 +292,8 @@
   cmOStringStream final_image_command;
   final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
   final_image_command << " convert \"" << temp_image.str() << "\"";
-  final_image_command << " -format UDZO";
+  final_image_command << " -format ";
+  final_image_command << cpack_bundle_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