forked from nvpro-samples/vk_raytracing_tutorial_NV
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
46 lines (41 loc) · 2.03 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
cmake_minimum_required(VERSION 2.8)
project(vk_raytracing_tutorial)
#####################################################################################
# look for shared_sources 1) as a sub-folder 2) at some other locations
# this cannot be put anywhere else since we still didn't find CMakeLists_include.txt yet
#
if(NOT BASE_DIRECTORY) # if not defined, it means this cmake file was called as the first entry point and not included
# check if the external repository is outside or inside the project (as a sub-module)
# testing the file CMakeLists_include.txt because when sub-modules are not cloned, the folders are still there...
# we also assume here that if shared_sources is there, shared_external is, too...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/shared_sources/CMakeLists_include.txt)
Message(STATUS "found sub-folder shared_sources")
SET(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/shared_sources/CMakeLists_include.txt)
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../shared_sources)
SET(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../..)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../../shared_sources/CMakeLists_include.txt)
else()
SET(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../shared_sources/CMakeLists_include.txt)
endif()
SET(ADD_SHARED_SOURCES 1)
endif(NOT BASE_DIRECTORY)
_add_package_OpenGL()
_add_package_ImGUI()
_add_package_ZLIB()
_add_shared_sources_lib()
add_subdirectory(ray_tracing__advance)
add_subdirectory(ray_tracing__before)
add_subdirectory(ray_tracing__simple)
add_subdirectory(ray_tracing_animation)
add_subdirectory(ray_tracing_anyhit)
add_subdirectory(ray_tracing_callable)
add_subdirectory(ray_tracing_jitter_cam)
add_subdirectory(ray_tracing_manyhits)
add_subdirectory(ray_tracing_reflections)
add_subdirectory(ray_tracing_instances)
add_subdirectory(ray_tracing_intersection)
if(ADD_SHARED_SOURCES)
add_subdirectory(${BASE_DIRECTORY}/shared_sources ${CMAKE_BINARY_DIR}/shared_sources)
endif(ADD_SHARED_SOURCES)