-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
40 lines (33 loc) · 941 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
project(Kdtree VERSION 1.0 LANGUAGES CXX)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_library(kdtree INTERFACE)
target_include_directories(kdtree INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
function(setWarnings target)
target_compile_options(${target} PRIVATE
-Wall
-Wextra
-Wshadow
-Wnon-virtual-dtor
-Wold-style-cast
-Wcast-align
-Wunused
-Woverloaded-virtual
-Wpedantic
-Wconversion
-Wsign-conversion
-Wmisleading-indentation
-Wnull-dereference
-Wdouble-promotion)
endfunction()
function(setStandard target)
target_compile_features(${target} PRIVATE cxx_std_17)
endfunction()
# Examples
option (BUILD_EXAMPLES "Build the examples." ON)
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif()