2017-01-29 17:38:13 +02:00
|
|
|
cmake_minimum_required(VERSION 2.8.7)
|
|
|
|
project(test)
|
2013-04-22 17:49:28 +03:00
|
|
|
enable_testing()
|
2016-08-12 08:38:26 +02:00
|
|
|
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/test)
|
2013-04-22 17:49:28 +03:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
set(test_SRCS
|
2017-06-29 01:03:37 +02:00
|
|
|
StdInc.cpp
|
|
|
|
|
|
|
|
Battlefield.cpp
|
|
|
|
CMapEditManagerTest.cpp
|
|
|
|
CMapFormatTest.cpp
|
|
|
|
CMemoryBufferTest.cpp
|
|
|
|
CVcmiTestConfig.cpp
|
|
|
|
MapComparer.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(test_HEADERS
|
|
|
|
StdInc.h
|
|
|
|
|
|
|
|
CVcmiTestConfig.h
|
|
|
|
MapComparer.h
|
2013-04-22 17:49:28 +03:00
|
|
|
)
|
|
|
|
|
2017-06-29 01:03:37 +02:00
|
|
|
add_executable(vcmitest ${test_SRCS} ${test_HEADERS})
|
2013-07-07 22:44:08 +03:00
|
|
|
target_link_libraries(vcmitest vcmi ${Boost_LIBRARIES} ${RT_LIB} ${DL_LIB})
|
2013-04-22 17:49:28 +03:00
|
|
|
add_test(vcmitest vcmitest)
|
|
|
|
|
2014-02-05 23:25:36 +03:00
|
|
|
set_target_properties(vcmitest PROPERTIES ${PCH_PROPERTIES})
|
|
|
|
cotire(vcmitest)
|
2014-02-01 16:37:26 +03:00
|
|
|
|
2013-04-25 19:09:48 +03:00
|
|
|
# Files to copy to the build directory
|
|
|
|
add_custom_target(vcmitestFiles ALL)
|
2013-04-22 17:49:28 +03:00
|
|
|
set(vcmitest_FILES
|
2016-11-13 12:38:42 +02:00
|
|
|
testdata/TerrainViewTest.h3m
|
|
|
|
testdata/terrainViewMappings.json
|
|
|
|
testdata/ObjectPropertyTest/header.json
|
|
|
|
testdata/ObjectPropertyTest/objects.json
|
|
|
|
testdata/ObjectPropertyTest/surface_terrain.json
|
|
|
|
testdata/ObjectPropertyTest/underground_terrain.json
|
2013-04-22 17:49:28 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
foreach(file ${vcmitest_FILES})
|
2017-01-29 17:38:13 +02:00
|
|
|
add_custom_command(TARGET vcmitestFiles POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/${file}" ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
2013-04-22 17:49:28 +03:00
|
|
|
endforeach()
|