forked from Forceflow/libmorton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (34 loc) · 996 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
# CMake version >= 3.8.2
# This requirement is for the "cxx_std_11" variable in target_compile_features().
cmake_minimum_required(VERSION 3.8.2)
project(libmorton CXX)
option(LIBMORTON_BUILD_TESTS "Build unit tests for libmorton" ON)
add_library(libmorton INTERFACE)
target_compile_features(libmorton
INTERFACE
cxx_std_11
)
target_compile_options(libmorton
INTERFACE
# gcc and clang
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>>:-Wall -Wextra -Wpedantic>
# Intel compiler
$<$<CXX_COMPILER_ID:Intel>:$<IF:$<PLATFORM_ID:Windows>,/W3,-w3>>
# MSVC
$<$<CXX_COMPILER_ID:MSVC>:/W3>
)
target_compile_definitions(libmorton
INTERFACE
# MSVC
# To avoid errors related to std::min/std::max
$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX>
)
target_include_directories(libmorton
INTERFACE
libmorton/include
)
add_subdirectory(libmorton)
add_library(libmorton::libmorton ALIAS libmorton)
if (LIBMORTON_BUILD_TESTS)
add_subdirectory(test)
endif()