This repository has been archived by the owner on Apr 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
56 lines (46 loc) · 2.23 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
cmake_minimum_required( VERSION 3.10 FATAL_ERROR )
project( "FrameGraph-Samples" LANGUAGES C CXX )
set_property( GLOBAL PROPERTY USE_FOLDERS ON )
# this options required for samples
set( FG_ENABLE_ASSIMP ON CACHE INTERNAL "" FORCE )
set( FG_ENABLE_GLM ON CACHE INTERNAL "" FORCE )
set( FG_ENABLE_DEVIL ON CACHE INTERNAL "" FORCE )
set( FG_ENABLE_STB ON CACHE BOOL "" FORCE )
set( FG_ENABLE_TINYOBJ ON CACHE BOOL "" FORCE )
set( FG_ENABLE_IMGUI ON CACHE BOOL "" FORCE )
add_subdirectory( "FrameGraph" )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${MAIN_BINARY_DIR}" )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${MAIN_BINARY_DIR}" )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${MAIN_BINARY_DIR}" )
# prepare for external projects
if (TRUE)
include( ExternalProject )
set( FG_LIST_SEPARATOR "|" )
string( REPLACE ";" "${FG_LIST_SEPARATOR}" FG_EXTERNAL_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" )
set( FG_BUILD_TARGET_FLAGS "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}"
"-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
"-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}"
"-DCMAKE_STATIC_LINKER_FLAGS=${CMAKE_STATIC_LINKER_FLAGS}"
"-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}" )
foreach ( CONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${CONFIG} OUT_CONFIG )
set( FG_BUILD_TARGET_FLAGS
"${FG_BUILD_TARGET_FLAGS}"
"-DCMAKE_C_FLAGS_${OUT_CONFIG}=${CMAKE_C_FLAGS_${OUT_CONFIG}}"
"-DCMAKE_CXX_FLAGS_${OUT_CONFIG}=${CMAKE_CXX_FLAGS_${OUT_CONFIG}}"
"-DCMAKE_EXE_LINKER_FLAGS_${OUT_CONFIG}=${CMAKE_EXE_LINKER_FLAGS_${OUT_CONFIG}}"
"-DCMAKE_STATIC_LINKER_FLAGS_${OUT_CONFIG}=${CMAKE_STATIC_LINKER_FLAGS_${OUT_CONFIG}}"
"-DCMAKE_SHARED_LINKER_FLAGS_${OUT_CONFIG}=${CMAKE_SHARED_LINKER_FLAGS_${OUT_CONFIG}}" )
endforeach ()
endif ()
include( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_stb.cmake" )
include( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_tinyobj.cmake" )
add_subdirectory( "samples/utils" )
add_subdirectory( "samples/clouds" )
add_subdirectory( "samples/particles" )
add_subdirectory( "samples/planet" )
add_subdirectory( "samples/ray_tracing" )
add_subdirectory( "samples/shadertoy" )
add_subdirectory( "samples/vulkan" )