2017-11-30 21:00:47 +01:00
|
|
|
cmake_minimum_required (VERSION 3.2.0)
|
|
|
|
|
|
|
|
SET(CMAKE_COLOR_MAKEFILE ON)
|
|
|
|
|
|
|
|
project(breakhack C)
|
|
|
|
|
2017-12-05 12:40:37 +01:00
|
|
|
include(FindLua)
|
2017-12-13 12:09:04 +01:00
|
|
|
include(FindX11)
|
|
|
|
include(cmake/FindSDL2.cmake)
|
|
|
|
include(cmake/FindSDL2_image.cmake)
|
|
|
|
include(cmake/FindSDL2_mixer.cmake)
|
|
|
|
include(cmake/FindSDL2_ttf.cmake)
|
|
|
|
include(cmake/FindCheck.cmake)
|
2017-12-05 12:40:37 +01:00
|
|
|
|
2017-11-30 21:00:47 +01:00
|
|
|
add_subdirectory(linkedlist)
|
2017-12-12 13:06:01 +01:00
|
|
|
add_subdirectory(hashtable)
|
2017-12-05 12:40:37 +01:00
|
|
|
|
2017-12-13 12:09:04 +01:00
|
|
|
include_directories(
|
|
|
|
linkedlist
|
|
|
|
hashtable
|
2017-12-05 12:51:09 +01:00
|
|
|
${LUA_INCLUDE_DIR}
|
2017-12-13 12:09:04 +01:00
|
|
|
${SDL2_INCLUDE_DIR}
|
|
|
|
${SDL2_IMAGE_INCLUDE_DIR}
|
|
|
|
${SDL2_MIXER_INCLUDE_DIR}
|
|
|
|
${SDL2_TTF_INCLUDE_DIR}
|
|
|
|
${X11_INCLUDE_DIR}
|
|
|
|
${CHECK_INCLUDE_DIR}
|
2017-12-05 12:40:37 +01:00
|
|
|
)
|
|
|
|
|
2017-11-30 21:00:47 +01:00
|
|
|
add_definitions("-Wall")
|
|
|
|
|
|
|
|
# PROGRAMS:
|
2017-12-01 16:03:19 +01:00
|
|
|
add_executable(breakhack
|
2017-11-30 21:00:47 +01:00
|
|
|
src/main
|
|
|
|
src/texture
|
|
|
|
src/screenresolution
|
|
|
|
src/sprite
|
|
|
|
src/util
|
|
|
|
src/player
|
2017-12-01 16:03:19 +01:00
|
|
|
src/map
|
2017-12-02 23:32:40 +01:00
|
|
|
src/map_lua
|
2017-12-01 16:03:19 +01:00
|
|
|
src/camera
|
2017-12-05 08:30:08 +01:00
|
|
|
src/timer
|
2017-12-05 15:03:20 +01:00
|
|
|
src/roommatrix
|
|
|
|
src/position
|
2017-12-13 14:26:30 +01:00
|
|
|
src/monster
|
2017-11-30 21:00:47 +01:00
|
|
|
)
|
|
|
|
|
2017-12-01 16:03:19 +01:00
|
|
|
target_link_libraries(breakhack
|
2017-11-30 21:00:47 +01:00
|
|
|
linkedlist
|
2017-12-12 13:06:01 +01:00
|
|
|
hashtable
|
2017-12-13 12:09:04 +01:00
|
|
|
${LUA_LIBRARY}
|
|
|
|
${SDL2_LIBRARY}
|
|
|
|
${SDL2_IMAGE_LIBRARY}
|
|
|
|
${SDL2_MIXER_LIBRARY}
|
|
|
|
${SDL2_TTF_LIBRARY}
|
|
|
|
${X11_LIBRARIES}
|
2017-11-30 21:00:47 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# TESTS:
|
2017-12-13 12:09:04 +01:00
|
|
|
IF (CHECK_FOUND)
|
2017-12-13 12:18:20 +01:00
|
|
|
find_package(Threads REQUIRED)
|
2017-12-13 12:09:04 +01:00
|
|
|
enable_testing()
|
|
|
|
add_executable(test_util test/check_util src/util)
|
2017-12-13 12:18:20 +01:00
|
|
|
target_link_libraries(test_util ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
2017-12-13 12:09:04 +01:00
|
|
|
add_test(test_util test_util)
|
|
|
|
ENDIF (CHECK_FOUND)
|