-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
87 lines (74 loc) · 3.09 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
# ===============================================================================
# Made by: Yakub (https://github.com/itsYakub)
# Version: 1.0.0
# ===============================================================================
# Project's Licence:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
# OR OTHER DEALINGS IN THE SOFTWARE.
# ===============================================================================
cmake_minimum_required(VERSION 3.14)
project(easter_hunt VERSION 1.0.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(
SOURCES
${CMAKE_SOURCE_DIR}/src/main.cpp
${CMAKE_SOURCE_DIR}/src/Egg.cpp
${CMAKE_SOURCE_DIR}/src/EggController.cpp
${CMAKE_SOURCE_DIR}/src/Player.cpp
${CMAKE_SOURCE_DIR}/src/Timer.cpp
${CMAKE_SOURCE_DIR}/src/SceneMenager.cpp
${CMAKE_SOURCE_DIR}/src/SceneGameplay.cpp
${CMAKE_SOURCE_DIR}/src/SceneSplashScreen.cpp
${CMAKE_SOURCE_DIR}/src/Display.cpp
${CMAKE_SOURCE_DIR}/src/Background.cpp
${CMAKE_SOURCE_DIR}/src/ColorList.cpp
${CMAKE_SOURCE_DIR}/src/Resources.cpp
)
set(
INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/lib/raylib-cpp/include
${CMAKE_SOURCE_DIR}/lib/raylib-cpp/bin/_deps/raylib-src/src
)
set(
LINK_DIRECTORIES
${CMAKE_SOURCE_DIR}/lib/raylib-cpp/bin/_deps/raylib-build/raylib
)
set(
COMPILE_OPTIONS
-std=c++20
-Wall
-Werror
-Wextra
-Wpedantic
-O2
)
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE ${INCLUDE_DIRECTORIES})
target_link_directories(${PROJECT_NAME} PRIVATE ${LINK_DIRECTORIES})
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_compile_options(${PROJECT_NAME} PRIVATE ${COMPILE_OPTIONS} -mwindows)
target_link_options(${PROJECT_NAME} PRIVATE -static)
target_link_libraries(${PROJECT_NAME} PRIVATE -lraylib -lgdi32 -lwinmm)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_compile_options(${PROJECT_NAME} PRIVATE ${COMPILE_OPTIONS})
target_link_options(${PROJECT_NAME} PRIVATE -static-libgcc -static-libstdc++)
target_link_libraries(${PROJECT_NAME} PRIVATE -lraylib)
endif()