+ add_library(testutils STATIC ${UNITTEST_TARGET_OPTIONS})
+endif()
+
+# Module interface / provided facilities
+target_include_directories(testutils PUBLIC include)
+
+# Executable targets for tests based on `testutils` acquire the source for
+# their entry point from unittest_main.cpp when linking to the `testutils` target.
+target_sources(testutils INTERFACE unittest_main.cpp)
+
+
+target_sources(testutils PRIVATE
+ cmdlinetest.cpp
+ conftest.cpp
+ filematchers.cpp
+ interactivetest.cpp
+ loggertest.cpp
+ mpi_printer.cpp
+ mpitest.cpp
+ refdata.cpp
+ refdata_xml.cpp
+ simulationdatabase.cpp
+ stdiohelper.cpp
+ stringtest.cpp
+ testasserts.cpp
+ testfilemanager.cpp
+ testfileredirector.cpp
+ test_device.cpp
+ test_hardware_environment.cpp
+ testinit.cpp
+ testmatchers.cpp
+ testoptions.cpp
+ textblockmatchers.cpp
+ tprfilegenerator.cpp
+ xvgtest.cpp
+ )
+
+
+if(HAVE_TINYXML2)
+ target_include_directories(testutils SYSTEM PRIVATE ${TinyXML2_INCLUDE_DIR})
+ target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
+else()
+ target_include_directories(testutils SYSTEM BEFORE PRIVATE ${CMAKE_SOURCE_DIR}/src/external/tinyxml2)
+ target_sources(testutils PRIVATE ${CMAKE_SOURCE_DIR}/src/external/tinyxml2/tinyxml2.cpp)