cmake_minimum_required(VERSION 3.10) project(USBHIDExample) set(CMAKE_CXX_STANDARD 14) find_package(PkgConfig REQUIRED) pkg_check_modules(LIBUSB1 REQUIRED libusb-1.0) include_directories(${LIBUSB1_INCLUDE_DIRS}) link_directories(${LIBUSB1_LIBRARY_DIRS}) add_executable(USBHIDExample main.cpp hiddev.cpp) target_link_libraries(USBHIDExample ${LIBUSB1_LIBRARIES} pthread)