-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
64 lines (47 loc) · 2.17 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
cmake_minimum_required(VERSION 3.5.1)
project (pathed)
project (pathed_tests)
project (testbed)
# Compiler settings
set (CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
# Disable building extras we won't need (pure C++ project)
set(NANOGUI_BUILD_EXAMPLE OFF CACHE BOOL " " FORCE)
set(NANOGUI_BUILD_PYTHON OFF CACHE BOOL " " FORCE)
set(NANOGUI_INSTALL OFF CACHE BOOL " " FORCE)
# Add the configurations from nanogui
add_subdirectory(ext/nanogui)
include_directories(ext/nanogui/include)
# Add the configurations from embree
set(EMBREE_STATIC_LIB ON CACHE BOOL "Build Embree as a static library." FORCE)
set(EMBREE_ISPC_SUPPORT OFF CACHE BOOL "Build Embree with support for ISPC applications." FORCE)
set(EMBREE_TUTORIALS OFF CACHE BOOL "Enable to build Embree tutorials" FORCE)
set(EMBREE_RAY_MASK OFF CACHE BOOL "Enables ray mask support." FORCE)
SET(EMBREE_MAX_INSTANCE_LEVEL_COUNT 2)
add_subdirectory(ext/embree)
include_directories(ext/embree/include)
# ptex
SET(PTEX_BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE)
ADD_SUBDIRECTORY(ext/ptex)
INCLUDE_DIRECTORIES (ext/ptex/src/ptex)
# For reliability of parallel build, make the NanoGUI targets dependencies
set_property(TARGET glfw glfw_objects nanogui Ptex_static PROPERTY FOLDER "dependencies")
# .h files
include_directories(include)
include_directories(vendor)
# Source files
file(GLOB SOURCES "src/*.cpp")
file(GLOB TESTS "test/*.cpp")
# Various preprocessor definitions have been generated by NanoGUI
add_definitions(${NANOGUI_EXTRA_DEFS})
# On top of adding the path to nanogui/include, you may need extras
include_directories(${NANOGUI_EXTRA_INCS})
# Compile a target using NanoGUI
add_executable(pathed app/main.cpp ${SOURCES})
# Lastly, additional libraries may have been built for you. In addition to linking
# against NanoGUI, we need to link against those as well.
target_link_libraries(pathed nanogui ${NANOGUI_EXTRA_LIBS} embree Ptex_static)
add_executable(pathed_tests ${TESTS} ${SOURCES})
target_link_libraries(pathed_tests nanogui ${NANOGUI_EXTRA_LIBS} embree Ptex_static)
# add_executable(testbed app/testbed.cpp ${SOURCES})
# target_link_libraries(testbed nanogui ${NANOGUI_EXTRA_LIBS} embree Ptex_static)