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
|
|
|
# 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
|
|
|
## Mods
|
|
|
|
|
2021-06-27 22:16:37 -04:00
|
|
|
add_library(compat SHARED src/compat/compat.c src/compat/egl.c src/compat/x11.c)
|
2021-07-04 19:02:45 -04:00
|
|
|
target_link_libraries(compat feature input chat sign media-layer-core dl)
|
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
|
|
|
|
2021-06-28 16:00:52 -04:00
|
|
|
add_library(version SHARED src/version/version.cpp)
|
|
|
|
target_link_libraries(version reborn)
|
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
if(MCPI_SERVER_MODE)
|
|
|
|
add_library(server SHARED src/server/server.cpp src/server/server_properties.cpp)
|
2021-06-28 16:00:52 -04:00
|
|
|
target_link_libraries(server reborn feature home compat version dl media-layer-core pthread)
|
2021-06-27 22:16:37 -04:00
|
|
|
else()
|
|
|
|
add_library(multiplayer SHARED src/multiplayer/multiplayer.cpp)
|
2021-07-04 19:02:45 -04:00
|
|
|
target_link_libraries(multiplayer reborn home feature)
|
2021-06-17 17:32:24 -04:00
|
|
|
endif()
|
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-07-04 19:02:45 -04:00
|
|
|
target_link_libraries(camera reborn media-layer-core feature)
|
2020-10-03 20:30:15 -04:00
|
|
|
|
2021-06-28 17:00:29 -04:00
|
|
|
add_library(game-mode SHARED src/game-mode/game-mode.c src/game-mode/game-mode.cpp)
|
2021-07-04 19:02:45 -04:00
|
|
|
target_link_libraries(game-mode reborn feature)
|
2020-11-27 20:49:13 -05:00
|
|
|
|
2021-07-04 19:02:45 -04:00
|
|
|
add_library(input SHARED src/input/input.cpp src/input/bow.c src/input/attack.c src/input/toggle.c src/input/misc.c src/input/drop.cpp)
|
|
|
|
target_link_libraries(input reborn feature media-layer-core)
|
2021-06-28 22:59:24 -04:00
|
|
|
|
2021-07-04 19:02:45 -04:00
|
|
|
add_library(sign SHARED src/sign/sign.cpp)
|
|
|
|
target_link_libraries(sign reborn feature input)
|
2020-10-05 18:17:55 -04:00
|
|
|
|
2021-06-21 21:50:26 -04:00
|
|
|
add_library(death SHARED src/death/death.cpp)
|
2021-07-04 19:02:45 -04:00
|
|
|
target_link_libraries(death reborn feature)
|
2021-06-21 21:50:26 -04:00
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(misc SHARED src/misc/misc.c src/misc/misc.cpp)
|
2021-06-21 21:50:26 -04:00
|
|
|
target_link_libraries(misc reborn feature)
|
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
|
|
|
|
2021-06-19 19:07:09 -04:00
|
|
|
add_library(touch SHARED src/touch/touch.c)
|
|
|
|
target_link_libraries(touch reborn feature)
|
|
|
|
|
2020-12-02 18:18:49 -05:00
|
|
|
add_library(override SHARED src/override/override.c)
|
2021-06-17 17:32:24 -04:00
|
|
|
target_link_libraries(override reborn dl home)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
|
|
|
add_library(textures SHARED src/textures/textures.cpp)
|
2021-06-30 19:41:18 -04:00
|
|
|
target_link_libraries(textures reborn feature)
|
|
|
|
|
|
|
|
add_library(atlas SHARED src/atlas/atlas.cpp)
|
|
|
|
target_link_libraries(atlas 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)
|
2021-07-04 19:02:45 -04:00
|
|
|
target_link_libraries(chat reborn feature input pthread)
|
2021-02-16 12:26:40 -05:00
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
add_library(home SHARED src/home/home.c)
|
|
|
|
target_link_libraries(home reborn)
|
|
|
|
|
2021-01-27 11:13:06 -05:00
|
|
|
add_library(test SHARED src/test/test.c)
|
2021-06-17 17:32:24 -04:00
|
|
|
target_link_libraries(test reborn home)
|
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-06-30 19:41:18 -04:00
|
|
|
target_link_libraries(init compat game-mode camera input sign misc death options touch textures atlas chat home version test)
|
2021-06-17 17:32:24 -04:00
|
|
|
if(MCPI_SERVER_MODE)
|
|
|
|
target_link_libraries(init server)
|
2021-06-27 22:16:37 -04:00
|
|
|
else()
|
|
|
|
target_link_libraries(init multiplayer)
|
2021-06-17 17:32:24 -04:00
|
|
|
endif()
|
2021-01-27 16:26:19 -05:00
|
|
|
|
2021-02-21 14:53:17 -05:00
|
|
|
## Install Mods
|
2021-06-30 19:41:18 -04:00
|
|
|
install(TARGETS init compat readdir feature override game-mode camera input sign misc death options touch textures atlas chat home version test DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
2021-06-17 17:32:24 -04:00
|
|
|
if(MCPI_SERVER_MODE)
|
|
|
|
install(TARGETS server DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
2021-06-27 22:16:37 -04:00
|
|
|
else()
|
|
|
|
install(TARGETS multiplayer DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
2021-06-17 17:32:24 -04:00
|
|
|
endif()
|