Re: [CMake] Transitive linking and static libraries

2013-10-17 Thread Matthew Woehlke
On 2013-10-17 12:58, James Bigler wrote: It doesn't seem to work. I can't use target_link_libraries on an imported target. add_library(imported_lib STATIC IMPORTED GLOBAL) set_target_properties(imported_lib PROPERTIES IMPOARTED_LOCATION "${imported_lib_location}") target_link_libraries(imported

Re: [CMake] Transitive linking and static libraries

2013-10-17 Thread Andreas Pakulat
Hi James, On Thu, Oct 17, 2013 at 6:58 PM, James Bigler wrote: > It doesn't seem to work. > > I can't use target_link_libraries on an imported target. > > add_library(imported_lib STATIC IMPORTED GLOBAL) > set_target_properties(imported_lib PROPERTIES IMPOARTED_LOCATION > "${imported_lib_locatio

Re: [CMake] Transitive linking and static libraries

2013-10-17 Thread James Bigler
It doesn't seem to work. I can't use target_link_libraries on an imported target. add_library(imported_lib STATIC IMPORTED GLOBAL) set_target_properties(imported_lib PROPERTIES IMPOARTED_LOCATION "${imported_lib_location}") target_link_libraries(imported_lib other_lib) Produces an error: Attemp

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Robert Maynard
Can you try something like this? https://github.com/robertmaynard/Sandbox/blob/master/ImportedLibrary/CMakeLists.txt I don't see the second shared library linking to the imported static library. On Wed, Oct 16, 2013 at 3:44 PM, James Bigler wrote: > On Wed, Oct 16, 2013 at 1:34 PM, Giordano Kh

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread James Bigler
On Wed, Oct 16, 2013 at 1:34 PM, Giordano Khouri wrote: > The static libraries must be compiled with -fvisibility=hidden. Symbols > with default visibility are marked as “public” and will leak from a shared > library. With hidden visibility, they symbols are marked as “private > extern”, allowing

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Giordano Khouri
Nikon-1-AW1.html?cid=eml-0913-n1aw1-signature> From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of James Bigler Sent: Wednesday, October 16, 2013 2:06 PM To: cmake@cmake.org Subject: [CMake] Transitive linking and static libraries Is it possible to stop known static libr

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread James Bigler
This seems to do what I want. Is there a version of this that works for IMPORTED targets. There's *IMPORTED_LINK_INTERFACE_LIBRARIES*, but I'm not sure how to make them private for static libraries. Thanks, James On Wed, Oct 16, 2013 at 12:17 PM, Robert Maynard wrote: > Have you tried using

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Robert Maynard
Have you tried using the LINK_PRIVATE signature to target link libraries? On Wed, Oct 16, 2013 at 2:05 PM, James Bigler wrote: > Is it possible to stop known static libraries from being carried through > shared libraries? > > add_library(mystatic1 STATIC ...) > add_library(mystatic2 STATIC ...) >

Re: [CMake] Transitive linking and static libraries

2013-10-16 Thread Matthew Woehlke
On 2013-10-16 14:05, James Bigler wrote: Is it possible to stop known static libraries from being carried through shared libraries? Did you try using 'LINK_PRIVATE' in your target_link_libraries? -- Matthew -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ

[CMake] Transitive linking and static libraries

2013-10-16 Thread James Bigler
Is it possible to stop known static libraries from being carried through shared libraries? add_library(mystatic1 STATIC ...) add_library(mystatic2 STATIC ...) add_library(myshared SHARED ...) target_link_libraries(myshared mystatic1 mystatic2) add_executable(myexe) target_link_libraries(myexe mysh