2017-02-10 23:03:33 +01:00
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 3.2)
|
|
|
|
|
2017-02-25 17:01:04 +01:00
|
|
|
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
2017-07-30 00:16:54 +02:00
|
|
|
set (CMAKE_CXX_STANDARD 11)
|
2017-02-25 17:01:04 +01:00
|
|
|
|
2017-10-15 17:46:30 +02:00
|
|
|
include (GNUInstallDirs)
|
2017-02-10 23:03:33 +01:00
|
|
|
include (${CMAKE_ROOT}/Modules/ExternalProject.cmake)
|
|
|
|
|
2017-02-22 22:57:31 +01:00
|
|
|
include_directories (${CMAKE_INSTALL_PREFIX}/include)
|
|
|
|
link_directories (${CMAKE_INSTALL_PREFIX}/lib)
|
|
|
|
|
2017-02-10 23:03:33 +01:00
|
|
|
project (planetblupi)
|
2017-08-09 07:26:24 +02:00
|
|
|
set (PB_VERSION_MAJOR 1)
|
2017-10-09 16:17:47 +02:00
|
|
|
set (PB_VERSION_MINOR 11)
|
2017-09-22 13:09:05 +02:00
|
|
|
set (PB_VERSION_PATCH 0)
|
2017-09-08 18:22:51 +02:00
|
|
|
set (PB_VERSION_EXTRA "")
|
2017-08-21 18:29:11 +02:00
|
|
|
set (PB_PRODUCT_NAME "Planet Blupi")
|
|
|
|
set (PB_PACKAGE_NAME "planetblupi")
|
2017-10-21 09:51:54 +02:00
|
|
|
set (PB_EXEC "planetblupi")
|
|
|
|
set (PB_ICON_REF "blupi")
|
2017-10-20 17:54:20 +02:00
|
|
|
set (PB_DESCRIPTION "Planet Blupi - A delirious spell-binding game")
|
2017-02-10 23:03:33 +01:00
|
|
|
|
2017-10-20 17:40:31 +02:00
|
|
|
option (PB_HTTP_VERSION_CHECK "Run a version check over HTTP (with CURL)" OFF)
|
2017-10-20 16:04:46 +02:00
|
|
|
|
2017-02-28 22:39:26 +01:00
|
|
|
configure_file (
|
|
|
|
"${PROJECT_SOURCE_DIR}/src/config.h.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/include/config.h"
|
|
|
|
)
|
|
|
|
|
|
|
|
include_directories ("${PROJECT_BINARY_DIR}/include")
|
|
|
|
|
2017-02-26 10:46:11 +01:00
|
|
|
file (GLOB_RECURSE sources src/*.cxx src/*.h)
|
2017-02-15 22:02:59 +01:00
|
|
|
file (GLOB_RECURSE po resources/po/*.po)
|
2017-02-26 00:04:23 +01:00
|
|
|
|
|
|
|
if (APPIMAGE_APPRUN_PROGRAM AND APPIMAGE_ASSISTANT_PROGRAM)
|
|
|
|
set (USE_APPIMAGE ON)
|
|
|
|
endif ()
|
|
|
|
|
2017-10-21 09:39:18 +02:00
|
|
|
if (NOT USE_APPIMAGE)
|
|
|
|
configure_file (
|
|
|
|
"${PROJECT_SOURCE_DIR}/resources/linux/application.desktop.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/${PB_PACKAGE_NAME}.desktop"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2017-02-26 00:04:23 +01:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -L${CMAKE_INSTALL_PREFIX}/lib")
|
|
|
|
endif ()
|
|
|
|
|
2017-09-12 23:32:41 +02:00
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${STATIC_BUILD}")
|
2017-02-18 23:43:19 +01:00
|
|
|
set (CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
|
|
|
|
endif ()
|
|
|
|
|
2017-07-30 22:21:56 +02:00
|
|
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
|
|
|
|
endif ()
|
|
|
|
|
2017-09-08 18:07:37 +02:00
|
|
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
2017-02-26 00:04:55 +01:00
|
|
|
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
|
|
|
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
|
|
|
|
endif ()
|
|
|
|
|
2017-08-21 18:27:50 +02:00
|
|
|
# These copies are necessary with our stuff for AppImage because it's not
|
|
|
|
# supported by CPack.
|
|
|
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
|
|
|
file (COPY resources/data DESTINATION share/planetblupi)
|
|
|
|
else ()
|
|
|
|
file (
|
|
|
|
COPY resources/data DESTINATION share/planetblupi
|
|
|
|
PATTERN "world2*.blp" EXCLUDE
|
|
|
|
PATTERN "world*.dev.blp" EXCLUDE
|
|
|
|
)
|
|
|
|
endif ()
|
2017-02-18 17:58:52 +01:00
|
|
|
file (COPY resources/image DESTINATION share/planetblupi)
|
|
|
|
file (COPY resources/movie DESTINATION share/planetblupi)
|
|
|
|
file (COPY resources/sound DESTINATION share/planetblupi)
|
|
|
|
file (COPY resources/music DESTINATION share/planetblupi)
|
2017-08-27 16:16:13 +02:00
|
|
|
file (COPY LICENSE.all DESTINATION share/doc/planetblupi)
|
|
|
|
file (RENAME "${CMAKE_BINARY_DIR}/share/doc/planetblupi/LICENSE.all"
|
|
|
|
"${CMAKE_BINARY_DIR}/share/doc/planetblupi/copyright")
|
2017-08-03 14:28:29 +02:00
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
file (COPY resources/icon/hicolor DESTINATION share/icons)
|
|
|
|
endif ()
|
2017-02-10 23:03:33 +01:00
|
|
|
|
2017-02-23 19:35:00 +01:00
|
|
|
# Windows stuff
|
|
|
|
|
|
|
|
if (MINGW)
|
2017-08-22 21:39:46 +02:00
|
|
|
file (COPY resources/icon/blupi.ico DESTINATION "${CMAKE_BINARY_DIR}")
|
2017-08-22 13:05:35 +02:00
|
|
|
configure_file (
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/resources/win32/planetblupi.rc.in"
|
|
|
|
"${CMAKE_BINARY_DIR}/planetblupi.rc"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
|
|
|
list (APPEND sources "${CMAKE_BINARY_DIR}/planetblupi.rc")
|
|
|
|
|
2017-02-23 19:35:00 +01:00
|
|
|
set (CMAKE_RC_COMPILER_INIT windres)
|
|
|
|
enable_language (RC)
|
|
|
|
set (CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
|
2017-08-29 18:04:35 +02:00
|
|
|
|
2017-09-04 18:01:25 +02:00
|
|
|
# Remove cmd window when executing planetblupi
|
2017-08-29 18:04:35 +02:00
|
|
|
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mwindows")
|
2017-02-23 19:35:00 +01:00
|
|
|
endif (MINGW)
|
|
|
|
|
2017-02-10 23:03:33 +01:00
|
|
|
# Dependencies
|
|
|
|
|
2017-09-13 00:03:20 +02:00
|
|
|
if ("${STATIC_BUILD}")
|
|
|
|
set (CMAKE_INCLUDE_PATH ${CMAKE_INSTALL_PREFIX}/include)
|
|
|
|
set (CMAKE_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib)
|
|
|
|
endif ()
|
2017-09-12 23:46:02 +02:00
|
|
|
|
2017-02-10 23:03:33 +01:00
|
|
|
find_package (Intl REQUIRED)
|
2017-09-12 23:46:02 +02:00
|
|
|
include_directories (${Intl_INCLUDE_DIRS})
|
|
|
|
|
2017-03-21 19:52:33 +01:00
|
|
|
find_package (Iconv REQUIRED)
|
2017-09-12 23:46:02 +02:00
|
|
|
include_directories (${Iconv_INCLUDE_DIRS})
|
|
|
|
|
2017-09-11 21:49:56 +02:00
|
|
|
find_package (Argagg REQUIRED)
|
2017-09-12 23:46:02 +02:00
|
|
|
include_directories (${Argagg_INCLUDE_DIRS})
|
|
|
|
|
2017-09-11 22:24:37 +02:00
|
|
|
find_package (SDLKitchensink REQUIRED)
|
2017-09-12 23:46:02 +02:00
|
|
|
include_directories (${SDLKitchensink_INCLUDE_DIRS})
|
2017-02-10 23:03:33 +01:00
|
|
|
|
|
|
|
find_package (PkgConfig REQUIRED)
|
2017-02-22 22:57:31 +01:00
|
|
|
pkg_search_module (SDL2 REQUIRED sdl2)
|
2017-02-10 23:03:33 +01:00
|
|
|
pkg_search_module (SDL2_MIXER REQUIRED SDL2_mixer)
|
2017-02-12 22:06:08 +01:00
|
|
|
pkg_search_module (SDL2_IMAGE REQUIRED SDL2_image)
|
2017-10-20 17:40:31 +02:00
|
|
|
if (${PB_HTTP_VERSION_CHECK})
|
2017-10-20 16:04:46 +02:00
|
|
|
pkg_search_module (CURL REQUIRED libcurl)
|
2017-10-20 17:40:31 +02:00
|
|
|
add_definitions (-DUSE_CURL)
|
|
|
|
endif ()
|
2017-02-10 23:03:33 +01:00
|
|
|
|
2017-09-12 23:32:41 +02:00
|
|
|
if ("${STATIC_BUILD}")
|
|
|
|
pkg_search_module (PNG REQUIRED libpng)
|
|
|
|
# Static dependencies for SDL_kitchensink
|
|
|
|
pkg_search_module (AVCODEC REQUIRED libavcodec)
|
|
|
|
pkg_search_module (AVFORMAT REQUIRED libavformat)
|
|
|
|
pkg_search_module (AVUTIL REQUIRED libavutil)
|
|
|
|
pkg_search_module (SWSCALE REQUIRED libswscale)
|
|
|
|
pkg_search_module (SWRESAMPLE REQUIRED libswresample)
|
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
pkg_search_module (ALSA REQUIRED alsa)
|
|
|
|
pkg_search_module (PULSE REQUIRED libpulse)
|
|
|
|
endif ()
|
|
|
|
|
2017-10-20 17:40:31 +02:00
|
|
|
if (${PB_HTTP_VERSION_CHECK})
|
2017-10-20 16:04:46 +02:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURL_STATICLIB")
|
|
|
|
endif ()
|
2017-09-08 23:17:35 +02:00
|
|
|
endif ()
|
|
|
|
|
2017-02-14 23:47:24 +01:00
|
|
|
###########################
|
|
|
|
## Main binary dependencies
|
|
|
|
###########################
|
2017-02-10 23:03:33 +01:00
|
|
|
|
2017-08-22 13:24:47 +02:00
|
|
|
add_executable (planetblupi ${sources})
|
|
|
|
|
2017-09-12 23:32:41 +02:00
|
|
|
if ("${STATIC_BUILD}")
|
2017-09-13 00:03:51 +02:00
|
|
|
set (planetblupi_DEPS
|
|
|
|
${Intl_LIBRARIES}
|
|
|
|
${Iconv_LIBRARIES}
|
2017-09-12 23:32:41 +02:00
|
|
|
${SDL2_STATIC_LIBRARIES}
|
|
|
|
${SDL2_MIXER_STATIC_LIBRARIES}
|
|
|
|
${SDL2_IMAGE_STATIC_LIBRARIES}
|
|
|
|
${SDLKitchensink_STATIC_LIBRARIES}
|
|
|
|
${PNG_STATIC_LIBRARIES}
|
|
|
|
${AVCODEC_STATIC_LIBRARIES}
|
|
|
|
${AVFORMAT_STATIC_LIBRARIES}
|
|
|
|
${AVUTIL_STATIC_LIBRARIES}
|
|
|
|
${SWSCALE_STATIC_LIBRARIES}
|
|
|
|
${SWRESAMPLE_STATIC_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2017-10-20 17:40:31 +02:00
|
|
|
if (${PB_HTTP_VERSION_CHECK})
|
2017-10-20 17:41:40 +02:00
|
|
|
list (APPEND planetblupi_DEPS
|
2017-10-20 16:04:46 +02:00
|
|
|
${CURL_STATIC_LIBRARIES}
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2017-09-12 23:32:41 +02:00
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
list (APPEND planetblupi_DEPS
|
|
|
|
${ALSA_STATIC_LIBRARIES}
|
|
|
|
${PULSE_STATIC_LIBRARIES}
|
|
|
|
)
|
|
|
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_INSTALL_PREFIX}/lib/pulseaudio")
|
|
|
|
endif ()
|
|
|
|
else ()
|
2017-09-13 00:03:51 +02:00
|
|
|
set (planetblupi_DEPS
|
2017-09-12 23:32:41 +02:00
|
|
|
${SDL2_LIBRARIES}
|
|
|
|
${SDL2_MIXER_LIBRARIES}
|
|
|
|
${SDL2_IMAGE_LIBRARIES}
|
|
|
|
${CURL_LIBRARIES}
|
|
|
|
${SDLKitchensink_LIBRARIES}
|
2017-09-16 22:38:24 +02:00
|
|
|
pthread
|
2017-09-09 00:31:21 +02:00
|
|
|
)
|
2017-10-20 16:04:46 +02:00
|
|
|
|
2017-10-20 17:40:31 +02:00
|
|
|
if (${PB_HTTP_VERSION_CHECK})
|
2017-10-20 17:41:40 +02:00
|
|
|
list (APPEND planetblupi_DEPS
|
2017-10-20 16:04:46 +02:00
|
|
|
${CURL_LIBRARIES}
|
|
|
|
)
|
|
|
|
endif ()
|
2017-09-08 23:17:35 +02:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
target_link_libraries (planetblupi PUBLIC ${planetblupi_DEPS})
|
|
|
|
|
2017-02-14 23:47:24 +01:00
|
|
|
##########
|
2017-02-13 23:05:49 +01:00
|
|
|
## GetText
|
2017-02-14 23:47:24 +01:00
|
|
|
##########
|
2017-02-13 23:05:49 +01:00
|
|
|
|
|
|
|
find_package (Gettext)
|
|
|
|
|
2017-02-15 22:02:59 +01:00
|
|
|
set (_potFile ${CMAKE_CURRENT_SOURCE_DIR}/resources/po/${PROJECT_NAME}.pot)
|
2017-02-13 23:05:49 +01:00
|
|
|
|
|
|
|
add_custom_command (OUTPUT ${_potFile}
|
2017-08-28 22:03:55 +02:00
|
|
|
COMMAND xgettext --no-location --keyword=translate -o ${_potFile} ${sources}
|
2017-07-09 00:18:07 +02:00
|
|
|
DEPENDS ${sources}
|
2017-02-14 23:08:21 +01:00
|
|
|
COMMENT "Extract translatable messages to ${_potFile}"
|
2017-02-13 23:05:49 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target (pot_file ALL ${_all}
|
2017-02-14 23:08:21 +01:00
|
|
|
DEPENDS ${_potFile}
|
2017-02-13 23:05:49 +01:00
|
|
|
)
|
|
|
|
|
2017-02-14 23:08:21 +01:00
|
|
|
gettext_create_translations (${_potFile} ALL ${po})
|
2017-02-14 23:47:12 +01:00
|
|
|
|
|
|
|
## Put mo files to appropriate directory
|
2017-02-15 23:11:23 +01:00
|
|
|
foreach (file ${_gmoFiles})
|
|
|
|
get_filename_component (_lang ${file} NAME_WE)
|
2017-02-21 22:35:48 +01:00
|
|
|
set (_out "share/locale/${_lang}/LC_MESSAGES")
|
2017-02-15 23:11:23 +01:00
|
|
|
|
|
|
|
add_custom_command (OUTPUT ${_out}/planetblupi.mo
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${_out}/planetblupi.mo
|
2017-08-28 22:01:34 +02:00
|
|
|
DEPENDS translations ${file}
|
2017-02-15 23:11:23 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target ("po-${_lang}" ALL ${_all}
|
|
|
|
DEPENDS ${_out}/planetblupi.mo
|
|
|
|
)
|
2017-07-09 00:18:07 +02:00
|
|
|
|
|
|
|
add_dependencies (planetblupi "po-${_lang}")
|
2017-02-15 23:11:23 +01:00
|
|
|
endforeach (file)
|
2017-02-22 22:57:43 +01:00
|
|
|
|
2017-09-04 18:01:25 +02:00
|
|
|
##############
|
2017-02-22 22:57:43 +01:00
|
|
|
# Installation
|
2017-09-04 18:01:25 +02:00
|
|
|
##############
|
2017-02-22 22:57:43 +01:00
|
|
|
|
|
|
|
install (TARGETS planetblupi
|
2017-10-15 17:46:30 +02:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
2017-02-22 22:57:43 +01:00
|
|
|
)
|
|
|
|
|
2017-08-19 23:42:26 +02:00
|
|
|
install (
|
|
|
|
DIRECTORY resources/data DESTINATION share/planetblupi
|
|
|
|
PATTERN "world2*.blp" EXCLUDE
|
2017-08-20 21:44:57 +02:00
|
|
|
PATTERN "world*.dev.blp" EXCLUDE
|
2017-08-19 23:42:26 +02:00
|
|
|
)
|
|
|
|
install (
|
|
|
|
DIRECTORY resources/data DESTINATION share/planetblupi
|
|
|
|
CONFIGURATIONS Debug
|
|
|
|
PATTERN "world2*.blp"
|
2017-08-20 21:44:57 +02:00
|
|
|
PATTERN "world*.dev.blp"
|
2017-08-19 23:42:26 +02:00
|
|
|
)
|
2017-02-22 22:57:43 +01:00
|
|
|
install (DIRECTORY resources/image DESTINATION share/planetblupi)
|
|
|
|
install (DIRECTORY resources/movie DESTINATION share/planetblupi)
|
|
|
|
install (DIRECTORY resources/sound DESTINATION share/planetblupi)
|
|
|
|
install (DIRECTORY resources/music DESTINATION share/planetblupi)
|
2017-08-27 16:16:13 +02:00
|
|
|
install (FILES LICENSE.all DESTINATION share/doc/planetblupi RENAME copyright)
|
2017-08-03 14:00:29 +02:00
|
|
|
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
install (DIRECTORY resources/icon/hicolor DESTINATION share/icons)
|
|
|
|
endif ()
|
2017-02-25 17:01:04 +01:00
|
|
|
|
2017-10-21 09:39:18 +02:00
|
|
|
if (NOT USE_APPIMAGE)
|
|
|
|
install (
|
|
|
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PB_PACKAGE_NAME}.desktop
|
2017-10-21 09:51:54 +02:00
|
|
|
DESTINATION share/applications
|
2017-10-21 09:39:18 +02:00
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2017-07-28 16:13:39 +02:00
|
|
|
# Copy libwinpthread-1.dll which seems not be linkable statically
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND MINGW)
|
|
|
|
execute_process (COMMAND cygpath.exe --windows /mingw64 OUTPUT_VARIABLE MINGW64_PATH)
|
|
|
|
string (REGEX REPLACE "[ \t\n\r]+$" "" MINGW64_PATH "${MINGW64_PATH}")
|
|
|
|
string (REGEX REPLACE "[\\]" "\\\\\\\\" MINGW64_PATH "${MINGW64_PATH}")
|
|
|
|
install (FILES "${MINGW64_PATH}\\\\bin\\\\libwinpthread-1.dll" DESTINATION bin)
|
|
|
|
endif ()
|
|
|
|
|
2017-02-25 17:01:04 +01:00
|
|
|
#########
|
|
|
|
## Deploy
|
|
|
|
#########
|
|
|
|
|
2017-09-12 23:32:41 +02:00
|
|
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND "${STATIC_BUILD}")
|
2017-09-08 18:07:37 +02:00
|
|
|
# set (CPACK_STRIP_FILES TRUE)
|
2017-08-21 18:29:11 +02:00
|
|
|
set (CPACK_PACKAGE_NAME ${PB_PACKAGE_NAME})
|
2017-08-03 14:00:29 +02:00
|
|
|
set (CPACK_PACKAGE_VENDOR "blupi.org")
|
2017-08-21 18:29:11 +02:00
|
|
|
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PB_DESCRIPTION})
|
2017-09-05 17:55:38 +02:00
|
|
|
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
2017-08-15 16:55:03 +02:00
|
|
|
# set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README-user.md")
|
2017-08-21 18:29:11 +02:00
|
|
|
set (CPACK_PACKAGE_FILE_NAME ${PB_PACKAGE_NAME})
|
2017-08-29 18:36:30 +02:00
|
|
|
set (CPACK_PACKAGE_VERSION "${PB_VERSION_MAJOR}.${PB_VERSION_MINOR}.${PB_VERSION_PATCH}${PB_VERSION_EXTRA}")
|
2017-08-21 18:29:11 +02:00
|
|
|
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${PB_PRODUCT_NAME})
|
2017-08-03 14:00:29 +02:00
|
|
|
set (CPACK_PACKAGE_EXECUTABLES "planetblupi;Planet Blupi")
|
|
|
|
|
2017-07-28 15:29:25 +02:00
|
|
|
if (USE_APPIMAGE)
|
|
|
|
include (LinuxAppImageBuild)
|
|
|
|
set (CMAKE_PACKAGED_OUTPUT_PREFIX ${CMAKE_INSTALL_PREFIX})
|
2017-10-21 09:51:54 +02:00
|
|
|
APPIMAGE_PACKAGE (planetblupi ${PB_PACKAGE_NAME} ${PB_PRODUCT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/resources/linux" "${CMAKE_BINARY_DIR}/share" "" "" ${PB_ICON_REF})
|
2017-08-02 18:32:54 +02:00
|
|
|
elseif (MINGW)
|
2017-09-08 18:08:05 +02:00
|
|
|
set (INSTALLER_FILE_NAME "${PB_PACKAGE_NAME}-${PB_VERSION_MAJOR}.${PB_VERSION_MINOR}.${PB_VERSION_PATCH}${PB_VERSION_EXTRA}")
|
|
|
|
set (CPACK_PACKAGE_FILE_NAME "${INSTALLER_FILE_NAME}")
|
2017-08-03 14:14:07 +02:00
|
|
|
set (CPACK_GENERATOR "NSIS64")
|
2017-07-28 18:03:58 +02:00
|
|
|
set (CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\resources\\\\nsis\\\\installer.bmp")
|
2017-07-28 15:58:41 +02:00
|
|
|
set (CPACK_NSIS_COMPRESSOR "/SOLID lzma")
|
|
|
|
set (CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\planetblupi.exe")
|
2017-09-02 23:50:47 +02:00
|
|
|
set (CPACK_NSIS_URL_INFO_ABOUT "http://www.blupi.org")
|
2017-07-28 17:39:42 +02:00
|
|
|
set (CPACK_NSIS_MUI_FINISHPAGE_RUN "planetblupi")
|
2017-07-28 15:29:25 +02:00
|
|
|
include (CPack)
|
2017-09-08 18:08:05 +02:00
|
|
|
|
|
|
|
find_program (SIGNTOOL_EXECUTABLE signtool)
|
2017-09-08 19:08:51 +02:00
|
|
|
if (SIGN_APP AND SIGNTOOL_EXECUTABLE)
|
2017-09-08 18:08:05 +02:00
|
|
|
add_custom_command (TARGET planetblupi
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${SIGNTOOL_EXECUTABLE}
|
|
|
|
sign -a -fd sha1 -t http://time.certum.pl -v
|
|
|
|
"${CMAKE_BINARY_DIR}/planetblupi.exe")
|
|
|
|
endif ()
|
|
|
|
|
2017-08-02 18:32:54 +02:00
|
|
|
add_custom_command (TARGET planetblupi
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND make package)
|
2017-09-08 18:08:05 +02:00
|
|
|
|
2017-09-08 19:08:51 +02:00
|
|
|
if (SIGN_APP AND SIGNTOOL_EXECUTABLE)
|
2017-09-08 18:08:05 +02:00
|
|
|
add_custom_command (TARGET planetblupi
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${SIGNTOOL_EXECUTABLE}
|
|
|
|
sign -a -fd sha1 -t http://time.certum.pl
|
|
|
|
"${CMAKE_BINARY_DIR}/${INSTALLER_FILE_NAME}.exe")
|
|
|
|
endif ()
|
2017-08-03 14:00:29 +02:00
|
|
|
elseif (APPLE)
|
|
|
|
set (CPACK_GENERATOR "Bundle")
|
|
|
|
set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/darwin/icon.icns")
|
2017-08-21 18:29:11 +02:00
|
|
|
set (CPACK_BUNDLE_NAME ${PB_PRODUCT_NAME})
|
2017-08-03 14:00:29 +02:00
|
|
|
set (CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/Info.plist")
|
|
|
|
set (CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/resources/darwin/Planet Blupi")
|
2017-09-08 19:09:09 +02:00
|
|
|
if (SIGN_APP)
|
|
|
|
set (CPACK_BUNDLE_APPLE_CERT_APP "Developer ID Application: Mathieu Schroeter")
|
|
|
|
endif ()
|
2017-08-29 18:36:30 +02:00
|
|
|
set (CPACK_PACKAGE_FILE_NAME "planetblupi-${PB_VERSION_MAJOR}.${PB_VERSION_MINOR}.${PB_VERSION_PATCH}${PB_VERSION_EXTRA}")
|
2017-08-03 14:00:29 +02:00
|
|
|
|
2017-08-15 16:23:45 +02:00
|
|
|
set (CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/resources/darwin/background.tiff")
|
|
|
|
set (CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/resources/darwin/dmgsetup.scpt")
|
|
|
|
|
2017-08-29 18:36:30 +02:00
|
|
|
set (BUNDLE_VERSION "${PB_VERSION_MAJOR}.${PB_VERSION_MINOR}.${PB_VERSION_PATCH}${PB_VERSION_EXTRA}")
|
2017-08-03 14:00:29 +02:00
|
|
|
set (BUNDLE_IDENTIFIER "org.blupi.planet")
|
|
|
|
set (BUNDLE_ICON_REF "Planet Blupi")
|
|
|
|
|
|
|
|
configure_file (
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/resources/darwin/Info.plist.in"
|
|
|
|
"${CMAKE_BINARY_DIR}/Info.plist"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
|
|
|
include (CPack)
|
2017-08-03 14:57:48 +02:00
|
|
|
add_custom_command (TARGET planetblupi
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND make package)
|
2017-07-28 15:29:25 +02:00
|
|
|
endif ()
|
2017-02-25 17:01:04 +01:00
|
|
|
endif ()
|