minecraft-pi-reborn/media-layer/core/CMakeLists.txt

38 lines
1.4 KiB
CMake
Raw Permalink Normal View History

2021-06-17 21:32:24 +00:00
project(media-layer-core)
# Configuration
set(CORE_SRC src/base.cpp src/media.c src/screenshot.c) # SDL Re-Implementation Using GLFW
2021-09-12 03:18:12 +00:00
if(NOT MCPI_HEADLESS_MODE)
list(APPEND CORE_SRC src/audio/api.cpp src/audio/engine.c src/audio/file.cpp)
endif()
2021-06-17 21:32:24 +00:00
# Build
if(MCPI_USE_MEDIA_LAYER_PROXY AND BUILD_NATIVE_COMPONENTS)
# Building Native Components
add_library(media-layer-core OBJECT ${CORE_SRC}) # Dependencies Are Setup Later
elseif(NOT MCPI_USE_MEDIA_LAYER_PROXY AND BUILD_ARM_COMPONENTS)
# Building ARM Components
add_library(media-layer-core SHARED ${CORE_SRC}) # Dependencies Are Setup Later
# Install
install(TARGETS media-layer-core DESTINATION "${MCPI_LIB_DIR}")
endif()
# Configure Media Layer Core If Built
if(TARGET media-layer-core)
# Link
2022-03-14 23:09:25 +00:00
target_link_libraries(media-layer-core media-layer-headers reborn-util pthread dl)
2021-08-27 02:52:18 +00:00
if(NOT MCPI_HEADLESS_MODE)
2021-06-17 21:32:24 +00:00
# Find FreeImage
find_library(FREEIMAGE_LIBRARY NAMES freeimage libfreeimage.so.3 REQUIRED)
2021-09-12 03:18:12 +00:00
# OpenAL
find_library(OPENAL_LIBRARY NAMES openal REQUIRED)
# Link
target_link_libraries(media-layer-core "${FREEIMAGE_LIBRARY}" "${OPENAL_LIBRARY}" m GLESv1_CM glfw)
2021-06-17 21:32:24 +00:00
endif()
endif()
# Add Symlinks So MCPI Can Locate Libraries
if(BUILD_ARM_COMPONENTS)
install_symlink("libmedia-layer-core.so" "${MCPI_LIB_DIR}/libSDL-1.2.so.0")
endif()