I have library which we will call libB with statically linked dependencies libE.a, libF.a and libG.a (prebuilt) in target_link_dependencies(libB PRIVATE libE.a libF.a libG.a PUBLIC m). I have defined different project progA which is using libB which is exported as B-config.cmake. B-config.cmake is imported by progA. progA doesn’t directly use libE, libF, libG, but when I try to build it I get linker error that libE.a libF.a libG.a are missing.
This is was my logic: libE, libF, libG are PRIVATE and therefore they won’t be passed down when exporting B-targets.
I believe it could be solved by changing INTERFACE_LINK_LIBRARIES from generated file, but Im not sure how to do it.
In target file I have line that looks something like this:
set_target_properties(libB PROPERTIES INTERFACE_LINK_LIBRARIES "libE.a libF.a libG.a m" )
while I want it to look like this:
set_target_properties(libB PROPERTIES INTERFACE_LINK_LIBRARIES "m" )