project(testsRaiiSafeCuda CXX) find_package(Catch2 3) if (NOT Catch2_FOUND) message(STATUS "Using FetchContent to download and use Catch2") include(FetchContent) fetchcontent_declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2 GIT_TAG v3.11.0 EXCLUDE_FROM_ALL OVERRIDE_FIND_PACKAGE ) fetchcontent_makeavailable(Catch2) find_package(Catch2 3 REQUIRED) endif () include(CTest) enable_testing() include(Catch) include(CatchAddTests) add_executable(tests tests_stream.cpp ) target_link_libraries(tests Catch2::Catch2WithMain raiiSafeCuda) set_target_properties(tests PROPERTIES CXX_STANDARD 20 CXX_EXTENSIONS OFF INTERPROCEDURAL_OPTIMIZATION ON ) catch_discover_tests(tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})