# The QtTest libraries are required for building the tests. find_package(Qt6Test REQUIRED) # Specify the source files for the tests. set(QREDIS_TESTS_SRC main.cpp testclient.cpp) # Specify the files that need to be MOC'd. qt6_wrap_cpp(QREDIS_TESTS_MOC testclient.h) # Create the test executable. add_executable(qredis-tests ${QREDIS_TESTS_SRC} ${QREDIS_TESTS_MOC}) # Specify the Qt modules the test executable links against. target_link_libraries(qredis-tests Qt6::Core Qt6::Test) # Naturally, we also link against the QRedis library. target_link_libraries(qredis-tests qredis) # Register the target as a test. add_test(tests qredis-tests)