mirror of
https://github.com/catchorg/Catch2
synced 2026-02-26 05:12:13 +00:00
We still want to build VS 2017 through AppVeyor, and those images have CMake 3.16.2 installed. We could install newer CMake as part of the build, but since we don't use newer CMake features yet, this is simpler.
30 lines
578 B
CMake
30 lines
578 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(discover-tests-test
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
add_executable(tests
|
|
register-tests.cpp
|
|
)
|
|
|
|
add_subdirectory(${CATCH2_PATH} catch2-build)
|
|
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)
|
|
|
|
enable_testing()
|
|
include(Catch)
|
|
set(extra_args)
|
|
if (CMAKE_VERSION GREATER_EQUAL 3.27)
|
|
list(APPEND extra_args
|
|
DL_PATHS "${CMAKE_CURRENT_LIST_DIR};${CMAKE_CURRENT_LIST_DIR}/.."
|
|
)
|
|
endif ()
|
|
catch_discover_tests(
|
|
tests
|
|
ADD_TAGS_AS_LABELS
|
|
DISCOVERY_MODE PRE_TEST
|
|
${extra_args}
|
|
)
|
|
|
|
# DISCOVERY_MODE <POST_BUILD|PRE_TEST>
|