diff --git a/src/xrt/state_trackers/prober/CMakeLists.txt b/src/xrt/state_trackers/prober/CMakeLists.txt index 74195e0d3..55283b8f4 100644 --- a/src/xrt/state_trackers/prober/CMakeLists.txt +++ b/src/xrt/state_trackers/prober/CMakeLists.txt @@ -7,24 +7,34 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../../external ) +set(PROBER_INCLUDES) + set(PROBER_SOURCE_FILES p_auto_wrap.c p_documentation.h p_dump.c p_prober.c p_prober.h - p_udev.c ) +# Add libudev +if(BUILD_WITH_LIBUDEV) + list(APPEND PROBER_SOURCE_FILES + p_udev.c + ) + list(APPEND PROBER_INCLUDES + ${LIBUDEV_INCLUDES} + ) +endif() + # Use OBJECT to not create a archive, since it just gets in the way. add_library(st_prober OBJECT ${PROBER_SOURCE_FILES}) target_include_directories(st_prober PRIVATE + ${PROBER_INCLUDES} ${LIBUSB_INCLUDES} ${LIBUVC_INCLUDES} - ${FFMPEG_INCLUDES} - ${OPENCV_INCLUDES} ) set_property(TARGET st_prober PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/src/xrt/state_trackers/prober/p_prober.c b/src/xrt/state_trackers/prober/p_prober.c index efcbbdea4..e1b382835 100644 --- a/src/xrt/state_trackers/prober/p_prober.c +++ b/src/xrt/state_trackers/prober/p_prober.c @@ -465,11 +465,13 @@ probe(struct xrt_prober* xp) return -1; } +#ifdef XRT_HAVE_LIBUDEV ret = p_udev_probe(p); if (ret != 0) { P_ERROR(p, "Failed to enumerate udev devices\n"); return -1; } +#endif return 0; } diff --git a/src/xrt/state_trackers/prober/p_udev.c b/src/xrt/state_trackers/prober/p_udev.c index f834989f4..2f2c211aa 100644 --- a/src/xrt/state_trackers/prober/p_udev.c +++ b/src/xrt/state_trackers/prober/p_udev.c @@ -7,8 +7,6 @@ * @ingroup st_prober */ -#ifdef XRT_HAVE_LIBUDEV - #include "util/u_misc.h" #include "p_prober.h" @@ -341,5 +339,3 @@ p_udev_get_and_parse_uevent(struct udev_device* raw_dev, return -1; } } - -#endif