-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
58 lines (46 loc) · 1.38 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.1)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
project(lyli C CXX)
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wstrict-aliasing -Wextra")
################
# Dependencies #
################
# GUI (optional)
find_package(Qt5Core)
find_package(Qt5Widgets)
# minimal dependencies
find_package(JsonCpp REQUIRED 1.4.0)
find_package(OpenCV REQUIRED)
find_package(TBB REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUSB REQUIRED libusb-1.0>=1.0.0)
find_package(Threads)
# pass the OpenCV version as a define (the included defines are not reliable for OpenCV 2)
add_definitions(-DOPENCV_VERSION=${OpenCV_VERSION_MAJOR})
# pkg-config to find libusbpp-1.0
find_package(PkgConfig REQUIRED)
pkg_check_modules(USBPP REQUIRED usbpp)
##################
# Compiler flags #
##################
set(CMAKE_CXX_STANDARD 14)
add_definitions(${TBB_DEFINITIONS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${JsonCpp_INCLUDE_DIRS})
include_directories(${TBB_INCLUDE_DIRS})
include_directories(${LIBUSB_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(lib)
#########
# Build #
#########
# liblyli
add_subdirectory(lib)
# ui part
if (Qt5Core_FOUND AND Qt5Widgets_FOUND)
add_subdirectory(ui)
else (Qt5Core_FOUND AND Qt5Widgets_FOUND)
message(ERROR Qt5 not found)
endif()
# aditional tools
add_subdirectory(tools)