forked from versatica/mediasoup-broadcaster-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (61 loc) · 2.03 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
cmake_minimum_required(VERSION 3.8)
project(broadcaster LANGUAGES CXX)
# Set version number.
set(broadcaster_VERSION_MAJOR 0)
set(broadcaster_VERSION_MINOR 1)
# C++ standard requirements.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Add some compile flags to our source files.
set_source_files_properties(${SOURCE_FILES}
PROPERTIES COMPILE_FLAGS -Wall -Wextra -Wpedantic)
# Create target.
add_executable(${PROJECT_NAME} ${SOURCES})
# Extra libs required in order to use Apple media devices.
if(APPLE)
find_library(APPLICATION_SERVICES ApplicationServices)
find_library(AUDIO_TOOLBOX AudioToolbox)
find_library(AV_FOUNDATION AVFoundation)
find_library(CORE_AUDIO CoreAudio)
find_library(CORE_FOUNDATION Foundation)
find_library(CORE_MEDIA CoreMedia)
find_library(CORE_VIDEO CoreVideo)
find_library(CORE_SERVICES CoreServices)
target_link_libraries(${PROJECT_NAME} PUBLIC
${APPLICATION_SERVICES}
${AUDIO_TOOLBOX}
${AV_FOUNDATION}
${CORE_AUDIO}
${CORE_FOUNDATION}
${CORE_MEDIA}
${CORE_VIDEO}
${CORE_SERVICES}
)
endif(APPLE)
target_sources(${PROJECT_NAME} PRIVATE
src/Broadcaster.cpp
src/main.cpp
src/MediaStreamTrackFactory.cpp
src/fakegenerators/fake_audio_capture_module.cc
src/fakegenerators/fake_frame_source.cc
src/fakegenerators/frame_generator_capturer.cc
src/fakegenerators/frame_generator.cc
src/fakegenerators/test_video_capturer.cc
src/fakegenerators/frame_utils.cc
src/fakegenerators/task_queue_for_test.cc
)
# Private (implementation) header files.
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include)
# Source Dependencies.
add_subdirectory(deps/libmediasoupclient "${CMAKE_CURRENT_BINARY_DIR}/libmediasoupclient")
add_subdirectory(deps/cpr "${CMAKE_CURRENT_BINARY_DIR}/cpr")
# Public (interface) headers from dependencies.
target_include_directories(${PROJECT_NAME} PUBLIC
"${PROJECT_SOURCE_DIR}/deps/libmediasoupclient/include"
${CPR_INCLUDE_DIRS}
)
# Public (interface) dependencies.
target_link_libraries(${PROJECT_NAME} PUBLIC
mediasoupclient
${CPR_LIBRARIES}
)