gd-tools/cmake/dev-mode.cmake

53 lines
1.3 KiB
CMake
Raw Permalink Normal View History

2024-02-04 18:24:04 +00:00
# Testing library
2024-02-14 12:17:31 +00:00
if ( (NOT ${GUIX}) )
include(FetchContent)
FetchContent_Declare(
catch
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.5.2)
FetchContent_MakeAvailable(catch)
2024-02-28 00:30:28 +00:00
include(Catch)
2024-02-14 12:17:31 +00:00
endif() #Adds Catch2::Catch2
2024-02-04 18:24:04 +00:00
include(CTest)
2024-02-14 12:17:31 +00:00
include(cmake/folders.cmake)
2024-02-07 20:32:30 +00:00
2024-02-14 12:17:31 +00:00
#FIXME Later use tests dir to do testing: guix refuses to build tests
2024-02-07 20:32:30 +00:00
#if(BUILD_TESTING)
# add_subdirectory(tests)
#endif()
2024-02-04 18:24:04 +00:00
2024-02-07 20:32:30 +00:00
add_executable(tests src/tests_main_guix.cpp src/kana_conv.h src/util.h )
2024-02-04 18:24:04 +00:00
target_compile_features(tests PRIVATE cxx_std_23)
# Should be linked to the rdricpp library, as well as the Catch2 testing library
2024-02-14 12:17:31 +00:00
if( ${GUIX} )
include(tests/Catch.cmake)
target_link_libraries(tests PRIVATE cpr marisa rdricpp Catch2Main Catch2)
else()
2024-02-20 20:52:36 +00:00
target_link_libraries(tests PRIVATE cpr::cpr nlohmann_json::nlohmann_json marisa rdricpp Catch2::Catch2WithMain)
2024-02-14 12:17:31 +00:00
endif()
2024-02-07 20:32:30 +00:00
2024-02-04 18:24:04 +00:00
catch_discover_tests(tests)
2024-02-07 20:32:30 +00:00
add_test(NAME test COMMAND tests)
2024-02-04 18:24:04 +00:00
option(BUILD_MCSS_DOCS "Build documentation using Doxygen and m.css" OFF)
if(BUILD_MCSS_DOCS)
include(cmake/docs.cmake)
endif()
option(ENABLE_COVERAGE "Enable coverage support separate from CTest's" OFF)
if(ENABLE_COVERAGE)
include(cmake/coverage.cmake)
endif()
include(cmake/lint-targets.cmake)
include(cmake/spell-targets.cmake)
add_folders(Project)