-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
58 lines (49 loc) · 1.2 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
cmake_minimum_required(VERSION 3.10)
project(Traffic)
# Enable C++17 standard and set common compiler flags
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
find_package(PkgConfig REQUIRED)
pkg_check_modules(OPENCV REQUIRED opencv4)
find_package(OpenCV REQUIRED)
find_package(gflags REQUIRED)
# Include directories
include_directories(
${OpenCV_INCLUDE_DIRS}
${GFLAGS_INCLUDE_DIRS}
include
/usr/include/eigen3
/usr/local/include/eigen3
)
# Source files
set(SRC_FILES
src/BYTETracker.cpp
src/MJPG_sender.cpp
src/MJPGthread.cpp
src/MQTT.cpp
src/STrack.cpp
src/TChannel.cpp
src/Tjson.cpp
src/kalmanFilter.cpp
src/lapjv.cpp
src/main.cpp
src/postprocess.cpp
src/utils.cpp
)
# Apply common compiler flags
add_compile_options(${COMMON_FLAGS})
set(EXECUTABLE_OUTPUT_PATH "../")
# Add executable
add_executable(Traffic ${SRC_FILES})
# Link libraries using the new-style (keyword) approach
target_link_libraries(Traffic
PRIVATE
${OpenCV_LIBS}
${GFLAGS_LIBRARIES}
/usr/local/lib/librknnrt.so
/usr/local/lib/libpaho-mqtt3c.so
dl
pthread
)
# Add link options
target_link_options(Traffic PRIVATE -fopenmp -s)