Skip to content

Commit a816fe7

Browse files
committed
fix CMake .desktop install
1 parent 22cf065 commit a816fe7

File tree

18 files changed

+21
-6
lines changed

18 files changed

+21
-6
lines changed

CMakeLists.txt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,30 @@ if(NOT TEST)
272272
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}
273273
)
274274

275+
set(RESOURCES_SOURCE "${CMAKE_SOURCE_DIR}/resources")
276+
set(RESOURCES_BINARY "${CMAKE_BINARY_DIR}/resources")
277+
278+
configure_file(
279+
${RESOURCES_SOURCE}/applications/TombRaiderLinuxLauncher.desktop
280+
${RESOURCES_BINARY}/applications/TombRaiderLinuxLauncher.desktop
281+
@ONLY
282+
)
283+
284+
275285
install(FILES
276-
${CMAKE_SOURCE_DIR}/resources/TombRaiderLinuxLauncher.desktop
286+
${RESOURCES_BINARY}/applications/TombRaiderLinuxLauncher.desktop
277287
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
278288
)
279289

280-
install(
281-
FILES ${CMAKE_SOURCE_DIR}/resources/TombRaiderLinuxLauncher.png
282-
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/1024x1024/apps
283-
)
290+
set(ICON_SIZES 1024 512 256 192 128 96 72 64 48 40 36 32 24 22 20 16)
291+
foreach(RES IN LISTS ICON_SIZES)
292+
set(ICON_SOURCE "${RESOURCES_SOURCE}/icons/hicolor/${RES}x${RES}")
293+
set(ICON_OUT "${ICON_SOURCE}/apps/TombRaiderLinuxLauncher.png")
294+
set(ICON_DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor")
295+
install(FILES ${ICON_OUT}
296+
DESTINATION ${ICON_DESTINATION}/${RES}x${RES}/apps
297+
)
298+
endforeach()
284299

285300
if(NOT NO_DATABASE)
286301
install(FILES

resources/TombRaiderLinuxLauncher.desktop renamed to resources/applications/TombRaiderLinuxLauncher.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Desktop Entry]
22
Name=Tomb Raider Linux Launcher
33
Comment=Play Tomb Raider Custom Levels and Tomb Raider Core Design games
4-
Exec=%h/.local/bin/TombRaiderLinuxLauncher
4+
Exec=@INSTALL_PREFIX@/bin/TombRaiderLinuxLauncher
55
Icon=TombRaiderLinuxLauncher
66
Terminal=false
77
Type=Application

resources/TombRaiderLinuxLauncher.png renamed to resources/icons/hicolor/1024x1024/apps/TombRaiderLinuxLauncher.png

File renamed without changes.
24.2 KB
Loading
2.37 KB
Loading
46.9 KB
Loading
2.43 KB
Loading
2.62 KB
Loading
2.82 KB
Loading
76.9 KB
Loading

0 commit comments

Comments
 (0)