-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
57 lines (44 loc) · 1.19 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
cmake_minimum_required(VERSION 3.20)
project(volpt LANGUAGES CXX)
option(BUILD_TESTS "build tests" OFF)
# spdlog
if(NOT TARGET spdlog)
find_package(spdlog REQUIRED)
endif()
# OpenMP
find_package(OpenMP)
if(NOT OpenMP_CXX_FOUND)
message(WARNING "failed to find OpenMP")
endif()
# Embree3
find_package(embree 3.0 REQUIRED)
if(${embree_FOUND})
message(STATUS "Found Embree")
else()
message(FATAL_ERROR "Could not find Embree")
endif()
# OpenVDB
find_package(OpenVDB REQUIRED)
if(${OpenVDB_FOUND})
message(STATUS "Found OpenVDB")
else()
message(FATAL_ERROR "Could not find OpenVDB")
endif()
# externals
add_subdirectory("externals")
# volpt
add_library(volpt INTERFACE)
target_include_directories(volpt INTERFACE "include")
target_compile_features(volpt INTERFACE cxx_std_20)
set_target_properties(volpt PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(volpt INTERFACE spdlog::spdlog)
target_link_libraries(volpt INTERFACE OpenMP::OpenMP_CXX)
target_link_libraries(volpt INTERFACE tinyobjloader)
target_link_libraries(volpt INTERFACE embree)
target_link_libraries(volpt INTERFACE OpenVDB::openvdb)
# examples
add_subdirectory("examples")
# tests
if(BUILD_TESTS)
add_subdirectory(tests)
endif()