On Thursday 17 May 2012, Petr Kmoch wrote: > Hi Anton, > > you should look into target property LINK_INTERFACE_LIBRARIES (and its > per-configuration variants) which controls "transitive linking." > target_link_libraries() also accepts LINK_INTERFACE_LIBRARIES as an > argument mode, which sets the property instead of linking.
No, this is a different problem. Linking a shared library against static libraries does not have the effect that the object files of the static libs are included in the shared lib. But this is probably what Anton expected. So, since this does not happen, to resolve the functions when linking the executable, it also needs to link against the static libraries. So this is correct. "Convenience libraries" as they are called with autotools are not really supported with cmake. You have two options: 1) simply compile all source files directly into the shared library. They can be in different directories, no problem. 2) since cmake 2.8.8: instead of creating static libs, create a "object" libs: add_library(.. OBJECT ...). This basically avoids the need for recompiling the source files if the files are otherwise built multiple times (which may happen with solution 1) ). Alex
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
