From de0653ac70a6a6f0eb8c70125a9d4450f78afdcf Mon Sep 17 00:00:00 2001 From: pionere Date: Sun, 10 Sep 2023 09:23:16 +0200 Subject: [PATCH] install either devilutionx.desktop or devilutionx-hellfire.desktop, but never both on linux --- CMakeLists.txt | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42f77ec242a..e08235e3bc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1324,23 +1324,22 @@ if(CPACK) # Common *nix files set(CPACK_STRIP_FILES TRUE) install(TARGETS ${BIN_TARGET} DESTINATION bin) - set(desktop_file "${PROJECT_SOURCE_DIR}/Packaging/nix/${project_name}.desktop") - set(desktop_file_hellfire "${PROJECT_SOURCE_DIR}/Packaging/nix/${project_name}-hellfire.desktop") + if(HELLFIRE) + set(desktop_file_name "devilutionx-hellfire.desktop") + else() + set(desktop_file_name "devilutionx.desktop") + endif() + set(desktop_file "${PROJECT_SOURCE_DIR}/Packaging/nix/${desktop_file_name}") find_program(DFI desktop-file-install) if(DFI) execute_process(COMMAND ${DFI} --dir=${CMAKE_BINARY_DIR} ${desktop_file}) - set(desktop_file "${CMAKE_BINARY_DIR}/${project_name}.desktop") - execute_process(COMMAND ${DFI} --dir=${CMAKE_BINARY_DIR} ${desktop_file_hellfire}) - set(desktop_file_hellfire "${CMAKE_BINARY_DIR}/${project_name}-hellfire.desktop") + set(desktop_file "${CMAKE_BINARY_DIR}/${desktop_file_name}") endif() install(FILES "${desktop_file}" DESTINATION "share/applications" ) - install(FILES "${desktop_file_hellfire}" - DESTINATION "share/applications" - ) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/nix/README.txt" DESTINATION "share/diasurgical/${project_name}" ) @@ -1355,14 +1354,17 @@ if(CPACK) DESTINATION "share/diasurgical/${project_name}" ) endif() - install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/icon.png" - DESTINATION "share/icons/hicolor/512x512/apps" - RENAME "${project_name}.png" - ) - install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/hellfire.png" - DESTINATION "share/icons/hicolor/512x512/apps" - RENAME "${project_name}-hellfire.png" - ) + if(HELLFIRE) + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/hellfire.png" + DESTINATION "share/icons/hicolor/512x512/apps" + RENAME "${project_name}-hellfire.png" + ) + else() + install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/icon.png" + DESTINATION "share/icons/hicolor/512x512/apps" + RENAME "${project_name}.png" + ) + endif() # -G DEB set(CPACK_PACKAGE_CONTACT "${PROJECT_NAME} https://github.com/pionere/devilutionX")