[CMake] Link error when building static exe against static Qt 4.5 plugin

Stephen Collyer scollyer at netspinner.co.uk
Mon Mar 23 13:14:49 EDT 2009


2009/3/23 Andreas Pakulat <apaku at gmx.de>

> On 23.03.09 16:53:15, Stephen Collyer wrote:
> > 2009/3/23 Stephen Collyer <scollyer at netspinner.co.uk>
>
> > However, I'm not entirely happy as:
> >
> > a) I've hardcoded the relative path ../plugins/sqldrivers in the
> > SQL_LIB_DIRS
>
> Thats ok, anybody who doesn't have this simply has a broken Qt install,
> Linux distro's usually provide some directory under which they symlink a
> proper directory hierarchy (and if the distro doesn't it simply broken).
>

I've checked the Win32 build and the dir. heirarchy is the same too, so I
think this should be OK in Win32-land too.

>
> You could of course also use the (not properly documented) QT_PLUGINS_DIR
> variable.


Right. I'll take a look at that.

>
> > b) I've got an explicity reference to /usr/lib as well
> >
> > Can anyone suggest how I can make this a bit more platform independent ?
>
> Use find_library for your mysql library, not sure how to force it to search
> for the static version though (except removing the shared lib).


Of course. That's obvious. Not having touched cmake for about 5 months, I've
forgotten it all :-(

Re: the finding the static version: I guess I can add my own FindMySQL.cmake
and make it sufficiently clever, if I want.

Steve Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090323/8bd2d823/attachment-0001.htm>


More information about the CMake mailing list