-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
114 lines (85 loc) · 3.14 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
112
113
114
cmake_minimum_required(VERSION 3.24.1)
#----------------------------------------------------
# PROJECT PROPERTIES
#----------------------------------------------------
project(acaer VERSION 0.0.3)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
## Requierments ##
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
# Set release and debug folder
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/release)
#----------------------------------------------------
# RESOURCE
#----------------------------------------------------
set(ACAER_APP_ICO "${CMAKE_SOURCE_DIR}/resource/images/acaer_logo.rc")
#----------------------------------------------------
# SOURCE & INCLUDE
#----------------------------------------------------
# Global Header fildes
file(GLOB_RECURSE HEADER_FILES ${CMAKE_SOURCE_DIR}/src/*.h
${CMAKE_SOURCE_DIR}/src/*.hpp)
# Global Source files
file(GLOB_RECURSE SRC_FILES ${CMAKE_SOURCE_DIR}/src/*c
${CMAKE_SOURCE_DIR}/src/*.cpp)
### APP ###
add_executable(${PROJECT_NAME} ${SRC_FILES}
${HEADER_FILES}
${ACAER_APP_ICO})
# Compiler Flags
#target_compile_options(${PROJECT_NAME} PRIVATE /W4)
#----------------------------------------------------
# LIBS
#----------------------------------------------------
#---------SFML---------
set(SFML_STATIC_LIBRARIES TRUE)
set(SFML_DIR ${CMAKE_SOURCE_DIR}/lib/SFML-2.5.1/lib/cmake/SFML)
find_package(SFML 2.5.1 REQUIRED COMPONENTS window system graphics audio network)
#---------BOX2D---------
# FIXME (flex): only debug build possible
set(BOX2D_LIB ${CMAKE_SOURCE_DIR}/lib/box2d/lib/bin/Debug/box2d.lib)
#---------LUA---------
set(LUA_LIB ${CMAKE_SOURCE_DIR}/lib/lua/lua54.lib)
#--------YAML--------
set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "disable yaml tests")
set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "disable yaml tools")
set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "disable yaml contrib")
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/vendor/yaml/)
#--------SPDLOG-------
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/vendor/spdlog/)
#----IMGUI-SFML-------
set(IMGUI_DIR ${CMAKE_SOURCE_DIR}/lib/vendor/imgui/)
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/vendor/imgui-sfml/)
#----------------------------------------------------
# INCLUDE DIRS
#----------------------------------------------------
include_directories(
${CMAKE_SOURCE_DIR}/src
#EnTT
${CMAKE_SOURCE_DIR}/lib/entt
#SFML
${CMAKE_SOURCE_DIR}/lib/SFML-2.5.1/include
# Box2D
${CMAKE_SOURCE_DIR}/lib/box2d/include
# Lua
${CMAKE_SOURCE_DIR}/lib/lua/include
)
#----------------------------------------------------
# LINK & PCH
#----------------------------------------------------
#Put all libraries into a variable
set(LIBS sfml-window
sfml-system
sfml-graphics
sfml-audio
sfml-network
yaml-cpp
spdlog
ImGui-SFML
${BOX2D_LIB}
${LUA_LIB})
target_link_libraries(${PROJECT_NAME} ${LIBS})
### PCH ###
target_precompile_headers(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/src/acaer/ac_pch.h)