-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
86 lines (67 loc) · 1.7 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
cmake_minimum_required(VERSION 3.5)
# ##############################################################################
# CMake Project ##
# ##############################################################################
# include useful macros
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/util.cmake)
# read metadata from package.xml and setup project
zetton_cc_metadata()
# set project name and version
project(
${extracted_name}
VERSION ${extracted_version}
LANGUAGES C CXX)
# =========#
# Settings #
# =========#
# introduce default building settings
zetton_cc_settings()
# =============#
# Dependencies #
# =============#
# ----------------------#
# Third-party libraries #
# ----------------------#
find_package(Threads REQUIRED)
# find_package(OpenCV 4 REQUIRED)
find_package(absl REQUIRED)
find_package(fmt REQUIRED)
# ##############################################################################
# Build #
# ##############################################################################
# ==============#
# Build targets #
# ==============#
include(GenerateExportHeader)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
# ---------------#
# Library target #
# ---------------#
# find all source files
file(GLOB_RECURSE src_files ${PROJECT_SOURCE_DIR}/src/*.cc
${PROJECT_SOURCE_DIR}/src/*/*.cc)
# common library
zetton_cc_library(
NAME
${PROJECT_NAME}
SRCS
${src_files}
INCLUDES
${OpenCV_INCLUDE_DIRS}
DEPS
Threads::Threads
${OpenCV_LIBS}
fmt::fmt
absl::time
absl::flags
absl::flags_parse)
# ------------------#
# Executable targets #
# ------------------#
zetton_cc_apps()
zetton_cc_examples()
# -------------#
# Test targets #
# -------------#
zetton_cc_tests("common")