PRIVATE linked UNKNOWN IMPORTED targets
I'm encountering an issue when linking to a shared target that itself has a PRIVATE linked shared target. This situation should be covered with the IMPORTED_LINK_DEPENDENT_LIBRARIES property declaring those PRIVATE linked libraries, but this is not the case in my scenario, since that shared dependency target is obtained from an upstream FindXXX/Config file and marked as an UNKNOWN IMPORTED target.
add_library(Foo::foo UNKNOWN IMPORTED) # foo is actually shared ...
find_package(Foo REQUIRED CONFIG) add_library(bar SHARED ...) target_link_libraries(bar PRIVATE Foo::foo) add_executable(myprog ...) target_link_libraries(myprog bar)
Now the linker prevents me from linking myprog, telling me that libfoo.so required by libbar.so cannot be found.
I think I understand how things are supposed to work in a "PRIVATE dependency of a shared library" scenario for STATIC / SHARED dependencies, but what should I do in these situations where I have an UNKNOWN dependency?