-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
54 lines (40 loc) · 1.99 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
cmake_minimum_required(VERSION 2.8.9)
project(directory_test)
# To automatically run MOC when building(Meta Object Compiler)
set(CMAKE_AUTOMOC ON)
# To automatically run UIC when building(User Interface Compiler)
set(CMAKE_AUTOUIC ON)
# To automatically run RCC when building(Resource Compiler)
set(CMAKE_AUTORCC ON)
include_directories(include)
#Can manually add the sources using the set command as follows:
set(SOURCES src/watch.cpp src/camera_manager.cpp src/objectdetection.cpp
src/objecttracker.cpp src/objectdetection_yolo.cpp src/objectdetection_yolotiny.cpp
src/objectdetection_ssdcaffe.cpp src/objectdetection_gender_caffe.cpp src/objectdetection_age_caffe.cpp
src/facerecognition.cpp src/qt/watch_qt_main.cpp src/qt/watch_qt.cpp src/qt/watch_dialog_qt.cpp
src/pipeline_manager.cpp src/database/watch_mysql.cpp
src/mat_serialize_helper.cpp)
find_package(OpenCV)
find_package(Qt5Core)
find_package(Qt5Gui)
find_package(Qt5Widgets)
find_package(Threads REQUIRED)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
message(STATUS " source path: ${CMAKE_CURRENT_SOURCE_DIR}")
#For the shared library:
set ( PROJECT_LINK_LIBS ${OpenCV_LIBS} )
include_directories(${OpenCV_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/json)
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "dir='${dir}'")
endforeach()
link_directories( ${OpenCV_LIBS} )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} -Wall -Wextra -pedantic -std=c++14 -g")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
file(GLOB ${SOURCES} ${SOURCES})
add_executable(watch ${SOURCES})
# Link your application with OpenCV libraries
target_link_libraries(watch ${OpenCV_LIBS} Qt5::Core Qt5::Gui Qt5::Widgets mysqlcppconn Threads::Threads)