3.21.0-rc1 breaks transitive out-of-dir linking
The following example works in 3.20.5 and fails in 3.21.0-rc1:
$ cat ../CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
project(LinkInSubdir LANGUAGES "CXX")
add_library(foo STATIC foo.cpp)
add_subdirectory(sub)
add_executable(baz main.cpp)
target_link_libraries(baz PRIVATE foo)
$ cat ../sub/CMakeLists.txt
add_library(sub::target INTERFACE IMPORTED)
target_link_libraries(foo PRIVATE sub::target)
$ cmake ..
...
CMake Error at CMakeLists.txt:7 (add_executable):
Target "baz" links to target "sub::target" but the target was not found.
Perhaps a find_package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
Edited by Brad King