cmake: add pthreads and make add libmaa as REQUIRED
authorBrendan Le Foll <brendan.le.foll@intel.com>
Thu, 8 May 2014 13:39:21 +0000 (14:39 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Thu, 8 May 2014 13:39:21 +0000 (14:39 +0100)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
CMakeLists.txt
examples/CMakeLists.txt

index 2f5d95d..66b5237 100644 (file)
@@ -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 "")
index c174d10..30591ea 100644 (file)
@@ -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})