Linking executables on FreeBSD

Alexander Neundorf neundorf at kde.org
Fri Oct 19 15:24:39 CEST 2007


On Thursday 18 October 2007 20:43, Frerich Raabe wrote:
> Hi,
>
> I just attempted to build a few KDE modules from KDE trunk on my FreeBSD
> box and noticed that none of the executables (like, test programs) which
> link against Qt worked on FreeBSD. This is because '-pthread' was missing
> on the linker line (you use that instead of '-lpthread' on FreeBSD).
>
> I attached a patch which I applied to all FindQt4.cmake copies I could find
> in my checkout and except for the copy which is in
> kdesupport/qca/cmake/modules, it applied nicely and fixed the problem (for
> qca, I needed a slightly different patch because the FindQt4.cmake file is
> different).
>
> I don't dare to commit this though as I have not much of a clue how the
> build system works. Does this patch look sane?


If you look at FindQt4.cmake, you'll find the following two lines almost at 
the end of the file:

FIND_PACKAGE(Threads)
SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})

CMAKE_THREAD_LIBS_INIT should be set to "-pthread" in your case, this should 
be done by Modules/FindThreads.cmake coming with cmake. Please check which 
value CMAKE_THREAD_LIBS_INIT has on your system and try to figure out what 
FindThreads.cmake does on your box.

Bye
Alex


More information about the Kde-buildsystem mailing list