At least on Linux, boost-thread depends on pthread. The linking is not
automatic, and users have had issues with this.
We need to link against the platform's thread library, as it is needed for
boost-thread. CMake takes care of getting the exact settings to be passed
to the linker for us with ${CMAKE_THREAD_LIBS_INIT}.
This fixes bug #42.
Signed-off-by: Alexandru Gagniuc <redacted>
## This file is part of the PulseView project.
##
## Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
-## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
+## Copyright (C) 2012-2013 Alexandru Gagniuc <mr.nuke.me@gmail.com>
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
find_package(Qt4 REQUIRED)
+# Find the platform's thread library (needed for boost-thread).
+# This will set ${CMAKE_THREAD_LIBS_INIT} to the correct, OS-specific value.
+find_package(Threads)
+
if(WIN32)
# On Windows/MinGW the we need to use 'thread_win32' instead of 'thread'.
# The library is named libboost_thread_win32* (not libboost_thread*).
set(PULSEVIEW_LINK_LIBS
${Boost_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
${QT_LIBRARIES}
)