Good morning,
given the following configuration:
/CMakeLists.txt
/include/
/lib1/CMakeLists.txt
/lib2/CMakeLists.txt
...
where each /lib.*/CMakeLists.txt creates its own archive:
add_library(lib.* EXCLUDE_FROM_ALL
foo.cpp
bar.cpp
)
target_link_libraries(lib1 PUBLIC interface)
and the final /CMakeLists.txt should wrap all libraries together::
add_library(interface INTERFACE)
target_include_directories(interface INTERFACE include/)
add_subdirectory(lib1 lib2...)
add_library(libcommon INTERFACE)
target_link_libraries(libcommon INTERFACE lib1 lib2...)
I wonder how to create an install target for the final library `libcommon' ?
This snippet doesn't seem effective with INTERFACE targets:
install(TARGETS libcommon
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
Thanks,
Quack
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake