[CMake] unsetting CXX_SHARED_LINKER_FLAGS for one library in a project?
Boudewijn Rempt
boud at valdyas.org
Fri Dec 25 05:12:34 EST 2009
On Friday 25 December 2009, Hendrik Sattler wrote:
> Am Mittwoch 23 Dezember 2009 18:22:42 schrieb Boudewijn Rempt:
> > Hi,
> >
> > I am integrating an external library in the build process of a KDE
> > application. KDE's findkde4 cmake module adds --fatal-
> > warnings -Wl,--no-undefined to the linker flags. This library (wv2) links
> > to glib2, and when I try to link it with these flags set, I get lots of
> > errors like:
> >
> > CMakeFiles/wv2.dir/olestream.cpp.o: In function `~OLEStreamReader':
> > /home/boud/kde/src/koffice/filters/kword/wv2/src/olestream.cpp:76:
> > undefined reference to `g_type_check_instance_cast
> >
> > If I make the (old) standalone version of wv2, and add the linker flags,
> > linking fails as well. Apparently the library works well even though at
> > linking time there are undefined references, so I am trying to unset the
> > linker flags for this library only.
> >
> > Is that possible? Or is there a better solution?
>
> Yes, add the missing libraries to the link line: gobject-2.0
>
Thanks, that worked. I had never realized that this would be a separate
library, since the project I am porting never linked to it explicitly.
--
Boudewijn Rempt | http://www.valdyas.org
More information about the CMake
mailing list