I have the following layout:
top_project
+ subproject1
+ subproject2
Each of subproject1
and subproject2
I am not sure if this is what suits your need, but cmake also offers INTERFACE
libraries, which serve (among others) precisely this need.
add_library(bundle INTERFACE)
target_link_libraries(bundle lib1 lib2)
will bundle lib1 and lib2 into a single library, and inherit the PUBLIC
and INTERFACE
section of lib1
and lib2
.
More info here.