CMP0112 NEW isn't work as expected
Project
project(test)
add_executable(${PROJECT_NAME} main.cpp)
add_custom_target(
custom_target
COMMAND "$<TARGET_FILE:${PROJECT_NAME}>")
add_dependencies(${PROJECT_NAME} custom_target)
gives following:
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"custom_target" of type UTILITY
depends on "test" (strong)
"test" of type EXECUTABLE
depends on "custom_target" (strong)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.
But NEW CMP0112 should not add dependency by definition. https://cmake.org/cmake/help/latest/policy/CMP0112.html
Looks like unexpected. This broke OLD behaviour.
Tested with CMake 3.20.2