forked from rawrtc/rawrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (50 loc) · 1.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Project
cmake_minimum_required(VERSION 3.2)
project(rawrtc)
set(rawrtc_VERSION_MAJOR 0)
set(rawrtc_VERSION_MINOR 0)
set(rawrtc_VERSION_PATCH 1)
# Debug build type as default
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, using DEBUG")
set(CMAKE_BUILD_TYPE "DEBUG")
endif()
# Enable verbose output in DEBUG mode
if (${CMAKE_BUILD_TYPE} MATCHES "DEBUG")
message(STATUS "enabling verbose outout")
set(CMAKE_VERBOSE_MAKEFILE on)
endif()
# Use pkg-config
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
# TODO: Dependency: zf_log
#include_directories(.../build.cmake/prefix/include)
# Dependency: OpenSSL
pkg_check_modules(LIB_OPENSSL REQUIRED openssl>=1.0.2)
include_directories(${LIB_OPENSSL_INCLUDE_DIRS})
link_directories(${LIB_OPENSSL_LIBRARY_DIRS})
# Dependency: libre
pkg_check_modules(LIB_RE REQUIRED libre>=0.4.15)
include_directories(${LIB_RE_INCLUDE_DIRS})
link_directories(${LIB_RE_LIBRARY_DIRS})
# Dependency: librew
pkg_check_modules(LIB_REW REQUIRED librew>=0.4.0)
include_directories(${LIB_REW_INCLUDE_DIRS})
link_directories(${LIB_REW_LIBRARY_DIRS})
# Dependency: usrsctp
# TODO: Add a pkg-config file to usrsctp
find_library(LIB_USRSCTP_LIBRARIES NAMES usrsctp.a libusrsctp.a)
find_path(LIB_USRSCTP_INCLUDE_DIRS usrsctp.h)
get_filename_component(LIB_USRSCTP_LIBRARY_DIRS ${LIB_USRSCTP_LIBRARIES} DIRECTORY)
include_directories(${LIB_USRSCTP_INCLUDE_DIRS})
link_directories(${LIB_USRSCTP_LIBRARY_DIRS})
# Dependencies library list
set(rawrtc_DEP_LIBRARIES
Threads::Threads
${LIB_RE_LIBRARIES}
${LIB_REW_LIBRARIES}
${LIB_OPENSSL_LIBRARIES}
${LIB_USRSCTP_LIBRARIES})
# Walk through subdirectories
add_subdirectory(src)
# TODO: Generate pkg entry