-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
52 lines (45 loc) · 1.74 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
cmake_minimum_required(VERSION 3.16)
if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/CMakeLists.txt")
message(FATAL_ERROR
"In-source builds are not allowed, please create a 'build' subfolder and use `cmake ..` inside it.\n"
"NOTE: cmake will now create CMakeCache.txt and CMakeFiles/*.\n"
"You must delete them, or cmake will refuse to work.")
endif()
option(USE_CODE_TIDY "Use code static analysis on build" ON)
project(rtsp-cam
VERSION 1.0.0
LANGUAGES CXX)
if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(GStreamer REQUIRED IMPORTED_TARGET gstreamer-rtsp-server-1.0 gstreamer-app-1.0)
add_executable(${PROJECT_NAME}
src/CameraManager.cpp
src/CameraManager.h
src/EncodingPipeline.cpp
src/EncodingPipeline.h
src/IFrameProducer.h
src/ImageWriter.cpp
src/ImageWriter.h
src/IStreamConsumer.h
src/main.cpp
src/StreamingServer.cpp
src/StreamingServer.h
src/StreamRecorder.cpp
src/StreamRecorder.h)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Werror)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::GStreamer)
if(USE_CODE_TIDY)
find_program(CLANG_TIDY_EXE
NAMES clang-tidy-13 clang-tidy-12 clang-tidy
DOC "Path to clang-tidy executable")
if(CLANG_TIDY_EXE)
message(STATUS "Using clang-tidy from ${CLANG_TIDY_EXE}")
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
else()
message(WARNING "clang-tidy not found, please install tool and relaunch configuration")
endif()
endif()