-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (49 loc) · 1.04 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
cmake_minimum_required(VERSION 3.28.1)
project(time_tracker VERSION 1.1.0)
set(CMAKE_CXX_STANDARD 17)
add_library(time_tracker_common STATIC
src/db.cc
src/printer.cc
src/record.cc
src/timestamp.cc
src/type.cc
)
target_include_directories(time_tracker_common
PUBLIC
src
)
find_package(fmt REQUIRED)
find_package(SQLite3 REQUIRED)
target_link_libraries(time_tracker_common
PUBLIC
fmt::fmt
PRIVATE
SQLite::SQLite3
)
add_executable(time_tracker
src/main.cc
)
find_package(Boost COMPONENTS program_options REQUIRED)
target_link_libraries(time_tracker
PRIVATE
Boost::program_options
time_tracker_common
)
add_executable(time_tracker_test
test/db_test.cc
test/printer_test.cc
test/record_test.cc
test/timestamp_test.cc
test/type_test.cc
)
find_package(GTest REQUIRED)
target_link_libraries(time_tracker_test
PRIVATE
GTest::gmock
GTest::gtest_main
time_tracker_common
)
enable_testing()
add_test(NAME time_tracker_test COMMAND time_tracker_test)
install(TARGETS time_tracker DESTINATION bin)
include(CPack)