Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (45 loc) · 2.08 KB
/
Copy pathCMakeLists.txt
File metadata and controls
52 lines (45 loc) · 2.08 KB
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
cmake_minimum_required(VERSION 3.24)
project(Ldx12 VERSION 0.4.0 LANGUAGES CXX)
set(LDX12_PROJECT_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
if(NOT WIN32)
message(FATAL_ERROR "Ldx12 currently supports only Windows.")
endif()
# Public build switches keep the same defaults for standalone and embedded builds.
option(LDX12_BUILD_APP "Build the optional App support library" ${PROJECT_IS_TOP_LEVEL})
option(LDX12_BUILD_EXAMPLES "Build the Ldx12 examples" ${PROJECT_IS_TOP_LEVEL})
option(LDX12_BUILD_TESTS "Build the Ldx12 tests" ${PROJECT_IS_TOP_LEVEL})
option(LDX12_BUILD_UTILS "Build the optional Ldx12 utility library" OFF)
option(LDX12_BUILD_THIRD_PARTY "Build bundled third-party integrations and samples" ${PROJECT_IS_TOP_LEVEL})
option(LDX12_INSTALL "Generate installation rules for Ldx12" ${PROJECT_IS_TOP_LEVEL})
option(LDX12_BUILD_DESKTOP_RETRO_OVERLAY "Build the Windows capture/D3D11 desktop overlay example" ${LDX12_BUILD_EXAMPLES})
set(LDX12_RESOURCE_PROFILE "HIGH" CACHE STRING "Static resource capacity: SMALL (256), MEDIUM (1024), HIGH (4096)")
set_property(CACHE LDX12_RESOURCE_PROFILE PROPERTY STRINGS SMALL MEDIUM HIGH)
string(TOUPPER "${LDX12_RESOURCE_PROFILE}" LDX12_SELECTED_RESOURCE_PROFILE)
if(NOT LDX12_SELECTED_RESOURCE_PROFILE MATCHES "^(SMALL|MEDIUM|HIGH)$")
message(FATAL_ERROR "LDX12_RESOURCE_PROFILE must be SMALL, MEDIUM or HIGH.")
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(GNUInstallDirs)
include(cmake/Ldx12BuildHelpers.cmake)
include(cmake/Ldx12Library.cmake)
# Examples need Utils even when it is not requested as an installable component.
set(LDX12_UTILS_AVAILABLE OFF)
if(LDX12_BUILD_UTILS OR LDX12_BUILD_EXAMPLES)
add_subdirectory(Utils/Ldx12)
set(LDX12_UTILS_AVAILABLE ON)
endif()
include(cmake/Ldx12App.cmake)
if(LDX12_BUILD_EXAMPLES)
add_subdirectory(samples)
endif()
if(LDX12_BUILD_DESKTOP_RETRO_OVERLAY)
add_subdirectory(samples/thirdParty/DesktopRetroOverlay)
endif()
if(LDX12_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(LDX12_INSTALL)
include(cmake/Ldx12Install.cmake)
endif()
include(cmake/Ldx12IDE.cmake)