rdricpp/tests/CMakeLists.txt
2024-02-14 01:53:46 -08:00

37 lines
753 B
CMake

# Testing library
message("Guix = ${GUIX}")
if ( (NOT ${GUIX}) )
message("NOT GUIX")
include(FetchContent)
FetchContent_Declare(
catch
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.5.2)
FetchContent_MakeAvailable(catch)
endif() #Adds Catch2::Catch2
#If building manually
#add_subdirectory(Catch2-3.5.2)
include(CTest)
if ( ${GUIX} )
include(Catch.cmake)
else()
include(Catch)
endif()
add_executable(tests tests.cpp test_cases.cpp test_cases.h)
target_compile_features(tests PRIVATE cxx_std_23)
# Should be linked to the rdricpp library, as well as the Catch2 testing library
target_link_libraries(tests PRIVATE rdricpp Catch2Main Catch2)
catch_discover_tests(tests)
add_test(NAME Test COMMAND tests)