-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
38 lines (33 loc) · 1 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
cmake_minimum_required(VERSION 3.14)
project(baudvine-ringbuf)
# Build options
option(RINGBUF_TESTS "Build the baudvine-ringbuf tests" ON)
# Library configuration. Header-only, so "interface"
add_library(baudvine-ringbuf INTERFACE)
target_include_directories(baudvine-ringbuf INTERFACE include)
target_compile_features(baudvine-ringbuf INTERFACE cxx_std_11)
if (MSVC)
add_compile_options(
/W4
# C4127 "conditional expression is constant" - don't have `if constexpr` in c++11
/wd4127
)
else ()
add_compile_options(-Wall -Wextra -Wpedantic -Werror=return-type)
endif ()
# Install configuration
set_target_properties(baudvine-ringbuf
PROPERTIES
PUBLIC_HEADER include/baudvine/ringbuf.h
)
include(GNUInstallDirs)
install(
TARGETS baudvine-ringbuf
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/baudvine/ringbuf/
)
# Build the tests (or not)
if (${RINGBUF_TESTS})
enable_testing()
add_subdirectory(test)
endif ()