-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
42 lines (34 loc) · 962 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
cmake_minimum_required(VERSION 3.20)
project(embree-tinyobj-example LANGUAGES C CXX)
# spdlog
if(NOT TARGET spdlog)
find_package(spdlog REQUIRED)
endif()
# OpenMP
find_package(OpenMP)
if(NOT OpenMP_CXX_FOUND)
message(WARNING "Could not 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")
add_library(lib INTERFACE)
target_include_directories(lib INTERFACE "include")
target_compile_features(lib INTERFACE cxx_std_17)
set_target_properties(lib PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(lib INTERFACE spdlog::spdlog)
target_link_libraries(lib INTERFACE OpenMP::OpenMP_CXX)
target_link_libraries(lib INTERFACE embree)
target_link_libraries(lib INTERFACE tinyobjloader)
# examples
add_subdirectory("examples")
# tests
if(BUILD_TESTS)
add_subdirectory(tests)
endif()