-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
89 lines (70 loc) · 2.47 KB
/
CMakeLists.txt
File metadata and controls
89 lines (70 loc) · 2.47 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
cmake_minimum_required(VERSION 3.15)
project(IXRay)
# CMake options
option(IXRAY_UTILS "Apply utils to solution" OFF)
option(IXRAY_EDITORS "Apply editors to solution" OFF)
option(IXRAY_MP "Apply multiplayer xrGame and multiplayer utilities to solution" OFF)
option(IXRAY_COMPRESSOR_ONLY "Build only compressor" OFF)
option(IXRAY_PLUGIN_MAX "Enable X-Ray Plugins for Autodesk 3ds Max" OFF)
option(IXRAY_PLUGIN_LW "Enable X-Ray Plugins for Lightwave 2020" OFF)
option(IXRAY_ASAN "Enable Address Sanitizer" OFF)
option(IXRAY_USE_R1 "Enable DirectX 9 static render" ON)
option(IXRAY_USE_R2 "Enable DirectX 9 dynamic render" ON)
option(IXRAY_USE_COMPRESSOR "Enable xrCompresor" ON)
option(IXRAY_UNITYBUILD "Enable UnityBuild for xrGame" ON)
# CMake Dev options
option(DEVIXRAY_ENABLE_SHIPPING "Enable shipping build cfg" OFF)
option(DEVIXRAY_ENABLE_OGL_RENDER "Enable OGL Render" OFF)
# VS options
set(CMAKE_EXECUTABLE_ENABLE_EXPORTS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if (MSVC)
include("cmake/msvc.cmake")
endif()
# Add new build types
include("cmake/shipping.cmake")
# Wrap CMake general configs
set(CMAKE_CONFIGURATION_TYPES ${IXR_CONFIGURATIONS_STR} CACHE STRING "" FORCE)
set(PREDEFINED_TARGETS_FOLDER "CustomTargets")
# Output target
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Set LLVM config
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
include("cmake/clang.cmake")
endif()
# Asan
if (IXRAY_ASAN)
add_compile_options(-fsanitize=address)
endif()
# Configure NuGet
if (WIN32)
include("cmake/windows/nuget.cmake")
else()
include("cmake/linux/nuget.cmake")
endif()
# Download API from GitHub Releases
include("cmake/github.cmake")
# SDK folders
set(IXRAY_SDK_LIB ${CMAKE_CURRENT_SOURCE_DIR}/sdk/libraries/${CMAKE_VS_PLATFORM_NAME}/)
set(IXRAY_SDK_BIN ${CMAKE_CURRENT_SOURCE_DIR}/sdk/binaries/${CMAKE_VS_PLATFORM_NAME}/)
set(IXRAY_SDK_INC ${CMAKE_CURRENT_SOURCE_DIR}/sdk/include/)
# Configure dependencies
set(RENDERDOC_API "${CMAKE_CURRENT_SOURCE_DIR}/src/3rd Party/renderdoc")
# CMake targets
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# 3rd libraries
add_subdirectory("src/3rd party")
# Engine libraries
add_subdirectory("src")
# Plugins
add_subdirectory("src/plugins")
# Utils
add_subdirectory("src/utils")
# Editors
if (IXRAY_EDITORS)
add_subdirectory("src/Editors")
endif()