2017-11-16 20:52:32 +01:00
|
|
|
cmake_minimum_required(VERSION 3.4)
|
2017-12-27 12:43:38 +01:00
|
|
|
#set(CMAKE_DISABLE_SOURCE_CHANGES ON)
|
2017-09-17 13:43:13 +02:00
|
|
|
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
|
|
|
|
|
2017-11-16 20:52:32 +01:00
|
|
|
execute_process(
|
|
|
|
COMMAND git describe --tags --always
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_COMMIT
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
file(WRITE "src/gitparams.h" "#define GIT_CUR_COMMIT ${GIT_COMMIT}")
|
|
|
|
|
2017-09-17 20:07:38 +02:00
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
2017-12-30 00:08:09 +01:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
2017-09-17 13:43:13 +02:00
|
|
|
|
2017-12-27 21:54:11 +01:00
|
|
|
set(TARGET dungeon)
|
|
|
|
project(${TARGET} LANGUAGES CXX)
|
2017-09-17 13:43:13 +02:00
|
|
|
|
2017-09-17 20:07:38 +02:00
|
|
|
find_package(OpenGL REQUIRED)
|
2017-12-27 21:54:11 +01:00
|
|
|
find_package(glbinding REQUIRED)
|
2017-10-18 12:22:28 +02:00
|
|
|
find_package(Lua REQUIRED)
|
2017-09-17 13:43:13 +02:00
|
|
|
find_package(SDL2 REQUIRED)
|
2017-12-28 10:01:38 +01:00
|
|
|
include_directories("libs/kaguya-1.3.2/include")
|
2017-09-17 13:43:13 +02:00
|
|
|
|
2017-09-17 15:59:32 +02:00
|
|
|
file(GLOB SOURCES "src/*.cpp" "src/*.c" "src/*.h")
|
2017-12-27 22:53:48 +01:00
|
|
|
add_executable(${TARGET} ${SOURCES})
|
2017-12-27 21:54:11 +01:00
|
|
|
target_link_libraries(${TARGET} PUBLIC glbinding::glbinding)
|
2017-12-30 00:08:09 +01:00
|
|
|
target_link_libraries(${TARGET} PUBLIC ${SDL2_LIBRARY})
|
|
|
|
target_link_libraries(${TARGET} PUBLIC ${OPENGL_LIBRARY})
|
|
|
|
target_link_libraries(${TARGET} PUBLIC ${LUA_LIBRARY})
|