From 3e38ada9a585aa36b1dc03f425f3ffeeab877484 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 6 Dec 2021 20:53:00 +0000 Subject: [PATCH] build: s/rs/realsense/g --- CMakeLists.txt | 4 +- doc/Doxyfile.in | 2 +- meson.build | 52 +++++++++++----------- meson_options.txt | 25 ++++++++++- src/xrt/drivers/CMakeLists.txt | 6 +-- src/xrt/drivers/meson.build | 6 +-- src/xrt/state_trackers/prober/p_prober.c | 4 +- src/xrt/state_trackers/prober/p_tracking.c | 4 +- src/xrt/targets/common/CMakeLists.txt | 4 +- src/xrt/targets/common/target_lists.c | 4 +- src/xrt/targets/meson.build | 6 +-- 11 files changed, 70 insertions(+), 47 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a06c9d109..0b0c71384 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -242,7 +242,7 @@ cmake_dependent_option(XRT_HAVE_KIMERA_SLAM "Enable Kimera support" ON "kimera_v cmake_dependent_option(XRT_HAVE_BASALT_SLAM "Enable Basalt support" ON "basalt_FOUND" OFF) cmake_dependent_option(XRT_HAVE_SLAM "Enable SLAM tracking support" ON "SLAM;XRT_HAVE_OPENCV" OFF) cmake_dependent_option(XRT_BUILD_DRIVER_PSVR "Enable PSVR HMD driver" ON "HIDAPI_FOUND" OFF) -cmake_dependent_option(XRT_BUILD_DRIVER_RS "Enable RealSense device driver" ON "XRT_HAVE_REALSENSE" OFF) +cmake_dependent_option(XRT_BUILD_DRIVER_REALSENSE "Enable RealSense device driver" ON "XRT_HAVE_REALSENSE" OFF) cmake_dependent_option(XRT_BUILD_DRIVER_VIVE "Enable driver for HTC Vive, Vive Pro, Valve Index, and their controllers" ON "ZLIB_FOUND AND XRT_HAVE_LINUX" OFF) cmake_dependent_option(XRT_BUILD_DRIVER_OHMD "Enable OpenHMD driver" ON "OPENHMD_FOUND" OFF) cmake_dependent_option(XRT_BUILD_DRIVER_HANDTRACKING "Enable Camera Hand Tracking driver" ON "XRT_HAVE_ONNXRUNTIME AND XRT_HAVE_OPENCV AND XRT_HAVE_V4L2" OFF) @@ -447,7 +447,7 @@ message(STATUS "# DRIVER_ULV2: ${XRT_BUILD_DRIVER_ULV2}") message(STATUS "# DRIVER_OHMD: ${XRT_BUILD_DRIVER_OHMD}") message(STATUS "# DRIVER_PSMV: ${XRT_BUILD_DRIVER_PSMV}") message(STATUS "# DRIVER_PSVR: ${XRT_BUILD_DRIVER_PSVR}") -message(STATUS "# DRIVER_RS: ${XRT_BUILD_DRIVER_RS}") +message(STATUS "# DRIVER_RS: ${XRT_BUILD_DRIVER_REALSENSE}") message(STATUS "# DRIVER_REMOTE: ${XRT_BUILD_DRIVER_REMOTE}") message(STATUS "# DRIVER_SURVIVE: ${XRT_BUILD_DRIVER_SURVIVE}") message(STATUS "# DRIVER_VF: ${XRT_BUILD_DRIVER_VF}") diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 710d5f147..0e2e2a1d3 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -36,7 +36,7 @@ PREDEFINED = VK_USE_PLATFORM_XCB_KHR \ XR_USE_GRAPHICS_API_VULKAN \ XR_USE_PLATFORM_XLIB \ XR_USE_TIMESPEC \ - XRT_BUILD_DRIVER_RS \ + XRT_BUILD_DRIVER_REALSENSE \ XRT_DOXYGEN \ XRT_FEATURE_SERVICE \ XRT_HAVE_JPEG \ diff --git a/meson.build b/meson.build index 800e9bf70..705b0c730 100644 --- a/meson.build +++ b/meson.build @@ -57,30 +57,30 @@ glslangValidator = find_program('glslangValidator') pthreads = cc.find_library('pthread', required: true) rt = cc.find_library('rt', required: true) -avcodec = dependency('libavcodec', required: false) -egl = dependency('egl', required: get_option('egl')) -egl = egl.partial_dependency(includes: true) -eigen3 = dependency('eigen3') -libjpeg = dependency('libjpeg', required: false) -libusb = dependency('libusb-1.0', required: false) -opengl = dependency('gl', required: get_option('opengl')) -opengles = dependency('glesv2', required: get_option('opengles')) -rs = dependency('realsense2', required: false) -sdl2 = dependency('sdl2', required: get_option('gui')) -udev = dependency('libudev', required: false) -libuvc = dependency('libuvc', required: false) -vulkan = dependency('vulkan', required: true) -zlib = dependency('zlib', required: false) -survive = dependency('survive', required: false) -dbus = dependency('dbus-1', required: get_option('dbus')) -systemd = dependency('libsystemd', required: get_option('systemd')) -libbsd = dependency('libbsd', required: get_option('libbsd')) -gst = dependency('gstreamer-1.0', required: false) -gst_app = dependency('gstreamer-app-1.0', required: false) -gst_video= dependency('gstreamer-video-1.0', required: false) -depthai = dependency('depthai', method: 'cmake', modules : ['depthai::core', 'depthai::opencv', 'XLink'], required: false) +avcodec = dependency('libavcodec', required: false) +egl = dependency('egl', required: get_option('egl')) +egl = egl.partial_dependency(includes: true) +eigen3 = dependency('eigen3') +libjpeg = dependency('libjpeg', required: false) +libusb = dependency('libusb-1.0', required: false) +opengl = dependency('gl', required: get_option('opengl')) +opengles = dependency('glesv2', required: get_option('opengles')) +realsense = dependency('realsense2', required: false) +sdl2 = dependency('sdl2', required: get_option('gui')) +udev = dependency('libudev', required: false) +libuvc = dependency('libuvc', required: false) +vulkan = dependency('vulkan', required: true) +zlib = dependency('zlib', required: false) +survive = dependency('survive', required: false) +dbus = dependency('dbus-1', required: get_option('dbus')) +systemd = dependency('libsystemd', required: get_option('systemd')) +libbsd = dependency('libbsd', required: get_option('libbsd')) +gst = dependency('gstreamer-1.0', required: false) +gst_app = dependency('gstreamer-app-1.0', required: false) +gst_video = dependency('gstreamer-video-1.0', required: false) +depthai = dependency('depthai', method: 'cmake', modules : ['depthai::core', 'depthai::opencv', 'XLink'], required: false) onnxruntime = dependency('libonnxruntime', required: false) -percetto = dependency('percetto', required: false) +percetto = dependency('percetto', required: false) gst_found = gst.found() and gst_app.found() and gst_video.found() @@ -219,9 +219,9 @@ if zlib.found() and ('auto' in drivers or 'vive' in drivers) endif endif -if rs.found() and ('auto' in drivers or 'rs' in drivers) - if 'rs' not in drivers - drivers += ['rs'] +if realsense.found() and ('auto' in drivers or 'realsense' in drivers) + if 'realsense' not in drivers + drivers += ['realsense'] endif endif diff --git a/meson_options.txt b/meson_options.txt index f4ae42cc8..88c4ddba9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,7 +3,30 @@ option('drivers', type: 'array', - choices: ['auto', 'dummy', 'hdk', 'hydra', 'ns', 'ohmd', 'psmv', 'psvr', 'rs', 'v4l2', 'vf', 'depthai', 'vive', 'wmr', 'survive', 'daydream', 'arduino', 'remote', 'handtracking', 'qwerty', 'ulv2', 'euroc'], + choices: [ + 'auto', + 'dummy', + 'hdk', + 'hydra', + 'ns', + 'ohmd', + 'psmv', + 'psvr', + 'realsense', + 'v4l2', + 'vf', + 'depthai', + 'vive', + 'wmr', + 'survive', + 'daydream', + 'arduino', + 'remote', + 'handtracking', + 'qwerty', + 'ulv2', + 'euroc', + ], value: ['auto'], description: 'Set of drivers to build') diff --git a/src/xrt/drivers/CMakeLists.txt b/src/xrt/drivers/CMakeLists.txt index 7f36bd06c..202f92a3b 100644 --- a/src/xrt/drivers/CMakeLists.txt +++ b/src/xrt/drivers/CMakeLists.txt @@ -138,16 +138,16 @@ if(XRT_BUILD_DRIVER_PSVR) list(APPEND ENABLED_HEADSET_DRIVERS psvr) endif() -if(XRT_BUILD_DRIVER_RS) +if(XRT_BUILD_DRIVER_REALSENSE) add_library( - drv_rs STATIC + drv_realsense STATIC realsense/rs_ddev.c realsense/rs_hdev.c realsense/rs_prober.c realsense/rs_driver.h realsense/rs_interface.h ) - target_link_libraries(drv_rs PRIVATE xrt-interfaces realsense2::realsense2 aux_util) + target_link_libraries(drv_realsense PRIVATE xrt-interfaces realsense2::realsense2 aux_util) list(APPEND ENABLED_HEADSET_DRIVERS rs) endif() diff --git a/src/xrt/drivers/meson.build b/src/xrt/drivers/meson.build index 1edf3b313..d3c448905 100644 --- a/src/xrt/drivers/meson.build +++ b/src/xrt/drivers/meson.build @@ -150,8 +150,8 @@ lib_drv_psvr = static_library( build_by_default: 'psvr' in drivers, ) -lib_drv_rs = static_library( - 'drv_rs', +lib_drv_realsense = static_library( + 'drv_realsense', files( 'realsense/rs_ddev.c', 'realsense/rs_hdev.c', @@ -160,7 +160,7 @@ lib_drv_rs = static_library( 'realsense/rs_prober.c', ), include_directories: [xrt_include,cjson_include], - dependencies: [aux, rs], + dependencies: [aux, realsense], build_by_default: 'rs' in drivers, ) diff --git a/src/xrt/state_trackers/prober/p_prober.c b/src/xrt/state_trackers/prober/p_prober.c index e77ed7491..aba641824 100644 --- a/src/xrt/state_trackers/prober/p_prober.c +++ b/src/xrt/state_trackers/prober/p_prober.c @@ -31,7 +31,7 @@ #include "euroc/euroc_interface.h" #endif -#ifdef XRT_BUILD_DRIVER_RS +#ifdef XRT_BUILD_DRIVER_REALSENSE #include "realsense/rs_interface.h" #endif @@ -1006,7 +1006,7 @@ p_open_video_device(struct xrt_prober *xp, } #endif -#if defined(XRT_BUILD_DRIVER_RS) +#if defined(XRT_BUILD_DRIVER_REALSENSE) int rs_source_index = debug_get_num_option_rs_source_index(); if (rs_source_index != -1) { *out_xfs = rs_source_create(xfctx, rs_source_index); diff --git a/src/xrt/state_trackers/prober/p_tracking.c b/src/xrt/state_trackers/prober/p_tracking.c index 4ff9bd8c2..97da80c60 100644 --- a/src/xrt/state_trackers/prober/p_tracking.c +++ b/src/xrt/state_trackers/prober/p_tracking.c @@ -31,7 +31,7 @@ DEBUG_GET_ONCE_OPTION(euroc_path, "EUROC_PATH", NULL) #endif -#ifdef XRT_BUILD_DRIVER_RS +#ifdef XRT_BUILD_DRIVER_REALSENSE #include "util/u_debug.h" DEBUG_GET_ONCE_NUM_OPTION(rs_source_index, "RS_SOURCE_INDEX", -1) #endif @@ -275,7 +275,7 @@ p_factory_ensure_slam_frameserver(struct p_factory *fact) // SLAM tracker with RealSense frameserver -#ifdef XRT_BUILD_DRIVER_RS +#ifdef XRT_BUILD_DRIVER_REALSENSE if (debug_get_num_option_rs_source_index() != -1) { struct xrt_slam_sinks empty_sinks = {0}; struct xrt_slam_sinks *sinks = &empty_sinks; diff --git a/src/xrt/targets/common/CMakeLists.txt b/src/xrt/targets/common/CMakeLists.txt index ca237ff73..61cb422bf 100644 --- a/src/xrt/targets/common/CMakeLists.txt +++ b/src/xrt/targets/common/CMakeLists.txt @@ -59,8 +59,8 @@ if(XRT_BUILD_DRIVER_PSVR) target_link_libraries(target_lists PRIVATE drv_psvr) endif() -if(XRT_BUILD_DRIVER_RS) - target_link_libraries(target_lists PRIVATE drv_rs) +if(XRT_BUILD_DRIVER_REALSENSE) + target_link_libraries(target_lists PRIVATE drv_realsense) endif() if(XRT_BUILD_DRIVER_REMOTE) diff --git a/src/xrt/targets/common/target_lists.c b/src/xrt/targets/common/target_lists.c index dae435d59..9d114c33e 100644 --- a/src/xrt/targets/common/target_lists.c +++ b/src/xrt/targets/common/target_lists.c @@ -62,7 +62,7 @@ #include "illixr/illixr_interface.h" #endif -#ifdef XRT_BUILD_DRIVER_RS +#ifdef XRT_BUILD_DRIVER_REALSENSE #include "realsense/rs_interface.h" #endif @@ -179,7 +179,7 @@ xrt_auto_prober_creator target_auto_list[] = { illixr_create_auto_prober, #endif -#ifdef XRT_BUILD_DRIVER_RS +#ifdef XRT_BUILD_DRIVER_REALSENSE rs_create_auto_prober, #endif diff --git a/src/xrt/targets/meson.build b/src/xrt/targets/meson.build index 6c62b9afc..25b322700 100644 --- a/src/xrt/targets/meson.build +++ b/src/xrt/targets/meson.build @@ -44,9 +44,9 @@ if 'psvr' in drivers driver_libs += [lib_drv_psvr] endif -if 'rs' in drivers - driver_libs += [lib_drv_rs] - driver_deps += [rs] +if 'realsense' in drivers + driver_libs += [lib_drv_realsense] + driver_deps += [realsense] endif if 'v4l2' in drivers