1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-09 20:32:43 +01:00
openrw/tests/CMakeLists.txt

78 lines
1.7 KiB
CMake
Raw Normal View History

##############################################################################
# Unit Tests
##############################################################################
if(${TESTS_NODATA})
add_definitions(-DRW_TEST_WITH_DATA=0)
else()
add_definitions(-DRW_TEST_WITH_DATA=1)
endif()
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
set(TEST_SOURCES
"main.cpp"
"test_animation.cpp"
"test_archive.cpp"
"test_buoyancy.cpp"
"test_character.cpp"
"test_chase.cpp"
"test_cutscene.cpp"
"test_config.cpp"
"test_data.cpp"
"test_FileIndex.cpp"
"test_GameData.cpp"
"test_GameWorld.cpp"
"test_globals.hpp"
"test_items.cpp"
"test_Input.cpp"
"test_lifetime.cpp"
"test_loaderdff.cpp"
"test_Logger.cpp"
"test_menu.cpp"
"test_object.cpp"
"test_object_data.cpp"
"test_pickup.cpp"
"test_renderer.cpp"
"test_rwbstream.cpp"
"test_SaveGame.cpp"
"test_scriptmachine.cpp"
"test_skeleton.cpp"
"test_state.cpp"
"test_text.cpp"
"test_trafficdirector.cpp"
"test_vehicle.cpp"
"test_VisualFX.cpp"
"test_weapon.cpp"
"test_worker.cpp"
"test_world.cpp"
# Hack in rwgame sources until there's a per-target test suite
"${CMAKE_SOURCE_DIR}/rwgame/GameConfig.cpp"
"${CMAKE_SOURCE_DIR}/rwgame/GameWindow.cpp"
"${CMAKE_SOURCE_DIR}/rwgame/GameInput.cpp"
)
2013-09-11 13:10:42 +02:00
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK)
add_executable(run_tests ${TEST_SOURCES})
2013-09-11 13:10:42 +02:00
include_directories(
include
"${CMAKE_SOURCE_DIR}/tests"
"${CMAKE_SOURCE_DIR}/rwgame")
2013-09-11 13:10:42 +02:00
include_directories(SYSTEM
${BULLET_INCLUDE_DIR})
2013-09-11 13:10:42 +02:00
target_link_libraries(run_tests
rwengine
inih
${OPENGL_LIBRARIES}
${BULLET_LIBRARIES}
2016-06-22 23:28:05 +02:00
${SDL2_LIBRARY}
${PNG_LIBRARIES}
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
2013-09-11 13:10:42 +02:00
add_test(UnitTests run_tests)