|
| 1 | +option(DISABLE_CPACK_BUNDLING "Build an .app bundle without CPack" OFF) |
| 2 | + |
| 3 | +include(InstallRequiredSystemLibraries) |
| 4 | +set(DIRS ${Boost_LIBRARY_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/external/squirrel ${CMAKE_CURRENT_BINARY_DIR}/external/tinygettext) |
| 5 | + |
| 6 | +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT DISABLE_CPACK_BUNDLING) |
| 7 | + set(INFOPLIST_CFBUNDLEEXECUTABLE "SuperTux") |
| 8 | + |
| 9 | + find_package(PNG) |
| 10 | + foreach(_file ${PNG_LIBRARIES}) |
| 11 | + get_filename_component(_resolvedFile "${_file}" REALPATH) |
| 12 | + get_filename_component(_name "${_file}" NAME) |
| 13 | + install(FILES ${_resolvedFile} DESTINATION "MacOS" RENAME ${_name}) |
| 14 | + endforeach() |
| 15 | + find_package(JPEG) |
| 16 | + foreach(_file ${JPEG_LIBRARIES}) |
| 17 | + get_filename_component(_resolvedFile "${_file}" REALPATH) |
| 18 | + get_filename_component(_name "${_file}" NAME) |
| 19 | + install(FILES ${_resolvedFile} DESTINATION "MacOS" RENAME ${_name}) |
| 20 | + endforeach() |
| 21 | + |
| 22 | + install(CODE " |
| 23 | + if(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\" MATCHES \".*\\\\.app.*\") |
| 24 | + include(BundleUtilities) |
| 25 | + fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\") |
| 26 | + endif() |
| 27 | + ") |
| 28 | + |
| 29 | + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/info.plist.in" "${CMAKE_BINARY_DIR}/tools/darwin/info.plist") |
| 30 | + |
| 31 | + set(CPACK_BUNDLE_NAME "SuperTux") |
| 32 | + set(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/tools/darwin/info.plist") |
| 33 | + set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.icns") |
| 34 | + set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/startup.sh") |
| 35 | + set(CPACK_DMG_VOLUME_NAME "SuperTux ${SUPERTUX_VERSION_STRING}") |
| 36 | + set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/dsstore_setup.scpt") |
| 37 | + set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/tools/darwin/background.png") |
| 38 | +endif() |
| 39 | + |
| 40 | +set(CPACK_PACKAGE_NAME "SuperTux") |
| 41 | +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Jump'n'Run Game featuring Tux") |
| 42 | +set(CPACK_PACKAGE_VENDOR "SuperTux Devel Team") |
| 43 | +set(CPACK_PACKAGE_CONTACT "SuperTux Devel Team <[email protected]>") |
| 44 | +set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;${CMAKE_BINARY_DIR};/\\\\..*") |
| 45 | +set(CPACK_DEBIAN_PACKAGE_NAME "supertux2") |
| 46 | +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.5), libgcc1 (>= 1:4.1), libgl1-mesa-glx | libgl1, libogg0 (>= 1.1.3), libopenal0a, libphysfs-1.0-0, libsdl-image1.2 (>= 1.2.5), libsdl1.2debian (>= 1.2.10-1), libstdc++6 (>= 4.1.2), libvorbis0a (>= 1.1.2), libvorbisfile3 (>= 1.1.2), libcurl3 (>= 7.16)") |
| 47 | +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Classic 2D jump 'n run sidescroller with Tux\n SuperTux is a classic 2D jump 'n run sidescroller game in a similar\n style like the original SuperMario games. This release of SuperTux\n features 9 enemies, 26 playable levels, software and OpenGL rendering\n modes, configurable joystick and keyboard input, new music and\n completely redone graphics.\n .\n This is a development snapshot of SuperTux. It may suffer from\n critical bugs and has not been fully tested. \n .\n Homepage: http://supertux.lethargik.org/") |
| 48 | +set(CPACK_DEBIAN_PACKAGE_SECTION "games") |
| 49 | +set(CPACK_RPM_PACKAGE_NAME "supertux2") |
| 50 | +set(CPACK_RPM_PACKAGE_DESCRIPTION "Classic 2D jump 'n run sidescroller with Tux\n SuperTux is a classic 2D jump 'n run sidescroller game in a similar\n style like the original SuperMario games. This release of SuperTux\n features 9 enemies, 26 playable levels, software and OpenGL rendering\n modes, configurable joystick and keyboard input, new music and\n completely redone graphics.\n .\n This is a development snapshot of SuperTux. It may suffer from\n critical bugs and has not been fully tested. \n .\n Homepage: http://supertux.lethargik.org/") |
| 51 | +set(CPACK_RPM_PACKAGE_LICENSE "GNU General Public License (GPL)") |
| 52 | +set(CPACK_RPM_PACKAGE_GROUP "Amusements/Games/Action/Arcade") |
| 53 | +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") |
| 54 | +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") |
| 55 | +set(CPACK_PACKAGE_VERSION_MAJOR ${SUPERTUX_VERSION_MAJOR}) |
| 56 | +set(CPACK_PACKAGE_VERSION_MINOR ${SUPERTUX_VERSION_MINOR}) |
| 57 | + |
| 58 | +if(SUPERTUX_VERSION_TWEAK) |
| 59 | + set(CPACK_PACKAGE_VERSION_PATCH "${SUPERTUX_VERSION_PATCH}.${SUPERTUX_VERSION_TWEAK}") |
| 60 | +else() |
| 61 | + set(CPACK_PACKAGE_VERSION_PATCH ${SUPERTUX_VERSION_PATCH}) |
| 62 | +endif() |
| 63 | + |
| 64 | +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${SUPERTUX_VERSION_STRING}-${SUPERTUX_SYSTEM_NAME}") |
| 65 | +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${SUPERTUX_VERSION_STRING}-Source") |
| 66 | +set(CPACK_PACKAGE_INSTALL_DIRECTORY "SuperTux") |
| 67 | +set(CPACK_PACKAGE_EXECUTABLES "supertux2" "SuperTux") |
| 68 | + |
| 69 | +if(WIN32 AND NOT UNIX) |
| 70 | + set(CPACK_NSIS_INSTALLED_ICON_NAME "supertux2") |
| 71 | + set(CPACK_NSIS_DISPLAY_NAME "SuperTux") |
| 72 | + set(CPACK_NSIS_COMPRESSOR "/SOLID lzma") |
| 73 | + set(CPACK_WIX_PROGRAM_MENU_FOLDER "") |
| 74 | + set(CPACK_WIX_UPGRADE_GUID "93E16F4E-0A68-422A-8ADC-47BE5B9433B2") |
| 75 | + set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.ico") |
| 76 | + |
| 77 | + set(CPACK_WIX_UI_BANNER "${CMAKE_CURRENT_SOURCE_DIR}/mk/wix/banner.png") |
| 78 | + set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/mk/wix/dialog.png") |
| 79 | + set(CPACK_GENERATOR WIX) |
| 80 | +endif() |
| 81 | + |
| 82 | +include(CPack) |
| 83 | + |
| 84 | +# EOF # |
0 commit comments