瀏覽代碼

cmake: add pthreads and make add libmaa as REQUIRED

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Brendan Le Foll 11 年之前
父節點
當前提交
e44974862a
共有 2 個檔案被更改,包括 5 行新增4 行删除
  1. 2
    1
      CMakeLists.txt
  2. 3
    3
      examples/CMakeLists.txt

+ 2
- 1
CMakeLists.txt 查看文件

@@ -6,8 +6,9 @@ if (SWIG_FOUND)
6 6
   include (${SWIG_USE_FILE})
7 7
 endif ()
8 8
 
9
+find_package (Threads REQUIRED)
9 10
 find_package (PkgConfig REQUIRED)
10
-pkg_check_modules (MAA maa>=0.2.2)
11
+pkg_check_modules (MAA REQUIRED maa>=0.2.2)
11 12
 message (INFO " found libmaa version: ${MAA_VERSION}")
12 13
 
13 14
 set (CMAKE_SWIG_FLAGS "")

+ 3
- 3
examples/CMakeLists.txt 查看文件

@@ -5,6 +5,6 @@ add_executable (grovetemp grovetemp.cxx)
5 5
 include_directories (${PROJECT_SOURCE_DIR}/src/hmc5883l)
6 6
 include_directories (${PROJECT_SOURCE_DIR}/src/grove)
7 7
 
8
-target_link_libraries (compass hmc5883l)
9
-target_link_libraries (groveled grove)
10
-target_link_libraries (grovetemp grove)
8
+target_link_libraries (compass hmc5883l ${CMAKE_THREAD_LIBS_INIT})
9
+target_link_libraries (groveled grove ${CMAKE_THREAD_LIBS_INIT})
10
+target_link_libraries (grovetemp grove ${CMAKE_THREAD_LIBS_INIT})