I have a project has the following structure. aaa and bbb is 2 sub directory and was compiled into static library. and up one level( folder) there's another project ccc which is also compiled into static library and the libccc.a is the final static library I want to get. In the libccc.a, I hope it will include both project ccc and aaa + bbb. I have tried to change the link flag in the CMakelist.txt for the ccc, but seems not working. I guess I am using wrong flag.
my original cmakelist.txt for ccc is like the following:
add_subdirectory(aaa)
add_subdirectory(bbb)
set( sources cccsrc1.cpp cccsrc2.cpp)
include_directorys( ${incdir})
add_library( ccc STATIC sources)
target_link_library( ccc aaa bbb)
So does anyone know how to change the cmake file to tell ccc generate static library which also include all aaa and bbb code.