summaryrefslogtreecommitdiffhomepage
path: root/test/CMakeLists.txt
blob: bca15714cb291ca9fa804598b73393bf8888b04b (plain)
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
set(self floormat-test)
file(GLOB sources "*.cpp" CONFIGURE_ARGS)

file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/test")

add_library(${self}_o OBJECT "${sources}")
target_link_libraries(${self}_o PUBLIC Magnum::GL Magnum::Trade nlohmann_json::nlohmann_json fmt::fmt)

if(APPLE)
    target_link_libraries(${self}_o PUBLIC Magnum::WindowlessCglApplication)
elseif(WIN32)
    target_link_libraries(${self}_o PUBLIC Magnum::WindowlessWglApplication ntdll)
else()
    target_link_libraries(${self}_o PUBLIC Magnum::WindowlessGlxApplication)
endif()

add_executable(${self} dummy.cc)
target_link_libraries(${self} ${self}_o floormat-serialize floormat)

install(TARGETS ${self} RUNTIME DESTINATION bin)

set(save-dir "${CMAKE_BINARY_DIR}/test/save")
file(REMOVE_RECURSE "${save-dir}")
file(MAKE_DIRECTORY "${save-dir}")
file(GLOB saves "save/*.dat" CONFIGURE_ARGS)
foreach(file ${saves})
    configure_file("${file}" "${save-dir}" COPYONLY)
endforeach()