Skip to content

Commit 22cf065

Browse files
committed
add a desktop file and update CMake
1 parent d2e4331 commit 22cf065

File tree

4 files changed

+41
-11
lines changed

4 files changed

+41
-11
lines changed

CMakeLists.txt

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,31 @@ find_package(Qt6 COMPONENTS Core Gui Test Widgets WebEngineWidgets Sql REQUIRED)
1818

1919
find_package(CURL REQUIRED)
2020

21-
# Add miniz as a subdirectory
22-
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt")
23-
message(STATUS "Submodule 'libs/miniz' not found. Updating submodules...")
21+
# Static libs
22+
function(update_submodules)
2423
execute_process(
2524
COMMAND git submodule update --init --recursive
2625
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
26+
RESULT_VARIABLE res1
27+
)
28+
if(NOT res1 EQUAL 0)
29+
message(FATAL_ERROR "Failed to update submodules.")
30+
endif()
31+
32+
execute_process(
33+
COMMAND git config submodule.libs/miniz.ignore all
34+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
35+
)
36+
execute_process(
37+
COMMAND git config submodule.libs/libbacktrace.ignore all
38+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
2739
)
40+
endfunction()
41+
42+
# Add miniz as a subdirectory
43+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt")
44+
message(STATUS "Submodule 'libs/miniz' not found. Updating submodules...")
45+
update_submodules()
2846
file(READ "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt" MINIZ_CMAKE)
2947
string(REPLACE "cmake_minimum_required(VERSION 3.5)"
3048
"cmake_minimum_required(VERSION 3.16)"
@@ -40,10 +58,7 @@ add_subdirectory(libs/miniz)
4058
# Add LIEF as a subdirectory
4159
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/LIEF/CMakeLists.txt")
4260
message(STATUS "Submodule 'libs/LIEF' not found. Updating submodules...")
43-
execute_process(
44-
COMMAND git submodule update --init --recursive
45-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
46-
)
61+
update_submodules()
4762
endif()
4863
set(LIEF_INSTALL OFF CACHE BOOL "Disable installation of LIEF")
4964
set(LIEF_PYTHON_API OFF)
@@ -63,10 +78,7 @@ if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/libbacktrace/configure")
6378
message(STATUS
6479
"Submodule 'libs/libbacktrace' not found. Updating submodules..."
6580
)
66-
execute_process(
67-
COMMAND git submodule update --init --recursive
68-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
69-
)
81+
update_submodules()
7082
endif()
7183
if(EXISTS "${CMAKE_SOURCE_DIR}/libs/libbacktrace/configure")
7284
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/libbacktrace/Makefile")
@@ -260,6 +272,16 @@ if(NOT TEST)
260272
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}
261273
)
262274

275+
install(FILES
276+
${CMAKE_SOURCE_DIR}/resources/TombRaiderLinuxLauncher.desktop
277+
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
278+
)
279+
280+
install(
281+
FILES ${CMAKE_SOURCE_DIR}/resources/TombRaiderLinuxLauncher.png
282+
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/1024x1024/apps
283+
)
284+
263285
if(NOT NO_DATABASE)
264286
install(FILES
265287
${CMAKE_SOURCE_DIR}/database/tombll.db
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Desktop Entry]
2+
Name=Tomb Raider Linux Launcher
3+
Comment=Play Tomb Raider Custom Levels and Tomb Raider Core Design games
4+
Exec=%h/.local/bin/TombRaiderLinuxLauncher
5+
Icon=TombRaiderLinuxLauncher
6+
Terminal=false
7+
Type=Application
8+
Categories=Game;

src/icons/TRLL.xcf

-2.84 MB
Binary file not shown.

0 commit comments

Comments
 (0)