This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
forked from alm4096/FFMPEG-Live555-H264-H265-Streamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
92 lines (76 loc) · 3.09 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
82
83
84
85
86
87
88
89
90
91
92
cmake_minimum_required(VERSION 3.13)
project(Test1)
set(CMAKE_CXX_STANDARD 11)
if(NOT DEFINED ENV{FFMPEG_PATH})
message(FATAL_ERROR "You must set FFMPEG_PATH environment variable")
endif()
message("Additional path: $ENV{FFMPEG_PATH}")
set(CMAKE_PREFIX_PATH "$ENV{FFMPEG_PATH}")
SET(live555example_HEADERS
Live555FFMPEG/Definitions.h
Live555FFMPEG/FFMPEGClass.h
Live555FFMPEG/Live555Class.h
Live555FFMPEG/Live555UsageEnv.h
Live555FFMPEG/Live_AnalyserInput.h
Live555FFMPEG/Live_AnalyserSource.h
Live555FFMPEG/Live_AnalysingServerMediaSubsession.h
Live555FFMPEG/MutexUtility.h
)
SET(live555example_SOURCES
Live555FFMPEG/FFMPEGClass.cpp
Live555FFMPEG/Live555Class.cpp
Live555FFMPEG/Live555FFMPEG.cpp
Live555FFMPEG/Live_AnalyserInput.cpp
Live555FFMPEG/Live_AnalyserSource.cpp
Live555FFMPEG/Live_AnalysingServerMediaSubsession.cpp
)
# mark headers as headers...
SET_SOURCE_FILES_PROPERTIES( ${live555example_HEADERS} PROPERTIES HEADER_FILE_ONLY TRUE )
# append to sources so that dependency checks work on headers
LIST(APPEND live555example_SOURCES ${live555example_HEADERS})
add_executable(live555Example ${live555example_SOURCES})
# PKG_CONFIG
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
message("PkgConfig Found")
endif()
## SDL2
#pkg_check_modules(SDL2 REQUIRED sdl2)
#if (SDL2_FOUND)
# message("SDL2 found: ${SDL2_VERSION}")
# message("Libraries: ${SDL2_LIBRARIES}")
# message("Include dirs: ${SDL2_INCLUDE_DIRS}")
# message("Additional flags: ${SDL2_CFLAGS_OTHER}")
#endif()
#
#target_link_libraries(Test1 ${SDL2_LIBRARIES})
#target_include_directories(Test1 PUBLIC ${SDL2_INCLUDE_DIRS})
#target_compile_options(Test1 PUBLIC ${SDL2_CFLAGS_OTHER})
#
#
# FFMPEG
pkg_check_modules(FFMPEG REQUIRED libavformat libavcodec libswscale libavutil)
if (FFMPEG_FOUND)
message("FFMPEG found: ${FFMPEG_VERSION}")
message("Libraries: ${FFMPEG_LINK_LIBRARIES}")
message("Include dirs: ${FFMPEG_INCLUDE_DIRS}")
message("Additional flags: ${FFMPEG_CFLAGS_OTHER}")
endif()
target_link_libraries(live555Example PRIVATE ${FFMPEG_LINK_LIBRARIES})
target_include_directories(live555Example PRIVATE ${FFMPEG_INCLUDE_DIRS})
target_compile_options(live555Example PRIVATE ${FFMPEG_CFLAGS_OTHER})
# LIVE555
if(NOT DEFINED ENV{LIVE555})
message(FATAL_ERROR "You must set LIVE555 environment variable")
endif()
message("LIVE555 path: $ENV{LIVE555}")
target_link_options(live555Example PRIVATE -L$ENV{LIVE555}/lib)
target_link_libraries(live555Example PRIVATE groupsock liveMedia BasicUsageEnvironment UsageEnvironment)
target_include_directories(live555Example PRIVATE $ENV{LIVE555}/include/BasicUsageEnvironment)
target_include_directories(live555Example PRIVATE $ENV{LIVE555}/include/groupsock)
target_include_directories(live555Example PRIVATE $ENV{LIVE555}/include/liveMedia)
target_include_directories(live555Example PRIVATE $ENV{LIVE555}/include/UsageEnvironment)
## Threads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(live555Example PRIVATE Threads::Threads)