-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
111 lines (85 loc) · 3.4 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
cmake_minimum_required(VERSION 3.19)
project(mad)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# SFML
find_package(SFML 2.5 COMPONENTS system window graphics audio REQUIRED)
set(LIBRARY_SFML sfml-system sfml-window sfml-graphics sfml-audio)
set(INCLUDE_SFML ${SFML_INCLUDE_DIR})
message(STATUS "SFML include: ${INCLUDE_SFML}")
message(STATUS "SFML library: ${LIBRARY_SFML}")
# OpenGL
find_package(OpenGL REQUIRED)
set(LIBRARY_OPENGL ${OPENGL_LIBRARIES})
set(INCLUDE_OPENGL ${OPENGL_INCLUDE_DIRS})
message(STATUS "OpenGL include: ${INCLUDE_OPENGL}")
message(STATUS "OpenGL library: ${LIBRARY_OPENGL}")
# Testing framework
set(DIRECTORY_GTEST ${PROJECT_SOURCE_DIR}/deps/googletest)
set(INCLUDE_GTEST ${DIRECTORY_GTEST}/googletest/include)
set(LIBRARY_GTEST gtest_main)
add_subdirectory(${DIRECTORY_GTEST})
message(STATUS "Gtest include: ${INCLUDE_GTEST}")
message(STATUS "Gtest library: ${LIBRARY_GTEST}")
# Physics library
set(DIRECTORY_BOX2D ${PROJECT_SOURCE_DIR}/deps/box2d)
set(INCLUDE_BOX2D ${DIRECTORY_BOX2D}/include)
set(LIBRARY_BOX2D box2d)
add_subdirectory(${DIRECTORY_BOX2D})
message(STATUS "Box2d include: ${INCLUDE_BOX2D}")
message(STATUS "Box2d library: ${LIBRARY_BOX2D}")
# ImGui library
set(DIRECTORY_IMGUI ${PROJECT_SOURCE_DIR}/deps/imgui)
set(INCLUDE_IMGUI ${DIRECTORY_IMGUI})
set(SOURCES_IMGUI
${DIRECTORY_IMGUI}/imgui.cpp
${DIRECTORY_IMGUI}/imgui_widgets.cpp
${DIRECTORY_IMGUI}/imgui_draw.cpp
${DIRECTORY_IMGUI}/imgui_tables.cpp
${DIRECTORY_IMGUI}/imgui_demo.cpp)
message(STATUS "ImGui include: ${INCLUDE_IMGUI}")
message(STATUS "ImGui sources: ${SOURCES_IMGUI}")
# JSON parce library
set(DIRECTORY_JSON ${PROJECT_SOURCE_DIR}/deps/json)
set(INCLUDE_JSON ${DIRECTORY_JSON}/include)
message(STATUS "JSON include: ${INCLUDE_JSON}")
# ImGui-sfml library
set(IMGUI_DIR ${DIRECTORY_IMGUI})
set(DIRECTORY_IMGUI_SFML ${PROJECT_SOURCE_DIR}/deps/imgui-sfml)
set(INCLUDE_IMGUI_SFML ${DIRECTORY_IMGUI_SFML})
set(SOURCES_IMGUI_SFML ${DIRECTORY_IMGUI_SFML}/imgui-SFML.cpp)
message(STATUS "ImGui-sfml include: ${INCLUDE_IMGUI_SFML}")
message(STATUS "ImGui-sfml sources: ${SOURCES_IMGUI_SFML}")
# Spdlog library
set(DIRECTORY_SPDLOG ${PROJECT_SOURCE_DIR}/deps/spdlog)
set(INCLUDE_SPDLOG ${DIRECTORY_SPDLOG}/include)
set(LIBRARY_SPDLOG spdlog)
add_subdirectory(${DIRECTORY_SPDLOG})
message(STATUS "Spdlog include: ${INCLUDE_SPDLOG}")
message(STATUS "Spdlog library: ${LIBRARY_SPDLOG}")
# PostgreSQL library
set(DIRECTORY_PQXX ${PROJECT_SOURCE_DIR}/deps/libpqxx)
set(INCLUDE_PQXX ${DIRECTORY_PQXX}/include)
set(LIBRARY_PQXX pqxx)
add_subdirectory(${DIRECTORY_PQXX})
message(STATUS "PostgreSQL include: ${INCLUDE_PQXX}")
message(STATUS "PostgreSQL library: ${LIBRARY_PQXX}")
# Core library
set(DIRECTORY_CORE ${PROJECT_SOURCE_DIR}/core)
set(INCLUDE_CORE ${DIRECTORY_CORE})
set(LIBRARY_CORE engine)
add_subdirectory(${DIRECTORY_CORE})
message(STATUS "Core include: ${INCLUDE_CORE}")
message(STATUS "Core library: ${LIBRARY_CORE}")
# Game binaries
set(DIRECTORY_GAME ${PROJECT_SOURCE_DIR}/game)
set(EXECUTABLE_GAME example)
set(EXECUTABLE_GAME_RUNNER game_runner_example)
set(EXECUTABLE_GAME_DATABASE game_database_example)
add_subdirectory(${DIRECTORY_GAME})
message(STATUS "Game executable: ${EXECUTABLE_GAME}")
message(STATUS "Game-runner executable ${EXECUTABLE_GAME_RUNNER}")
# Tests
set(DIRECTORY_TEST ${PROJECT_SOURCE_DIR}/test)
set(EXECUTABLE_TEST test)
add_subdirectory(${DIRECTORY_TEST})