-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (44 loc) · 2.28 KB
/
Copy pathCMakeLists.txt
File metadata and controls
52 lines (44 loc) · 2.28 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
############################################################################
# Rotten MonoRepo CMake
# Builds the entirety of the rotten toolsets
#
# LICENSE : MIT
# Copyrite : Rotten
# Authors : Lawrence G,
############################################################################
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
if(TARGET rotten)
return()
endif()
project(rotten-monorepo VERSION 0.0.1 LANGUAGES C)
add_library(rotten INTERFACE)
# Add in all the cmake module paths and functions used by rotten
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(rotten-common)
# Make the cmake predefined targets like ALL_BUILD and ZERO_CHECK into a folder
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_CMakePredefinedTargets")
message("Rotten monorepo build system")
message("Target : ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR}")
message("Host : ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_PROCESSOR}")
# Enable the compile commands.json to be automatically generated
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "" FORCE)
# Allow the users to configure which rotten projects are built
option(ROTTEN_PROJECT_EXAMPLES "Build the rotten examples for all projecsts" ON)
option(ROTTEN_PROJECT_GFX "Build the rotten graphics abstraction layer" ON)
option(ROTTEN_PROJECT_RETRO "Build the rotten retro targets" ON)
option(ROTTEN_PROJECT_VK_BOTTOM "Build the rotten vulkan low level helpers" ON)
option(ROTTEN_PROJECT_VK_RUNTIME "Build the rotten vulkan runtime loader" ON)
option(ROTTEN_PROJECT_VK_TOP "Build the rotten vulkan high level helpers" ON)
option(ROTTEN_PROJECT_WINDOW "Build the rotten windowing system abstraction" ON)
# Set the options for linux only libraries. Each library also has an ifdef linux guard
# but better to be safe than sorry!
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(ROTTEN_LINUX_ONLY_LIBS ON)
else()
set(ROTTEN_LINUX_ONLY_LIBS OFF)
endif()
option(ROTTEN_PROJECT_XCB "Build linux XCB dynamic loader" ${ROTTEN_LINUX_ONLY_LIBS})
option(ROTTEN_PROJECT_WAYLAND "Build linux Wayland dynamic loader" ${ROTTEN_LINUX_ONLY_LIBS})
# Jump into the source directory to add in all of the different subprojects
add_subdirectory(src)