From 9ab405b6543dfd6ea0eef8e5e80d76ffa9d4dd04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 28 Jan 2017 18:11:06 +0100 Subject: [PATCH] Split distribution stuff per platform --- CMakeLists.txt | 21 +++++++++------------ Dist/{ => Linux}/lugaru.6 | 0 Dist/{ => Linux}/lugaru.appdata.xml | 0 Dist/{ => Linux}/lugaru.desktop | 0 Dist/{ => Linux}/lugaru.png | Bin Dist/{lugaru.ico => Windows/Lugaru.ico} | Bin Source/Lugaru.rc | 2 +- 7 files changed, 10 insertions(+), 13 deletions(-) rename Dist/{ => Linux}/lugaru.6 (100%) rename Dist/{ => Linux}/lugaru.appdata.xml (100%) rename Dist/{ => Linux}/lugaru.desktop (100%) rename Dist/{ => Linux}/lugaru.png (100%) rename Dist/{lugaru.ico => Windows/Lugaru.ico} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0965b30..851df4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,13 +180,15 @@ set(LUGARU_H ) +set(LUGARU_OBJS "") if(WIN32) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Lugaru.res COMMAND ${CMAKE_RC_COMPILER} - -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj + -o ${CMAKE_CURRENT_BINARY_DIR}/Lugaru.res -i${SRCDIR}/Lugaru.rc DEPENDS ${SRCDIR}/Lugaru.rc ) + set(LUGARU_OBJS "Lugaru.res") endif(WIN32) if(APPLE) @@ -235,12 +237,7 @@ set(LUGARU_LIBS ${OPENAL_LIBRARY} ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARIE ### Definitions -if(WIN32) - add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} lugaru_resource.obj) -else(WIN32) - add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H}) -endif(WIN32) - +add_executable(lugaru ${LUGARU_SRCS} ${LUGARU_H} ${LUGARU_OBJS}) target_link_libraries(lugaru ${LUGARU_LIBS}) if(WIN32) @@ -307,10 +304,10 @@ if(LINUX) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_BINDIR}) # Trailing '/' is significant, it installs and _renames_ Data/ as the destination folder install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) - install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata) - install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) - install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps) - install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) + install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata) + install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps) + install(FILES ${CMAKE_SOURCE_DIR}/Dist/Linux/lugaru.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) else(SYSTEM_INSTALL) message("You are building Lugaru without having enabled the SYSTEM_INSTALL option. It will default to looking for the data in the 'Data' directory next to the binary.") install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/Dist/lugaru.6 b/Dist/Linux/lugaru.6 similarity index 100% rename from Dist/lugaru.6 rename to Dist/Linux/lugaru.6 diff --git a/Dist/lugaru.appdata.xml b/Dist/Linux/lugaru.appdata.xml similarity index 100% rename from Dist/lugaru.appdata.xml rename to Dist/Linux/lugaru.appdata.xml diff --git a/Dist/lugaru.desktop b/Dist/Linux/lugaru.desktop similarity index 100% rename from Dist/lugaru.desktop rename to Dist/Linux/lugaru.desktop diff --git a/Dist/lugaru.png b/Dist/Linux/lugaru.png similarity index 100% rename from Dist/lugaru.png rename to Dist/Linux/lugaru.png diff --git a/Dist/lugaru.ico b/Dist/Windows/Lugaru.ico similarity index 100% rename from Dist/lugaru.ico rename to Dist/Windows/Lugaru.ico diff --git a/Source/Lugaru.rc b/Source/Lugaru.rc index f0f8807..c436aab 100644 --- a/Source/Lugaru.rc +++ b/Source/Lugaru.rc @@ -18,6 +18,6 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -LUGARU_ICON ICON "../Dist/lugaru.ico" +LUGARU_ICON ICON "../Dist/Windows/Lugaru.ico" // TODO: Add version info -- 2.39.2