-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathCMakeLists.txt
36 lines (25 loc) · 1.08 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
cmake_minimum_required(VERSION 3.1.3)
project(Fast_BVH LANGUAGES CXX)
option(FASTBVH_BUILD_EXAMPLES "Whether or not to build the example programs." ON)
option(FASTBVH_BUILD_TESTS "Whether or not to build the unit tests." ON)
option(FASTBVH_BUILD_BENCHMARK "Whether or not to build the benchmark." OFF)
set(CMAKE_CXX_STANDARD 14)
set(gnu_cxxflags -Wall -Wextra -Werror -Wfatal-errors)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
list(APPEND gnu_cxxflags -ffast-math)
endif(CMAKE_BUILD_TYPE STREQUAL "Release")
if((CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
set(cxxflags ${gnu_cxxflags})
endif((CMAKE_CXX_COMPILER_ID STREQUAL GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
add_library(FastBVH INTERFACE)
target_include_directories(FastBVH INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
if(FASTBVH_BUILD_EXAMPLES)
add_subdirectory(examples)
endif(FASTBVH_BUILD_EXAMPLES)
if(FASTBVH_BUILD_TESTS)
add_subdirectory(tests)
enable_testing()
endif(FASTBVH_BUILD_TESTS)
if(FASTBVH_BUILD_BENCHMARK)
add_subdirectory(benchmark)
endif(FASTBVH_BUILD_BENCHMARK)