diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 93c0c0caa..f638fcc5a 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -1,149 +1,153 @@ #android build # copied/inspired from stellarium project (http://www.stellarium.org/wiki/index.php/Building_for_Android) LIST(APPEND JAVA_SRCS "src/com/android/vending/billing/IInAppBillingService.aidl" "src/net/gcompris/GComprisActivity.java") FOREACH(JavaSource ${JAVA_SRCS}) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${JavaSource} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${JavaSource} ${CMAKE_CURRENT_BINARY_DIR}/${JavaSource} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${JavaSource} ) LIST(APPEND TARGET_JAVA_FILES ${CMAKE_CURRENT_BINARY_DIR}/${JavaSource}) ENDFOREACH() ADD_CUSTOM_TARGET (java_src DEPENDS ${TARGET_JAVA_FILES}) find_program(ANDROID_DEPLOY_QT NAMES androiddeployqt PATHS ${_qt5Core_install_prefix}/bin/ ) # Look for androiddeployqt program if (NOT ANDROID_DEPLOY_QT) message(FATAL_ERROR "Could not find androiddeployqt. Make sure you set all the Qt5_* paths to the Qt for android compiled version.") endif(NOT ANDROID_DEPLOY_QT) # Set version set(ANDROID_VERSION_NAME ${GCOMPRIS_VERSION}) # Set a name representing the build type set(APK_SUFFIX "-") if(ACTIVATION_MODE STREQUAL "inapp") set(APK_SUFFIX "-inapp${APK_SUFFIX}") elseif(ACTIVATION_MODE STREQUAL "internal") set(APK_SUFFIX "-internal${APK_SUFFIX}") endif(ACTIVATION_MODE STREQUAL "inapp") +# _HOST have been removed from ECM in https://cgit.kde.org/extra-cmake-modules.git/commit/?id=731ba7036effcc430f98031e7f2a9826f6234cba +set(_HOST "${CMAKE_HOST_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}") +string(TOLOWER "${_HOST}" _HOST) + if(WITH_DEMO_ONLY) set(APK_SUFFIX "-demo${APK_SUFFIX}") endif(WITH_DEMO_ONLY) if(WITH_DOWNLOAD) set(APK_SUFFIX "-dl${APK_SUFFIX}") endif(WITH_DOWNLOAD) if(WITH_KIOSK_MODE) set(APK_SUFFIX "-kiosk${APK_SUFFIX}") endif(WITH_KIOSK_MODE) # set android package source for androiddeployqt json file set(PACKAGE_SOURCE_ANDROID ${CMAKE_BINARY_DIR}/tmpAndroid) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/AndroidManifest.xml.cmake ${PACKAGE_SOURCE_ANDROID}/AndroidManifest.xml @ONLY) # create json file parsed by the androiddeployqt set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK_ROOT}) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configAndroid.json.cmake ${PACKAGE_SOURCE_ANDROID}/configAndroid.json @ONLY) # Get all po files in po/ to create the values-{locale} in order to have the locales available in android file(GLOB TRANSLATIONS_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "../po/*.po") foreach(PoSource ${TRANSLATIONS_FILES}) # Remove suffix ".po" string(REPLACE ".po" "" PoSource ${PoSource}) # Remove prefix "../po/gcompris_" string(REPLACE "../po/gcompris_" "" locale ${PoSource}) # replace _ par -r for locales with country string(REPLACE "_" "-r" locale ${locale}) add_custom_command( OUTPUT ${locale} COMMAND cmake -E make_directory ${GCOMPRIS_TRANSLATIONS_DIR} COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/android/res/values-${locale} COMMAND cmake -E copy ${CMAKE_SOURCE_DIR}/android/strings.xml ${CMAKE_BINARY_DIR}/android/res/values-${locale}/strings.xml ) list(APPEND ALL_LOCALES ${locale}) endforeach() add_custom_command ( OUTPUT createApkFromAndroidDeployQtDebug DEPENDS ${PACKAGE_SOURCE_ANDROID}/AndroidManifest.xml COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${PACKAGE_SOURCE_ANDROID} COMMAND ${ANDROID_DEPLOY_QT} --output ${CMAKE_CURRENT_BINARY_DIR}/ --input ${PACKAGE_SOURCE_ANDROID}/configAndroid.json --debug COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/bin/QtApp-debug.apk ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-debug-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk ) add_custom_command ( OUTPUT createApkFromAndroidDeployQtRelease DEPENDS ${PACKAGE_SOURCE_ANDROID}/AndroidManifest.xml COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${PACKAGE_SOURCE_ANDROID} COMMAND ${ANDROID_DEPLOY_QT} --output ${CMAKE_CURRENT_BINARY_DIR}/ --input ${PACKAGE_SOURCE_ANDROID}/configAndroid.json --release COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/bin/QtApp-release-unsigned.apk ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk ) add_custom_command ( OUTPUT createApkSignedFromAndroidDeployQtRelease DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk COMMAND jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $ENV{ANDROID_KEYSTORE} -storepass $ENV{ANDROID_KEYSTORE_PASSWD} ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk gcompris ) add_custom_command ( OUTPUT createApkSignedAlignedFromAndroidDeployQtRelease DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-aligned-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk COMMAND ${ANDROID_SDK_ROOT}/build-tools/21.1.2/zipalign -v 4 ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-aligned-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk ) add_custom_command ( OUTPUT apkInstall DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-aligned-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk COMMAND ${ANDROID_SDK_ROOT}/platform-tools/adb install -r ${CMAKE_CURRENT_BINARY_DIR}/bin/GCompris-Android-release-signed-aligned-${ANDROID_ABI}${APK_SUFFIX}${GCOMPRIS_VERSION}.apk ) # Command to create apk from Makefile add_custom_target (apk_debug DEPENDS ${ALL_LOCALES} move_translations_to_assets createApkFromAndroidDeployQtDebug java_src ) # Command to create apk from Makefile add_custom_target (apk_release DEPENDS ${ALL_LOCALES} move_translations_to_assets createApkFromAndroidDeployQtRelease java_src ) # Command to create signed apk from Makefile add_custom_target (apk_signed DEPENDS ${ALL_LOCALES} move_translations_to_assets createApkSignedFromAndroidDeployQtRelease java_src ) # Command to create signed aligned apk from Makefile add_custom_target (apk_signed_aligned DEPENDS ${ALL_LOCALES} move_translations_to_assets createApkSignedAlignedFromAndroidDeployQtRelease java_src ) # Command to install the signed aligned apk through adb from Makefile add_custom_target (apk_install DEPENDS apkInstall ) add_custom_command( OUTPUT move_translations_to_assets COMMAND ${CMAKE_COMMAND} -E copy_directory ${GCOMPRIS_TRANSLATIONS_DIR} ${CMAKE_BINARY_DIR}/android/assets/share/GCompris ) if (TARGET create-apk) set(PACKAGE_DIR ${PACKAGE_SOURCE_ANDROID}) set_target_properties(create-apk-GCompris PROPERTIES ANDROID_APK_DIR "${PACKAGE_DIR}") add_custom_target(gcompris-move-metadata ALL COMMAND cmake -E echo "Moving GCompris shared Android resources" COMMAND cmake -E make_directory ${PACKAGE_SOURCE_ANDROID} COMMAND cmake -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}" "${PACKAGE_SOURCE_ANDROID}" ) add_dependencies(create-apk gcompris-move-metadata) endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 849e3d88f..c987c3e84 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,324 +1,331 @@ include(qt_helper) configure_file(config.h.in "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) if(WITH_KIOSK_MODE) add_definitions(-DWITH_KIOSK_MODE) endif() if(SAILFISHOS) add_definitions(-DSAILFISHOS) endif() +if(ANDROID) + # needed since ECM 5.45 (https://bugs.kde.org/show_bug.cgi?id=394042) + include_directories(SYSTEM + "${CMAKE_SYSROOT}/usr/include" + ) +endif() + set(gcompris_SRCS ActivityInfo.cpp ActivityInfo.h ActivityInfoTree.cpp ActivityInfoTree.h ApplicationInfo.cpp ApplicationInfo.h ApplicationSettings.cpp ApplicationSettings.h File.cpp File.h Directory.cpp Directory.h DownloadManager.cpp DownloadManager.h GComprisPlugin.cpp GComprisPlugin.h main.cpp config.h.in synth/ADSRenvelope.cpp synth/ADSRenvelope.h synth/GSynth.cpp synth/GSynth.h synth/linearSynthesis.cpp synth/linearSynthesis.h synth/modulation.cpp synth/modulation.h synth/generator.cpp synth/generator.h synth/preset.h synth/preset.cpp synth/waveform.cpp synth/waveform.h ) if(ANDROID) list(APPEND gcompris_SRCS ApplicationAndroid.cpp) else() list(APPEND gcompris_SRCS ApplicationSettingsDefault.cpp ApplicationInfoDefault.cpp) endif() # Resources set(GCOMPRIS_RESOURCES "${PROJECT_SOURCE_DIR}/installer") if(CMAKE_HOST_WIN32) set(gcompris_icon GCompris.ico) set(gcompris_RES ${GCOMPRIS_RESOURCES}/${gcompris_icon} GCompris.rc ) elseif(CMAKE_HOST_APPLE) set(gcompris_icon GCompris.icns) set(gcompris_RES ${GCOMPRIS_RESOURCES}/${gcompris_icon}) set_source_files_properties(${gcompris_RES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") endif() set(used_qt_modules Qt5::Qml Qt5::Quick Qt5::Gui Qt5::Multimedia Qt5::Core Qt5::Svg Qt5::Xml Qt5::XmlPatterns Qt5::Sensors) if(ANDROID) add_library(${GCOMPRIS_EXECUTABLE_NAME} SHARED ${gcompris_SRCS}) set(used_qt_modules ${used_qt_modules} Qt5::AndroidExtras) elseif(CMAKE_HOST_APPLE) add_executable(${GCOMPRIS_EXECUTABLE_NAME} MACOSX_BUNDLE ${gcompris_SRCS} ${gcompris_RES}) elseif(CMAKE_HOST_WIN32) add_executable(${GCOMPRIS_EXECUTABLE_NAME} WIN32 ${gcompris_SRCS} ${gcompris_RES}) elseif(SAILFISHOS) add_executable(${GCOMPRIS_EXECUTABLE_NAME} ${gcompris_SRCS} ${gcompris_RES}) set(used_qt_modules ${used_qt_modules} Qt5::Widgets) else() add_executable(${GCOMPRIS_EXECUTABLE_NAME} ${gcompris_SRCS} ${gcompris_RES}) endif() # only build the lib for testing purpose if(BUILD_TESTING) add_library(gcompris_core SHARED ${gcompris_SRCS}) target_link_libraries(gcompris_core ${used_qt_modules}) endif() target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} ${used_qt_modules}) GCOMPRIS_ADD_RCC(core *.qml *.js resource/*.${COMPRESSED_AUDIO} resource/*.gif resource/*.png resource/*.svg resource/bonus/* resource/sounds/* resource/fonts/* qmldir COPYING) # Installation # ============ install(TARGETS ${GCOMPRIS_EXECUTABLE_NAME} ARCHIVE DESTINATION bin RUNTIME DESTINATION bin LIBRARY DESTINATION lib BUNDLE DESTINATION .) if(BUILD_STANDALONE) # Qt plugins to install set(_qt_plugins "") if(NOT SAILFISHOS) list(APPEND _qt_plugins Qt5::QJpegPlugin) endif() if(APPLE) list(APPEND _qt_plugins Qt5::QTgaPlugin Qt5::QTiffPlugin Qt5::QCocoaIntegrationPlugin) elseif(WIN32) list(APPEND _qt_plugins Qt5::QWindowsIntegrationPlugin Qt5::QWindowsAudioPlugin Qt5::AudioCaptureServicePlugin Qt5::DSServicePlugin) elseif(UNIX AND NOT ANDROID AND NOT SAILFISHOS) list(APPEND _qt_plugins Qt5::QXcbIntegrationPlugin Qt5::QXcbEglIntegrationPlugin Qt5::QXcbGlxIntegrationPlugin Qt5::QAlsaPlugin Qt5::QPulseAudioPlugin) endif() list(APPEND _qt_plugins Qt5::genericSensorPlugin Qt5::QtSensorGesturePlugin Qt5::QShakeSensorGesturePlugin) # Qml plugins to install if(WIN32) set(_lib_prefix "") else() set(_lib_prefix "lib") endif() set(_qt_plugins2 imageformats/${_lib_prefix}qsvg) if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT SAILFISHOS) list(APPEND _qt_plugins2 mediaservice/${_lib_prefix}gstaudiodecoder mediaservice/${_lib_prefix}gstcamerabin mediaservice/${_lib_prefix}gstmediacapture mediaservice/${_lib_prefix}gstmediaplayer) elseif(APPLE) list(APPEND _qt_plugins2 audio/${_lib_prefix}qtaudio_coreaudio mediaservice/${_lib_prefix}qavfmediaplayer mediaservice/${_lib_prefix}qtmedia_audioengine mediaservice/${_lib_prefix}qavfcamera) endif() set(_qml_plugins QtGraphicalEffects/${_lib_prefix}qtgraphicaleffectsplugin QtGraphicalEffects/private/${_lib_prefix}qtgraphicaleffectsprivate QtQuick/Window.2/${_lib_prefix}windowplugin QtQuick/Particles.2/${_lib_prefix}particlesplugin QtQuick.2/${_lib_prefix}qtquick2plugin QtMultimedia/${_lib_prefix}declarative_multimedia QtSensors/${_lib_prefix}declarative_sensors) if(NOT SAILFISHOS) list(APPEND _qml_plugins QtQuick/Controls/${_lib_prefix}qtquickcontrolsplugin QtQuick/Layouts/${_lib_prefix}qquicklayoutsplugin) endif() set(GCOMPRIS_OTHER_LIBS) if(APPLE) set(_app gcompris-qt.app) set(_qtconf_destdir ${_app}/Contents/Resources) set(_qt_plugins_destdir ${_app}/Contents/plugins) set(_qt_qml_destdir ${_app}/Contents/qml) set(GCOMPRIS_BUNDLE "\${CMAKE_INSTALL_PREFIX}/${_app}") set_target_properties(gcompris-qt PROPERTIES MACOSX_BUNDLE_INFO_STRING "GCompris, Educational game for children 2 to 10" MACOSX_BUNDLE_ICON_FILE "${gcompris_icon}" MACOSX_BUNDLE_GUI_IDENTIFIER "net.gcompris" MACOSX_BUNDLE_LONG_VERSION_STRING "${GCOMPRIS_MAJOR_VERSION}.${GCOMPRIS_MINOR_VERSION}.${GCOMPRIS_PATCH_VERSION}" MACOSX_BUNDLE_BUNDLE_NAME "gcompris-qt" MACOSX_BUNDLE_SHORT_VERSION_STRING "${GCOMPRIS_VERSION}" MACOSX_BUNDLE_BUNDLE_VERSION "${GCOMPRIS_VERSION}" MACOSX_BUNDLE_COPYRIGHT "GPL License, Copyright 2000-2019 Timothee Giet and Others.") set_source_files_properties(${GCOMPRIS_RESOURCES}/${gcompris_icon} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") else() set(_qtconf_destdir bin) set(_qt_plugins_destdir bin/plugins) set(_qt_qml_destdir bin/qml) if(CMAKE_HOST_WIN32) set(GCOMPRIS_BUNDLE "\${CMAKE_INSTALL_PREFIX}/bin/${GCOMPRIS_EXECUTABLE_NAME}.exe") else() set(GCOMPRIS_BUNDLE "\${CMAKE_INSTALL_PREFIX}/bin/${GCOMPRIS_EXECUTABLE_NAME}") endif() endif() # install qt.conf file install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/qt.conf DESTINATION ${_qtconf_destdir}) # install qt plugins foreach(_plugin ${_qt_plugins}) installQtPlugin(${_plugin} ${_qt_plugins_destdir} _lib) list(APPEND GCOMPRIS_OTHER_LIBS ${_lib}) endforeach() foreach(_plugin ${_qt_plugins2}) if(APPLE) installQtPlugin2(${_plugin} ${_qt_plugins_destdir}/../Plugins _lib) else() installQtPlugin2(${_plugin} ${_qt_plugins_destdir} _lib) endif() list(APPEND GCOMPRIS_OTHER_LIBS ${_lib}) endforeach() # install qml plugins foreach(_plugin ${_qml_plugins}) installQmlPlugin(${_plugin} ${_qt_qml_destdir} _lib) list(APPEND GCOMPRIS_OTHER_LIBS ${_lib}) endforeach() ## install QtGraphicalEffects (which is not a lib but only qml files) # BUT, actually there are some libs in it, and this does not work on APPLE. Moved to _qml_plugins instead # #set(_qml_subdir QtGraphicalEffects) #getQtQmlPath(_qt_qml_path) #install(DIRECTORY ${_qt_qml_path}/QtGraphicalEffects DESTINATION ${_qt_qml_destdir}) # Fix for Linux 'make package' that fails to link with libicu if(UNIX AND NOT APPLE AND NOT SAILFISHOS AND NOT ANDROID) add_library( libicudata SHARED IMPORTED ) FILE(GLOB LIBICUDATA_SO "${Qt5_DIR}/../../libicudata.so.[0-9][0-9]") if ("${LIBICUDATA_SO}" STREQUAL "") FILE(GLOB LIBICUDATA_SO "/usr/lib/*/libicudata.so.[0-9][0-9]") endif() set_target_properties( libicudata PROPERTIES IMPORTED_LOCATION ${LIBICUDATA_SO} ) add_library( libicui18n SHARED IMPORTED ) FILE(GLOB LIBICUI18N_SO "${Qt5_DIR}/../../libicui18n.so.[0-9][0-9]") if ("${LIBICUI18N_SO}" STREQUAL "") FILE(GLOB LIBICUI18N_SO "/usr/lib/*/libicui18n.so.[0-9][0-9]") endif() set_target_properties( libicui18n PROPERTIES IMPORTED_LOCATION ${LIBICUI18N_SO} ) add_library( libicuuc SHARED IMPORTED ) FILE(GLOB LIBICUUC_SO "${Qt5_DIR}/../../libicuuc.so.[0-9][0-9]") if ("${LIBICUUC_SO}" STREQUAL "") FILE(GLOB LIBICUUC_SO "/usr/lib/*/libicuuc.so.[0-9][0-9]") endif() set_target_properties( libicuuc PROPERTIES IMPORTED_LOCATION ${LIBICUUC_SO} ) TARGET_LINK_LIBRARIES(${GCOMPRIS_EXECUTABLE_NAME} libicudata libicui18n libicuuc) endif() endif(BUILD_STANDALONE) # Hack: do not fixup Qt and Qml plugins on Windows because fixup_bundle takes ages (cmake bug ?) -> Johnny : we need this even if it takes time because some required dependencies are pulled here #if(WIN32) set(GCOMPRIS_OTHER_LIBS "") endif() # install fixup_bundle script to resolve and fixup runtime dependencies if(BUILD_STANDALONE AND NOT ANDROID) configure_file(${CMAKE_SOURCE_DIR}/cmake/FixBundle.cmake.in FixBundle.cmake) install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake) # install a startup script for linux bundle if(UNIX AND NOT APPLE AND NOT SAILFISHOS) install(PROGRAMS ../../tools/gcompris-qt.sh DESTINATION bin) endif() endif() if(WIN32 AND NOT MINGW) # install libEGL.dll, libGLESv2.dll, d3dcompiler_47.dll from Qt installation. Not sure if there is a clean way to get them... # Qt5_Dir is like C:/Qt/Qt5.5.1/5.5/mingw492_32/lib/cmake/Qt5 install(FILES ${Qt5_DIR}/../../../bin/libEGL.dll DESTINATION bin) install(FILES ${Qt5_DIR}/../../../bin/libGLESv2.dll DESTINATION bin) install(FILES ${Qt5_DIR}/../../../bin/d3dcompiler_47.dll DESTINATION bin) target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} ${Qt5_DIR}/../../libEGL.lib) target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} ${Qt5_DIR}/../../libGLESv2.lib) install(FILES ${Qt5_DIR}/../../../bin/opengl32sw.dll DESTINATION bin) # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS contains visual c++ libraries install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin) endif() # Packaging # ========= set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GCompris is a high quality educational software suite, including a large number of activities for children aged 2 to 10.") set(CPACK_PACKAGE_VERSION_MAJOR ${GCOMPRIS_MAJOR_VERSION}) set(CPACK_PACKAGE_VERSION_MINOR ${GCOMPRIS_MINOR_VERSION}) set(CPACK_PACKAGE_VERSION_PATCH ${GCOMPRIS_PATCH_VERSION}) set(CPACK_PACKAGE_VERSION ${GCOMPRIS_VERSION}) set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README") if(WIN32) set(CPACK_PACKAGE_INSTALL_DIRECTORY "${GCOMPRIS_EXECUTABLE_NAME}-Qt") set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${GCOMPRIS_EXECUTABLE_NAME}-Qt") set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/installer\\\\gcompris-header.bmp") set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/installer\\\\GCompris-install.ico") set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/installer\\\\GCompris-uninstall.ico") set(CPACK_NSIS_EXECUTABLES_DIRECTORY "bin") set(CPACK_PACKAGE_EXECUTABLES "${GCOMPRIS_EXECUTABLE_NAME};GCompris") set(CPACK_CREATE_DESKTOP_LINKS "${GCOMPRIS_EXECUTABLE_NAME};GCompris") set(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\\\\\gcompris.net") set(CPACK_NSIS_DISPLAY_NAME "GCompris Educational Software") set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${GCOMPRIS_EXECUTABLE_NAME}") set(CPACK_PACKAGE_VENDOR "GCompris team") # Create shortcuts in menu to be able to launch in software or opengl mode list(APPEND CPACK_NSIS_CREATE_ICONS_EXTRA " CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\GCompris (Safe Mode).lnk' '$INSTDIR\\\\bin\\\\${GCOMPRIS_EXECUTABLE_NAME}.exe' '--software-renderer'") list(APPEND CPACK_NSIS_CREATE_ICONS_EXTRA " CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\GCompris.lnk' '$INSTDIR\\\\bin\\\\${GCOMPRIS_EXECUTABLE_NAME}.exe' '--opengl-renderer'") string (REPLACE ";" "\n" CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA}") else(WIN32) set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/GCompris64.png") endif() if(APPLE) set(CPACK_GENERATOR "DragNDrop") set(CPACK_DMG_DS_STORE "${GCOMPRIS_RESOURCES}/dmg_DS_Store") set(CPACK_DMG_BACKGROUND_IMAGE "${GCOMPRIS_RESOURCES}/dmg_background.png") elseif(WIN32) set(CPACK_GENERATOR "NSIS") elseif(SAILFISHOS) configure_file(${PROJECT_SOURCE_DIR}/platforms/sailfishOS/harbour-gcompris-qt.spec.cmake ${CMAKE_BINARY_DIR}/harbour-gcompris-qt.spec @ONLY) install(FILES ${PROJECT_SOURCE_DIR}/platforms/sailfishOS/harbour-gcompris-qt.desktop DESTINATION share/applications) install(FILES ${PROJECT_SOURCE_DIR}/platforms/sailfishOS/harbour-gcompris-qt.png DESTINATION share/icons/hicolor/86x86/apps) set(CPACK_RPM_PACKAGE_SUMMARY "gcompris-qt") # BUILD_ARCH is either armv7hl or i486 set(CPACK_RPM_PACKAGE_ARCHITECTURE "${BUILD_ARCH}") set(CPACK_RPM_PACKAGE_NAME "${GCOMPRIS_EXECUTABLE_NAME}") set(CPACK_RPM_PACKAGE_VERSION "${GCOMPRIS_VERSION}") set(CPACK_RPM_PACKAGE_LICENSED "GPLv3") set(CPACK_RPM_PACKAGE_URL "https://www.gcompris.org") set(CPACK_RPM_PACKAGE_DESCRIPTION "GCompris is a high quality educational software suite comprising of numerous activities for children aged 2 to 10.") set(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_BINARY_DIR}/harbour-gcompris-qt.spec") set(CMAKE_INSTALL_PREFIX "/usr") set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") set(CPACK_GENERATOR "RPM") else() set(CPACK_GENERATOR "STGZ") endif() include(CPack)