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)
|
2018-08-05 14:36:35 +02:00
|
|
|
include ("${CMAKE_SOURCE_DIR}/cmake/Ronn2Man.cmake")
|
2017-02-10 23:03:33 +01:00
|
|
|
|
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)
|
2022-10-30 21:11:13 +01:00
|
|
|
set (PB_VERSION_MINOR 15)
|
|
|
|
set (PB_VERSION_PATCH 0)
|
|
|
|
set (PB_VERSION_EXTRA "-rc1")
|
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")
|
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
if (BUILD_JS)
|
|
|
|
file (GLOB sources src/*.cxx src/*.h src/json/* src/platform/*_js.*)
|
|
|
|
else ()
|
|
|
|
file (GLOB sources src/*.cxx src/*.h src/json/* src/platform/*_sdl.*)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
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 ()
|
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
set (planetblupi_OUTPUT planetblupi)
|
|
|
|
|
|
|
|
if (NOT DEFINED BUILD_LINUX)
|
|
|
|
set (BUILD_LINUX UNIX AND NOT APPLE)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (BUILD_JS)
|
|
|
|
set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${EMSCRIPTEN_FLAGS})
|
|
|
|
set (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "--preload-file share")
|
|
|
|
set (planetblupi_OUTPUT planetblupi.html)
|
|
|
|
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}")
|
2018-07-18 18:29:55 +02:00
|
|
|
set (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-static-libgcc -static-libstdc++")
|
2017-02-18 23:43:19 +01:00
|
|
|
endif ()
|
|
|
|
|
2017-07-30 22:21:56 +02:00
|
|
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
2017-10-30 17:36:09 +01:00
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3 -DDEBUG")
|
2017-07-30 22:21:56 +02:00
|
|
|
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)
|
2022-09-26 23:14:09 +02:00
|
|
|
file (COPY resources/fonts DESTINATION share/planetblupi)
|
2019-01-13 00:23:11 +01:00
|
|
|
if (NOT BUILD_JS)
|
|
|
|
file (COPY resources/movie DESTINATION share/planetblupi)
|
|
|
|
endif ()
|
2017-02-18 17:58:52 +01:00
|
|
|
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)
|
2019-02-21 21:15:30 +01:00
|
|
|
file (COPY COPYING DESTINATION share/doc/planetblupi)
|
2017-08-27 16:16:13 +02:00
|
|
|
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
|
|
|
|
2018-07-20 14:54:08 +02:00
|
|
|
if (BUILD_LINUX)
|
2017-08-03 14:28:29 +02:00
|
|
|
file (COPY resources/icon/hicolor DESTINATION share/icons)
|
2019-02-26 22:35:15 +01:00
|
|
|
file (
|
2022-07-13 00:25:43 +02:00
|
|
|
COPY resources/linux/org.blupi.${PB_PACKAGE_NAME}.appdata.xml
|
2019-02-26 22:35:15 +01:00
|
|
|
DESTINATION share/metainfo
|
|
|
|
)
|
2017-08-03 14:28:29 +02:00
|
|
|
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)
|
2018-07-18 18:29:55 +02:00
|
|
|
if (NOT BUILD_JS)
|
2022-07-13 00:27:52 +02:00
|
|
|
find_package (SDL2 REQUIRED)
|
|
|
|
#include_directories (${SDL2_INCLUDE_DIRS})
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS} SDL2::Main)
|
|
|
|
find_package (SDL2_image REQUIRED)
|
|
|
|
#include_directories (${SDL2_IMAGE_INCLUDE_DIRS})
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS} SDL2::Image)
|
|
|
|
find_package (SDL2_ttf REQUIRED)
|
|
|
|
#include_directories (${SDL2_TTF_INCLUDE_DIRS})
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS} SDL2::TTF)
|
|
|
|
find_package (SDL2_mixer REQUIRED)
|
|
|
|
#include_directories (${SDL2_MIXER_INCLUDE_DIRS})
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS} SDL2::Mixer)
|
2018-07-18 18:29:55 +02:00
|
|
|
endif ()
|
|
|
|
|
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}")
|
|
|
|
# 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)
|
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
if (NOT BUILD_JS)
|
|
|
|
pkg_search_module (PNG REQUIRED libpng)
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS} ${PNG_STATIC_LIBRARIES})
|
|
|
|
|
|
|
|
# Static dependencies for SDL_mixer
|
|
|
|
pkg_search_module (VORBIS REQUIRED vorbisfile)
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS} ${VORBIS_STATIC_LIBRARIES})
|
|
|
|
|
|
|
|
if (BUILD_LINUX)
|
|
|
|
pkg_search_module (ALSA REQUIRED alsa)
|
|
|
|
pkg_search_module (PULSE REQUIRED libpulse)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS}
|
|
|
|
${Intl_LIBRARIES}
|
|
|
|
${Iconv_LIBRARIES}
|
|
|
|
)
|
2022-07-13 00:27:52 +02:00
|
|
|
|
|
|
|
# For the static SDL2::TTF
|
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS}
|
|
|
|
-Wl,--allow-multiple-definition
|
|
|
|
-lz
|
|
|
|
-lfreetype
|
|
|
|
-lharfbuzz
|
|
|
|
)
|
2017-09-12 23:32:41 +02:00
|
|
|
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
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
add_executable (${planetblupi_OUTPUT} ${sources})
|
2017-08-22 13:24:47 +02:00
|
|
|
|
2017-09-12 23:32:41 +02:00
|
|
|
if ("${STATIC_BUILD}")
|
2018-07-18 18:29:55 +02:00
|
|
|
set (planetblupi_DEPS ${planetblupi_DEPS}
|
2017-09-12 23:32:41 +02:00
|
|
|
${SDLKitchensink_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 ()
|
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
if (BUILD_LINUX)
|
2017-09-12 23:32:41 +02:00
|
|
|
list (APPEND planetblupi_DEPS
|
|
|
|
${ALSA_STATIC_LIBRARIES}
|
2022-01-14 23:18:15 +01:00
|
|
|
${PULSE_STATIC_LIBRARIES} -lrt
|
2017-09-12 23:32:41 +02:00
|
|
|
)
|
|
|
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_INSTALL_PREFIX}/lib/pulseaudio")
|
|
|
|
endif ()
|
2023-06-16 23:21:46 +02:00
|
|
|
|
|
|
|
if (BUILD_WINDOWS)
|
|
|
|
# Missing SDL2 static dependencies
|
|
|
|
list (APPEND planetblupi_DEPS
|
|
|
|
-lwinmm -limm32 -lsetupapi -lversion
|
|
|
|
)
|
|
|
|
endif ()
|
2017-09-12 23:32:41 +02:00
|
|
|
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}
|
2022-06-24 23:53:18 +02:00
|
|
|
${SDL2_TTF_LIBRARIES}
|
2017-09-12 23:32:41 +02:00
|
|
|
${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 ()
|
|
|
|
|
2023-06-16 23:21:46 +02:00
|
|
|
target_link_libraries (${planetblupi_OUTPUT} PUBLIC ${planetblupi_DEPS})
|
2017-09-08 23:17:35 +02:00
|
|
|
|
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
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
add_dependencies (${planetblupi_OUTPUT} "po-${_lang}")
|
2017-02-15 23:11:23 +01:00
|
|
|
endforeach (file)
|
2017-02-22 22:57:43 +01:00
|
|
|
|
2018-08-05 14:36:35 +02:00
|
|
|
#########
|
|
|
|
# manpage
|
|
|
|
#########
|
|
|
|
|
|
|
|
add_manpage_target ()
|
2018-10-24 08:30:05 +02:00
|
|
|
manpage(${PROJECT_NAME} 6)
|
2018-08-05 14:36:35 +02: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
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
if (NOT BUILD_JS)
|
|
|
|
install (TARGETS ${planetblupi_OUTPUT}
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
)
|
2017-10-21 09:39:18 +02:00
|
|
|
install (
|
2018-07-18 18:29:55 +02:00
|
|
|
DIRECTORY resources/data DESTINATION share/planetblupi
|
|
|
|
PATTERN "world2*.blp" EXCLUDE
|
|
|
|
PATTERN "world*.dev.blp" EXCLUDE
|
2017-10-21 09:39:18 +02:00
|
|
|
)
|
2018-07-18 18:29:55 +02:00
|
|
|
install (
|
|
|
|
DIRECTORY resources/data DESTINATION share/planetblupi
|
|
|
|
CONFIGURATIONS Debug
|
|
|
|
PATTERN "world2*.blp"
|
|
|
|
PATTERN "world*.dev.blp"
|
|
|
|
)
|
|
|
|
install (DIRECTORY resources/image DESTINATION share/planetblupi)
|
2022-09-26 23:14:09 +02:00
|
|
|
install (DIRECTORY resources/fonts DESTINATION share/planetblupi)
|
2018-07-18 18:29:55 +02:00
|
|
|
install (DIRECTORY resources/movie DESTINATION share/planetblupi)
|
|
|
|
install (DIRECTORY resources/sound DESTINATION share/planetblupi)
|
|
|
|
install (DIRECTORY resources/music DESTINATION share/planetblupi)
|
|
|
|
install (FILES LICENSE.all DESTINATION share/doc/planetblupi RENAME copyright)
|
2019-02-21 21:15:30 +01:00
|
|
|
install (FILES COPYING DESTINATION share/doc/planetblupi)
|
2018-07-18 18:29:55 +02:00
|
|
|
|
2019-02-26 22:35:26 +01:00
|
|
|
if (BUILD_LINUX)
|
2018-07-18 18:29:55 +02:00
|
|
|
install (DIRECTORY resources/icon/hicolor DESTINATION share/icons)
|
2019-02-10 00:14:38 +01:00
|
|
|
install (
|
2022-07-13 00:25:43 +02:00
|
|
|
FILES resources/linux/org.blupi.${PB_PACKAGE_NAME}.appdata.xml
|
2019-02-10 00:14:38 +01:00
|
|
|
DESTINATION share/metainfo
|
|
|
|
)
|
2018-07-18 18:29:55 +02:00
|
|
|
endif ()
|
2017-10-21 09:39:18 +02:00
|
|
|
|
2018-07-18 18:29:55 +02:00
|
|
|
if (NOT USE_APPIMAGE)
|
|
|
|
install (
|
|
|
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PB_PACKAGE_NAME}.desktop
|
|
|
|
DESTINATION share/applications
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Copy libwinpthread-1.dll which seems not be linkable statically
|
|
|
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND MINGW)
|
|
|
|
execute_process (COMMAND cygpath.exe --windows $ENV{MINGW_PREFIX} OUTPUT_VARIABLE MINGW_PATH)
|
|
|
|
string (REGEX REPLACE "[ \t\n\r]+$" "" MINGW_PATH "${MINGW_PATH}")
|
|
|
|
string (REGEX REPLACE "[\\]" "\\\\\\\\" MINGW_PATH "${MINGW_PATH}")
|
|
|
|
install (FILES "${MINGW_PATH}\\\\bin\\\\libwinpthread-1.dll" DESTINATION bin)
|
|
|
|
endif ()
|
2018-06-08 07:47:35 +02:00
|
|
|
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})
|
2018-06-06 18:04:14 +02:00
|
|
|
APPIMAGE_PACKAGE (planetblupi ${PB_PACKAGE_NAME} ${PB_PRODUCT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/resources/linux" "${CMAKE_BINARY_DIR}/share" "" "" ${PB_ICON_REF} SIGN_APP)
|
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")
|
2023-06-25 15:37:36 +02:00
|
|
|
set (CPACK_NSIS_URL_INFO_ABOUT "https://www.blupi.org")
|
2017-07-28 17:39:42 +02:00
|
|
|
set (CPACK_NSIS_MUI_FINISHPAGE_RUN "planetblupi")
|
2017-12-01 16:50:03 +01:00
|
|
|
if (SIGN_APP)
|
2023-06-25 15:00:06 +02:00
|
|
|
set (CPACK_NSIS_SIGN_UNINSTALLER "sign -a -fd sha256 -t http://time.certum.pl -v")
|
2017-12-01 16:00:35 +01:00
|
|
|
endif ()
|
|
|
|
|
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}
|
2023-06-25 15:00:06 +02:00
|
|
|
sign -a -fd sha256 -t http://time.certum.pl -v
|
2017-09-08 18:08:05 +02:00
|
|
|
"${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}
|
2023-06-25 15:37:52 +02:00
|
|
|
sign -a -fd sha256 -t http://time.certum.pl
|
2017-09-08 18:08:05 +02:00
|
|
|
"${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 ()
|