-
Notifications
You must be signed in to change notification settings - Fork 294
/
CMakeLists.txt
30 lines (22 loc) · 896 Bytes
/
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
cmake_minimum_required(VERSION 3.5.1)
project(DungeonRush VERSION 0.1.0
DESCRIPTION "A game inspired by snake"
LANGUAGES C)
# Add SDL2 CMake modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2)
# Set output path
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Find SDL2
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_net REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)
set(BIN_NAME dungeon_rush)
file(GLOB SRC src/*.c)
add_executable(${BIN_NAME} ${SRC})
target_include_directories(${BIN_NAME} PUBLIC src)
target_include_directories(${BIN_NAME} PUBLIC ${SDL2_INCLUDE_DIR})
target_link_libraries(${BIN_NAME} SDL2::Main SDL2::Net SDL2::Image SDL2::Mixer
SDL2::TTF m)
file(COPY res DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})