From d59abed109c6f87c2af96b87744437f2e77222c4 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Sat, 1 Nov 2025 16:28:11 +0100 Subject: [PATCH] Fix CMake subdir test * Fix CMake subdir test `add_test(main main)` treats the 2nd argument as the command to run. The one-argument (or named argument variant) supports resolving target names so it will always find it * Use named arguments for subdir-add_test --- test/cmake_subdir_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index a91830f..f5fb571 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -39,6 +39,6 @@ add_executable(main main.cpp) target_link_libraries(main Boost::openmethod) enable_testing() -add_test(main main) +add_test(NAME main COMMAND main) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $)