On 11/17/2015 2:46 PM, Jack Stalnaker wrote:
I read about those, but they don't seem to provide a way to add linked
in libraries, so it didn't seem to add a lot over a list of sources. In
autotools, you could bind your convenience lib with any dependencies via
a LIBADD primary, and the added libs would automatically propagate to
the final target. This of course works in cmake if I build a real
library, but if I try to link a library (e.g. say the system math
library) to the object library, cmake tells me it cannot do that for
object libraries. In that case, it seems like I still need to create the
foobarLIBRARIES variable to provide to target_link_libraries later.
Am I missing something, or is there a way to somehow attach the
necessary external libraries to the object library as well?
It is a feature that has not been implemented. However, I would say
that it does add something over lists of sources. It avoids all the
cache and parent scope in this thread. Seems like it would still be
more simple to use object libraries than to try and do it via lists of
sources.
To add that feature would be some work, but is possible:
https://cmake.org/Bug/view.php?id=14778
https://cmake.org/Bug/view.php?id=14970
I still think the object libraries might work for you.
-Bill
--
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