-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
84 lines (54 loc) · 1.61 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
cmake_minimum_required(VERSION 3.8)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(
HUNTER_CACHE_SERVERS
"https://github.com/bmstu-iu8-cpp-sem-3/hunter-cache"
CACHE STRING "Default cache server"
)
include("tools/gate/cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.218.tar.gz"
SHA1 "9a3594a61227967fb92159339ba326701b287b19"
)
project(lab_o_two)
string(APPEND CMAKE_CXX_FLAGS " -pedantic -Wall -Wextra")
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-command-line-argument")
string(APPEND CMAKE_CXX_FLAGS " -Wshadow -Wnon-virtual-dtor")
hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED)
add_library(date STATIC
${CMAKE_CURRENT_SOURCE_DIR}/Logic/Date.cpp
)
add_library(rand STATIC
${CMAKE_CURRENT_SOURCE_DIR}/Generators/Randomizer.cpp
)
add_library(name STATIC
${CMAKE_CURRENT_SOURCE_DIR}/Generators/NameGenerator.cpp
)
add_executable(tests
${CMAKE_CURRENT_SOURCE_DIR}/tests/test.cpp
)
target_include_directories(date
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Logic
)
target_include_directories(tests
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Logic
)
target_include_directories(date
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(tests
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(rand
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Generators
)
target_include_directories(name
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Generators
)
target_link_libraries(date rand)
target_link_libraries(name rand)
target_link_libraries(tests GTest::main date rand name)
enable_testing()
add_test(NAME unit_tests COMMAND tests)