2021-11-11 23:41:58 +00:00
|
|
|
# Copyright 2019-2021, Collabora, Ltd.
|
2019-03-18 05:52:32 +00:00
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
2021-03-31 00:57:10 +00:00
|
|
|
add_subdirectory(bindings)
|
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
# Common includes
|
|
|
|
add_library(aux-includes INTERFACE)
|
|
|
|
target_include_directories(
|
|
|
|
aux-includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
2020-08-19 19:51:54 +00:00
|
|
|
)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_link_libraries(aux-includes INTERFACE xrt-interfaces)
|
2020-08-19 19:51:54 +00:00
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
# OpenGL library.
|
|
|
|
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
|
|
|
add_library(
|
|
|
|
aux_ogl STATIC
|
|
|
|
ogl/ogl_documentation.h
|
|
|
|
ogl/ogl_api.c
|
|
|
|
ogl/ogl_api.h
|
|
|
|
ogl/ogl_helpers.c
|
|
|
|
ogl/ogl_helpers.h
|
|
|
|
)
|
|
|
|
target_link_libraries(aux_ogl PUBLIC aux-includes xrt-external-glad)
|
|
|
|
if(XRT_HAVE_EGL)
|
|
|
|
target_sources(aux_ogl PRIVATE ogl/egl_api.c ogl/egl_api.h)
|
|
|
|
endif()
|
|
|
|
if(XRT_HAVE_OPENGLES)
|
|
|
|
target_link_libraries(aux_ogl PUBLIC EGL::EGL)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Math library.
|
|
|
|
add_library(
|
|
|
|
aux_math STATIC
|
2019-03-18 05:52:32 +00:00
|
|
|
math/m_api.h
|
|
|
|
math/m_base.cpp
|
2019-11-21 13:15:38 +00:00
|
|
|
math/m_eigen_interop.hpp
|
2020-02-18 12:48:57 +00:00
|
|
|
math/m_filter_fifo.c
|
|
|
|
math/m_filter_fifo.h
|
2021-08-18 18:51:11 +00:00
|
|
|
math/m_filter_one_euro.c
|
|
|
|
math/m_filter_one_euro.h
|
2019-04-01 16:10:41 +00:00
|
|
|
math/m_hash.cpp
|
2020-03-13 19:56:47 +00:00
|
|
|
math/m_imu_3dof.c
|
|
|
|
math/m_imu_3dof.h
|
2020-01-29 20:50:42 +00:00
|
|
|
math/m_imu_pre.c
|
|
|
|
math/m_imu_pre.h
|
2022-02-22 22:42:38 +00:00
|
|
|
math/m_lowpass_float.cpp
|
|
|
|
math/m_lowpass_float.h
|
2022-02-22 20:37:15 +00:00
|
|
|
math/m_lowpass_float.hpp
|
|
|
|
math/m_lowpass_float_vector.hpp
|
2022-02-22 22:29:31 +00:00
|
|
|
math/m_lowpass_integer.cpp
|
|
|
|
math/m_lowpass_integer.h
|
2022-02-22 20:37:15 +00:00
|
|
|
math/m_lowpass_integer.hpp
|
2019-04-01 16:10:41 +00:00
|
|
|
math/m_optics.c
|
2020-08-25 18:14:08 +00:00
|
|
|
math/m_permutation.c
|
|
|
|
math/m_permutation.h
|
2020-08-17 22:57:39 +00:00
|
|
|
math/m_predict.c
|
|
|
|
math/m_predict.h
|
2019-03-18 05:52:32 +00:00
|
|
|
math/m_quatexpmap.cpp
|
2022-01-28 23:49:38 +00:00
|
|
|
math/m_rational.hpp
|
2021-09-15 17:12:43 +00:00
|
|
|
math/m_relation_history.cpp
|
2022-01-28 23:49:38 +00:00
|
|
|
math/m_relation_history.h
|
2020-07-23 11:12:03 +00:00
|
|
|
math/m_space.cpp
|
|
|
|
math/m_space.h
|
2019-11-21 13:15:38 +00:00
|
|
|
math/m_vec2.h
|
2020-01-27 06:31:56 +00:00
|
|
|
math/m_vec3.h
|
2019-03-18 05:52:32 +00:00
|
|
|
)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_link_libraries(aux_math PUBLIC aux-includes aux_util)
|
|
|
|
target_include_directories(aux_math SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
|
2019-03-18 05:52:32 +00:00
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
# OS library.
|
|
|
|
add_library(
|
|
|
|
aux_os STATIC
|
2020-03-05 11:38:01 +00:00
|
|
|
os/os_ble.h
|
2019-05-03 14:47:45 +00:00
|
|
|
os/os_documentation.h
|
|
|
|
os/os_hid.h
|
|
|
|
os/os_hid_hidraw.c
|
2019-09-13 18:34:10 +00:00
|
|
|
os/os_threading.h
|
2019-05-03 14:47:45 +00:00
|
|
|
)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_link_libraries(aux_os PUBLIC aux-includes xrt-pthreads)
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_DBUS)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_sources(aux_os PRIVATE os/os_ble_dbus.c)
|
|
|
|
target_link_libraries(aux_os PRIVATE ${DBUS_LIBRARIES})
|
|
|
|
target_include_directories(aux_os SYSTEM PRIVATE ${DBUS_INCLUDE_DIRS})
|
2020-03-05 11:38:01 +00:00
|
|
|
endif()
|
2019-05-03 14:47:45 +00:00
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
# GStreamer library.
|
|
|
|
if(XRT_HAVE_GST)
|
|
|
|
add_library(
|
|
|
|
aux_gstreamer STATIC
|
|
|
|
gstreamer/gst_internal.h
|
|
|
|
gstreamer/gst_sink.h
|
|
|
|
gstreamer/gst_sink.c
|
|
|
|
gstreamer/gst_pipeline.h
|
|
|
|
gstreamer/gst_pipeline.c
|
|
|
|
)
|
|
|
|
target_link_libraries(aux_gstreamer PUBLIC aux-includes)
|
|
|
|
target_link_libraries(aux_gstreamer PRIVATE xrt-interfaces aux_math aux_os ${GST_LIBRARIES})
|
|
|
|
target_include_directories(aux_gstreamer PRIVATE ${GST_INCLUDE_DIRS})
|
|
|
|
endif()
|
2021-02-02 18:21:14 +00:00
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
# Tracking library.
|
|
|
|
add_library(
|
|
|
|
aux_tracking STATIC
|
2020-03-10 13:27:43 +00:00
|
|
|
tracking/t_data_utils.c
|
2019-11-21 13:00:52 +00:00
|
|
|
tracking/t_imu_fusion.hpp
|
2019-12-03 21:48:36 +00:00
|
|
|
tracking/t_imu.cpp
|
|
|
|
tracking/t_imu.h
|
2019-07-23 16:29:14 +00:00
|
|
|
tracking/t_tracking.h
|
|
|
|
)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_link_libraries(
|
|
|
|
aux_tracking
|
2021-12-03 19:20:48 +00:00
|
|
|
PUBLIC aux-includes xrt-external-cjson
|
|
|
|
PRIVATE aux_math aux_util xrt-external-flexkalman xrt-external-hungarian
|
2021-11-11 23:41:58 +00:00
|
|
|
)
|
|
|
|
target_include_directories(aux_tracking SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_OPENCV)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_sources(
|
|
|
|
aux_tracking
|
|
|
|
PRIVATE
|
|
|
|
tracking/t_calibration_opencv.hpp
|
|
|
|
tracking/t_calibration.cpp
|
|
|
|
tracking/t_convert.cpp
|
|
|
|
tracking/t_debug_hsv_filter.cpp
|
|
|
|
tracking/t_debug_hsv_picker.cpp
|
|
|
|
tracking/t_debug_hsv_viewer.cpp
|
2021-11-30 12:57:21 +00:00
|
|
|
tracking/t_euroc_recorder.cpp
|
|
|
|
tracking/t_euroc_recorder.h
|
2021-11-11 23:41:58 +00:00
|
|
|
tracking/t_file.cpp
|
|
|
|
tracking/t_frame_cv_mat_wrapper.cpp
|
|
|
|
tracking/t_frame_cv_mat_wrapper.hpp
|
|
|
|
tracking/t_fusion.hpp
|
|
|
|
tracking/t_helper_debug_sink.hpp
|
|
|
|
tracking/t_hsv_filter.c
|
|
|
|
tracking/t_kalman.cpp
|
|
|
|
tracking/t_tracker_psmv_fusion.hpp
|
|
|
|
tracking/t_tracker_psmv.cpp
|
|
|
|
tracking/t_tracker_psvr.cpp
|
|
|
|
tracking/t_tracker_hand.cpp
|
2019-12-03 21:48:36 +00:00
|
|
|
)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_include_directories(aux_tracking SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(aux_tracking PUBLIC ${OpenCV_LIBRARIES})
|
2021-11-03 22:51:13 +00:00
|
|
|
endif()
|
|
|
|
if(XRT_HAVE_SLAM)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_sources(aux_tracking PRIVATE tracking/t_tracker_slam.cpp)
|
|
|
|
target_link_libraries(aux_tracking PRIVATE xrt-external-slam)
|
2019-12-03 21:48:36 +00:00
|
|
|
endif()
|
2019-07-23 16:29:14 +00:00
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
# Util library.
|
|
|
|
add_library(
|
|
|
|
aux_util STATIC
|
2020-03-05 11:41:06 +00:00
|
|
|
util/u_bitwise.c
|
|
|
|
util/u_bitwise.h
|
2019-03-18 05:52:32 +00:00
|
|
|
util/u_debug.c
|
|
|
|
util/u_debug.h
|
|
|
|
util/u_device.c
|
|
|
|
util/u_device.h
|
2020-10-25 01:12:11 +00:00
|
|
|
util/u_distortion.c
|
|
|
|
util/u_distortion.h
|
2019-10-22 17:45:25 +00:00
|
|
|
util/u_distortion_mesh.c
|
|
|
|
util/u_distortion_mesh.h
|
2019-04-06 11:28:56 +00:00
|
|
|
util/u_documentation.h
|
2020-04-06 10:08:48 +00:00
|
|
|
util/u_file.c
|
2021-03-25 16:58:46 +00:00
|
|
|
util/u_file.cpp
|
2020-04-06 10:08:48 +00:00
|
|
|
util/u_file.h
|
2019-07-22 21:41:03 +00:00
|
|
|
util/u_format.c
|
|
|
|
util/u_format.h
|
2019-08-22 13:15:41 +00:00
|
|
|
util/u_frame.c
|
|
|
|
util/u_frame.h
|
2021-03-26 19:49:54 +00:00
|
|
|
util/u_generic_callbacks.hpp
|
2020-10-20 16:43:11 +00:00
|
|
|
util/u_git_tag.h
|
2021-02-23 02:41:53 +00:00
|
|
|
util/u_hand_tracking.c
|
|
|
|
util/u_hand_tracking.h
|
2020-08-13 19:58:01 +00:00
|
|
|
util/u_handles.c
|
|
|
|
util/u_handles.h
|
2019-05-07 15:03:38 +00:00
|
|
|
util/u_hashmap.cpp
|
|
|
|
util/u_hashmap.h
|
2019-04-06 11:33:01 +00:00
|
|
|
util/u_hashset.cpp
|
|
|
|
util/u_hashset.h
|
2022-02-08 19:18:15 +00:00
|
|
|
util/u_id_ringbuffer.cpp
|
|
|
|
util/u_id_ringbuffer.h
|
2019-11-08 11:25:36 +00:00
|
|
|
util/u_json.c
|
|
|
|
util/u_json.h
|
2021-10-31 03:18:12 +00:00
|
|
|
util/u_json.hpp
|
2020-07-03 13:27:39 +00:00
|
|
|
util/u_logging.c
|
|
|
|
util/u_logging.h
|
|
|
|
util/u_misc.c
|
|
|
|
util/u_misc.h
|
2022-01-14 23:48:52 +00:00
|
|
|
util/u_pacing.h
|
|
|
|
util/u_pacing_app.c
|
|
|
|
util/u_pacing_compositor.c
|
|
|
|
util/u_pacing_compositor_fake.c
|
2019-07-23 12:38:58 +00:00
|
|
|
util/u_sink.h
|
2021-10-09 20:52:31 +00:00
|
|
|
util/u_sink_combiner.c
|
2022-02-08 17:29:23 +00:00
|
|
|
util/u_sink_force_genlock.c
|
2019-08-22 13:15:41 +00:00
|
|
|
util/u_sink_converter.c
|
2020-01-18 20:59:38 +00:00
|
|
|
util/u_sink_deinterleaver.c
|
2019-08-22 13:15:41 +00:00
|
|
|
util/u_sink_queue.c
|
2022-03-19 00:18:32 +00:00
|
|
|
util/u_sink_simple_queue.c
|
2020-01-17 14:17:54 +00:00
|
|
|
util/u_sink_quirk.c
|
2019-09-03 09:07:20 +00:00
|
|
|
util/u_sink_split.c
|
2022-03-04 11:39:03 +00:00
|
|
|
util/u_sink_stereo_sbs_to_slam_sbs.c
|
2021-11-05 17:45:36 +00:00
|
|
|
util/u_string_list.cpp
|
|
|
|
util/u_string_list.h
|
|
|
|
util/u_string_list.hpp
|
2021-09-15 07:11:10 +00:00
|
|
|
util/u_template_historybuf.hpp
|
2019-03-18 05:52:32 +00:00
|
|
|
util/u_time.cpp
|
|
|
|
util/u_time.h
|
2021-02-22 20:33:58 +00:00
|
|
|
util/u_trace_marker.c
|
|
|
|
util/u_trace_marker.h
|
2019-08-31 11:46:25 +00:00
|
|
|
util/u_var.cpp
|
|
|
|
util/u_var.h
|
2021-02-17 02:51:21 +00:00
|
|
|
util/u_config_json.c
|
|
|
|
util/u_config_json.h
|
2021-04-10 00:30:00 +00:00
|
|
|
util/u_verify.h
|
2020-10-21 20:18:57 +00:00
|
|
|
util/u_process.c
|
|
|
|
util/u_process.h
|
2022-03-02 19:59:14 +00:00
|
|
|
util/u_worker.c
|
|
|
|
util/u_worker.cpp
|
|
|
|
util/u_worker.h
|
|
|
|
util/u_worker.hpp
|
2021-11-11 23:41:58 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c"
|
2019-03-18 05:52:32 +00:00
|
|
|
)
|
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/util/u_git_tag.c.in" "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c"
|
|
|
|
@ONLY
|
2020-02-23 12:30:26 +00:00
|
|
|
)
|
2021-11-11 23:41:58 +00:00
|
|
|
target_link_libraries(aux_util PUBLIC aux-includes xrt-pthreads aux_generated_bindings aux_math)
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_JPEG)
|
2020-03-04 23:25:27 +00:00
|
|
|
target_link_libraries(aux_util PRIVATE ${JPEG_LIBRARIES})
|
2020-05-28 21:13:34 +00:00
|
|
|
target_include_directories(aux_util PRIVATE ${JPEG_INCLUDE_DIRS})
|
2020-03-04 23:25:27 +00:00
|
|
|
endif()
|
2020-04-29 23:11:43 +00:00
|
|
|
if(XRT_HAVE_SYSTEM_CJSON)
|
2020-03-31 19:58:04 +00:00
|
|
|
target_link_libraries(aux_util PUBLIC cJSON::cJSON)
|
2020-04-29 23:11:43 +00:00
|
|
|
target_compile_definitions(aux_util PRIVATE XRT_HAVE_SYSTEM_CJSON)
|
2020-03-31 19:59:02 +00:00
|
|
|
else()
|
|
|
|
target_link_libraries(aux_util PUBLIC xrt-external-cjson)
|
2020-03-31 19:58:04 +00:00
|
|
|
endif()
|
2021-05-18 16:39:41 +00:00
|
|
|
if(XRT_FEATURE_TRACING AND XRT_HAVE_PERCETTO)
|
2022-03-23 16:20:49 +00:00
|
|
|
target_link_libraries(aux_util PUBLIC percetto::percetto)
|
2021-05-01 02:07:50 +00:00
|
|
|
endif()
|
2020-10-21 20:18:57 +00:00
|
|
|
if(XRT_HAVE_LIBBSD)
|
|
|
|
target_include_directories(aux_util SYSTEM PRIVATE ${LIBBSD_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(aux_util PUBLIC ${LIBBSD_LIBRARIES})
|
|
|
|
endif()
|
2020-09-02 16:31:39 +00:00
|
|
|
if(ANDROID)
|
|
|
|
target_link_libraries(aux_util PUBLIC ${ANDROID_LOG_LIBRARY})
|
|
|
|
endif()
|
2020-03-04 23:25:27 +00:00
|
|
|
|
2020-07-16 10:17:30 +00:00
|
|
|
if(XRT_HAVE_VULKAN)
|
|
|
|
# Vulkan library.
|
2021-11-11 23:41:58 +00:00
|
|
|
add_library(
|
|
|
|
aux_vk STATIC
|
2022-03-30 18:29:05 +00:00
|
|
|
vk/vk_bundle_init.c
|
2021-11-11 23:41:58 +00:00
|
|
|
vk/vk_command_buffer.c
|
2022-02-18 13:16:30 +00:00
|
|
|
vk/vk_compositor_flags.c
|
2021-11-11 23:41:58 +00:00
|
|
|
vk/vk_documentation.h
|
2022-03-30 18:29:05 +00:00
|
|
|
vk/vk_function_loaders.c
|
2021-11-11 23:41:58 +00:00
|
|
|
vk/vk_helpers.c
|
|
|
|
vk/vk_helpers.h
|
|
|
|
vk/vk_image_allocator.c
|
|
|
|
vk/vk_image_allocator.h
|
2022-02-19 02:23:41 +00:00
|
|
|
vk/vk_image_readback_to_xf_pool.c
|
|
|
|
vk/vk_image_readback_to_xf_pool.h
|
2022-02-23 13:26:34 +00:00
|
|
|
vk/vk_state_creators.c
|
2022-02-15 14:16:58 +00:00
|
|
|
vk/vk_sync_objects.c
|
2021-11-11 23:41:58 +00:00
|
|
|
)
|
2021-05-01 02:07:50 +00:00
|
|
|
target_link_libraries(aux_vk PUBLIC aux_os aux_util)
|
2020-07-16 10:17:30 +00:00
|
|
|
target_link_libraries(aux_vk PUBLIC Vulkan::Vulkan)
|
2020-10-08 22:00:25 +00:00
|
|
|
target_include_directories(aux_vk PUBLIC ${Vulkan_INCLUDE_DIR})
|
2020-07-20 21:07:32 +00:00
|
|
|
if(ANDROID)
|
|
|
|
target_link_libraries(aux_vk PUBLIC ${ANDROID_LIBRARY})
|
|
|
|
endif()
|
2020-07-16 10:17:30 +00:00
|
|
|
endif()
|
2020-08-19 19:51:54 +00:00
|
|
|
|
2021-11-11 23:41:58 +00:00
|
|
|
if(XRT_BUILD_DRIVER_VIVE OR XRT_BUILD_DRIVER_SURVIVE)
|
|
|
|
set(VIVE_CONFIG_SOURCE_FILES vive/vive_config.h vive/vive_config.c)
|
|
|
|
add_library(aux_vive STATIC ${VIVE_CONFIG_SOURCE_FILES})
|
|
|
|
target_link_libraries(
|
|
|
|
aux_vive
|
|
|
|
PRIVATE
|
|
|
|
xrt-interfaces
|
|
|
|
aux_util
|
|
|
|
aux_math
|
|
|
|
aux_tracking
|
|
|
|
xrt-external-cjson
|
|
|
|
${ZLIB_LIBRARIES}
|
|
|
|
)
|
|
|
|
target_include_directories(aux_vive PRIVATE ${ZLIB_INCLUDE_DIRS})
|
|
|
|
endif()
|
2020-08-19 19:51:54 +00:00
|
|
|
|
|
|
|
if(ANDROID)
|
2021-11-11 23:41:58 +00:00
|
|
|
add_library(
|
|
|
|
android_app_glue STATIC
|
|
|
|
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c
|
|
|
|
)
|
|
|
|
target_include_directories(
|
|
|
|
android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue
|
|
|
|
)
|
|
|
|
# disable these warnings in external code
|
|
|
|
target_compile_options(android_app_glue PRIVATE -Wno-format-pedantic)
|
|
|
|
|
|
|
|
add_library(
|
|
|
|
aux_android STATIC
|
|
|
|
android/android_ahardwarebuffer_allocator.c
|
|
|
|
android/android_ahardwarebuffer_allocator.h
|
|
|
|
android/android_custom_surface.cpp
|
|
|
|
android/android_custom_surface.h
|
|
|
|
android/android_globals.cpp
|
|
|
|
android/android_globals.h
|
|
|
|
android/android_load_class.cpp
|
|
|
|
android/android_load_class.hpp
|
2021-11-30 12:49:58 +00:00
|
|
|
android/android_looper.cpp
|
2021-11-11 23:41:58 +00:00
|
|
|
android/android_looper.h
|
|
|
|
android/org.freedesktop.monado.auxiliary.cpp
|
|
|
|
android/org.freedesktop.monado.auxiliary.hpp
|
|
|
|
android/org.freedesktop.monado.auxiliary.impl.hpp
|
|
|
|
)
|
|
|
|
target_link_libraries(
|
|
|
|
aux_android
|
2020-08-19 19:51:54 +00:00
|
|
|
PUBLIC aux_util
|
2021-11-11 23:41:58 +00:00
|
|
|
PRIVATE
|
|
|
|
${ANDROID_LIBRARY}
|
|
|
|
${ANDROID_LOG_LIBRARY}
|
|
|
|
xrt-external-jni-wrap
|
|
|
|
xrt-external-jnipp
|
|
|
|
android_app_glue
|
2020-08-19 19:51:54 +00:00
|
|
|
)
|
2020-11-12 10:58:56 +00:00
|
|
|
target_link_libraries(aux_vk PUBLIC aux_android)
|
2020-08-19 19:51:54 +00:00
|
|
|
endif()
|