-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
79 lines (63 loc) · 1.5 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
cmake_minimum_required(VERSION 3.8.2)
project(slope-spam)
enable_testing()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED 17)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
add_subdirectory(third_party/fmt)
find_package(Threads)
include_directories(
${CMAKE_SOURCE_DIR}/third_party
${CMAKE_SOURCE_DIR}/third_party/fmt/include
)
add_library(slope-spam-common OBJECT
src/spam/distance_matrix.cpp
src/spam/pattern.cpp
src/spam/sequence.cpp
src/spam/wordlist.cpp
src/config.cpp
src/filesystem.cpp
src/string.cpp
)
add_executable(slope-spam
$<TARGET_OBJECTS:slope-spam-common>
src/main.cpp
)
target_link_libraries(slope-spam
${CMAKE_THREAD_LIBS_INIT}
fmt::fmt
stdc++fs
)
add_executable(slope-spam-test
$<TARGET_OBJECTS:slope-spam-common>
src/config.test.cpp
src/main.test.cpp
src/string.test.cpp
src/spam/pattern.test.cpp
src/spam/wordlist.test.cpp
)
target_include_directories(slope-spam-test PRIVATE
${CMAKE_SOURCE_DIR}/third_party/catch2/single_include
)
target_link_libraries(slope-spam-test
${CMAKE_THREAD_LIBS_INIT}
fmt::fmt
stdc++fs
)
add_test(slope-spam-test slope-spam-test)
add_executable(generator
src/generator.cpp
)
add_executable(simulate
$<TARGET_OBJECTS:slope-spam-common>
src/simulate.cpp
src/generator.cpp
)
target_compile_definitions(simulate
PRIVATE -DGENERATOR_NO_MAIN
)
target_link_libraries(simulate
${CMAKE_THREAD_LIBS_INIT}
fmt::fmt
stdc++fs
)