2020-03-03 23:24:39 +00:00
|
|
|
# Copyright 2019-2020, Collabora, Ltd.
|
2019-04-30 13:33:34 +00:00
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
2019-06-20 17:02:28 +00:00
|
|
|
set(PROBER_INCLUDES)
|
|
|
|
|
2019-04-30 13:33:34 +00:00
|
|
|
set(PROBER_SOURCE_FILES
|
|
|
|
p_documentation.h
|
|
|
|
p_dump.c
|
2020-04-08 11:27:41 +00:00
|
|
|
p_json.c
|
2019-04-30 13:33:34 +00:00
|
|
|
p_prober.c
|
|
|
|
p_prober.h
|
2019-09-21 18:08:26 +00:00
|
|
|
p_tracking.c
|
2019-04-30 13:33:34 +00:00
|
|
|
)
|
|
|
|
|
2019-06-20 17:02:28 +00:00
|
|
|
# Add libudev
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_LIBUDEV)
|
2019-06-20 17:02:28 +00:00
|
|
|
list(APPEND PROBER_SOURCE_FILES
|
|
|
|
p_udev.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-06-20 13:51:34 +00:00
|
|
|
# Add libusb
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_LIBUSB)
|
2019-06-20 13:51:34 +00:00
|
|
|
list(APPEND PROBER_SOURCE_FILES
|
|
|
|
p_libusb.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-06-20 14:14:09 +00:00
|
|
|
# Add libuvc
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_LIBUVC)
|
2019-06-20 14:14:09 +00:00
|
|
|
list(APPEND PROBER_SOURCE_FILES
|
|
|
|
p_libuvc.c
|
|
|
|
)
|
2020-03-03 23:24:39 +00:00
|
|
|
endif()
|
|
|
|
|
2020-04-11 10:08:07 +00:00
|
|
|
add_library(st_prober STATIC
|
|
|
|
${PROBER_SOURCE_FILES}
|
|
|
|
)
|
|
|
|
target_link_libraries(st_prober PUBLIC
|
|
|
|
xrt-interfaces
|
|
|
|
)
|
|
|
|
target_link_libraries(st_prober PRIVATE
|
|
|
|
aux_util
|
|
|
|
aux_os
|
|
|
|
aux_tracking
|
|
|
|
)
|
|
|
|
target_include_directories(st_prober PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../drivers
|
|
|
|
)
|
2020-03-03 23:24:39 +00:00
|
|
|
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_LIBUDEV)
|
2020-03-03 23:24:39 +00:00
|
|
|
target_include_directories(st_prober
|
|
|
|
PRIVATE
|
|
|
|
${UDEV_INCLUDE_DIRS}
|
2019-06-20 14:14:09 +00:00
|
|
|
)
|
2020-04-11 10:08:07 +00:00
|
|
|
target_link_libraries(st_prober PRIVATE
|
|
|
|
${UDEV_LIBRARIES}
|
|
|
|
)
|
2019-06-20 14:14:09 +00:00
|
|
|
endif()
|
|
|
|
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_LIBUSB)
|
2020-03-03 23:24:39 +00:00
|
|
|
target_include_directories(st_prober
|
2020-07-16 02:39:36 +00:00
|
|
|
PUBLIC
|
2020-03-03 23:24:39 +00:00
|
|
|
${LIBUSB1_INCLUDE_DIRS}
|
|
|
|
)
|
2020-04-11 10:08:07 +00:00
|
|
|
target_link_libraries(st_prober PRIVATE
|
|
|
|
${LIBUSB1_LIBRARIES}
|
|
|
|
)
|
2020-03-03 23:24:39 +00:00
|
|
|
endif()
|
2019-04-30 13:33:34 +00:00
|
|
|
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_LIBUVC)
|
2020-03-03 23:24:39 +00:00
|
|
|
target_include_directories(st_prober
|
|
|
|
PRIVATE
|
|
|
|
${LIBUVC_INCLUDES}
|
|
|
|
)
|
2020-04-11 10:08:07 +00:00
|
|
|
target_link_libraries(st_prober PRIVATE
|
|
|
|
${LIBUVC_LIBRARIES}
|
|
|
|
)
|
2020-03-03 23:24:39 +00:00
|
|
|
endif()
|
2020-03-05 17:24:14 +00:00
|
|
|
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_V4L2)
|
2020-03-05 17:24:14 +00:00
|
|
|
# Uses v4l2_fs_create
|
2020-04-11 10:08:07 +00:00
|
|
|
target_link_libraries(st_prober PRIVATE
|
|
|
|
drv_v4l2
|
|
|
|
)
|
2020-03-05 17:24:14 +00:00
|
|
|
endif()
|