-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
81 lines (77 loc) · 2.73 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
cmake_minimum_required (VERSION 3.15)
project (low_latency_hls)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(
-fdiagnostics-show-location=every-line
-DBOOST_LOG_DYN_LINK=1
-Wall
-g
)
########## Check Third party dependency
if( NOT EXISTS ${CMAKE_SOURCE_DIR}/third_party/avpp/av.h )
message(FATAL_ERROR
"Please clone and make 'avpp' in third_party folder:
git clone https://github.com/h4tr3d/avcpp.git ")
endif()
if( NOT EXISTS ${CMAKE_SOURCE_DIR}/third_party/redis-plus-plus/src/sw/redis++/redis++.h )
message(FATAL_ERROR
"Please clone and make 'redis++' in third_party folder:
git clone https://github.com/sewenew/redis-plus-plus.git")
endif()
if( NOT EXISTS ${CMAKE_SOURCE_DIR}/third_party/served/src/served/served.hpp )
message(FATAL_ERROR
"Please clone and make 'served' in third_party folder:
git clone https://github.com/meltwater/served.git")
endif()
find_package(Boost COMPONENTS system log log_setup REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LibAV REQUIRED
libavdevice
libavformat
libavresample
libavfilter
libavcodec
libavutil
)
#link_directories(
#${CMAKE_SOURCE_DIR}/third_party/avpp
#${CMAKE_SOURCE_DIR}/third_party/redis-plus-plus/build
#${CMAKE_SOURCE_DIR}/third_party/served/lib
#)
############# hls_generator
add_executable(hls_generator src/hls_generator.cpp src/hls_generator_main.cpp)
target_include_directories(hls_generator PUBLIC
third_party/avpp
third_party/redis-plus-plus/src
${LibAV_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
target_link_libraries (hls_generator
${Boost_LIBRARIES}
${LibAV_LIBRARIES}
)
############# hls_server
add_executable(hls_server
src/hls_server_main.cpp
src/hls_server.cpp
src/hls_manifest.cpp
src/redis_client.cpp
src/util.cpp
)
target_include_directories(hls_server PUBLIC
third_party/served/src/served
third_party/redis-plus-plus/src
third_party/redis-plus-plus/src/sw/redis++/no_tls
${Boost_INCLUDE_DIRS}
)
target_link_libraries (hls_server
${CMAKE_SOURCE_DIR}/third_party/hiredis/libhiredis.a
${CMAKE_SOURCE_DIR}/third_party/served/lib/libserved.a
${Boost_LIBRARIES}
pthread
)
add_subdirectory(test)
enable_testing ()
add_test (NAME MyTest COMMAND Test)