-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
45 lines (36 loc) · 1006 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
41
42
43
44
45
cmake_minimum_required(VERSION 3.20)
project(photon_mapping 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()
# externals
add_subdirectory("externals")
# pm(photon_mapping)
add_library(pm INTERFACE)
target_include_directories(pm INTERFACE "include")
target_compile_features(pm INTERFACE cxx_std_20)
set_target_properties(pm PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(pm INTERFACE spdlog::spdlog)
target_link_libraries(pm INTERFACE OpenMP::OpenMP_CXX)
target_link_libraries(pm INTERFACE tinyobjloader)
target_link_libraries(pm INTERFACE embree)
# examples
add_subdirectory("examples")
# tests
if(BUILD_TESTS)
add_subdirectory(tests)
endif()