message(\n${BoldRed}"Now configuring tests for ${CMAKE_PROJECT_NAME}"${ColourReset}\n)

qt6_add_resources(${TARGET}_QRC_CPP ../${LOWCASE_PROJECT_NAME}.qrc)

find_package(Catch2 REQUIRED)

set(catch2_tests_SRCS
    test_Formula.cpp
    ../libmass/includes/libmass/Formula.hpp
)

add_executable(${LOWCASE_PROJECT_NAME}-catch2-tests
    ${catch2_tests_SRCS}
    ${${TARGET}_QRC_CPP}
)

target_link_libraries(${LOWCASE_PROJECT_NAME}-catch2-tests
  -Wl,--whole-archive
  libXpertMass::nongui
  libXpertMass::gui
  -Wl,--no-whole-archive

  -Wl,--no-as-needed
  PappsoMSpp::Core
  -Wl,--as-needed

  -Wl,--no-as-needed
  IsoSpec++::IsoSpec++
  -Wl,--as-needed

  Catch2::Catch2
  Catch2::Catch2WithMain

  Qt6::Core
  Qt6::Xml
  Qt6::Widgets
  Qt6::Svg
  Qt6::SvgWidgets
  Qt6::PrintSupport
  Qt6::Xml
  Qt6::Network
)

set_property(TARGET ${LOWCASE_PROJECT_NAME}-catch2-tests PROPERTY CXX_STANDARD 17) # we want C++17

  # Add the Catch2-based single binary test file to the CMake's test suite so
  # that it gets called using 'make test'. To see the output, add "ARGS=-V" to
  # the call.
add_test(${LOWCASE_PROJECT_NAME}-catch2-tests "catch2-tests")
