I have 2 static libraries in two different folders: libA
and libB
libB
must includelibA
My main CMakeLists.txt is:
add_subdirectory(libA)
add_subdirectory(libB)
My first mistake was to think linking libA in libB would include it but it isn't:
target_link_libraries(${PROJECT_NAME} PUBLIC libA::libA)
I get undefined reference to some libA's functions
when I try to use libB in an app.
- How can I tell CMake to include libA as part of libB?
- What's the best practice for that?
- I'd like to avoid any extra step (How to merge two "ar" static libraries into one?)