CMakeLists.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. SET(MACOSX_BUNDLE_ICON_FILE "icon.icns")
  2. SET(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME_UCASE}")
  3. SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}")
  4. SET(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME_UCASE}")
  5. SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
  6. SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
  7. SET(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT}")
  8. SET(MACOSX_BUNDLE_MIMETYPE "application/x-lmms-project")
  9. SET(MACOSX_BUNDLE_MIMETYPE_ICON "project.icns")
  10. SET(MACOSX_BUNDLE_MIMETYPE_ID "io.lmms")
  11. SET(MACOSX_BUNDLE_PROJECT_URL "${PROJECT_URL}")
  12. SET(MACOSX_BUNDLE_DMG_TITLE "${MACOSX_BUNDLE_BUNDLE_NAME} ${MACOSX_BUNDLE_LONG_VERSION_STRING}")
  13. # FIXME: appdmg won't allow volume names > 27 char
  14. # See also https://github.com/LinusU/node-appdmg/issues/48
  15. STRING(SUBSTRING "${MACOSX_BUNDLE_DMG_TITLE}" 0 27 MACOSX_BUNDLE_DMG_TITLE)
  16. CONFIGURE_FILE("lmms.plist.in" "${CMAKE_BINARY_DIR}/Info.plist")
  17. CONFIGURE_FILE("install_apple.sh.in" "${CMAKE_BINARY_DIR}/install_apple.sh" @ONLY)
  18. CONFIGURE_FILE("package_apple.json.in" "${CMAKE_BINARY_DIR}/package_apple.json" @ONLY)
  19. # DMG creation target
  20. SET(DMG_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}.dmg")
  21. FILE(REMOVE "${DMG_FILE}")
  22. ADD_CUSTOM_TARGET(removedmg
  23. COMMAND touch "\"${DMG_FILE}\"" && rm "\"${DMG_FILE}\""
  24. COMMENT "Removing old DMG")
  25. ADD_CUSTOM_TARGET(dmg
  26. COMMAND appdmg "\"${CMAKE_BINARY_DIR}/package_apple.json\"" "\"${DMG_FILE}\""
  27. DEPENDS "${CMAKE_BINARY_DIR}/package_apple.json"
  28. COMMENT "Generating DMG")
  29. ADD_DEPENDENCIES(dmg removedmg)
  30. # see also ../postinstall/CMakeLists.txt