project(simple-printf-test) add_subdirectory(catch2 EXCLUDE_FROM_ALL) add_custom_target(test "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}" "-r compact" "-s" DEPENDS ${PROJECT_NAME}) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/catch-framework") aux_source_directory("src" TEST_SOURCES) add_executable(${PROJECT_NAME} EXCLUDE_FROM_ALL ${TEST_SOURCES}) target_link_libraries(${PROJECT_NAME} PRIVATE simple-printf Catch2::Catch2WithMain)