DependenciesForTests.cmake 1.0 KB

123456789101112131415161718192021222324
  1. #[[
  2. Set up dependencies for the RmlUi tests. The dependencies are all built-in header-only libraries.
  3. ]]
  4. function(add_builtin_header_only_tests_dependency NAME)
  5. set(DEPENDENCY_PATH "${PROJECT_SOURCE_DIR}/Tests/Dependencies/${NAME}")
  6. set(DEPENDENCY_TARGET "${NAME}::${NAME}")
  7. add_library(${DEPENDENCY_TARGET} IMPORTED INTERFACE)
  8. set_property(TARGET ${DEPENDENCY_TARGET} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${DEPENDENCY_PATH}")
  9. endfunction()
  10. add_builtin_header_only_tests_dependency("doctest")
  11. add_builtin_header_only_tests_dependency("nanobench")
  12. add_builtin_header_only_tests_dependency("lodepng")
  13. add_builtin_header_only_tests_dependency("trompeloeil")
  14. # Include doctest's discovery module
  15. include("${PROJECT_SOURCE_DIR}/Tests/Dependencies/doctest/cmake/doctest.cmake")
  16. if(MSVC)
  17. target_compile_definitions(doctest::doctest INTERFACE DOCTEST_CONFIG_USE_STD_HEADERS)
  18. endif()
  19. if(NOT RMLUI_RTTI_AND_EXCEPTIONS)
  20. target_compile_definitions(doctest::doctest INTERFACE DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS)
  21. endif()