-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
82 lines (61 loc) · 1.66 KB
/
CMakeLists.txt
File metadata and controls
82 lines (61 loc) · 1.66 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
cmake_minimum_required(VERSION 3.13)
project(ge211
VERSION 2021.6.0
DESCRIPTION "A student game engine"
LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
###
### OPTIONS
###
option(BUILD_TESTS
"Build GE211 tests"
Off)
option(BUILD_DOCS
"Create the HTML-based API documentation (requires Doxygen)"
Off)
option(DOWNLOAD_STDLIB_TAGS
"Download tags for linking GE211 docs to the C++ standard library"
On)
###
### DEPENDENCIES
###
# For Apple Silicon (ARM). (This can go away when CMake is updated to
# know about it.)
if (APPLE AND EXISTS /opt/homebrew)
message(STATUS "GE211: Adding /opt/homebrew to system search path")
list(PREPEND CMAKE_SYSTEM_PREFIX_PATH /opt/homebrew)
list(REMOVE_DUPLICATES CMAKE_SYSTEM_PREFIX_PATH)
endif ()
# Prefer Homebrew's /usr/local to Valve's /Library/Frameworks:
set(CMAKE_FIND_FRAMEWORK LAST)
# Don't link in SDL2's main():
set(SDL2_BUILDING_LIBRARY 1)
add_subdirectory(3rdparty/utf8-cpp/ EXCLUDE_FROM_ALL)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)
###
### MAIN LIBRARY SETUP
###
configure_file(include/ge211/version.hxx.in
include/ge211/version.hxx)
add_subdirectory(src/)
###
### EXTRAS
###
# Tests
if (BUILD_TESTS)
add_subdirectory(3rdparty/doctest/ EXCLUDE_FROM_ALL)
add_subdirectory(test/)
endif ()
# HTML documentation
if(BUILD_DOCS)
find_package(Doxygen REQUIRED)
add_subdirectory(doc/)
endif()
# Support library installation
include(Ge211Installer)
# Example client program
set(GE211_INHERITED 1)
add_subdirectory(example/)