···2424 fmt::fmt
2525)
26262727-add_executable(hello_compute test/01_hello_compute/hello_compute.cpp)
2828-target_link_libraries(hello_compute PRIVATE vektor)
2727+file(GLOB TEST_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/test ${CMAKE_CURRENT_SOURCE_DIR}/test/*)
2828+2929+foreach(test_dir ${TEST_DIRS})
3030+ # Ensure we are looking at a directory, not a random file
3131+ if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test/${test_dir})
3232+3333+ # 2. Define the executable name based on the folder name
3434+ set(test_name "test_${test_dir}")
3535+3636+ # 3. Find all .cpp files within that specific test folder
3737+ file(GLOB_RECURSE TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/test/${test_dir}/*.cpp")
3838+3939+ if(TEST_SOURCES)
4040+ add_executable(${test_name} ${TEST_SOURCES})
4141+4242+ # 4. Link your library (libvektor)
4343+ target_link_libraries(${test_name} PRIVATE vektor)
4444+4545+ message(STATUS "Added test: ${test_name}")
4646+ endif()
4747+ endif()
4848+endforeach()