-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
97 lines (83 loc) · 3.75 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
unset(CMAKE_TOOLCHAIN_FILE)
cmake_minimum_required(VERSION 3.10)
project(pandora)
option(PANDORA_ISPC_SUPPORT "Use ISPC to accelerate voxelization" OFF)
option(PANDORA_BUILD_TESTS "Build tests for Pandora" OFF)
option(PANDORA_BUILD_ATLAS "Build Atlas (real-time viewer)" OFF)
option(PANDORA_BUILD_VOXEL_EXPORTER "Build voxel exporter" OFF)
option(PANDORA_BUILD_PBRT_IMPORTER "Build voxel exporter" OFF)
option(PANDORA_ISA_AVX512 "Compile code that uses AVX512" OFF)
option(LINK_STDCXX_FILESYSTEM "Add libstdc++ filesystem to the linker flags" OFF)
option(LINK_CXX_FILESYSTEM "Add libc++ filesystem to the linker flags" OFF)
if (WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(PANDORA_COMPILER "Clang-cl")
else()
set(PANDORA_COMPILER ${CMAKE_CXX_COMPILER_ID})
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")
include("${CMAKE_CURRENT_LIST_DIR}/cmake/enable_simd.cmake")
if (PANDORA_ISPC_SUPPORT)
include("${CMAKE_CURRENT_LIST_DIR}/cmake/ispc.cmake")
endif()
# vcpkg only installs Release and Debug libraries. Map RelWithDebInfo to Release.
set(CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL MinSizeRel Release)
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release)
find_package(assimp CONFIG REQUIRED)
find_package(EASTL CONFIG REQUIRED)
find_package(EABase CONFIG REQUIRED)
find_package(glm REQUIRED)
find_package(Boost REQUIRED COMPONENTS program_options)
find_package(fmt CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(mio CONFIG REQUIRED)
find_package(Threads REQUIRED)
find_package(TBB CONFIG REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(OpenImageIO CONFIG REQUIRED)
find_package(embree 3 CONFIG REQUIRED)
find_package(Cnl CONFIG REQUIRED)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/third_party/optick/" EXCLUDE_FROM_ALL)
if (PANDORA_COMPILER MATCHES "Clang-cl")
# Ignore warnings about dllexport and strcat being deprecated/unsafe.
target_compile_options(OptickCore PUBLIC "-Wno-ignored-attributes" "-Wno-deprecated-declarations")
endif()
get_target_property(EASTL_LOC EASTL IMPORTED_LOCATION_DEBUG)
message("EASTL LOC: ${EASTL_LOC}")
# Modified version of mio (https://github.com/mandreyel/mio) with a flag added to control the file system cache.
add_library(mio_cache_control INTERFACE)
target_include_directories(mio_cache_control INTERFACE "${CMAKE_CURRENT_LIST_DIR}/third_party/mio_cache_control/include/")
#if (PANDORA_BUILD_VOXEL_EXPORTER)
# add_library(tinyply "${CMAKE_CURRENT_LIST_DIR}/third_party/tinyply/source/tinyply.cpp")
# target_include_directories(tinyply PUBLIC "${CMAKE_CURRENT_LIST_DIR}/third_party/tinyply/source/")
#
# add_subdirectory("projects/voxel/")
#endif()
find_package(Flatbuffers CONFIG REQUIRED)
if (TARGET flatbuffers::flatc)
get_property(FLATBUFFERS_FLATC_EXECUTABLE TARGET flatbuffers::flatc PROPERTY IMPORTED_LOCATION_RELEASE)
elseif (NOT DEFINED FLATBUFFERS_FLATC_EXECUTABLE)
message(FATAL_ERROR "Please define FLATBUFFERS_FLATC_EXECUTABLE as the path to the flatbuffer executable")
endif()
include("cmake/BuildFlatBuffers.cmake") # Include cmake script that defines the flatc compile function
if (PANDORA_BUILD_TESTS)
enable_testing()
find_package(GTest CONFIG REQUIRED)
set(SIMD_BUILD_TESTS ON)
set(STREAM_BUILD_TESTS ON)
endif()
if (PANDORA_BUILD_ATLAS)
find_package(glfw3 REQUIRED)
find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)
endif()
add_subdirectory("projects/diskbench/")
add_subdirectory("projects/stream_framework/")
include("projects/simd/CMakeLists.txt")
include("projects/metrics/CMakeLists.txt")
include("projects/pandora/CMakeLists.txt")
add_subdirectory("projects/pbf_importer/")
add_subdirectory("projects/pbrt_importer2/")
if (PANDORA_BUILD_ATLAS)
include("projects/atlas/CMakeLists.txt")
endif()
include("projects/torque/CMakeLists.txt")