Ruslan Baratov via CMake wrote: >> So my question is, in general, how can I make installabled static >> libraries with a package config file? Or is the trying to redistribute >> static libraries a bad idea in the first place? > It's not related to static/shared, this is about absolute path. If you > have an absolute path for dynamic library in FooConfig.cmake you'll have > the same issue.
The solution is IMPORTED targets in the INTERFACE_LINK_LIBRARIES and a find_package to define the IMPORTED target on the consumer system. I don't know if that works as well for static libraries, because you'd probably need to ensure that the exact same file is linked to by the consumer, which is not the case with shared libraries - as long as the API is the same, you could link to another version. Thanks, Steve. -- 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: http://public.kitware.com/mailman/listinfo/cmake
