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

Re: [CMake] transitive linking with separate projects

2012-03-07 Thread Michael Hertling
On 03/07/2012 11:29 AM, Alexander Dahl wrote: > Hello Michael, > > Am 2012-03-06 16:46, schrieb Michael Hertling: >> or possibly better: >> >> # libbar/bar-config.cmake.in: >> FIND_PACKAGE(FOO PATHS @FOO_DIR@ NO_DEFAULT_PATH) > > I used > > FIND_PACKAGE(FOO 0.1.0 REQUIRED) > > in the package c

Re: [CMake] transitive linking with separate projects

2012-03-07 Thread Alexander Dahl
Hello Michael, Am 2012-03-06 16:46, schrieb Michael Hertling: > or possibly better: > > # libbar/bar-config.cmake.in: > FIND_PACKAGE(FOO PATHS @FOO_DIR@ NO_DEFAULT_PATH) I used FIND_PACKAGE(FOO 0.1.0 REQUIRED) in the package config file now, which works, too. > BTW, find modules / config fil

Re: [CMake] transitive linking with separate projects

2012-03-06 Thread Michael Hertling
On 03/06/2012 02:47 PM, Alexander Dahl wrote: > Hei hei, > > we faced a build problem with transitive linking of separate projects > where I can't find the right solution on my own. I hope someone can give > me a hint. I prepared a test case with two libraries libfoo and libbar > and an applicati

[CMake] transitive linking with separate projects

2012-03-06 Thread Alexander Dahl
Hei hei, we faced a build problem with transitive linking of separate projects where I can't find the right solution on my own. I hope someone can give me a hint. I prepared a test case with two libraries libfoo and libbar and an application baz. libfoo is on his own, libbar calls a function from

Re: [CMake] transitive linking topics

2011-11-24 Thread Hendrik Sattler
Am 24.11.2011 09:47, schrieb Rolf Eike Beer: Oops. You are right. I had never ever heard of applications exporting symbols before. Live and learn. You use one every day: $ /lib/libc.so.6 GNU C Library stable release version 2.11.3 (20110203), by Roland McGrath et al. Copyright (C) 2009 Fr

Re: [CMake] transitive linking topics

2011-11-24 Thread Rolf Eike Beer
> On 2011-11-23 10:44+0100 Michael Wild wrote: > >> On 11/23/2011 10:25 AM, Alan W. Irwin wrote: >>> cmake-2.8.6 has the following documentation of the >>> LINK_INTERFACE_LIBRARIES property for targets: >>> >>> LINK_INTERFACE_LIBRARIES >>>List public interface libraries for a shared libra

Re: [CMake] transitive linking topics

2011-11-23 Thread Alan W. Irwin
lf. I was just commenting on the CMake transitive linking implications of what Orion told me about rpmlint warnings he had encountered (which I confirmed with "ldd -u"). Since I wrote "all this to quiet rpmlint warnings", it turns out the PLplot Debian packager (again not me) confir

Re: [CMake] transitive linking topics

2011-11-23 Thread Alan W. Irwin
On 2011-11-23 10:44+0100 Michael Wild wrote: On 11/23/2011 10:25 AM, Alan W. Irwin wrote: cmake-2.8.6 has the following documentation of the LINK_INTERFACE_LIBRARIES property for targets: LINK_INTERFACE_LIBRARIES List public interface libraries for a shared library or executable.

Re: [CMake] Transitive linking

2011-11-21 Thread Michael Hertling
On 11/19/2011 08:02 AM, James Bigler wrote: > On Fri, Nov 18, 2011 at 5:51 PM, Michael Hertling wrote: > >> On 11/18/2011 10:03 PM, James Bigler wrote: >>> 2011/11/18 Alexander Neundorf >>> On Friday 18 November 2011, James Bigler wrote: > I thought CMake knew how to not drag all the dep

Re: [CMake] Transitive linking

2011-11-19 Thread David Cole
On Nov 19, 2011, at 2:02 AM, James Bigler wrote: > On Fri, Nov 18, 2011 at 5:51 PM, Michael Hertling wrote: > On 11/18/2011 10:03 PM, James Bigler wrote: > > 2011/11/18 Alexander Neundorf > > > >> On Friday 18 November 2011, James Bigler wrote: > >>> I thought CMake knew how to not drag all t

Re: [CMake] Transitive linking

2011-11-19 Thread Andreas Pakulat
On 19.11.11 00:02:22, James Bigler wrote: > On Fri, Nov 18, 2011 at 5:51 PM, Michael Hertling wrote: > > > On 11/18/2011 10:03 PM, James Bigler wrote: > > > 2011/11/18 Alexander Neundorf > > > > > >> On Friday 18 November 2011, James Bigler wrote: > > >>> I thought CMake knew how to not drag all

Re: [CMake] Transitive linking

2011-11-19 Thread Alexander Neundorf
On Saturday 19 November 2011, Michael Hertling wrote: > On 11/18/2011 10:03 PM, James Bigler wrote: > > 2011/11/18 Alexander Neundorf > > > >> On Friday 18 November 2011, James Bigler wrote: > >>> I thought CMake knew how to not drag all the dependent libraries once > >>> you linked an executable

Re: [CMake] Transitive linking

2011-11-18 Thread James Bigler
On Fri, Nov 18, 2011 at 5:51 PM, Michael Hertling wrote: > On 11/18/2011 10:03 PM, James Bigler wrote: > > 2011/11/18 Alexander Neundorf > > > >> On Friday 18 November 2011, James Bigler wrote: > >>> I thought CMake knew how to not drag all the dependent libraries once > you > >>> linked an execu

Re: [CMake] Transitive linking

2011-11-18 Thread Michael Hertling
On 11/18/2011 10:03 PM, James Bigler wrote: > 2011/11/18 Alexander Neundorf > >> On Friday 18 November 2011, James Bigler wrote: >>> I thought CMake knew how to not drag all the dependent libraries once you >>> linked an executable module. >>> >>> add_library(A STATIC a.cpp) >>> add_library(B SHA

Re: [CMake] Transitive linking

2011-11-18 Thread James Bigler
2011/11/18 Alexander Neundorf > On Friday 18 November 2011, James Bigler wrote: > > I thought CMake knew how to not drag all the dependent libraries once you > > linked an executable module. > > > > add_library(A STATIC a.cpp) > > add_library(B SHARED b.cpp) > > target_link_libraries(B A) > > add

Re: [CMake] Transitive linking

2011-11-18 Thread Alexander Neundorf
On Friday 18 November 2011, James Bigler wrote: > I thought CMake knew how to not drag all the dependent libraries once you > linked an executable module. > > add_library(A STATIC a.cpp) > add_library(B SHARED b.cpp) > target_link_libraries(B A) > add_library(C SHARED c.cpp) > target_link_librarie

[CMake] Transitive linking

2011-11-18 Thread James Bigler
I thought CMake knew how to not drag all the dependent libraries once you linked an executable module. add_library(A STATIC a.cpp) add_library(B SHARED b.cpp) target_link_libraries(B A) add_library(C SHARED c.cpp) target_link_libraries(C B) add_executable(run run.cpp) target_link_libraries(run C)

Re: [CMake] Transitive linking and imported targets

2009-03-31 Thread Tobias Rudolph
On Mar 31, 2009, at 21:10, Hendrik Sattler wrote: Am Dienstag 31 März 2009 19:48:49 schrieb Tobias Rudolph: add_library( iLib SHARED IMPORTED ) set_target_properties( iLib PROPERTIES IMPORTED_LOCATION "/opt/local/ lib/libzip.dylib" ) add_library( libFoo SHARED foo.cpp ) target_link_libra

Re: [CMake] Transitive linking and imported targets

2009-03-31 Thread Hendrik Sattler
Am Dienstag 31 März 2009 19:48:49 schrieb Tobias Rudolph: > > add_library( iLib SHARED IMPORTED ) > set_target_properties( iLib PROPERTIES IMPORTED_LOCATION "/opt/local/ > lib/libzip.dylib" ) > > add_library( libFoo SHARED foo.cpp ) > target_link_libraries( libFoo iLib ) > > > According t

[CMake] Transitive linking and imported targets

2009-03-31 Thread Tobias Rudolph
Hi All, I am trying to build a project containing several subprojects that are included via add_subdirectory. Now, here is an example demonstrating the problem: The test project contains the following CMakeLists.txt: project( CMakeTest ) cmake_minimum_required( VERSION 2.6 ) add_subdi