-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 1.17 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
cmake_minimum_required(VERSION 3.14)
project(lxstreamer
VERSION 1.0.0
LANGUAGES C CXX
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin/examples")
set(DIR_3RDPARTIES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty" CACHE PATH "path to 3rdparty libs")
option(HTTPS "compile with https support" ON)
option(BUILD_EXAMPLES "build examples" ON)
list(PREPEND CMAKE_INCLUDE_PATH "${DIR_3RDPARTIES}/ffmpeg/include")
list(PREPEND CMAKE_LIBRARY_PATH "${DIR_3RDPARTIES}/ffmpeg/lib" )
list(PREPEND CMAKE_PREFIX_PATH "${DIR_3RDPARTIES}" )
list(REMOVE_DUPLICATES CMAKE_INCLUDE_PATH)
list(REMOVE_DUPLICATES CMAKE_LIBRARY_PATH)
list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH)
include_directories(${CMAKE_INCLUDE_PATH})
link_directories(${CMAKE_LIBRARY_PATH})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(FFMPEG REQUIRED
COMPONENTS avfilter avformat avcodec avdevice swresample swscale avutil
)
if(HTTPS)
list(PREPEND CMAKE_PREFIX_PATH "${DIR_3RDPARTIES}/openssl" )
find_package(OpenSSL)
add_compile_definitions(MG_ENABLE_SSL=1)
endif()
add_subdirectory(src)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()