-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (32 loc) · 1.26 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
cmake_minimum_required(VERSION 3.22)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_COMPILER "/usr/local/bin/g++-10")
# Local Debug Mode Preprocessor
set(DEBUG_MODE FALSE)
if(DEBUG_MODE)
add_definitions(-DLOCAL_DEBUG)
endif()
# General Configuration
set(CMAKE_CXX_FLAGS "-fmax-errors=1")
project(wal VERSION 0.0 LANGUAGES CXX)
add_library(CRC STATIC include/CRC/CRC.h)
set_property(TARGET CRC PROPERTY CXX_STANDARD 11)
set_target_properties(CRC PROPERTIES LINKER_LANGUAGE CXX)
add_library(inc STATIC src/walstream.cpp include/walstream.h
src/walreader.cpp include/walreader.h
src/walwriter.cpp include/walwriter.h)
target_include_directories(inc PUBLIC include PUBLIC CRC)
add_executable(${PROJECT_NAME} src/main.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} PUBLIC inc CRC)
# Test CMake Configuration
set(MAKE_TESTS TRUE)
if(MAKE_TESTS)
add_executable(logtest tests/log_tests.cpp)
target_include_directories(logtest PUBLIC include)
target_link_libraries(logtest PUBLIC inc CRC)
add_executable(benchmark tests/bench.cpp)
target_include_directories(benchmark PUBLIC include)
target_link_libraries(benchmark PUBLIC inc CRC)
endif()