lasp/cmake/uldaq.cmake

31 lines
1.1 KiB
CMake

# ###################################### UlDAQ
if(LASP_HAS_ULDAQ)
message("Building UlDAQ")
if(NOT WIN32)
find_package(PkgConfig REQUIRED)
pkg_check_modules(libusb-1.0 REQUIRED libusb-1.0)
endif()
# This is rather coarse!
file(GLOB ULDAQ_FILES1 third_party/uldaq/src/*.cpp)
file(GLOB ULDAQ_FILES2 third_party/uldaq/src/*/*.cpp)
file(GLOB ULDAQ_FILES3 third_party/uldaq/src/*/*/*.cpp)
file(GLOB ULDAQ_FILES4 third_party/uldaq/src/usb/fw/*c)
add_library(uldaq STATIC ${ULDAQ_FILES1} ${ULDAQ_FILES2}
${ULDAQ_FILES3} ${ULDAQ_FILES4})
target_compile_options(uldaq PUBLIC -Wno-unused -Wno-empty-body
-Wno-missing-field-initializers)
if(NOT WIN32)
# message("libUSB libs: ${libusb-1.0_LIBRARIES}")
target_link_libraries(uldaq ${libusb-1.0_LIBRARIES})
# Rules to match UlDAQ Usb devices with libusb
install(FILES third_party/uldaq/rules/50-uldaq.rules DESTINATION
/etc/udev/rules.d PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ
GROUP_WRITE WORLD_READ)
endif()
endif()