I use CMake 3.13RC1. My project produces, installs and exports a shared library target ”fooshared”. Some logical parts of “fooshared” are reused in an executable, so I have placed those sources into an internal static
library target “barstatic”. I have used target_link_libraries(fooshared barstatic) to make this work.
..I get a whine about dependency to “barstatic” which is not in the export group “myexport”.
I wouldn’t like to export “barstatic” at all, it should remain under the hood. I tried to use target_link_libraries(fooshared PRIVATE barstatic) which cut the export chaining, but then symbols from “barstatic” were not
available for users of “fooshared” anymore. So I worked around this by converting “barstatic” into an object library, but it feels ugly.
Why would CMake require exporting statically linked dependency targets among the targets that use them? Feels like a bug to me…unless someone can explain why