]> sigrok.org Git - pulseview.git/blobdiff - CMakeLists.txt
Fix the C++11 thread linking issues for unit tests as well.
[pulseview.git] / CMakeLists.txt
index 2fd35b1c3a1ee389fa1587ff2c2cafdf624c2686..f334f9118c024018179cd8fb433d2525790cce39 100644 (file)
@@ -92,6 +92,10 @@ endif()
 
 find_package(Boost 1.42 COMPONENTS filesystem system REQUIRED)
 
+# Find the platform's thread library (needed for C++11 threads).
+# This will set ${CMAKE_THREAD_LIBS_INIT} to the correct, OS-specific value.
+find_package(Threads REQUIRED)
+
 #===============================================================================
 #= System Introspection
 #-------------------------------------------------------------------------------
@@ -318,6 +322,7 @@ link_directories(${Boost_LIBRARY_DIRS})
 set(PULSEVIEW_LINK_LIBS
        ${Boost_LIBRARIES}
        ${QT_LIBRARIES}
+       ${CMAKE_THREAD_LIBS_INIT}
 )
 
 if(STATIC_PKGDEPS_LIBS)