forked from GPUOpen-LibrariesAndSDKs/Cauldron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (38 loc) · 1.63 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
cmake_minimum_required(VERSION 3.4)
set(CMAKE_GENERATOR_PLATFORM x64)
project (Cauldron_${GFX_API})
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
# output exe to bin directory
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin)
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_HOME_DIRECTORY}/bin )
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
# reference libs used by both backends
add_subdirectory(src/Common)
add_subdirectory(libs/json)
add_subdirectory(libs/ImGUI)
add_subdirectory(libs/stb)
add_subdirectory(libs/DXC)
if(GFX_API STREQUAL DX12)
add_subdirectory(libs/d3d12x)
add_subdirectory(libs/ags)
add_subdirectory(src/DX12)
elseif(GFX_API STREQUAL VK)
find_package(Vulkan REQUIRED)
add_subdirectory(libs/VulkanMemoryAllocator)
add_subdirectory(src/VK)
else()
message(STATUS "----------------------------------------------------------------------------------------")
message(STATUS "")
message(STATUS "** Almost there!!")
message(STATUS "")
message(STATUS " This framework supports DX12 or VULKAN, you need to invoke cmake in one of these ways:")
message(STATUS "")
message(STATUS " Examples:")
message(STATUS " cmake <project_root_dir> -DGFX_API=DX12")
message(STATUS " cmake <project_root_dir> -DGFX_API=VK")
message(STATUS "")
message(STATUS "----------------------------------------------------------------------------------------")
message(FATAL_ERROR "")
endif()