154 lines
3.8 KiB
CMake
154 lines
3.8 KiB
CMake
project(mods)
|
|
|
|
# Common Sources
|
|
set(SRC
|
|
# compat
|
|
src/compat/compat.c
|
|
src/compat/egl.c
|
|
src/compat/x11.c
|
|
src/compat/bcm_host.c
|
|
# readdir
|
|
src/readdir/readdir.c
|
|
# feature
|
|
src/feature/feature.c
|
|
# version
|
|
src/version/version.cpp
|
|
# chat
|
|
src/chat/chat.cpp
|
|
src/chat/ui.c
|
|
# creative
|
|
src/creative/creative.cpp
|
|
# game-mode
|
|
src/game-mode/game-mode.c
|
|
src/game-mode/ui.cpp
|
|
# override
|
|
src/override/override.c
|
|
# death
|
|
src/death/death.cpp
|
|
# misc
|
|
src/misc/misc.c
|
|
src/misc/misc.cpp
|
|
src/misc/logging.cpp
|
|
src/misc/api.cpp
|
|
# options
|
|
src/options/options.c
|
|
src/options/options.cpp
|
|
# bucket
|
|
src/bucket/bucket.cpp
|
|
# cake
|
|
src/cake/cake.cpp
|
|
# home
|
|
src/home/home.c
|
|
# test
|
|
src/test/test.c
|
|
# init
|
|
src/init/init.c
|
|
)
|
|
|
|
# Server-Only Sources
|
|
if(MCPI_SERVER_MODE)
|
|
list(APPEND SRC
|
|
# server
|
|
src/server/server.cpp
|
|
src/server/server_properties.cpp
|
|
)
|
|
else()
|
|
list(APPEND SRC
|
|
# multiplayer
|
|
src/multiplayer/multiplayer.cpp
|
|
# benchmark
|
|
src/benchmark/benchmark.cpp
|
|
)
|
|
endif()
|
|
|
|
# Headless-Only Sources
|
|
if(MCPI_HEADLESS_MODE)
|
|
list(APPEND SRC
|
|
# textures
|
|
src/textures/headless.cpp
|
|
)
|
|
else()
|
|
list(APPEND SRC
|
|
# sound
|
|
src/sound/sound.cpp
|
|
src/sound/repository.cpp
|
|
# camera
|
|
src/camera/camera.cpp
|
|
# input
|
|
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
|
|
# sign
|
|
src/sign/sign.cpp
|
|
# touch
|
|
src/touch/touch.cpp
|
|
# atlas
|
|
src/atlas/atlas.cpp
|
|
# title-screen
|
|
src/title-screen/title-screen.cpp
|
|
# skin
|
|
src/skin/skin.cpp
|
|
src/skin/loader.cpp
|
|
# screenshot
|
|
src/screenshot/screenshot.c
|
|
# textures
|
|
src/textures/textures.cpp
|
|
)
|
|
endif()
|
|
|
|
# Build
|
|
add_library(mods SHARED ${SRC})
|
|
|
|
==== BASE ====
|
|
add_library(death SHARED src/death/death.cpp)
|
|
target_link_libraries(death mods-headers reborn-patch symbols feature)
|
|
|
|
add_library(misc SHARED src/misc/misc.c src/misc/misc.cpp src/misc/logging.cpp src/misc/api.cpp)
|
|
target_link_libraries(misc mods-headers reborn-patch symbols media-layer-core feature)
|
|
|
|
add_library(options SHARED src/options/options.c src/options/options.cpp)
|
|
target_link_libraries(options mods-headers reborn-patch symbols feature home)
|
|
|
|
add_library(bucket SHARED src/bucket/bucket.cpp)
|
|
target_link_libraries(bucket mods-headers reborn-patch symbols feature misc)
|
|
|
|
add_library(home SHARED src/home/home.c)
|
|
target_link_libraries(home mods-headers reborn-patch symbols)
|
|
|
|
add_library(test SHARED src/test/test.c)
|
|
target_link_libraries(test mods-headers reborn-patch home)
|
|
==== BASE ====
|
|
|
|
==== BASE ====
|
|
add_library(init SHARED src/init/init.c)
|
|
target_link_libraries(init symbols mods-headers reborn-util compat game-mode misc death options chat creative bucket textures home version test media-layer-core)
|
|
if(MCPI_SERVER_MODE)
|
|
target_link_libraries(init server)
|
|
else()
|
|
target_link_libraries(init multiplayer benchmark)
|
|
endif()
|
|
==== BASE ====
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
target_link_libraries(mods stb_image)
|
|
endif()
|
|
|
|
==== BASE ====
|
|
## Install Mods
|
|
set(MODS_TO_INSTALL init compat readdir feature game-mode misc override death options chat creative bucket textures home version test)
|
|
if(MCPI_SERVER_MODE)
|
|
list(APPEND MODS_TO_INSTALL server)
|
|
else()
|
|
list(APPEND MODS_TO_INSTALL multiplayer benchmark)
|
|
endif()
|
|
if(NOT MCPI_HEADLESS_MODE)
|
|
list(APPEND MODS_TO_INSTALL sound camera input sign touch atlas title-screen skin screenshot)
|
|
endif()
|
|
install(TARGETS ${MODS_TO_INSTALL} DESTINATION "${MCPI_INSTALL_DIR}/mods")
|
|
==== BASE ====
|
|
# SDK
|
|
install(DIRECTORY "include/" DESTINATION "${MCPI_SDK_INCLUDE_DIR}/mods")
|