Re: [CMake] static library linking problem

2013-05-14 Thread Andreas Mohr
On Tue, May 14, 2013 at 08:47:36PM -0400, cmake-requ...@cmake.org wrote: > Date: Tue, 14 May 2013 19:05:13 -0400 > From: Vojt?ch Nov?k > I am getting this error: > > undefined reference to `ccv_read_impl(...)' > and more undefined references to the stuff from the library As has been clarified

Re: [CMake] static library linking problem

2013-05-14 Thread Sascha Cunz
Am Dienstag, 14. Mai 2013, 19:05:13 schrieb Vojtěch Novák: > hello, > I'm working on a C++ package for ROS (robot operating system) that uses a C > library libccv.a. ROS uses CMake which is why I am asking here. Asking at > ROS answers did not help and I am totally stuck. [...] From a quick loo

[CMake] static library linking problem

2013-05-14 Thread Vojtěch Novák
hello, I'm working on a C++ package for ROS (robot operating system) that uses a C library libccv.a. ROS uses CMake which is why I am asking here. Asking at ROS answers did not help and I am totally stuck. here is the relevant part of my CMakeLists.txt: set(SOURCES src/${PROJECT_NAME}.cpp src/Ro

Re: [CMake] static library linking

2008-06-15 Thread Brad King
Steven Van Ingelgem wrote: Another issue I just noticed... If you link to an "add_library" or so, it will add all the target linked libraries of the original "add_library", which is rather incorrect imho because I don't want to link every library to a 100M static library, that is only compiled

Re: [CMake] static library linking

2008-06-15 Thread Brad King
Steven Van Ingelgem wrote: I don't seem to be able to make it link correctly? I do: set_property(TARGET ${SUB_PROJECT} PROPERTY IMPORTED_LOCATION ${PTHREAD} ${RT} ${LIBC}) But it's still somehow linking wrongly :(... What would be the correct line for this? You've mis-read the example. Th

Re: [CMake] static library linking

2008-06-15 Thread Steven Van Ingelgem
I re-read my post and I gotta say I'm -again- unclear... Let me put this more detailed: === add_library( somename shared a.cpp) target_link_libraries(somename /somepath/lib100m.a) add_library( otherlib shared b.cpp) target_link_libraries(otherlib somename) === The first

Re: [CMake] static library linking

2008-06-15 Thread Steven Van Ingelgem
Another issue I just noticed... If you link to an "add_library" or so, it will add all the target linked libraries of the original "add_library", which is rather incorrect imho because I don't want to link every library to a 100M static library, that is only compiled in in 1 shared library... Is t

Re: [CMake] static library linking

2008-06-15 Thread Steven Van Ingelgem
Hmmm? I don't seem to be able to make it link correctly? I do: set_property(TARGET ${SUB_PROJECT} PROPERTY IMPORTED_LOCATION ${PTHREAD} ${RT} ${LIBC}) But it's still somehow linking wrongly :(... What would be the correct line for this? The weird thing is... When I turn it off (the linking),

Re: [CMake] static library linking

2008-06-15 Thread Alan W. Irwin
On 2008-06-15 21:58+0200 Steven Van Ingelgem wrote: Hi Alan, It doesn't want to link with the -Bstatic... But it links nicely with the static paths... In fact on the system is only 1 libpthread.a ... And that's not what is getting linked against because it returns errors related to symbols whi

Re: [CMake] static library linking

2008-06-15 Thread Steven Van Ingelgem
Hi Alan, It doesn't want to link with the -Bstatic... But it links nicely with the static paths... In fact on the system is only 1 libpthread.a ... And that's not what is getting linked against because it returns errors related to symbols which cannot be found in the .so (somehow). I have no ide

Re: [CMake] static library linking

2008-06-15 Thread Alan W. Irwin
On 2008-06-15 19:28+0200 Steven Van Ingelgem wrote: Hi Alan, I don't know why, but if I take the build command from cmake, and I insert the static libraries in there, it works all right. So somehow it's reverting itself to some other version of the static and/or dynamic libraries. You would

Re: [CMake] static library linking

2008-06-15 Thread Brad King
Steven Van Ingelgem wrote: > I don't know why, but if I take the build command from cmake, and I > insert the static libraries in there, it works all right. So somehow > it's reverting itself to some other version of the static and/or dynamic > libraries. > > The entire point of me reporting this

Re: [CMake] static library linking

2008-06-15 Thread Steven Van Ingelgem
Hi Alan, I don't know why, but if I take the build command from cmake, and I insert the static libraries in there, it works all right. So somehow it's reverting itself to some other version of the static and/or dynamic libraries. The entire point of me reporting this in fact is that in cmake cvs

Re: [CMake] static library linking

2008-06-15 Thread Alan W. Irwin
On 2008-06-15 11:47+0200 Steven Van Ingelgem wrote: A small example (and verified on a clean SUSE installation): PROJECT(test) cmake_policy(SET CMP0003 NEW) ADD_EXECUTABLE( test main.cpp ) TARGET_LINK_LIBRARIES( test /usr/lib/libpthread.a /usr/lib/librt.a /usr/lib/l

Re: [CMake] static library linking

2008-06-15 Thread Steven Van Ingelgem
A small example (and verified on a clean SUSE installation): PROJECT(test) cmake_policy(SET CMP0003 NEW) ADD_EXECUTABLE( test main.cpp ) TARGET_LINK_LIBRARIES( test /usr/lib/libpthread.a /usr/lib/librt.a /usr/lib/libc.a ) ==> this won't set

[CMake] static library linking

2008-06-14 Thread Steven Van Ingelgem
Hi, I have a question about CMP0003... When I give the full path to a static library, it's supposed to link against that one... But right now I'm linking against: "/usr/lib/libpthread.a" (message before the target_link_libraries call) This results however in "-Wl,-Bstatic -lpthread"... Which does