-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
28 lines (20 loc) · 988 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
cmake_minimum_required(VERSION 3.1)
project(mindscape LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Creating variables
set(INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
set(ASSETS "${PROJECT_SOURCE_DIR}/assets")
set(ENGINE "${PROJECT_SOURCE_DIR}/engine")
file(GLOB SOURCES "${SRC_DIR}/*.cpp")
# Setting COMPILE_FLAGS (this is from CMAKE)
set(COMPILE_FLAGS "-std=c++11 -W -std=c++0x -Wall -pedantic -Wshadow -O2 -g")
# Adding subdirectory which has it's own CMakeList
add_subdirectory(${ENGINE})
# Including header files
include_directories(${INCLUDE_DIR})
# Creating executable and adding libraries to CMake
add_executable(mindscape ${SOURCES})
set_property(TARGET mindscape PROPERTY CXX_STANDARD 11)
target_link_libraries(mindscape engine SDL2 SDL2_image SDL2_ttf SDL2_mixer)