I agree with Clint. This belongs in the new cmCPackDragNDropGenerator.<div><br><br><div class="gmail_quote">On Thu, Feb 5, 2009 at 1:25 PM, Clinton Stimpson <span dir="ltr"><<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
cmCPackBundleGenerator has a new base class cmCPackDragNDropGenerator. Can we please put this functionality there, and if necessary modify the CompressFiles(...) so they both get it (maybe the addition of a couple virtual functions would help).<br>
The DragNDrop generator supports multiple bundles, and uses whatever bundle properties were already set on the targets. It also supports installing non bundle things such as readme files. The Bundle generator is a specialization of the DragNDrop generator which is convenience for some.<br>
<br>
Clint<br>
<br>
Mike Arthur wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="Ih2E3d">
Please review the attached patch for inclusion.<br>
<br>
It adds support to the bundle generator to add a background image and .DS_Store for people (like myself/Mozilla/Last.fm) who want CPack to be able to set a nice background to the Bundle without having to manually convert it.<br>
</div>
------------------------------------------------------------------------<br>
<br>
--- source/Source/CPack/cmCPackBundleGenerator.cxx 2009-02-04 15:00:24.727403954 +0000<br>
+++ cmake-patch/Source/CPack/cmCPackBundleGenerator.cxx 2009-02-05 14:12:28.439443802 +0000<br>
@@ -105,6 +105,14 @@<br>
this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") ? this->GetOption("CPACK_BUNDLE_STARTUP_COMMAND") : "";<br>
+ const std::string cpack_bundle_dmg_background_image =<br>
+ this->GetOption("CPACK_BUNDLE_DMG_BACKGROUND_IMAGE")<br>
+ ? this->GetOption("CPACK_BUNDLE_DMG_BACKGROUND_IMAGE") : "";<br>
+<br>
+ const std::string cpack_bundle_dmg_ds_store =<br>
+ this->GetOption("CPACK_BUNDLE_DMG_DS_STORE")<br>
+ ? this->GetOption("CPACK_BUNDLE_DMG_DS_STORE") : "";<br>
+<br>
// The staging directory contains everything that will end-up inside the<br>
// final disk image ...<br>
cmOStringStream staging;<br>
@@ -202,6 +210,63 @@<br>
}<br>
}<br>
+ // Optionally add a custom .DS_Store file<br>
+ // (e.g. for setting background/layout) ...<br>
+ if(!cpack_bundle_dmg_ds_store.empty())<br>
+ {<br>
+ cmOStringStream package_settings_source;<br>
+ package_settings_source << cpack_bundle_dmg_ds_store;<br>
+<br>
+ cmOStringStream package_settings_destination;<br>
+ package_settings_destination << staging.str() << "/.DS_Store";<br>
+<br>
+ if(!this->CopyFile(package_settings_source, package_settings_destination))<br>
+ {<br>
+ cmCPackLogger(cmCPackLog::LOG_ERROR,<br>
+ "Error copying disk volume settings file. "<br>
+ "Check the value of CPACK_BUNDLE_DMG_DS_STORE."<br>
+ << std::endl);<br>
+<br>
+ return 0;<br>
+ }<br>
+ }<br>
+<br>
+ // Optionally add a custom background image ...<br>
+ if(!cpack_bundle_dmg_background_image.empty())<br>
+ {<br>
+ cmOStringStream package_background_source;<br>
+ package_background_source << cpack_bundle_dmg_background_image;<br>
+<br>
+ cmOStringStream package_background_destination;<br>
+ package_background_destination << staging.str() << "/background.png";<br>
+<br>
+ if(!this->CopyFile(package_background_source,<br>
+ package_background_destination))<br>
+ {<br>
+ cmCPackLogger(cmCPackLog::LOG_ERROR,<br>
+ "Error copying disk volume background image. "<br>
+ "Check the value of CPACK_BUNDLE_DMG_BACKGROUND_IMAGE."<br>
+ << std::endl);<br>
+<br>
+ return 0;<br>
+ }<br>
+<br>
+ cmOStringStream temp_background_hiding_command;<br>
+ temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE");<br>
+ temp_background_hiding_command << " -a V \"";<br>
+ temp_background_hiding_command << package_background_destination.str();<br>
+ temp_background_hiding_command << "\"";<br>
+<br>
+ if(!this->RunCommand(temp_background_hiding_command))<br>
+ {<br>
+ cmCPackLogger(cmCPackLog::LOG_ERROR,<br>
+ "Error setting attributes on disk volume background image."<br>
+ << std::endl);<br>
+<br>
+ return 0;<br>
+ }<br>
+ }<br>
+<br>
// Create a temporary read-write disk image ...<br>
cmOStringStream temp_image;<br>
temp_image << this->GetOption("CPACK_TOPLEVEL_DIRECTORY") << "/temp.dmg";<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>