-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
52 lines (40 loc) · 1.5 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
cmake_minimum_required(VERSION 3.22)
project(big2-stack VERSION 0.0.9)
set(USE_FOLDERS TRUE)
set(CMAKE_FOLDER "BIG2")
# Requirements
find_package(Git)
if (NOT GIT_FOUND)
message(FATAL_ERROR "Git needs to be installed to pull the dependencies")
else()
string(REGEX MATCH "^[0-9]+[.][0-9]+" GIT_VERSION "${GIT_VERSION_STRING}")
if("${GIT_VERSION}" LESS "2.35")
message(FATAL_ERROR "Git version of 2.35 is needed for patch application")
endif()
endif()
# Options
include(CMakeDependentOption)
option(BIG2_PROGRAMMER "Adds a more strict warnings and compiler flags" ${PROJECT_IS_TOP_LEVEL})
option(BIG2_BUILD_EXAMPLES "Whether or not to build examples with this stack" "${PROJECT_IS_TOP_LEVEL}")
option(BIG2_BUILD_DOCS "Whether or not to generate documentation" "${PROJECT_IS_TOP_LEVEL}")
option(BIG2_INCLUDE_IMGUI "Whether or not to add imgui into the mix" ON)
cmake_dependent_option(BIG2_USE_IMGUI_DOCKING "Will use the docking branch of ImGui" OFF "BIG2_INCLUDE_IMGUI" OFF)
if(BIG2_USE_IMGUI_DOCKING)
set(IMGUI_VERSION "docking")
else()
set(IMGUI_VERSION "v1.89.4")
endif ()
include(cmake/utils.cmake)
# Dependencies
include(external/cmake-snippets/JsonDependency.cmake)
json_config_dependencies(FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake-config.json" MEMBER_SELECTOR "dependencies")
if("${BIG2_INCLUDE_IMGUI}")
include(cmake/imgui.cmake)
endif()
add_subdirectory(big2)
if(BIG2_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(BIG2_BUILD_DOCS)
include(cmake/docs.cmake)
endif ()