The existing scripts for Debian and NSIS packaging were too complex and dealt unnecessarily with lower level details that should be already handled by CMake and CPack. - Packaging-related scripts have been moved to the new cpack/ directory. There, CPack variables common to all generators are defined in cpack/common.cmake, and then generator-specific variables are defined independently (e.g.: cpack/debian.cmake and cpack/nsis.cmake). - Packaging is now optionally done at a second stage, by running `cpack -G <generator>` on the build directory. This removes the requirement to branch based on the system name, and instead all CPack variables are assigned unconditionally. - Since now only one version of the game is packaged, there is no need to maintain the complex scripts in packaging/ and packaging/windows that used to deal with all variants (e.g.: "wip-cars-and-tracks", "hq-cars-and-tracks", etc.). - The use of CPACK_NSIS_EXTRA_INSTALL_COMMANDS, CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS and CPACK_NSIS_CREATE_ICONS_EXTRA should not be required, let alone modifying the HKLM registry manually, since CPack already provides everything required to set up the installer, the uninstaller and shortcuts. - $INSTDIR is not required, since NSIS would already prepend the target installation directory. - PROJECT_VERSION_METADATA is not a standard CMake variable. CMAKE_PROJECT_VERSION_TWEAK is instead meant for this purpose. [1] - OPTION_PACKAGING and OPTION_ALL_IN_ONE_PACKAGING were removed since packaging will always be available, yet optional. Packagers must then run CPack on a second stage, as described above. - Outdated comments were removed to avoid confusion. TODO: - Add shortcut to track editor on NSIS. - dmg packaging was not revamped because of lacking compatible hardware, but still it has been moved to cpack/dmg.cmake. - Windows portable packaging (OPTION_PORTABLE_PACKAGING) has been left out since it required 7z and relied on several hacks to work. Furthermore, portable versions of the game were already not released on the latest release, either. [2] [1]: https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_VERSION_TWEAK.html [2]: https://sourceforge.net/projects/speed-dreams/files/2.3.0/
35 lines
1.7 KiB
CMake
35 lines
1.7 KiB
CMake
# Speed Dreams, a free and open source motorsport simulator.
|
|
# Copyright (C) 2019 Joe Thompson, 2025 Xavier Del Campo Romero
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
set(CPACK_NSIS_INSTALLED_ICON_NAME ${PROJECT_NAME})
|
|
set(CPACK_NSIS_MUI_FINISHPAGE_RUN ${PROJECT_NAME})
|
|
set(CPACK_NSIS_DISPLAY_NAME "Speed Dreams ${CPACK_PACKAGE_VERSION} (engine and tools)")
|
|
set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}")
|
|
set(CPACK_NSIS_HELP_LINK "https://forge.a-lec.org/speed-dreams/")
|
|
set(CPACK_PACKAGE_EXECUTABLES
|
|
${PROJECT_NAME} "${CPACK_NSIS_DISPLAY_NAME}"
|
|
)
|
|
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME})
|
|
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL True)
|
|
|
|
# Extra shortcuts to add in the start menu (a list of pairs : URL, Menu label).
|
|
set(CPACK_NSIS_MENU_LINKS
|
|
"${CMAKE_PROJECT_HOMEPAGE_URL}" "Project website"
|
|
"https://forge.a-lec.org/speed-dreams/" "Project source repositories"
|
|
"/doc/userman/how_to_drive.html" "User manual")
|
|
|
|
if(SD_HAS_DATADIR AND NOT SD_ASSUME_DATADIR)
|
|
set(CPACK_NSIS_MUI_ICON "${SD_DATADIR_ABS}/data/icons/icon.ico")
|
|
set(CPACK_NSIS_MUI_UNIICON "${SD_DATADIR_ABS}/data/icons/icon.ico")
|
|
set(CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${SD_DATADIR_ABS}/data/img/header-vert.bmp")
|
|
set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${SD_DATADIR_ABS}/data/img/header-vert.bmp")
|
|
|
|
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.17")
|
|
set(CPACK_NSIS_MUI_HEADERIMAGE "${SD_DATADIR_ABS}/data/img/header.bmp")
|
|
endif(NOT ${CMAKE_VERSION} VERSION_LESS "3.17")
|
|
endif()
|