From e44974862a3e9cdc81b937901ba88c5568c59ed6 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Thu, 8 May 2014 14:39:21 +0100 Subject: [PATCH] cmake: add pthreads and make add libmaa as REQUIRED Signed-off-by: Brendan Le Foll --- CMakeLists.txt | 3 ++- examples/CMakeLists.txt | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f5d95d3..66b5237e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,9 @@ if (SWIG_FOUND) include (${SWIG_USE_FILE}) endif () +find_package (Threads REQUIRED) find_package (PkgConfig REQUIRED) -pkg_check_modules (MAA maa>=0.2.2) +pkg_check_modules (MAA REQUIRED maa>=0.2.2) message (INFO " found libmaa version: ${MAA_VERSION}") set (CMAKE_SWIG_FLAGS "") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index c174d10f..30591ea2 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -5,6 +5,6 @@ add_executable (grovetemp grovetemp.cxx) include_directories (${PROJECT_SOURCE_DIR}/src/hmc5883l) include_directories (${PROJECT_SOURCE_DIR}/src/grove) -target_link_libraries (compass hmc5883l) -target_link_libraries (groveled grove) -target_link_libraries (grovetemp grove) +target_link_libraries (compass hmc5883l ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries (groveled grove ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries (grovetemp grove ${CMAKE_THREAD_LIBS_INIT})