Updates to the CMakeList.txt - ProjectStow/ClassExamples GitHub Wiki

Requirements

enable testing should appear after the project entry

project(ZoSupportLib LANGUAGES CXX VERSION 0.0.1 DESCRIPTION "Zo Support classes")
enable_testing()

Automoc should be on

set(CMAKE_AUTOMOC ON)

Make sure the Test package is found

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Test)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Test)

Each test should be added as an executable, linked to the main code, and added as a Test

add_executable(TestTable test/testZoTable.cpp)
target_link_libraries(TestTable
        Qt${QT_VERSION_MAJOR}::Test
        ZoSupportLib
)

add_test(NAME TestTable COMMAND TestTable)