ishcherb / rpms / openambit

Forked from rpms/openambit 4 years ago
Clone
Blob Blame History Raw
diff -rupN openambit-0.4/src/libambit/CMakeLists.txt openambit-0.4-new/src/libambit/CMakeLists.txt
--- openambit-0.4/src/libambit/CMakeLists.txt	2017-04-24 19:30:54.000000000 +0200
+++ openambit-0.4-new/src/libambit/CMakeLists.txt	2017-04-24 22:45:53.665292621 +0200
@@ -15,9 +15,11 @@ IF (DEFINED DEBUG_PRINT_FILE_LINE)
   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG_PRINT_FILE_LINE=${DEBUG_PRINT_FILE_LINE}")
 ENDIF()
 
-include(HidapiDriver)
 include(GNUInstallDirs)
 
+find_package(PkgConfig)
+pkg_check_modules(HIDAPI REQUIRED hidapi-hidraw)
+
 add_library (
   ambit
   SHARED
@@ -37,19 +39,18 @@ add_library (
   sha256.c
   utils.c
   sport_mode_serialize.c
-  ${HIDAPI_SOURCE_FILES}
 )
 
 target_link_libraries(
   ambit
-  ${HIDAPI_LIBS}
+  ${HIDAPI_LIBRARIES}
   m
 )
 
 set_target_properties(ambit PROPERTIES VERSION 0.4.0 SOVERSION 0)
 
 include_directories(
-  ${HIDAPI_INCLUDE_DIR}
+  ${HIDAPI_INCLUDE_DIRS}
 )
 
 install(TARGETS ambit DESTINATION ${CMAKE_INSTALL_LIBDIR})