2023-09-05 00:16:30 +00:00
|
|
|
# load common dependencies
|
|
|
|
# this file will also load platform specific dependencies
|
|
|
|
|
|
|
|
# submodules
|
|
|
|
# moonlight common library
|
2023-09-22 03:16:23 +00:00
|
|
|
set(ENET_NO_INSTALL ON CACHE BOOL "Don't install any libraries build for enet")
|
2024-02-03 20:29:09 +00:00
|
|
|
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/enet")
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
# web server
|
2024-02-03 20:29:09 +00:00
|
|
|
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/Simple-Web-Server")
|
2023-09-05 00:16:30 +00:00
|
|
|
|
2024-01-01 01:04:04 +00:00
|
|
|
# common dependencies
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
pkg_check_modules(CURL REQUIRED libcurl)
|
|
|
|
|
2023-09-05 00:16:30 +00:00
|
|
|
# miniupnp
|
2024-01-01 23:48:27 +00:00
|
|
|
pkg_check_modules(MINIUPNP miniupnpc REQUIRED)
|
|
|
|
include_directories(SYSTEM ${MINIUPNP_INCLUDE_DIRS})
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
# ffmpeg pre-compiled binaries
|
2024-05-13 22:56:31 +00:00
|
|
|
if(NOT DEFINED FFMPEG_PREPARED_BINARIES)
|
|
|
|
if(WIN32)
|
|
|
|
set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid vpl)
|
2024-05-27 00:36:37 +00:00
|
|
|
elseif(UNIX AND NOT APPLE)
|
2024-05-13 22:56:31 +00:00
|
|
|
set(FFMPEG_PLATFORM_LIBRARIES numa va va-drm va-x11 vdpau X11)
|
|
|
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
|
|
|
list(APPEND FFMPEG_PLATFORM_LIBRARIES mfx)
|
|
|
|
set(CPACK_DEB_PLATFORM_PACKAGE_DEPENDS "libmfx1,")
|
|
|
|
set(CPACK_RPM_PLATFORM_PACKAGE_REQUIRES "intel-mediasdk >= 22.3.0,")
|
|
|
|
endif()
|
2023-09-05 00:16:30 +00:00
|
|
|
endif()
|
2024-05-27 00:36:37 +00:00
|
|
|
set(FFMPEG_PREPARED_BINARIES
|
|
|
|
"${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
|
|
|
|
# check if the directory exists
|
|
|
|
if(NOT EXISTS "${FFMPEG_PREPARED_BINARIES}")
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"FFmpeg pre-compiled binaries not found at ${FFMPEG_PREPARED_BINARIES}. \
|
|
|
|
Please consider contributing to the LizardByte/build-deps repository. \
|
|
|
|
Optionally, you can use the FFMPEG_PREPARED_BINARIES option to specify the path to the \
|
|
|
|
system-installed FFmpeg libraries")
|
|
|
|
endif()
|
|
|
|
|
2024-05-13 22:56:31 +00:00
|
|
|
if(EXISTS "${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a")
|
|
|
|
set(HDR10_PLUS_LIBRARY
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a")
|
2023-09-05 00:16:30 +00:00
|
|
|
endif()
|
2024-05-13 22:56:31 +00:00
|
|
|
set(FFMPEG_LIBRARIES
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libcbs.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libSvtAv1Enc.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libx264.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libx265.a"
|
|
|
|
${HDR10_PLUS_LIBRARY}
|
|
|
|
${FFMPEG_PLATFORM_LIBRARIES})
|
|
|
|
else()
|
|
|
|
set(FFMPEG_LIBRARIES
|
2024-02-03 20:29:09 +00:00
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libcbs.a"
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a"
|
2023-09-05 00:16:30 +00:00
|
|
|
${FFMPEG_PLATFORM_LIBRARIES})
|
2024-05-13 22:56:31 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(FFMPEG_INCLUDE_DIRS
|
|
|
|
"${FFMPEG_PREPARED_BINARIES}/include")
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
# platform specific dependencies
|
|
|
|
if(WIN32)
|
2024-02-03 20:29:09 +00:00
|
|
|
include("${CMAKE_MODULE_PATH}/dependencies/windows.cmake")
|
2023-09-05 00:16:30 +00:00
|
|
|
elseif(UNIX)
|
2024-02-03 20:29:09 +00:00
|
|
|
include("${CMAKE_MODULE_PATH}/dependencies/unix.cmake")
|
2023-09-05 00:16:30 +00:00
|
|
|
|
|
|
|
if(APPLE)
|
2024-02-03 20:29:09 +00:00
|
|
|
include("${CMAKE_MODULE_PATH}/dependencies/macos.cmake")
|
2023-09-05 00:16:30 +00:00
|
|
|
else()
|
2024-02-03 20:29:09 +00:00
|
|
|
include("${CMAKE_MODULE_PATH}/dependencies/linux.cmake")
|
2023-09-05 00:16:30 +00:00
|
|
|
endif()
|
|
|
|
endif()
|