-
Notifications
You must be signed in to change notification settings - Fork 280
/
CMakeLists.txt
44 lines (34 loc) · 1.53 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
36
37
38
39
40
41
42
43
44
if (BUILD_TESTING)
file(GLOB CATACLYSM_BN_TEST_SOURCES
${CMAKE_SOURCE_DIR}/tests/*.cpp)
# Enabling benchmarks
add_definitions(-DCATCH_CONFIG_ENABLE_BENCHMARKING)
# TODO: build MO files required for tests
# This needs to include catch.h with different macro switch
set_source_files_properties(test_main.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
if (TILES)
add_executable(cata_test-tiles ${CATACLYSM_BN_TEST_SOURCES})
target_link_libraries(cata_test-tiles PRIVATE cataclysm-bn-tiles-common)
add_test(
NAME test-tiles
COMMAND sh -c "$<TARGET_FILE:cata_test-tiles> --rng-seed time"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
if (NOT "${CMAKE_EXPORT_COMPILE_COMMANDS}")
target_precompile_headers(cata_test-tiles PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/pch/tests-pch.hpp)
endif ()
set_target_properties( cata_test-tiles PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" )
endif ()
if (CURSES)
add_executable(cata_test ${CATACLYSM_BN_TEST_SOURCES})
target_link_libraries(cata_test PRIVATE cataclysm-bn-common)
add_test(
NAME test
COMMAND sh -c "$<TARGET_FILE:cata_test> --rng-seed time"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
if (NOT "${CMAKE_EXPORT_COMPILE_COMMANDS}")
target_precompile_headers(cata_test PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/pch/tests-pch.hpp)
endif ()
endif ()
endif ()