1From 46660112b76664473cc98b8ae6c863fd27c27d2d Mon Sep 17 00:00:00 2001 2From: Samuel Martin <s.martin49@gmail.com> 3Date: Fri, 29 Aug 2014 23:40:59 +0200 4Subject: [PATCH 1/1] cmake: handle static library and find required thread 5 module 6 7Signed-off-by: Samuel Martin <s.martin49@gmail.com> 8--- 9 CMakeLists.txt | 2 ++ 10 src/CMakeLists.txt | 4 +++- 11 2 files changed, 5 insertions(+), 1 deletion(-) 12 13diff --git a/CMakeLists.txt b/CMakeLists.txt 14index 79f644c..7779a2a 100644 15--- a/CMakeLists.txt 16+++ b/CMakeLists.txt 17@@ -6,7 +6,9 @@ enable_testing() 18 # use local module (for Findlibusb-1.0.cmake) 19 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") 20 21+find_package(Threads REQUIRED) 22 find_package(libusb-1.0 REQUIRED) 23+ 24 if (NOT LIBUSB_1_FOUND) 25 message(FATAL_ERROR "libusb-1.0 not installed. (try apt-get install libusb-1.0-0-dev)") 26 endif (NOT LIBUSB_1_FOUND) 27diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 28index 149d198..0597ccd 100644 29--- a/src/CMakeLists.txt 30+++ b/src/CMakeLists.txt 31@@ -18,8 +18,10 @@ set (iqrf_sources 32 33 include_directories ("${LIBUSB_1_INCLUDE_DIRS}") 34 35-add_library(iqrf SHARED ${iqrf_sources} ${iqrf_headers}) 36+add_library(iqrf ${iqrf_sources} ${iqrf_headers}) 37+ 38 target_link_libraries(iqrf ${LIBUSB_1_LIBRARIES}) 39+target_link_libraries(iqrf ${CMAKE_THREAD_LIBS_INIT}) 40 41 set_target_properties(iqrf PROPERTIES 42 VERSION "${iqrf_version_major}.${iqrf_version_minor}" 43-- 442.1.0 45 46