ccec0ee45f
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6928 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 4f47f101cd9c62184e1469496a0e2bb3eeca6525 Former-commit-id: 8b036490454775236451f00caf9f78684e8d1181
64 lines
2.7 KiB
CMake
64 lines
2.7 KiB
CMake
#==============================================================================
|
|
#
|
|
# Generated Script file for creating the DMG file
|
|
# Apple only
|
|
#
|
|
#==============================================================================
|
|
|
|
set(_result )
|
|
message(STATUS "Creating read/write dmg...")
|
|
execute_process(COMMAND hdiutil create "./@READ_WRITE_DMG_NAME@" -volname "@DMG_VOL_NAME@" -size 4g -fs HFS+
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of hdiutil create = ${_result}")
|
|
|
|
message(STATUS "Attaching read/write dmg...")
|
|
execute_process(COMMAND hdiutil attach "./@READ_WRITE_DMG_NAME@" -nobrowse
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of hdiutil attach = ${_result}")
|
|
|
|
|
|
# Copy the background image (renaming NOTE the leading . in target name)
|
|
message(STATUS "Copying installer-mac-bg-22.png...")
|
|
execute_process(COMMAND cp "@CMAKE_SOURCE_DIR@/packaging/OSX/installer-mac-bg-22.png" "/Volumes/@DMG_VOL_NAME@/.installer-mac-bg-22.png"
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of copying installer-mac-bg-22.png = ${_result}")
|
|
|
|
# Create a link to Applications folder
|
|
message(STATUS "Creating link to Applications...")
|
|
execute_process(COMMAND ln -s /Applications "/Volumes/@DMG_VOL_NAME@/Applications"
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of creating link to Applications = ${_result}")
|
|
|
|
# Copy the whole .app folder recursively
|
|
message(STATUS "Copying the @SD_BUNDLE_NAME@ folder...")
|
|
execute_process(COMMAND cp -r "@SD_BUNDLE_NAME@/" "/Volumes/@DMG_VOL_NAME@/@SD_BUNDLE_NAME@"
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of copying the @SD_BUNDLE_NAME@ folder = ${_result}")
|
|
|
|
# run the generated 'Finder' script
|
|
message(STATUS "Running the generated 'Finder' script...")
|
|
execute_process(COMMAND osascript findersettings.scpt
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of running the generated 'Finder' script = ${_result}")
|
|
|
|
|
|
message(STATUS "Detaching read/write dmg...")
|
|
execute_process(COMMAND hdiutil detach "/Volumes/@DMG_VOL_NAME@/"
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of hdiutil detach = ${_result}")
|
|
|
|
|
|
# create the Read only version
|
|
message(STATUS "converting read/write dmg to read-only...")
|
|
execute_process(COMMAND hdiutil convert "./@READ_WRITE_DMG_NAME@" -format UDZO -imagekey zlib-level=9 -o "./@READ_ONLY_DMG_NAME@"
|
|
RESULT_VARIABLE _result
|
|
COMMAND_ECHO STDOUT )
|
|
message(STATUS "Result of hdiutil convert = ${_result}")
|
|
|