forked from BlazingRenderer/BRender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (48 loc) · 1.56 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
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.23)
project(BRender)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Prefer glvnd
cmake_policy(SET CMP0072 NEW)
cmake_policy(SET CMP0079 NEW)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Perl REQUIRED)
if (BUILD_SHARED_LIBS)
message(FATAL_ERROR "BUILD_SHARED_LIBS is not supported at this time.")
endif ()
option(BRENDER_DISABLE_FINDSDL "Disable searching for SDL2" OFF)
if (NOT BRENDER_DISABLE_FINDSDL)
find_package(SDL2)
endif ()
option(BRENDER_BUILD_DRIVERS "Build Drivers" ON)
option(BRENDER_BUILD_SOFT "Build Software Renderer" OFF)
if (BRENDER_BUILD_SOFT AND (NOT WIN32 OR NOT MSVC OR (NOT CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")))
message(FATAL_ERROR "Can only build the software renderer on 32-bit Windows using MSVC.")
endif ()
add_subdirectory(core)
if (BRENDER_BUILD_DRIVERS)
add_subdirectory(drivers)
endif ()
##
# Core BRender, no drivers, no DDI.
##
add_library(BRender::Core ALIAS brender)
##
# Full BRender, with drivers, no DDI.
##
add_library(BRender::Full ALIAS brender-full)
##
# Core BRender, no drivers, with DDI.
##
add_library(BRender::DDI ALIAS brender-ddi)
option(BRENDER_BUILD_TOOLS "Build Tools" ON)
option(BRENDER_BUILD_EXAMPLES "Build Examples" ON)
option(BRENDER_DISABLE_INSTALL "Disable installation" OFF)
if (BRENDER_BUILD_TOOLS)
add_subdirectory(tools)
endif ()
if (BRENDER_BUILD_EXAMPLES AND BRENDER_BUILD_DRIVERS AND TARGET SDL2::SDL2)
add_subdirectory(examples)
endif ()
if (NOT BRENDER_DISABLE_INSTALL)
include(cmake/packaging.cmake)
endif ()