2020-09-25 12:43:53 -04:00
|
|
|
project(mods)
|
|
|
|
|
2022-06-25 17:30:08 -04:00
|
|
|
## Headers
|
|
|
|
add_library(mods-headers INTERFACE)
|
|
|
|
target_include_directories(
|
|
|
|
mods-headers
|
|
|
|
INTERFACE
|
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
|
|
|
"$<INSTALL_INTERFACE:${MCPI_SDK_INCLUDE_DIR}/mods>"
|
|
|
|
)
|
|
|
|
# SDK
|
|
|
|
install(TARGETS mods-headers EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
|
|
|
|
install(DIRECTORY "include/" DESTINATION "${MCPI_SDK_INCLUDE_DIR}/mods")
|
|
|
|
|
2021-01-27 16:26:19 -05:00
|
|
|
## Mods
|
|
|
|
|
2022-03-24 22:47:34 -04:00
|
|
|
add_library(compat SHARED src/compat/compat.c src/compat/egl.c src/compat/x11.c src/compat/bcm_host.c)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(compat mods-headers reborn-patch media-layer-core)
|
2022-07-13 16:46:33 -04:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
2023-11-13 10:25:57 -05:00
|
|
|
target_link_libraries(compat screenshot input sign chat home dl)
|
2022-07-13 16:46:33 -04:00
|
|
|
endif()
|
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)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(feature mods-headers reborn-patch)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
2021-06-28 16:00:52 -04:00
|
|
|
add_library(version SHARED src/version/version.cpp)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(version mods-headers reborn-patch symbols)
|
2021-09-11 23:18:12 -04:00
|
|
|
|
|
|
|
add_library(chat SHARED src/chat/chat.cpp src/chat/ui.c)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(chat mods-headers reborn-patch symbols feature)
|
2023-11-13 10:25:57 -05:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
2022-07-13 16:46:33 -04:00
|
|
|
target_link_libraries(chat input media-layer-core pthread)
|
|
|
|
endif()
|
2021-06-28 16:00:52 -04:00
|
|
|
|
2022-04-09 20:01:16 -04:00
|
|
|
add_library(creative SHARED src/creative/creative.cpp)
|
2022-07-10 10:37:19 -04:00
|
|
|
target_link_libraries(creative mods-headers reborn-patch symbols feature misc)
|
2022-04-09 20:01:16 -04:00
|
|
|
|
2022-04-27 23:38:30 -04:00
|
|
|
add_library(game-mode SHARED src/game-mode/game-mode.c src/game-mode/ui.cpp)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(game-mode mods-headers reborn-patch symbols feature)
|
2022-07-13 16:46:33 -04:00
|
|
|
if(NOT MCPI_SERVER_MODE)
|
|
|
|
target_link_libraries(game-mode pthread media-layer-core)
|
|
|
|
endif()
|
2022-04-27 23:38:30 -04:00
|
|
|
|
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)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(server mods-headers reborn-patch symbols feature home misc compat dl media-layer-core pthread)
|
2021-06-27 22:16:37 -04:00
|
|
|
else()
|
|
|
|
add_library(multiplayer SHARED src/multiplayer/multiplayer.cpp)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(multiplayer mods-headers reborn-patch symbols home feature)
|
2020-11-24 17:12:23 -05:00
|
|
|
|
2023-11-13 01:41:52 -05:00
|
|
|
add_library(benchmark SHARED src/benchmark/benchmark.cpp)
|
|
|
|
target_link_libraries(benchmark mods-headers reborn-patch symbols compat misc media-layer-core)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
2021-09-11 23:18:12 -04:00
|
|
|
add_library(sound SHARED src/sound/sound.cpp src/sound/repository.cpp)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(sound mods-headers reborn-patch symbols feature override media-layer-core)
|
2020-10-03 20:30:15 -04:00
|
|
|
|
2021-09-11 23:18:12 -04:00
|
|
|
add_library(camera SHARED src/camera/camera.cpp)
|
2023-11-13 01:41:52 -05:00
|
|
|
target_link_libraries(camera mods-headers reborn-patch symbols feature home screenshot)
|
2020-11-27 20:49:13 -05:00
|
|
|
|
2022-10-07 00:06:50 -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 src/input/crafting.cpp)
|
2022-07-10 10:37:19 -04:00
|
|
|
target_link_libraries(input mods-headers reborn-patch symbols creative feature misc media-layer-core)
|
2021-06-28 22:59:24 -04:00
|
|
|
|
2021-09-11 23:18:12 -04:00
|
|
|
add_library(sign SHARED src/sign/sign.cpp)
|
2022-07-30 23:52:50 -04:00
|
|
|
target_link_libraries(sign mods-headers reborn-patch symbols feature input media-layer-core)
|
2020-10-05 18:17:55 -04:00
|
|
|
|
2022-04-11 19:59:21 -04:00
|
|
|
add_library(touch SHARED src/touch/touch.cpp)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(touch mods-headers reborn-patch symbols feature)
|
2020-12-02 18:18:49 -05:00
|
|
|
|
2021-09-11 23:18:12 -04:00
|
|
|
add_library(atlas SHARED src/atlas/atlas.cpp)
|
2022-07-11 23:51:27 -04:00
|
|
|
target_link_libraries(atlas mods-headers reborn-patch symbols feature media-layer-core)
|
2021-11-13 23:29:48 -05:00
|
|
|
|
2022-09-21 20:15:00 -04:00
|
|
|
add_library(title-screen SHARED src/title-screen/title-screen.cpp)
|
|
|
|
target_link_libraries(title-screen mods-headers reborn-patch symbols feature compat)
|
|
|
|
|
2023-10-19 01:23:34 -04:00
|
|
|
add_library(skin SHARED src/skin/skin.cpp src/skin/loader.cpp)
|
2023-11-13 01:41:52 -05:00
|
|
|
target_link_libraries(skin mods-headers reborn-patch symbols feature misc textures media-layer-core stb_image)
|
2023-10-19 01:23:34 -04:00
|
|
|
|
2023-11-13 01:41:52 -05:00
|
|
|
add_library(screenshot SHARED src/screenshot/screenshot.c)
|
|
|
|
target_link_libraries(screenshot mods-headers reborn-util media-layer-core stb_image)
|
2021-09-11 23:18:12 -04:00
|
|
|
endif()
|
2021-06-19 19:07:09 -04:00
|
|
|
|
2023-11-11 00:44:26 -05:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
add_library(textures SHARED src/textures/textures.cpp)
|
|
|
|
else()
|
|
|
|
add_library(textures SHARED src/textures/headless.cpp)
|
|
|
|
endif()
|
|
|
|
target_link_libraries(textures mods-headers reborn-patch symbols)
|
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
target_link_libraries(textures media-layer-core feature misc stb_image)
|
|
|
|
endif()
|
|
|
|
|
2022-07-08 00:25:01 -04:00
|
|
|
add_library(override SHARED src/override/override.c)
|
|
|
|
target_link_libraries(override mods-headers reborn-patch symbols dl home)
|
|
|
|
|
2021-09-11 23:18:12 -04:00
|
|
|
add_library(death SHARED src/death/death.cpp)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(death mods-headers reborn-patch symbols feature)
|
2021-06-30 19:41:18 -04:00
|
|
|
|
2022-06-27 14:47:55 -04:00
|
|
|
add_library(misc SHARED src/misc/misc.c src/misc/misc.cpp src/misc/logging.cpp src/misc/api.cpp)
|
2022-07-11 23:51:27 -04:00
|
|
|
target_link_libraries(misc mods-headers reborn-patch symbols media-layer-core feature)
|
2020-09-25 12:43:53 -04:00
|
|
|
|
2022-04-10 22:41:47 -04:00
|
|
|
add_library(options SHARED src/options/options.c src/options/options.cpp)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(options mods-headers reborn-patch symbols feature home)
|
2021-02-16 12:26:40 -05:00
|
|
|
|
2022-07-10 10:37:19 -04:00
|
|
|
add_library(bucket SHARED src/bucket/bucket.cpp)
|
|
|
|
target_link_libraries(bucket mods-headers reborn-patch symbols feature misc)
|
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
add_library(home SHARED src/home/home.c)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(home mods-headers reborn-patch symbols)
|
2021-06-17 17:32:24 -04:00
|
|
|
|
2021-01-27 11:13:06 -05:00
|
|
|
add_library(test SHARED src/test/test.c)
|
2022-06-25 17:30:08 -04:00
|
|
|
target_link_libraries(test mods-headers reborn-patch 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)
|
2023-11-11 00:44:26 -05:00
|
|
|
target_link_libraries(init mods-headers reborn-util compat game-mode misc death options chat creative bucket textures home version test media-layer-core)
|
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()
|
2023-11-13 01:41:52 -05:00
|
|
|
target_link_libraries(init multiplayer benchmark)
|
|
|
|
endif()
|
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
|
|
target_link_libraries(init sound camera input sign touch atlas title-screen skin)
|
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
|
2023-11-11 00:44:26 -05:00
|
|
|
set(MODS_TO_INSTALL init compat readdir feature game-mode misc override death options chat creative bucket textures home version test)
|
2021-06-17 17:32:24 -04:00
|
|
|
if(MCPI_SERVER_MODE)
|
2022-06-25 17:30:08 -04:00
|
|
|
list(APPEND MODS_TO_INSTALL server)
|
2021-06-27 22:16:37 -04:00
|
|
|
else()
|
2023-11-13 01:41:52 -05:00
|
|
|
list(APPEND MODS_TO_INSTALL multiplayer benchmark)
|
2021-06-17 17:32:24 -04:00
|
|
|
endif()
|
2022-07-13 16:46:33 -04:00
|
|
|
if(NOT MCPI_HEADLESS_MODE)
|
2023-11-13 01:41:52 -05:00
|
|
|
list(APPEND MODS_TO_INSTALL sound camera input sign touch atlas title-screen skin screenshot)
|
2022-07-13 16:46:33 -04:00
|
|
|
endif()
|
2022-06-25 17:30:08 -04:00
|
|
|
install(TARGETS ${MODS_TO_INSTALL} DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
|
|
|
# SDK
|
|
|
|
install(TARGETS ${MODS_TO_INSTALL} EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
|