I’m using object libraries to put together a project composed of numerous modules. When putting together the static library (deliverable) at the end I have used libtool to assemble final product. I’ve been trying to adopt the use of OBJECT type libraries to
avoid the libtool call and it mostly works with the exception that OpenSSL and Boost static libraries are not included in the result. This means I’ll still need libtool to add them to the archive.
1) Does this look like I’m using this correctly?
2) Can the .a files be handled by CMake in a better way than using libtool? It is a collection of objects after all.
When this is built, other libraries will add this library in the
target_link_libraries( another_interface INTERFACE common )
### Library - objects
add_library( common_objects OBJECT
set_target_properties( common_objects PROPERTIES POSITION_INDEPENDENT_CODE on )