This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
89 lines (75 loc) · 3.03 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
cmake_minimum_required(VERSION 3.10)
project(Incogine)
set(CMAKE_CXX_STANDARD 11)
add_definitions("-Wall" "-g")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
INCLUDE_DIRECTORIES(./reqs/include)
LINK_DIRECTORIES(./reqs/lib)
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
find_package(SDL2_ttf REQUIRED)
include_directories(${SDL2_TTF_INCLUDE_DIRS})
find_package(SDL2_image REQUIRED)
include_directories(${SDL2_IMAGE_INCLUDE_DIRS})
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
include_directories(./src)
file(GLOB SOURCES
"./src/*.cpp"
"./src/*.h"
"./src/*.hpp"
)
include_directories(./src/core)
file(GLOB SOURCES_CORE
"./src/core/*.cpp"
"./src/core/*.h"
"./src/core/*.hpp"
)
include_directories(./src/core/objects)
file(GLOB SOURCES_CORE_OBJECTS
"./src/core/objects/*.cpp"
"./src/core/objects/*.h"
"./src/core/objects/*.hpp"
)
include_directories(./src/core/misc)
file(GLOB SOURCES_CORE_MISC
"./src/core/misc/*.cpp"
"./src/core/misc/*.h"
"./src/core/misc/*.hpp"
)
include_directories(./src/core/misc/console)
file(GLOB SOURCES_CORE_MISC_CONSOLE
"./src/core/misc/console/*.cpp"
"./src/core/misc/console/*.h"
"./src/core/misc/console/*.hpp"
)
include_directories(./src/core/objects/components)
file(GLOB SOURCES_CORE_OBJECTS_COMPONENTS
"./src/core/objects/components/*.cpp"
"./src/core/objects/components/*.h"
"./src/core/objects/components/*.hpp"
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "Main" FILES ${SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src/core PREFIX "Main/Core" FILES ${SOURCES_CORE})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src/core/misc PREFIX "Main/Core/Misc" FILES ${SOURCES_CORE_MISC})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src/core/misc/console PREFIX "Main/Core/Misc/Console" FILES ${SOURCES_CORE_MISC_CONSOLE})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src/core/objects PREFIX "Main/Core/Objects" FILES ${SOURCES_CORE_OBJECTS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src/core/objects/components PREFIX "Main/Core/Objects/Components" FILES ${SOURCES_CORE_OBJECTS_COMPONENTS})
include_directories(./src/game)
file(GLOB SOURCES_GAME
"./src/game/*.cpp"
"./src/game/*.h"
"./src/game/*.hpp"
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src/game PREFIX "Main/Game" FILES ${SOURCES_GAME})
include_directories(./src/game/scenes)
file(GLOB SOURCES_GAME_SCENES
"./src/game/scenes/*.cpp"
"./src/game/scenes/*.h"
"./src/game/scenes/*.hpp"
)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src/game PREFIX "Main/Game/Scenes" FILES ${SOURCES_GAME_SCENES})
add_executable(${PROJECT_NAME} ${SOURCES} ${SOURCES_CORE} ${SOURCES_CORE_MISC} ${SOURCES_CORE_MISC_CONSOLE} ${SOURCES_CORE_OBJECTS} ${SOURCES_CORE_OBJECTS_COMPONENTS} ${SOURCES_GAME} ${SOURCES_GAME_SCENES})
target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES} ${SDL2_TTF_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES})