Skip to content

Commit

Permalink
test 5
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Sep 2, 2024
1 parent e564d1f commit a1ed35d
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions prboom2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,41 @@ if(NOT CMAKE_CROSSCOMPILING)
endif()

if(WIN32)
include(CPack)
endif()
set(CPACK_GENERATOR ZIP)
elseif(LINUX)
set(CPACK_GENERATOR External)
set(CPACK_EXTERNAL_ENABLE_STAGING YES)
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${PROJECT_BINARY_DIR}/appimage-generate.cmake")

file(GENERATE
OUTPUT "${PROJECT_BINARY_DIR}/appimage-generate.cmake"
CONTENT [[
find_program(LINUXDEPLOY_EXECUTABLE
NAMES linuxdeploy linuxdeploy-x86_64.AppImage
PATHS ${CPACK_PACKAGE_DIRECTORY}/linuxdeploy)

if(NOT LINUXDEPLOY_EXECUTABLE)
message(STATUS "Downloading linuxdeploy")
set(LINUXDEPLOY_EXECUTABLE ${CPACK_PACKAGE_DIRECTORY}/linuxdeploy/linuxdeploy)
file(DOWNLOAD
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
${LINUXDEPLOY_EXECUTABLE}
INACTIVITY_TIMEOUT 10)
execute_process(COMMAND
chmod +x ${LINUXDEPLOY_EXECUTABLE} COMMAND_ECHO STDOUT)
endif()

execute_process(COMMAND
${CMAKE_COMMAND} -E env
OUTPUT=${CPACK_PACKAGE_FILE_NAME}.appimage
VERSION=$<IF:$<BOOL:${CPACK_PACKAGE_VERSION}>,${CPACK_PACKAGE_VERSION},0.1.0>
${LINUXDEPLOY_EXECUTABLE}
--appimage-extract-and-run
--appdir=${CPACK_TEMPORARY_DIRECTORY}
--executable=$<TARGET_FILE:dsda-doom>
--desktop-file=${CPACK_TEMPORARY_DIRECTORY}/${CPACK_PACKAGING_INSTALL_PREFIX}/share/applications/dsda-doom.desktop
--output=appimage)
]])
endif()
include(CPack)

0 comments on commit a1ed35d

Please sign in to comment.