-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
56 lines (52 loc) · 1.48 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
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 17)
# -O2
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -g3 -Wno-unused-variable -Wno-unused-parameter")
set(PROJECT_NAME "game")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
set(INCLUDE "inc/")
set(SPATH "${CMAKE_SOURCE_DIR}/src/")
set(SOURCES
"${SPATH}main.cpp"
"${SPATH}game.cpp"
"${SPATH}engine.cpp"
"${SPATH}gui/screen.cpp"
"${SPATH}level/block/block.cpp"
"${SPATH}level/level.cpp"
"${SPATH}entities/entity.cpp"
"${SPATH}entities/player.cpp"
"${SPATH}entities/enemy.cpp"
"${SPATH}gui/bitmap.cpp"
"${SPATH}gui/bitmap3d.cpp"
"${SPATH}menu/menu.cpp"
"${SPATH}art.cpp"
"${SPATH}sound.cpp"
)
project(${PROJECT_NAME} CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(SDL2 REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_image REQUIRED)
# Compilation is OS Specific
IF (WIN32)
#
ELSEIF (APPLE)
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE
${INCLUDE}
${SDL2_INCLUDE_DIRS}
${SDL2_MIXER_INCLUDE_DIRS}
${SDL2_IMAGE_INCLUDE_DIRS}
)
target_link_libraries(${PROJECT_NAME}
SDL2::Main
SDL2::Mixer
SDL2::Image
)
set_target_properties(${PROJECT_NAME} PROPERTIES
LINKER_LANGUAGE CXX
# RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
ELSEIF (LINUX)
#
ENDIF ()