include(FetchContent)
find_package(Catch2 3 QUIET)
if(NOT Catch2_FOUND)
  FetchContent_Declare(Catch2
    GIT_REPOSITORY https://github.com/catchorg/Catch2.git
    GIT_TAG        v3.7.1
    GIT_SHALLOW    TRUE)
  FetchContent_MakeAvailable(Catch2)
  list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
endif()
include(Catch)

add_executable(nurbforge_tests
  test_basis.cpp
  test_curve.cpp
  test_surface.cpp
  test_transform.cpp
  test_construct.cpp
  test_refine.cpp
  test_elevate.cpp
  test_reduce.cpp
  test_split_join.cpp
  test_derivatives.cpp
  test_closest_point.cpp
  test_properties.cpp
  test_fitting.cpp
  test_fit_surface.cpp
  test_extend.cpp
  test_loft.cpp
  test_sweep.cpp
  test_gordon.cpp
  test_optics.cpp
  test_intersect.cpp
  test_surface_intersect.cpp
  test_trimmed.cpp
  test_section.cpp
  test_shell.cpp
  test_offset.cpp
  test_fillet.cpp
  test_curve_constructors.cpp
  test_face_labels.cpp
  test_boolean.cpp
  test_solids.cpp
  test_solid_ops.cpp
  test_region.cpp
  test_blend.cpp
  test_surface_blend.cpp
  test_project.cpp
  test_curve_tools.cpp
  test_edge_blend.cpp
  test_surface_tools.cpp
  test_step.cpp
  test_step_read.cpp
  test_shell_section.cpp
  test_hatch.cpp)
target_link_libraries(nurbforge_tests PRIVATE Nurbforge::core Catch2::Catch2WithMain)
catch_discover_tests(nurbforge_tests)
