mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 02:27:35 +00:00

- Add SDL2_net - Bring CMake file closer to proposed upstream - Remove opentyrian-data port and merge it into the main port - Do a release build - Add correct icon
126 lines
2.8 KiB
Diff
126 lines
2.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Fabian Dellwing <fabian.dellwing@gmail.com>
|
|
Date: Sun, 16 Jul 2023 07:09:55 +0200
|
|
Subject: [PATCH] Build with CMake
|
|
|
|
---
|
|
CMakeLists.txt | 110 +++++++++++++++++++++++++++++++++++++++++++++++++
|
|
1 file changed, 110 insertions(+)
|
|
create mode 100644 CMakeLists.txt
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..f52fb4d501707d290bf2e41bdca1867992fbb19d
|
|
--- /dev/null
|
|
+++ b/CMakeLists.txt
|
|
@@ -0,0 +1,110 @@
|
|
+cmake_minimum_required(VERSION 3.8)
|
|
+
|
|
+# set version number
|
|
+set (OPENTYRIAN_VERSION 2.1)
|
|
+
|
|
+# set the project name
|
|
+project(OpenTyrian VERSION ${OPENTYRIAN_VERSION})
|
|
+
|
|
+install(FILES NEWS README DESTINATION share/doc/opentyrian)
|
|
+
|
|
+set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
|
+
|
|
+# Options enabled by default
|
|
+option ( enable-network "compile support for network" on )
|
|
+
|
|
+# Include required scripts
|
|
+include(GNUInstallDirs)
|
|
+
|
|
+# Search for dependencies
|
|
+find_package(SDL2 REQUIRED)
|
|
+
|
|
+if (enable-network)
|
|
+ find_package(SDL2_net REQUIRED)
|
|
+ add_definitions(-DWITH_NETWORK)
|
|
+endif()
|
|
+
|
|
+# add the executable
|
|
+add_executable(opentyrian WIN32
|
|
+ src/animlib.c
|
|
+ src/arg_parse.c
|
|
+ src/backgrnd.c
|
|
+ src/config.c
|
|
+ src/config_file.c
|
|
+ src/destruct.c
|
|
+ src/editship.c
|
|
+ src/episodes.c
|
|
+ src/file.c
|
|
+ src/font.c
|
|
+ src/fonthand.c
|
|
+ src/game_menu.c
|
|
+ src/helptext.c
|
|
+ src/joystick.c
|
|
+ src/jukebox.c
|
|
+ src/keyboard.c
|
|
+ src/lds_play.c
|
|
+ src/loudness.c
|
|
+ src/lvllib.c
|
|
+ src/lvlmast.c
|
|
+ src/mainint.c
|
|
+ src/menus.c
|
|
+ src/mouse.c
|
|
+ src/mtrand.c
|
|
+ src/musmast.c
|
|
+ src/network.c
|
|
+ src/nortsong.c
|
|
+ src/nortvars.c
|
|
+ src/opentyr.c
|
|
+ src/opl.c
|
|
+ src/palette.c
|
|
+ src/params.c
|
|
+ src/pcxload.c
|
|
+ src/pcxmast.c
|
|
+ src/picload.c
|
|
+ src/player.c
|
|
+ src/shots.c
|
|
+ src/sizebuf.c
|
|
+ src/sndmast.c
|
|
+ src/sprite.c
|
|
+ src/starlib.c
|
|
+ src/tyrian2.c
|
|
+ src/varz.c
|
|
+ src/vga256d.c
|
|
+ src/vga_palette.c
|
|
+ src/video.c
|
|
+ src/video_scale.c
|
|
+ src/video_scale_hqNx.c
|
|
+ src/xmas.c
|
|
+)
|
|
+
|
|
+# Setup version
|
|
+target_compile_definitions(opentyrian PUBLIC
|
|
+ OPENTYRIAN_VERSION=\"${OPENTYRIAN_VERSION}\"
|
|
+ -DTYRIAN_DIR=\"/usr/local/share/games/opentyrian\"
|
|
+)
|
|
+
|
|
+# Compile options
|
|
+target_include_directories(opentyrian
|
|
+ PRIVATE
|
|
+ ${CMAKE_SOURCE_DIR}/src
|
|
+)
|
|
+
|
|
+target_link_libraries(opentyrian
|
|
+ SDL2::SDL2
|
|
+ SDL2::SDL2main
|
|
+ $<$<AND:$<BOOL:${enable-network}>,$<BOOL:${SDL2_net_FOUND}>>:
|
|
+ SDL2_net::SDL2_net
|
|
+ >
|
|
+)
|
|
+
|
|
+find_library(MATH_LIBRARY m)
|
|
+
|
|
+if (MATH_LIBRARY)
|
|
+ message(STATUS "Add math library ${MATH_LIBRARY}")
|
|
+ target_link_libraries(opentyrian
|
|
+ ${MATH_LIBRARY}
|
|
+ )
|
|
+endif()
|
|
+
|
|
+install(TARGETS opentyrian
|
|
+ RUNTIME DESTINATION bin)
|