-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
81 lines (62 loc) · 2.18 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
cmake_minimum_required(VERSION 3.1.3 FATAL_ERROR)
project("Quotient-Filter" CXX C) # C is needed for FindThreads
# ---------------------------------------
# Initial config
# ---------------------------------------
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Debug")
set(CMAKE_BUILD_TYPE "Debug")
endif()
find_package(Threads) # Needed for gtest
find_package(Doxygen)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# ---------------------------------------
# Helper functions
# ---------------------------------------
function(target_enable_all_warnings TARGET_ID)
target_compile_options(${TARGET_ID} PRIVATE
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>:
-Weverything
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-padded
>)
endfunction()
function(target_disable_global_constructor_warning TARGET_ID)
target_compile_options(${TARGET_ID} PRIVATE
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>:
-Wno-global-constructors
>)
endfunction()
function(configure_qf_target TARGET_ID)
target_enable_all_warnings(${TARGET_ID})
set_property(TARGET ${TARGET_ID} PROPERTY CXX_EXTENSIONS OFF)
endfunction()
function(add_qf_executable TARGET_ID)
add_executable(${TARGET_ID} ${ARGN})
target_link_libraries(${TARGET_ID} quotient_filter)
configure_qf_target(${TARGET_ID})
endfunction()
# ---------------------------------------
# Add utilities
# ---------------------------------------
add_subdirectory("utils")
# ---------------------------------------
# Add the Quotient-Filter library
# ---------------------------------------
add_subdirectory("src")
# ---------------------------------------
# Add the unit tests
# ---------------------------------------
enable_testing()
add_subdirectory("test")
# ---------------------------------------
# Add documentation
# ---------------------------------------
add_subdirectory("doc")
# ---------------------------------------
# Add benchmarks
# ---------------------------------------
add_subdirectory("benchmarks")