Zach Laine wrote:
On Wed, Nov 13, 2024 at 6:29 AM Peter Dimov via Boost
wrote: CMake tests are failing with
CMake Error at libs/parser/test/CMakeLists.txt:7 (add_custom_target): add_custom_target cannot create target "check" because another target
with
the same name already exists. The existing target is a custom target created in source directory "/home/runner/work/boost/boost". See documentation for policy CMP0002 for more details.
CMake target names are global and need to be prefixed by the project name. In this case, the target should have been boost_parser-check.
Although looking at that test/CMakeLists.txt, it doesn't seem to support testing from the superproject, so it probably shouldn't be included at all in that case. That is, the
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()
part of the root CMakeLists.txt should be removed.
Done on develop, here:
https://github.com/boostorg/parser/commit/6d796287b6011fa5cf041e8d67 95cbfa0aaf6fd4
I'll merge this commit to master if/when Marshall gives the thumbs-up
Thanks, tests are fixed now: https://github.com/boostorg/boost/actions/runs/11829983776/job/32962750332