Setup CMake to have 'check' target like autoconf

This setups the CMake build system to have the same `make check`
functionality as the autoconf build system
This commit is contained in:
Matt Schulte 2020-10-29 20:52:01 -07:00 committed by Serge Lamikhov-Center
parent 1559155e7d
commit b2154b3e81
2 changed files with 2 additions and 1 deletions

View File

@ -44,6 +44,7 @@ endif()
if (ELFIO_BUILD_TESTS AND IS_TOP_PROJECT)
enable_testing()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} USES_TERMINAL)
add_subdirectory(tests)
endif()

View File

@ -43,4 +43,4 @@ add_test(
WORKING_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(check DEPENDS test)
add_dependencies(check ELFIOTest)