Installing interface libraries has no effect without the 'EXPORT'
keyword as they have no artifacts, you will need to install the actual
archives to get any artifacts.

To generate a CMake file containing the correct import targets for
consumers of your project you should like at the 'EXPORT' keyword for
the install command (
https://cmake.org/cmake/help/latest/command/install.html#export )
On Sat, Aug 4, 2018 at 7:13 AM QuaquaraquĆ  <nuquaquara...@gmail.com> wrote:
>
> 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
-- 

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

Reply via email to