2018-02-24 15:00:39 +08:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2018-08-03 15:17:36 +08:00
|
|
|
project(live555 C CXX)
|
2018-02-24 15:00:39 +08:00
|
|
|
|
2023-07-08 00:04:03 +08:00
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
2018-02-24 15:00:39 +08:00
|
|
|
include_directories(
|
|
|
|
BasicUsageEnvironment/include
|
|
|
|
groupsock/include
|
|
|
|
liveMedia/include
|
|
|
|
UsageEnvironment/include
|
|
|
|
)
|
|
|
|
|
2021-12-29 07:04:54 +08:00
|
|
|
if (WIN32)
|
|
|
|
add_definitions(-DNO_GETIFADDRS)
|
|
|
|
endif(WIN32)
|
|
|
|
|
2018-10-09 15:44:45 +08:00
|
|
|
if (NOT MSVC)
|
|
|
|
add_compile_options(-DSOCKLEN_T=socklen_t)
|
|
|
|
endif()
|
|
|
|
|
2024-01-13 02:25:19 +08:00
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
|
|
|
add_compile_options(-DBSD=1)
|
|
|
|
add_compile_options(-DHAVE_SOCKADDR_LEN=1)
|
|
|
|
add_compile_options(-DTIME_BASE=int)
|
|
|
|
add_compile_options(-DNEED_XLOCALE_H=1)
|
|
|
|
endif()
|
|
|
|
|
2018-08-03 15:17:36 +08:00
|
|
|
file(GLOB BASIC_USAGE_ENVIRONMENT_SRCS BasicUsageEnvironment/*.c BasicUsageEnvironment/*.cpp)
|
2018-02-24 15:00:39 +08:00
|
|
|
add_library(BasicUsageEnvironment ${BASIC_USAGE_ENVIRONMENT_SRCS})
|
2024-10-26 17:22:53 +08:00
|
|
|
target_include_directories(BasicUsageEnvironment PUBLIC $<INSTALL_INTERFACE:include>)
|
2018-02-24 15:00:39 +08:00
|
|
|
|
2018-08-03 15:17:36 +08:00
|
|
|
file(GLOB GROUPSOCK_SRCS groupsock/*.c groupsock/*.cpp)
|
2018-02-24 15:00:39 +08:00
|
|
|
add_library(groupsock ${GROUPSOCK_SRCS})
|
2024-10-26 17:22:53 +08:00
|
|
|
target_include_directories(groupsock PUBLIC $<INSTALL_INTERFACE:include>)
|
2018-02-24 15:00:39 +08:00
|
|
|
|
2018-08-03 15:17:36 +08:00
|
|
|
file(GLOB LIVEMEDIA_SRCS liveMedia/*.c liveMedia/*.cpp)
|
2018-02-24 15:00:39 +08:00
|
|
|
add_library(liveMedia ${LIVEMEDIA_SRCS})
|
2019-12-21 04:00:56 +08:00
|
|
|
find_package(OpenSSL REQUIRED)
|
2024-10-26 17:22:53 +08:00
|
|
|
target_include_directories(liveMedia PRIVATE "${OPENSSL_INCLUDE_DIR}" PUBLIC $<INSTALL_INTERFACE:include>)
|
2018-02-24 15:00:39 +08:00
|
|
|
|
2018-08-03 15:17:36 +08:00
|
|
|
file(GLOB USAGE_ENVIRONMENT_SRCS UsageEnvironment/*.c UsageEnvironment/*.cpp)
|
|
|
|
add_library(UsageEnvironment ${USAGE_ENVIRONMENT_SRCS})
|
2024-10-26 17:22:53 +08:00
|
|
|
target_include_directories(UsageEnvironment PUBLIC $<INSTALL_INTERFACE:include>)
|
2018-02-24 15:00:39 +08:00
|
|
|
|
2022-12-13 06:35:22 +08:00
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/unofficial-live555-config.cmake"
|
|
|
|
[[
|
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
|
|
|
|
find_dependency(OpenSSL)
|
|
|
|
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-live555-targets.cmake")
|
|
|
|
]]
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES "${CMAKE_BINARY_DIR}/unofficial-live555-config.cmake" DESTINATION share/unofficial-live555)
|
|
|
|
|
2018-02-24 15:00:39 +08:00
|
|
|
install(TARGETS groupsock BasicUsageEnvironment liveMedia UsageEnvironment
|
2022-12-13 06:35:22 +08:00
|
|
|
EXPORT unofficial-live555-targets
|
2018-02-24 15:00:39 +08:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
)
|
2022-12-13 06:35:22 +08:00
|
|
|
|
|
|
|
install(
|
|
|
|
EXPORT unofficial-live555-targets
|
|
|
|
FILE unofficial-live555-targets.cmake
|
|
|
|
NAMESPACE unofficial::
|
|
|
|
DESTINATION share/unofficial-live555
|
|
|
|
)
|