add_dependency not working correctly for ninja generator against an imported or interface target
Using CMake 3.21.1 or 3.21.4 (targeting 3.9)
I have an ExternalProject that I have build and created an interface target from the products of that build (also tried import target).
I have an
add_dependency(library external-library-build) line to mark the transitive dependency.
This works for the Xcode generator, and the unix makefiles generators, and even the visual studio generators, but for ninja, it fails to follow the explicit dependency and errors out that it cannot find the library.
To see the project in-action go to https://github.com/HumbleNet/humblenet/ and build it. (try the develop-1.1.x branch)
The external projects (2 of them) are setup in the main CMakeLists.txt and the import/interface is for the websockets library. (branch has the import variant)