2020-10-26 15:58:28 -04:00
|
|
|
cmake_minimum_required(VERSION 3.13.0)
|
2020-09-25 12:43:53 -04:00
|
|
|
|
|
|
|
project(mods)
|
|
|
|
|
2021-01-27 16:26:19 -05:00
|
|
|
## Setup
|
|
|
|
|
2020-12-04 16:27:28 -05:00
|
|
|
add_compile_options(-Wall -Wextra -Werror)
|
2020-10-26 15:58:28 -04:00
|
|
|
add_link_options(-Wl,--no-undefined)
|
2020-12-04 16:27:28 -05:00
|
|
|
# Disable C++11 String ABI
|
2020-10-10 19:02:13 -04:00
|
|
|
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
|
2020-09-25 12:43:53 -04:00
|
|
|
|
2021-01-27 16:26:19 -05:00
|
|
|
# Add libreborn
|
|
|
|
add_subdirectory(../libreborn libreborn)
|
2020-10-03 16:18:53 -04:00
|
|
|
|
2020-12-04 16:27:28 -05:00
|
|
|
# Find GLFW
|
2020-12-02 18:18:49 -05:00
|
|
|
find_package(glfw3 3.3 REQUIRED)
|
|
|
|
|
2021-01-27 16:26:19 -05:00
|
|
|
## Mods
|
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(compat SHARED src/compat/compat.c)
|
2020-12-04 16:27:28 -05:00
|
|
|
target_link_libraries(compat feature input screenshot SDL GLESv1_CM X11 dl glfw Xfixes)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
2021-01-27 16:26:19 -05:00
|
|
|
add_library(readdir SHARED src/readdir/readdir.c)
|
2020-09-25 12:43:53 -04:00
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(feature SHARED src/feature/feature.c)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(feature reborn)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
2020-12-15 14:17:04 -05:00
|
|
|
add_library(server SHARED src/server/server.cpp src/server/server_properties.cpp)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(server reborn feature dl SDL pthread)
|
2020-10-10 19:02:13 -04:00
|
|
|
|
2020-11-24 17:12:23 -05:00
|
|
|
add_library(screenshot SHARED src/screenshot/screenshot.c)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(screenshot reborn GLESv1_CM freeimage)
|
2020-11-24 17:12:23 -05:00
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(camera SHARED src/camera/camera.cpp)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(camera reborn screenshot)
|
2020-10-03 20:30:15 -04:00
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(game_mode SHARED src/game_mode/game_mode.c src/game_mode/game_mode.cpp)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(game_mode reborn)
|
2020-11-27 20:49:13 -05:00
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(input SHARED src/input/input.c src/input/input.cpp)
|
2021-02-16 12:26:40 -05:00
|
|
|
target_link_libraries(input reborn feature SDL chat)
|
2020-10-05 18:17:55 -04:00
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(misc SHARED src/misc/misc.c src/misc/misc.cpp)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(misc reborn feature util)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
|
|
|
add_library(options SHARED src/options/options.c)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(options reborn feature)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
|
|
|
add_library(override SHARED src/override/override.c)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(override reborn dl)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
|
|
|
add_library(textures SHARED src/textures/textures.cpp)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(textures reborn feature GLESv1_CM)
|
2020-09-25 12:43:53 -04:00
|
|
|
|
2021-02-16 12:26:40 -05:00
|
|
|
add_library(chat SHARED src/chat/chat.cpp src/chat/ui.c)
|
|
|
|
target_link_libraries(chat reborn pthread)
|
|
|
|
|
2021-01-27 11:13:06 -05:00
|
|
|
add_library(test SHARED src/test/test.c)
|
2021-01-27 16:26:19 -05:00
|
|
|
target_link_libraries(test reborn)
|
2021-01-27 11:13:06 -05:00
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(init SHARED src/init/init.c)
|
2021-02-16 12:26:40 -05:00
|
|
|
target_link_libraries(init compat server game_mode camera input misc options textures chat test)
|
2021-01-27 16:26:19 -05:00
|
|
|
|
2021-02-21 14:53:17 -05:00
|
|
|
## Install Mods
|
|
|
|
install(TARGETS init compat readdir feature screenshot override server game_mode camera input misc options textures chat test DESTINATION /mods)
|