dmg bundle: icon

This commit is contained in:
Joachim Schöberl 2015-12-21 20:21:03 +01:00
parent 0e2fe66650
commit 99f83757fb

View File

@ -332,25 +332,27 @@ endif(UNIX)
if(APPLE)
set(CPACK_GENERATOR "Bundle")
set(CPACK_BUNDLE_NAME "NGSuite")
set(CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/../netgen/windows/netgen.ico)
set(CPACK_BUNDLE_NAME "Netgen")
set(CPACK_PACKAGE_FILE_NAME "netgen-${PACKAGE_VERSION}")
set(CPACK_BUNDLE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/netgen.icns)
# set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_SOURCE_DIR}/netgen.icns)
# create some auxiliary files
set(mac_startup ${CMAKE_CURRENT_BINARY_DIR}/startup.sh)
file(WRITE ${mac_startup} "#!/bin/sh\n")
file(APPEND ${mac_startup} "NGSuite_BUNDLE=\"`echo \"$0\" | sed -e 's/\\/Contents\\/Resources\\/bin\\/startup.sh//'`\"\n")
file(APPEND ${mac_startup} "NGSuite_RESOURCES=\"$NGSuite_BUNDLE/Contents/Resources\"\n")
file(APPEND ${mac_startup} "export DYLD_LIBRARY_PATH=$NGSuite_RESOURCES/lib:$DYLD_LIBRARY_PATH\n")
file(APPEND ${mac_startup} "export NETGENDIR=$NGSuite_RESOURCES/bin\n")
file(APPEND ${mac_startup} "cd $NGSuite_RESOURCES\n")
file(APPEND ${mac_startup} "$NGSuite_RESOURCES/bin/netgen\n")
file(APPEND ${mac_startup} "Netgen_BUNDLE=\"`echo \"$0\" | sed -e 's/\\/Contents\\/Resources\\/bin\\/startup.sh//'`\"\n")
file(APPEND ${mac_startup} "Netgen_RESOURCES=\"$Netgen_BUNDLE/Contents/Resources\"\n")
file(APPEND ${mac_startup} "export DYLD_LIBRARY_PATH=$Netgen_RESOURCES/lib:$DYLD_LIBRARY_PATH\n")
file(APPEND ${mac_startup} "export NETGENDIR=$Netgen_RESOURCES/bin\n")
file(APPEND ${mac_startup} "cd $Netgen_RESOURCES\n")
file(APPEND ${mac_startup} "$Netgen_RESOURCES/bin/netgen\n")
install(PROGRAMS ${mac_startup} DESTINATION bin)
set(mac_ngsuite ${CMAKE_CURRENT_BINARY_DIR}/ngsuite.sh)
file(WRITE ${mac_ngsuite} "#!/bin/sh\n")
file(APPEND ${mac_ngsuite} "NGSuite_BUNDLE=\"`echo \"$0\" | sed -e 's/\\/Contents\\/MacOS\\/NGSuite//'`\"\n")
file(APPEND ${mac_ngsuite} "NGSuite_RESOURCES=\"$NGSuite_BUNDLE/Contents/Resources\"\n")
file(APPEND ${mac_ngsuite} "open -a /Applications/Utilities/Terminal.app $NGSuite_RESOURCES/bin/startup.sh\n")
file(APPEND ${mac_ngsuite} "Netgen_BUNDLE=\"`echo \"$0\" | sed -e 's/\\/Contents\\/MacOS\\/Netgen//'`\"\n")
file(APPEND ${mac_ngsuite} "Netgen_RESOURCES=\"$Netgen_BUNDLE/Contents/Resources\"\n")
file(APPEND ${mac_ngsuite} "open -a /Applications/Utilities/Terminal.app $Netgen_RESOURCES/bin/startup.sh\n")
set(CPACK_BUNDLE_STARTUP_COMMAND ${mac_ngsuite})
set(mac_plist ${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
@ -361,7 +363,9 @@ if(APPLE)
file(APPEND ${mac_plist} " <key>CFBundleDevelopmentRegion</key>\n")
file(APPEND ${mac_plist} " <string>English</string>\n")
file(APPEND ${mac_plist} " <key>CFBundleExecutable</key>\n")
file(APPEND ${mac_plist} " <string>NGSuite</string>\n")
file(APPEND ${mac_plist} " <string>Netgen</string>\n")
file(APPEND ${mac_plist} " <key>CFBundleIconFile</key>\n")
file(APPEND ${mac_plist} " <string>Netgen.icns</string>\n")
file(APPEND ${mac_plist} "</dict>\n")
file(APPEND ${mac_plist} "</plist>\n")
set(CPACK_BUNDLE_PLIST ${mac_plist})