2018-10-23 10:22:57 +00:00
|
|
|
include(${CMAKE_SOURCE_DIR}/cmake/boost.cmake)
|
|
|
|
|
2018-10-23 01:16:52 +00:00
|
|
|
enable_testing()
|
|
|
|
|
2018-10-23 10:22:57 +00:00
|
|
|
set(BOOST_COMPONENTS unit_test_framework)
|
2018-10-23 01:16:52 +00:00
|
|
|
search_for_boost()
|
|
|
|
|
|
|
|
add_definitions(-DBOOST_TEST_DYN_LINK)
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
2018-10-23 10:22:57 +00:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
|
|
|
link_directories(${Boost_LIBRARY_DIR} ${Boost_LIBRARY_DIRS})
|
2018-10-23 01:16:52 +00:00
|
|
|
|
|
|
|
macro(addTest testName)
|
2018-10-23 10:22:57 +00:00
|
|
|
add_executable(${testName} ${testName}.cpp)
|
|
|
|
if(MSVC)
|
|
|
|
target_link_libraries(${testName} PUBLIC ${PROJECT_NAME})
|
|
|
|
else()
|
|
|
|
target_link_libraries(${testName} PUBLIC ${Boost_LIBRARIES} ${PROJECT_NAME})
|
|
|
|
endif()
|
2018-10-23 01:16:52 +00:00
|
|
|
add_test(${testName}Unit ${testName})
|
|
|
|
# Adding a project configuration file (for MSVC only)
|
2018-10-23 10:22:57 +00:00
|
|
|
GENERATE_MSVC_DOT_USER_FILE(${testName})
|
2018-10-23 01:16:52 +00:00
|
|
|
endmacro(addTest)
|
|
|
|
|
|
|
|
addTest(FilterTest)
|