1 From 46660112b76664473cc98b8ae6c863fd27c27d2d Mon Sep 17 00:00:00 2001
2 From: Samuel Martin <s.martin49@gmail.com>
3 Date: Fri, 29 Aug 2014 23:40:59 +0200
4 Subject: [PATCH 1/1] cmake: handle static library and find required thread
7 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
10 src/CMakeLists.txt | 4 +++-
11 2 files changed, 5 insertions(+), 1 deletion(-)
13 diff --git a/CMakeLists.txt b/CMakeLists.txt
14 index 79f644c..7779a2a 100644
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/")
21 +find_package(Threads REQUIRED)
22 find_package(libusb-1.0 REQUIRED)
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)
27 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
28 index 149d198..0597ccd 100644
29 --- a/src/CMakeLists.txt
30 +++ b/src/CMakeLists.txt
31 @@ -18,8 +18,10 @@ set (iqrf_sources
33 include_directories ("${LIBUSB_1_INCLUDE_DIRS}")
35 -add_library(iqrf SHARED ${iqrf_sources} ${iqrf_headers})
36 +add_library(iqrf ${iqrf_sources} ${iqrf_headers})
38 target_link_libraries(iqrf ${LIBUSB_1_LIBRARIES})
39 +target_link_libraries(iqrf ${CMAKE_THREAD_LIBS_INIT})
41 set_target_properties(iqrf PROPERTIES
42 VERSION "${iqrf_version_major}.${iqrf_version_minor}"