toml11/tests/CMakeLists.txt

30 lines
836 B
CMake
Raw Normal View History

2017-04-19 13:47:40 +00:00
set(TEST_NAMES
test_traits
test_utility
2017-04-19 15:08:41 +00:00
test_value
2017-04-20 01:49:11 +00:00
test_to_toml
2017-04-20 03:49:36 +00:00
test_from_toml
2017-04-20 04:30:11 +00:00
test_get
2017-04-20 05:38:25 +00:00
test_value_operator
test_datetime
2017-05-05 01:54:47 +00:00
test_acceptor
2017-05-06 09:44:19 +00:00
test_parser
2017-05-12 11:50:04 +00:00
test_parse_file
2017-04-19 13:47:40 +00:00
)
add_definitions("-Wall -Wpedantic")
set(test_library_dependencies)
find_library(BOOST_UNITTEST_FRAMEWORK_LIBRARY boost_unit_test_framework)
if (BOOST_UNITTEST_FRAMEWORK_LIBRARY)
add_definitions(-DBOOST_TEST_DYN_LINK)
add_definitions(-DUNITTEST_FRAMEWORK_LIBRARY_EXIST)
set(test_library_dependencies boost_unit_test_framework)
endif()
foreach(TEST_NAME ${TEST_NAMES})
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
target_link_libraries(${TEST_NAME} ${test_library_dependencies})
2017-05-12 11:50:04 +00:00
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
2017-04-19 13:47:40 +00:00
endforeach(TEST_NAME)