Transitiveness of MODULE library
add_library(foo MODULE foo.cpp bar.cpp ...)
It allows then to add more dependencies as:
target_include_directories (foo PUBLIC a.h INTERFACE b.h PRIVATE c.h)
That (public and interface) implies, that library can be further linked, as
target_link_libraries(bar foo)
as direct or imported target_link_libraries(bar foo::foo)
.
However that is not true and causes error about that module libraries can't be linked because they're module.
Here we can consider 'module' just as 'very special libary' with own rules. Or - as 'a kind of shared'.
In first case it is isolated, can't be linked (which is already reported), and should reject any kind of dependencies other then private (i.e. target_include_directories(foo PUBLIC a.h INTERFACE b.h...)
should report as error or warning that a.h and b.h are NOT transitive. So, to use provided dependencies you can't use 'target_link_libraries', but may explicitly read the properties and use them.
In second case it is just a library which will NOT be linked by 'target_link_libraries', but all other stuff like includes, complier definitions and options, compatible properties will be in game. (however usage them via 'target_link_libraries' became quite confusing because of the name of the function itself, as it is no 'link' possible.
Now it is a kind of inconsistency, as I can assign different properties, but actually only way to consume them is direct reading of their values via 'get_target_property'.
So, if would be good either to teach cmake to consume properties from module library via 'target_link_libraries' (all, except actual location). Either to explicitly disable, or warning when assigning to module libraries 'public' and 'interface' properties.