-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
77 lines (68 loc) · 2.09 KB
/
CMakeLists.txt
File metadata and controls
77 lines (68 loc) · 2.09 KB
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
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0146 OLD)
project(StreamVision-Client LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZeroMQ REQUIRED libzmq)
find_package(OpenCV REQUIRED)
find_package(nlohmann_json REQUIRED)
find_path(CPPZMQ_INCLUDE_DIR zmq.hpp)
if(CPPZMQ_INCLUDE_DIR)
message(STATUS "Found cppzmq at ${CPPZMQ_INCLUDE_DIR}")
else()
message(FATAL_ERROR "cppzmq not found!")
endif()
find_package(httplib REQUIRED)
find_package(tinyxml2 REQUIRED)
find_package(spdlog REQUIRED)
set(SOURCES
src/main.cpp
src/CameraCapture.cpp
src/FrameHandler.cpp
src/PipelineController.cpp
src/Drawer.cpp
src/WebStream.cpp
src/ConfigXML.cpp
)
add_executable(streamvision-client ${SOURCES})
target_include_directories(streamvision-client
PRIVATE
${OpenCV_INCLUDE_DIRS}
${ZeroMQ_INCLUDE_DIRS}
${CPPZMQ_INCLUDE_DIR}
${httplib_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/include
)
target_link_libraries(streamvision-client
PRIVATE
${OpenCV_LIBS}
${ZeroMQ_LIBRARIES}
nlohmann_json::nlohmann_json
tinyxml2::tinyxml2
spdlog::spdlog
)
target_compile_options(streamvision-client PRIVATE
$<$<CONFIG:Debug>:-g -O0 -Wall -Wextra -Wpedantic -Werror -Wimplicit-fallthrough -Wsign-conversion>
$<$<CONFIG:Release>:-O3>
)
# Doxygen Documentation
option(BUILD_DOCS "Build Doxygen documentation" OFF)
find_package(Doxygen QUIET)
if(BUILD_DOCS AND DOXYGEN_FOUND)
add_custom_target(doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
elseif(NOT BUILD_DOCS)
message(STATUS "BUILD_DOCS is OFF.")
else()
message(STATUS "Doxygen not found. Documentation target will not be available.")
endif()