The Catch2 code repository contains a contributed CMake function to parse Catch tests and automatically create CMake tests, without explicitly typing add_test() functions; see https://github.com/catchorg/Catch2/blob/master/contrib/ParseAndAddCatchTests.cmake.
See also
Get CMake Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.