-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
35 lines (28 loc) · 1.02 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
cmake_minimum_required(VERSION 2.8)
project(Athena)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3 -g")
# SDL2, SDL2/SDL2_Image, SDL2/SDL2_ttf
find_package(SDL2 REQUIRED)
find_package(SDL2_Image REQUIRED)
find_package(SDL2_ttf REQUIRED)
include_directories(${SDL2_INCLUDE_DIR}
${SDL2IMAGE_INCLUDE_DIR}
${SDL2TTF_INCLUDE_DIR})
# Athena
include_directories(src/)
include_directories(include/)
file(GLOB_RECURSE SOURCES src/*.cpp src/*.c include/*.cpp include/*.c)
file(GLOB_RECURSE HEADERS src/*.hpp src/*.h src/*.hpp include/*.hpp include/*.h)
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
#add_executable(${PROJECT_NAME} "src/TrGame.cpp" ${SOURCES} ${HEADERS})
target_link_libraries(${PROJECT_NAME}
${SDL2_LIBRARY}
${SDL2IMAGE_LIBRARY}
${SDL2TTF_LIBRARY})
add_custom_target(run
COMMAND ${PROJECT_NAME}
DEPENDS ${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_PROJECT_DIR}
)