An actual useful install-foo target would do something along the lines of `cmake -P cmake_install.cmake`, but we don't need that to demonstrate the issue. foo.c is also irrelevant; it could even be empty.
With CMake 3.11.4 and when using the Ninja generator, my custom install-foo target ends up transitively depending on "foo/foo.framework/foo", which doesn't exist and causes a build error. There is a "foo.framework/foo"
target, which is just a phony target depending on "foo/foo.framework/Versions/A/foo" (which is the actual library), and I suspect that's the actual desired dependency, but instead, the subdirectory is being incorrectly prepended to the dependency name.
This works correctly when using the Makefile generator instead of the Ninja generator. It works with the Ninja generator if my framework target is in the top-level CMakeLists.txt instead of a subdirectory,
but that's not a viable workaround for my use case.
Am I doing something wrong, or is this a bug with CMake's Ninja generator? If it's the latter, any thoughts on how to work around it? I suppose I could try to manually create the "foo/foo.framework/foo" target,
but that seems kinda gross.