-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
75 lines (65 loc) · 1.08 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
cmake_minimum_required( VERSION 3.2.2 )
project( base2 )
### Verbosity
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )
set( CMAKE_COLOR_MAKEFILE ON )
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
### Optimizations
if( MSVC )
add_compile_options( /W4 )
elseif( CMAKE_COMPILER_IS_GNUCXX )
add_compile_options( -march=native )
add_compile_options( -Wall )
add_compile_options( -Wextra )
endif()
### libbase2
add_library(
base2
source/Base2.cpp
)
target_include_directories(
base2
PUBLIC
include
)
## base2
add_executable(
base2-bin
source/main.cpp
)
set_target_properties(
base2-bin PROPERTIES
OUTPUT_NAME "base2"
)
target_include_directories(
base2-bin
PRIVATE
include
)
target_link_libraries(
base2-bin
PRIVATE
base2
)
### Tests
enable_testing()
find_package(Catch2 3 REQUIRED)
add_library(catch ALIAS Catch2::Catch2)
add_executable(
base2-test
tests/base2-enc.cpp
)
target_include_directories(
base2-test
PRIVATE
include
)
target_link_libraries(
base2-test
PRIVATE
base2
Catch2::Catch2WithMain
)
add_test(base2-test base2-test)