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?

- Frerich

P.S.: Please CC me on replies, I'm not (yet? ;-)) subscribed to this 
mailinglist.
Index: FindQt4.cmake
===================================================================
--- FindQt4.cmake	(revision 726465)
+++ FindQt4.cmake	(working copy)
@@ -757,6 +757,11 @@
   # Set QT_QTDESIGNERCOMPONENTS_LIBRARY
   FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY NAMES QtDesignerComponents QtDesignerComponents4 QtDesignerComponentsd4 PATHS ${QT_LIBRARY_DIR}        NO_DEFAULT_PATH)
 
+  if (CMAKE_SYSTEM_NAME MATCHES BSD)
+    set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
+    set ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pthread")
+  endif (CMAKE_SYSTEM_NAME MATCHES BSD)
+
   # Set QT_QTMAIN_LIBRARY
   IF(WIN32)
     FIND_LIBRARY(QT_QTMAIN_LIBRARY NAMES qtmain qtmaind PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to