The open source OpenXR runtime

cmake: Substantial cleanups and simplifications

We now have a cmake-format config file.
We no longer use list variables for sources, instead using
target_sources when we need to add, in accordance with current
best practice. (This makes it a lot easier to edit too.) There's no more
include_directories(), add_definitions(), or other gently-deprecated
directory-scoped commands, nor any CMake scripts that include
a parent directory reference (named targets instead)

+1013 -1077
+23
.cmake-format.py
···
··· 1 + # SPDX-FileCopyrightText: 2021, Collabora, Ltd. 2 + # SPDX-License-Identifier: CC0-1.0 3 + 4 + with section("format"): 5 + line_width = 100 6 + tab_size = 8 7 + use_tabchars = True 8 + fractional_tab_policy = "use-space" 9 + 10 + max_prefix_chars = 4 11 + 12 + dangle_parens = True 13 + dangle_align = "prefix-indent" 14 + max_pargs_hwrap = 4 15 + max_rows_cmdline = 1 16 + 17 + keyword_case = 'upper' 18 + 19 + 20 + # Do not reflow comments 21 + 22 + with section("markup"): 23 + enable_markup = False
+53 -35
CMakeLists.txt
··· 9 cmake_policy(SET CMP0072 NEW) 10 endif() 11 12 - option(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH "Use the absolute path to the runtime in the installed manifest, rather than a bare filename." ON) 13 option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON) 14 15 # We use C++17 ··· 45 find_program(PYTHON_EXECUTABLE python3) 46 if(PYTHON_EXECUTABLE MATCHES "WindowsApps") 47 # If you hit this error, you will have to install Python 3 or try harder to tell CMake where it is. 48 - message(FATAL_ERROR "Found WindowsApps alias for Python. Make sure Python3 is installed, then choose 'Manage App Execution Aliases' in Start and disable the aliases for Python.") 49 endif() 50 endif() 51 ··· 56 find_package(EGL MODULE) 57 find_package(HIDAPI MODULE) 58 find_package(OpenHMD MODULE) 59 - find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video CONFIG) 60 find_package(Libusb1 MODULE) 61 find_package(JPEG MODULE) 62 find_package(realsense2 CONFIG) ··· 94 pkg_check_modules(FFMPEG libavcodec) 95 endif() 96 97 - 98 find_package(OpenGL) 99 set(OPENGL_WITHOUT_GLX_FOUND ${OPENGL_FOUND}) 100 if(CMAKE_SYSTEM_NAME STREQUAL "Linux") ··· 112 pkg_search_module(WAYLAND wayland-client) 113 pkg_search_module(WAYLAND_SCANNER wayland-scanner) 114 pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols) 115 - pkg_search_module(LIBDRM libdrm) 116 endif() 117 find_package(OpenGL COMPONENTS GLX) 118 pkg_search_module(DBUS dbus-1) 119 pkg_search_module(LIBBSD libbsd) 120 121 - pkg_check_modules(GST 122 - gstreamer-1.0 123 - gstreamer-app-1.0 124 - gstreamer-video-1.0 125 - ) 126 127 pkg_check_modules(SURVIVE IMPORTED_TARGET survive) 128 - else() 129 endif() 130 131 find_library(RT_LIBRARY rt) 132 if(ANDROID) 133 find_library(ANDROID_LIBRARY android) 134 find_library(ANDROID_LOG_LIBRARY log) ··· 149 endif() 150 endforeach() 151 152 # This one is named differently because that's what CTest uses 153 option(BUILD_TESTING "Enable building of the test suite?" ON) 154 155 option(XRT_FEATURE_COLOR_LOG "Enable logging in color on supported platforms" ON) 156 cmake_dependent_option(XRT_HAVE_PERCETTO "Enable percetto support" ON "PERCETTO_FOUND" OFF) ··· 198 # Most users won't touch these. 199 mark_as_advanced(XRT_FEATURE_COMPOSITOR_MAIN XRT_FEATURE_OPENXR) 200 201 - # ILLIXR 202 - set(ILLIXR_PATH "" CACHE PATH "Path to ILLIXR headers") 203 204 if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 205 set(XRT_HAVE_LIBUDEV ON) ··· 207 else() 208 cmake_dependent_option(XRT_HAVE_LIBUDEV "Enable libudev (used for device probing on Linux)" ON "UDEV_FOUND" OFF) 209 endif() 210 cmake_dependent_option(XRT_HAVE_LIBUSB "Enable libusb (used for most drivers)" ON "LIBUSB1_FOUND" OFF) 211 cmake_dependent_option(XRT_HAVE_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF) 212 cmake_dependent_option(XRT_HAVE_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF) ··· 248 cmake_dependent_option(XRT_BUILD_DRIVER_QWERTY "Enable Qwerty driver" ON "XRT_HAVE_SDL2" OFF) 249 cmake_dependent_option(XRT_BUILD_DRIVER_EUROC "Enable EuRoC dataset driver for SLAM evaluation" ON "XRT_HAVE_OPENCV" OFF) 250 251 # You can set this from a superproject to add a driver 252 # All drivers must be listed in here to be included in the generated header! 253 - list(APPEND AVAILABLE_DRIVERS 254 "ANDROID" 255 "ARDUINO" 256 "DAYDREAM" ··· 275 "WMR" 276 "EUROC" 277 ) 278 - 279 280 # Package name needs to be known by the native code itself. 281 # Can be overridden from outside/command line ··· 313 if(XRT_HAVE_XCB) 314 set(VK_USE_PLATFORM_XCB_KHR TRUE) 315 endif() 316 - if(XRT_HAVE_XCB AND XRT_HAVE_XLIB AND XRT_HAVE_XRANDR) 317 set(VK_USE_PLATFORM_XLIB_XRANDR_EXT TRUE) 318 endif() 319 if(XRT_HAVE_WAYLAND) ··· 325 if(WIN32) 326 set(VK_USE_PLATFORM_WIN32_KHR TRUE) 327 endif() 328 - if (XRT_HAVE_VULKAN AND NOT ANDROID) 329 set(VK_USE_PLATFORM_DISPLAY_KHR TRUE) 330 endif() 331 332 - if(NOT MSVC) 333 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter") 334 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Werror=incompatible-pointer-types") 335 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion") 336 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter") 337 - 338 - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") 339 - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined") 340 - endif() 341 342 # Default to PIC code 343 set(CMAKE_POSITION_INDEPENDENT_CODE ON) ··· 348 endif() 349 350 # Make sure we have pretty colours 351 - option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE) 352 353 - if ("${FORCE_COLORED_OUTPUT}") 354 - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 355 - add_compile_options (-fdiagnostics-color=always) 356 - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") 357 - add_compile_options (-fcolor-diagnostics) 358 - endif () 359 - endif () 360 361 ### 362 - # Decend into madness. 363 ### 364 365 add_subdirectory(src)
··· 9 cmake_policy(SET CMP0072 NEW) 10 endif() 11 12 + option( 13 + XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH 14 + "Use the absolute path to the runtime in the installed manifest, rather than a bare filename." 15 + ON 16 + ) 17 option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON) 18 19 # We use C++17 ··· 49 find_program(PYTHON_EXECUTABLE python3) 50 if(PYTHON_EXECUTABLE MATCHES "WindowsApps") 51 # If you hit this error, you will have to install Python 3 or try harder to tell CMake where it is. 52 + message( 53 + FATAL_ERROR 54 + "Found WindowsApps alias for Python. Make sure Python3 is installed, then choose 'Manage App Execution Aliases' in Start and disable the aliases for Python." 55 + ) 56 endif() 57 endif() 58 ··· 63 find_package(EGL MODULE) 64 find_package(HIDAPI MODULE) 65 find_package(OpenHMD MODULE) 66 + find_package( 67 + OpenCV 68 + COMPONENTS 69 + core 70 + calib3d 71 + highgui 72 + imgproc 73 + imgcodecs 74 + features2d 75 + video 76 + CONFIG 77 + ) 78 find_package(Libusb1 MODULE) 79 find_package(JPEG MODULE) 80 find_package(realsense2 CONFIG) ··· 112 pkg_check_modules(FFMPEG libavcodec) 113 endif() 114 115 find_package(OpenGL) 116 set(OPENGL_WITHOUT_GLX_FOUND ${OPENGL_FOUND}) 117 if(CMAKE_SYSTEM_NAME STREQUAL "Linux") ··· 129 pkg_search_module(WAYLAND wayland-client) 130 pkg_search_module(WAYLAND_SCANNER wayland-scanner) 131 pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols) 132 + pkg_search_module(LIBDRM IMPORTED_TARGET libdrm) 133 endif() 134 find_package(OpenGL COMPONENTS GLX) 135 pkg_search_module(DBUS dbus-1) 136 pkg_search_module(LIBBSD libbsd) 137 138 + pkg_check_modules(GST gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0) 139 140 pkg_check_modules(SURVIVE IMPORTED_TARGET survive) 141 endif() 142 143 find_library(RT_LIBRARY rt) 144 + 145 if(ANDROID) 146 find_library(ANDROID_LIBRARY android) 147 find_library(ANDROID_LOG_LIBRARY log) ··· 162 endif() 163 endforeach() 164 165 + # ILLIXR 166 + set(ILLIXR_PATH 167 + "" 168 + CACHE PATH "Path to ILLIXR headers" 169 + ) 170 + 171 # This one is named differently because that's what CTest uses 172 option(BUILD_TESTING "Enable building of the test suite?" ON) 173 + 174 + # cmake-format: off 175 176 option(XRT_FEATURE_COLOR_LOG "Enable logging in color on supported platforms" ON) 177 cmake_dependent_option(XRT_HAVE_PERCETTO "Enable percetto support" ON "PERCETTO_FOUND" OFF) ··· 219 # Most users won't touch these. 220 mark_as_advanced(XRT_FEATURE_COMPOSITOR_MAIN XRT_FEATURE_OPENXR) 221 222 223 if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 224 set(XRT_HAVE_LIBUDEV ON) ··· 226 else() 227 cmake_dependent_option(XRT_HAVE_LIBUDEV "Enable libudev (used for device probing on Linux)" ON "UDEV_FOUND" OFF) 228 endif() 229 + 230 cmake_dependent_option(XRT_HAVE_LIBUSB "Enable libusb (used for most drivers)" ON "LIBUSB1_FOUND" OFF) 231 cmake_dependent_option(XRT_HAVE_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF) 232 cmake_dependent_option(XRT_HAVE_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF) ··· 268 cmake_dependent_option(XRT_BUILD_DRIVER_QWERTY "Enable Qwerty driver" ON "XRT_HAVE_SDL2" OFF) 269 cmake_dependent_option(XRT_BUILD_DRIVER_EUROC "Enable EuRoC dataset driver for SLAM evaluation" ON "XRT_HAVE_OPENCV" OFF) 270 271 + # cmake-format: on 272 + 273 # You can set this from a superproject to add a driver 274 # All drivers must be listed in here to be included in the generated header! 275 + list( 276 + APPEND 277 + AVAILABLE_DRIVERS 278 "ANDROID" 279 "ARDUINO" 280 "DAYDREAM" ··· 299 "WMR" 300 "EUROC" 301 ) 302 303 # Package name needs to be known by the native code itself. 304 # Can be overridden from outside/command line ··· 336 if(XRT_HAVE_XCB) 337 set(VK_USE_PLATFORM_XCB_KHR TRUE) 338 endif() 339 + if(XRT_HAVE_XCB 340 + AND XRT_HAVE_XLIB 341 + AND XRT_HAVE_XRANDR 342 + ) 343 set(VK_USE_PLATFORM_XLIB_XRANDR_EXT TRUE) 344 endif() 345 if(XRT_HAVE_WAYLAND) ··· 351 if(WIN32) 352 set(VK_USE_PLATFORM_WIN32_KHR TRUE) 353 endif() 354 + if(XRT_HAVE_VULKAN AND NOT ANDROID) 355 set(VK_USE_PLATFORM_DISPLAY_KHR TRUE) 356 endif() 357 358 + include(CompilerFlags.cmake) 359 360 # Default to PIC code 361 set(CMAKE_POSITION_INDEPENDENT_CODE ON) ··· 366 endif() 367 368 # Make sure we have pretty colours 369 + option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE) 370 371 + if(FORCE_COLORED_OUTPUT) 372 + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 373 + add_compile_options(-fdiagnostics-color=always) 374 + elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") 375 + add_compile_options(-fcolor-diagnostics) 376 + endif() 377 + endif() 378 379 ### 380 + # Descend into the source 381 ### 382 383 add_subdirectory(src)
+14
CompilerFlags.cmake
···
··· 1 + # Copyright 2018-2021, Collabora, Ltd. 2 + # SPDX-License-Identifier: BSL-1.0 3 + 4 + if(NOT MSVC) 5 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter") 6 + set(CMAKE_C_FLAGS 7 + "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Werror=incompatible-pointer-types" 8 + ) 9 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion") 10 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter") 11 + 12 + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") 13 + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined") 14 + endif()
+15 -7
doc/CMakeLists.txt
··· 3 4 # check if Doxygen is installed 5 find_package(Doxygen) 6 cmake_dependent_option(BUILD_DOC "Build documentation" ON "DOXYGEN_FOUND" OFF) 7 cmake_dependent_option(BUILD_DOC_WARN_UNDOCUMENTED "Warn on undocumented entities when building documentation" OFF "DOXYGEN_FOUND" OFF) 8 cmake_dependent_option(BUILD_DOC_EXTRACT_ALL "Extract all entities for documentation, not just documented ones (conflicts with BUILD_DOC_WARN_UNDOCUMENTED)" ON "DOXYGEN_FOUND AND NOT BUILD_DOC_WARN_UNDOCUMENTED" OFF) 9 10 if(BUILD_DOC) 11 if(BUILD_DOC_WARN_UNDOCUMENTED) ··· 30 configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) 31 32 # copy the schema 33 - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json 34 - ${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json 35 - @ONLY) 36 - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json.license 37 - ${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json.license 38 - @ONLY) 39 40 # note the option ALL which allows to build the docs together with the application 41 - add_custom_target(doc_doxygen ALL 42 COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} 43 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 44 COMMENT "Generating API documentation with Doxygen"
··· 3 4 # check if Doxygen is installed 5 find_package(Doxygen) 6 + 7 + # cmake-format: off 8 + 9 cmake_dependent_option(BUILD_DOC "Build documentation" ON "DOXYGEN_FOUND" OFF) 10 cmake_dependent_option(BUILD_DOC_WARN_UNDOCUMENTED "Warn on undocumented entities when building documentation" OFF "DOXYGEN_FOUND" OFF) 11 cmake_dependent_option(BUILD_DOC_EXTRACT_ALL "Extract all entities for documentation, not just documented ones (conflicts with BUILD_DOC_WARN_UNDOCUMENTED)" ON "DOXYGEN_FOUND AND NOT BUILD_DOC_WARN_UNDOCUMENTED" OFF) 12 + 13 + # cmake-format: on 14 15 if(BUILD_DOC) 16 if(BUILD_DOC_WARN_UNDOCUMENTED) ··· 35 configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) 36 37 # copy the schema 38 + configure_file( 39 + ${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json 40 + ${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json @ONLY 41 + ) 42 + configure_file( 43 + ${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json.license 44 + ${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json.license @ONLY 45 + ) 46 47 # note the option ALL which allows to build the docs together with the application 48 + add_custom_target( 49 + doc_doxygen ALL 50 COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} 51 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 52 COMMENT "Generating API documentation with Doxygen"
+42 -22
src/external/CMakeLists.txt
··· 5 add_library(xrt-external-catch2 INTERFACE) 6 target_include_directories(xrt-external-catch2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Catch2) 7 add_library(xrt-external-openvr INTERFACE) 8 - target_include_directories(xrt-external-openvr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openvr_includes) 9 - 10 11 # cJSON 12 add_library(xrt-external-cjson INTERFACE) ··· 31 32 # JNIPP and Android JNI wrappers 33 if(ANDROID) 34 - add_library(xrt-external-jnipp STATIC 35 - jnipp/jnipp.cpp) 36 target_include_directories(xrt-external-jnipp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/jnipp) 37 38 file(GLOB WRAP_SOURCES android-jni-wrap/wrap/*.cpp) 39 - add_library(xrt-external-jni-wrap STATIC 40 - ${WRAP_SOURCES}) 41 - target_include_directories(xrt-external-jni-wrap PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/android-jni-wrap) 42 target_link_libraries(xrt-external-jni-wrap PUBLIC xrt-external-jnipp) 43 endif() 44 45 # OpenXR 46 add_library(xrt-external-openxr INTERFACE) 47 - target_include_directories(xrt-external-openxr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openxr_includes) 48 49 # External SLAM tracking 50 - if (SLAM) 51 add_library(xrt-external-slam STATIC slam_tracker/slam_tracker.hpp) 52 set_target_properties(xrt-external-slam PROPERTIES LINKER_LANGUAGE CXX) 53 - target_include_directories(xrt-external-slam INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/slam_tracker) 54 target_include_directories(xrt-external-slam INTERFACE ${SLAM_INCLUDE_DIRS}) 55 target_link_libraries(xrt-external-slam INTERFACE ${SLAM_LIBRARIES}) 56 endif() ··· 60 target_include_directories(xrt-external-stb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/stb) 61 62 # imgui 63 - if(XRT_HAVE_SDL2) 64 - # c-imgui doesn't do well with IPO - lots of warnings. 65 - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF) 66 add_library( 67 xrt-external-imgui STATIC 68 imgui/imgui/cimgui.cpp ··· 88 imgui/imgui/imstb_truetype.h 89 imgui/imgui_monado/imgui_monado.cpp 90 ) 91 - target_include_directories(xrt-external-imgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui) 92 93 target_compile_definitions(xrt-external-imgui PUBLIC CIMGUI_NO_EXPORT) 94 - target_link_libraries(xrt-external-imgui PRIVATE xrt-external-glad) 95 96 - add_library( 97 - xrt-external-imgui-sdl2 STATIC imgui/imgui/cimgui_sdl.cpp imgui/imgui/imgui_impl_sdl.cpp 98 - imgui/imgui/imgui_impl_sdl.h 99 - ) 100 - target_link_libraries(xrt-external-imgui-sdl2 PRIVATE xrt-external-imgui ${SDL2_LIBRARIES}) 101 102 - target_include_directories(xrt-external-imgui-sdl2 PRIVATE ${SDL2_INCLUDE_DIRS}) 103 - target_include_directories(xrt-external-imgui-sdl2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui) 104 endif()
··· 5 add_library(xrt-external-catch2 INTERFACE) 6 target_include_directories(xrt-external-catch2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Catch2) 7 add_library(xrt-external-openvr INTERFACE) 8 + target_include_directories( 9 + xrt-external-openvr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openvr_includes 10 + ) 11 12 # cJSON 13 add_library(xrt-external-cjson INTERFACE) ··· 32 33 # JNIPP and Android JNI wrappers 34 if(ANDROID) 35 + add_library(xrt-external-jnipp STATIC jnipp/jnipp.cpp) 36 target_include_directories(xrt-external-jnipp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/jnipp) 37 38 file(GLOB WRAP_SOURCES android-jni-wrap/wrap/*.cpp) 39 + add_library(xrt-external-jni-wrap STATIC ${WRAP_SOURCES}) 40 + target_include_directories( 41 + xrt-external-jni-wrap PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/android-jni-wrap 42 + ) 43 target_link_libraries(xrt-external-jni-wrap PUBLIC xrt-external-jnipp) 44 endif() 45 46 # OpenXR 47 add_library(xrt-external-openxr INTERFACE) 48 + target_include_directories( 49 + xrt-external-openxr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openxr_includes 50 + ) 51 52 # External SLAM tracking 53 + if(SLAM) 54 add_library(xrt-external-slam STATIC slam_tracker/slam_tracker.hpp) 55 set_target_properties(xrt-external-slam PROPERTIES LINKER_LANGUAGE CXX) 56 + target_include_directories( 57 + xrt-external-slam INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/slam_tracker 58 + ) 59 target_include_directories(xrt-external-slam INTERFACE ${SLAM_INCLUDE_DIRS}) 60 target_link_libraries(xrt-external-slam INTERFACE ${SLAM_LIBRARIES}) 61 endif() ··· 65 target_include_directories(xrt-external-stb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/stb) 66 67 # imgui 68 + if(XRT_HAVE_OPENGL) 69 add_library( 70 xrt-external-imgui STATIC 71 imgui/imgui/cimgui.cpp ··· 91 imgui/imgui/imstb_truetype.h 92 imgui/imgui_monado/imgui_monado.cpp 93 ) 94 95 + target_include_directories( 96 + xrt-external-imgui SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui 97 + ) 98 + target_include_directories(xrt-external-imgui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/imgui) 99 target_compile_definitions(xrt-external-imgui PUBLIC CIMGUI_NO_EXPORT) 100 + set_target_properties(xrt-external-imgui PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF) 101 + target_link_libraries(xrt-external-imgui PUBLIC xrt-external-glad) 102 103 + if(XRT_HAVE_SDL2) 104 + add_library( 105 + xrt-external-imgui-sdl2 STATIC 106 + imgui/imgui/cimgui_sdl.cpp imgui/imgui/imgui_impl_sdl.cpp 107 + imgui/imgui/imgui_impl_sdl.h 108 + ) 109 + target_link_libraries( 110 + xrt-external-imgui-sdl2 111 + PUBLIC xrt-external-imgui 112 + PRIVATE ${SDL2_LIBRARIES} 113 + ) 114 115 + target_include_directories(xrt-external-imgui-sdl2 PRIVATE ${SDL2_INCLUDE_DIRS}) 116 + target_include_directories( 117 + xrt-external-imgui-sdl2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui 118 + ) 119 + set_target_properties( 120 + xrt-external-imgui-sdl2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF 121 + ) 122 + endif() 123 + 124 endif()
+151 -183
src/xrt/auxiliary/CMakeLists.txt
··· 1 - # Copyright 2019-2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 add_subdirectory(bindings) 5 6 - set(ANDROID_SOURCE_FILES 7 - android/android_ahardwarebuffer_allocator.c 8 - android/android_ahardwarebuffer_allocator.h 9 - android/android_custom_surface.cpp 10 - android/android_custom_surface.h 11 - android/android_globals.cpp 12 - android/android_globals.h 13 - android/android_load_class.cpp 14 - android/android_load_class.hpp 15 - android/android_looper.c 16 - android/android_looper.h 17 - android/org.freedesktop.monado.auxiliary.cpp 18 - android/org.freedesktop.monado.auxiliary.hpp 19 - android/org.freedesktop.monado.auxiliary.impl.hpp 20 ) 21 22 - set(MATH_SOURCE_FILES 23 math/m_api.h 24 math/m_base.cpp 25 math/m_eigen_interop.hpp ··· 45 math/m_vec2.h 46 math/m_vec3.h 47 ) 48 - 49 - set(OGL_SOURCE_FILES 50 - ogl/ogl_documentation.h 51 - ) 52 - if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 53 - list(APPEND OGL_SOURCE_FILES 54 - ogl/ogl_api.c 55 - ogl/ogl_api.h 56 - ogl/ogl_helpers.c 57 - ogl/ogl_helpers.h 58 - ) 59 - endif() 60 - if(XRT_HAVE_EGL) 61 - list(APPEND OGL_SOURCE_FILES 62 - ogl/egl_api.c 63 - ogl/egl_api.h 64 - ) 65 - endif() 66 67 - set(OS_SOURCE_FILES 68 os/os_ble.h 69 os/os_documentation.h 70 os/os_hid.h 71 os/os_hid_hidraw.c 72 os/os_threading.h 73 ) 74 if(XRT_HAVE_DBUS) 75 - list(APPEND OS_SOURCE_FILES 76 - os/os_ble_dbus.c 77 ) 78 endif() 79 80 - set(GSTREAMER_SOURCE_FILES 81 - gstreamer/gst_internal.h 82 - gstreamer/gst_sink.h 83 - gstreamer/gst_sink.c 84 - gstreamer/gst_pipeline.h 85 - gstreamer/gst_pipeline.c 86 - ) 87 - 88 - set(TRACKING_SOURCE_FILES 89 tracking/t_data_utils.c 90 tracking/t_imu_fusion.hpp 91 tracking/t_imu.cpp ··· 94 tracking/t_lowpass.hpp 95 tracking/t_tracking.h 96 ) 97 if(XRT_HAVE_OPENCV) 98 - list(APPEND TRACKING_SOURCE_FILES 99 - tracking/t_calibration_opencv.hpp 100 - tracking/t_calibration.cpp 101 - tracking/t_convert.cpp 102 - tracking/t_debug_hsv_filter.cpp 103 - tracking/t_debug_hsv_picker.cpp 104 - tracking/t_debug_hsv_viewer.cpp 105 - tracking/t_file.cpp 106 - tracking/t_frame_cv_mat_wrapper.cpp 107 - tracking/t_frame_cv_mat_wrapper.hpp 108 - tracking/t_fusion.hpp 109 - tracking/t_helper_debug_sink.hpp 110 - tracking/t_hsv_filter.c 111 - tracking/t_kalman.cpp 112 - tracking/t_tracker_psmv_fusion.hpp 113 - tracking/t_tracker_psmv.cpp 114 - tracking/t_tracker_psvr.cpp 115 - tracking/t_tracker_hand.cpp 116 ) 117 - 118 endif() 119 if(XRT_HAVE_SLAM) 120 - list(APPEND TRACKING_SOURCE_FILES tracking/t_tracker_slam.cpp) 121 endif() 122 123 - set(UTIL_SOURCE_FILES 124 util/u_bitwise.c 125 util/u_bitwise.h 126 util/u_debug.c ··· 178 util/u_verify.h 179 util/u_process.c 180 util/u_process.h 181 - ) 182 - 183 - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/util/u_git_tag.c.in" "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c" @ONLY) 184 - list(APPEND UTIL_SOURCE_FILES "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c") 185 - 186 - set(VK_SOURCE_FILES 187 - vk/vk_command_buffer.c 188 - vk/vk_documentation.h 189 - vk/vk_helpers.c 190 - vk/vk_helpers.h 191 - vk/vk_image_allocator.c 192 - vk/vk_image_allocator.h 193 - vk/vk_state_creators.c 194 ) 195 196 - # Common includes 197 - add_library(aux-includes INTERFACE) 198 - target_include_directories(aux-includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) 199 - target_link_libraries(aux-includes INTERFACE xrt-interfaces) 200 - 201 - if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 202 - # OpenGL library. 203 - add_library(aux_ogl STATIC ${OGL_SOURCE_FILES}) 204 - target_link_libraries(aux_ogl PUBLIC aux-includes) 205 - # for GLAD 206 - target_link_libraries(aux_ogl PUBLIC xrt-external-glad) 207 - if(XRT_HAVE_OPENGLES) 208 - target_link_libraries(aux_ogl PUBLIC EGL::EGL) 209 - endif() 210 - endif() 211 - 212 - # OS library. 213 - add_library(aux_os STATIC ${OS_SOURCE_FILES}) 214 - target_link_libraries(aux_os PUBLIC aux-includes xrt-pthreads) 215 - if(XRT_HAVE_DBUS) 216 - target_link_libraries(aux_os PRIVATE ${DBUS_LIBRARIES}) 217 - target_include_directories(aux_os SYSTEM 218 - PRIVATE 219 - ${DBUS_INCLUDE_DIRS} 220 - ) 221 - endif() 222 - 223 - 224 - # Math library. 225 - add_library(aux_math STATIC ${MATH_SOURCE_FILES}) 226 - target_link_libraries(aux_math PUBLIC aux-includes aux_util) 227 - 228 - # Math files has extra include(s). 229 - target_include_directories(aux_math SYSTEM 230 - PRIVATE ${EIGEN3_INCLUDE_DIR} 231 ) 232 - 233 - # Util library. 234 - add_library(aux_util STATIC ${UTIL_SOURCE_FILES}) 235 - target_link_libraries(aux_util PUBLIC aux-includes xrt-pthreads aux_generated_bindings) 236 - # for u_device 237 - target_link_libraries(aux_util PUBLIC aux_math) 238 if(XRT_HAVE_JPEG) 239 target_link_libraries(aux_util PRIVATE ${JPEG_LIBRARIES}) 240 target_include_directories(aux_util PRIVATE ${JPEG_INCLUDE_DIRS}) 241 endif() 242 - # for cJSON 243 if(XRT_HAVE_SYSTEM_CJSON) 244 target_link_libraries(aux_util PUBLIC cJSON::cJSON) 245 target_compile_definitions(aux_util PRIVATE XRT_HAVE_SYSTEM_CJSON) 246 else() 247 target_link_libraries(aux_util PUBLIC xrt-external-cjson) 248 endif() 249 - # For u_trace_marker 250 if(XRT_FEATURE_TRACING AND XRT_HAVE_PERCETTO) 251 target_link_libraries(aux_util PUBLIC Percetto::percetto) 252 endif() ··· 258 target_link_libraries(aux_util PUBLIC ${ANDROID_LOG_LIBRARY}) 259 endif() 260 261 - 262 - # GStreamer library. 263 - if(XRT_HAVE_GST) 264 - add_library(aux_gstreamer STATIC ${GSTREAMER_SOURCE_FILES}) 265 - target_link_libraries(aux_gstreamer PUBLIC 266 - aux-includes 267 - ) 268 - target_link_libraries(aux_gstreamer PRIVATE 269 - xrt-interfaces 270 - aux_math 271 - aux_os 272 - ${GST_LIBRARIES} 273 - ) 274 - target_include_directories(aux_gstreamer PRIVATE 275 - ${GST_INCLUDE_DIRS} 276 - ) 277 - endif() 278 - 279 - # Tracking library. 280 - add_library(aux_tracking STATIC ${TRACKING_SOURCE_FILES}) 281 - target_link_libraries(aux_tracking PUBLIC aux-includes PRIVATE aux_math aux_util) 282 - 283 - # Tracking files have extra includes. 284 - target_include_directories(aux_tracking SYSTEM 285 - PRIVATE 286 - ${EIGEN3_INCLUDE_DIR} 287 - ) 288 - target_link_libraries(aux_tracking PRIVATE 289 - xrt-external-flexkalman 290 - xrt-external-hungarian 291 - ) 292 - if(XRT_HAVE_OPENCV) 293 - target_include_directories(aux_tracking SYSTEM 294 - PRIVATE 295 - ${OpenCV_INCLUDE_DIRS} 296 - ) 297 - target_link_libraries(aux_tracking PUBLIC ${OpenCV_LIBRARIES}) 298 - if(XRT_HAVE_SLAM) 299 - target_link_libraries(aux_tracking PRIVATE xrt-external-slam) 300 - endif() 301 - endif() 302 - 303 - if (XRT_BUILD_DRIVER_VIVE OR XRT_BUILD_DRIVER_SURVIVE) 304 - set(VIVE_CONFIG_SOURCE_FILES 305 - vive/vive_config.h 306 - vive/vive_config.c 307 - ) 308 - add_library(aux_vive STATIC ${VIVE_CONFIG_SOURCE_FILES}) 309 - target_link_libraries(aux_vive PRIVATE xrt-interfaces aux_util aux_math aux_tracking xrt-external-cjson) 310 - target_link_libraries(aux_vive PRIVATE ${ZLIB_LIBRARIES}) 311 - target_include_directories(aux_vive PRIVATE ${ZLIB_INCLUDE_DIRS}) 312 - endif() 313 - 314 if(XRT_HAVE_VULKAN) 315 # Vulkan library. 316 - add_library(aux_vk STATIC ${VK_SOURCE_FILES}) 317 target_link_libraries(aux_vk PUBLIC aux_os aux_util) 318 target_link_libraries(aux_vk PUBLIC Vulkan::Vulkan) 319 target_include_directories(aux_vk PUBLIC ${Vulkan_INCLUDE_DIR}) ··· 322 endif() 323 endif() 324 325 326 if(ANDROID) 327 - add_library(android_app_glue STATIC 328 - ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c) 329 - target_include_directories(android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue) 330 - add_library(aux_android STATIC ${ANDROID_SOURCE_FILES}) 331 - target_link_libraries(aux_android 332 PUBLIC aux_util 333 - PRIVATE ${ANDROID_LIBRARY} ${ANDROID_LOG_LIBRARY} xrt-external-jni-wrap xrt-external-jnipp android_app_glue 334 ) 335 target_link_libraries(aux_vk PUBLIC aux_android) 336 endif()
··· 1 + # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 add_subdirectory(bindings) 5 6 + # Common includes 7 + add_library(aux-includes INTERFACE) 8 + target_include_directories( 9 + aux-includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} 10 ) 11 + target_link_libraries(aux-includes INTERFACE xrt-interfaces) 12 13 + # OpenGL library. 14 + if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 15 + add_library( 16 + aux_ogl STATIC 17 + ogl/ogl_documentation.h 18 + ogl/ogl_api.c 19 + ogl/ogl_api.h 20 + ogl/ogl_helpers.c 21 + ogl/ogl_helpers.h 22 + ) 23 + target_link_libraries(aux_ogl PUBLIC aux-includes xrt-external-glad) 24 + if(XRT_HAVE_EGL) 25 + target_sources(aux_ogl PRIVATE ogl/egl_api.c ogl/egl_api.h) 26 + endif() 27 + if(XRT_HAVE_OPENGLES) 28 + target_link_libraries(aux_ogl PUBLIC EGL::EGL) 29 + endif() 30 + endif() 31 + 32 + # Math library. 33 + add_library( 34 + aux_math STATIC 35 math/m_api.h 36 math/m_base.cpp 37 math/m_eigen_interop.hpp ··· 57 math/m_vec2.h 58 math/m_vec3.h 59 ) 60 + target_link_libraries(aux_math PUBLIC aux-includes aux_util) 61 + target_include_directories(aux_math SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR}) 62 63 + # OS library. 64 + add_library( 65 + aux_os STATIC 66 os/os_ble.h 67 os/os_documentation.h 68 os/os_hid.h 69 os/os_hid_hidraw.c 70 os/os_threading.h 71 ) 72 + target_link_libraries(aux_os PUBLIC aux-includes xrt-pthreads) 73 if(XRT_HAVE_DBUS) 74 + target_sources(aux_os PRIVATE os/os_ble_dbus.c) 75 + target_link_libraries(aux_os PRIVATE ${DBUS_LIBRARIES}) 76 + target_include_directories(aux_os SYSTEM PRIVATE ${DBUS_INCLUDE_DIRS}) 77 + endif() 78 + 79 + # GStreamer library. 80 + if(XRT_HAVE_GST) 81 + add_library( 82 + aux_gstreamer STATIC 83 + gstreamer/gst_internal.h 84 + gstreamer/gst_sink.h 85 + gstreamer/gst_sink.c 86 + gstreamer/gst_pipeline.h 87 + gstreamer/gst_pipeline.c 88 ) 89 + target_link_libraries(aux_gstreamer PUBLIC aux-includes) 90 + target_link_libraries(aux_gstreamer PRIVATE xrt-interfaces aux_math aux_os ${GST_LIBRARIES}) 91 + target_include_directories(aux_gstreamer PRIVATE ${GST_INCLUDE_DIRS}) 92 endif() 93 94 + # Tracking library. 95 + add_library( 96 + aux_tracking STATIC 97 tracking/t_data_utils.c 98 tracking/t_imu_fusion.hpp 99 tracking/t_imu.cpp ··· 102 tracking/t_lowpass.hpp 103 tracking/t_tracking.h 104 ) 105 + target_link_libraries( 106 + aux_tracking 107 + PUBLIC aux-includes 108 + PRIVATE aux_math aux_util xrt-external-flexkalman xrt-external-hungarian 109 + ) 110 + target_include_directories(aux_tracking SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR}) 111 if(XRT_HAVE_OPENCV) 112 + target_sources( 113 + aux_tracking 114 + PRIVATE 115 + tracking/t_calibration_opencv.hpp 116 + tracking/t_calibration.cpp 117 + tracking/t_convert.cpp 118 + tracking/t_debug_hsv_filter.cpp 119 + tracking/t_debug_hsv_picker.cpp 120 + tracking/t_debug_hsv_viewer.cpp 121 + tracking/t_file.cpp 122 + tracking/t_frame_cv_mat_wrapper.cpp 123 + tracking/t_frame_cv_mat_wrapper.hpp 124 + tracking/t_fusion.hpp 125 + tracking/t_helper_debug_sink.hpp 126 + tracking/t_hsv_filter.c 127 + tracking/t_kalman.cpp 128 + tracking/t_tracker_psmv_fusion.hpp 129 + tracking/t_tracker_psmv.cpp 130 + tracking/t_tracker_psvr.cpp 131 + tracking/t_tracker_hand.cpp 132 ) 133 + target_include_directories(aux_tracking SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS}) 134 + target_link_libraries(aux_tracking PUBLIC ${OpenCV_LIBRARIES}) 135 endif() 136 if(XRT_HAVE_SLAM) 137 + target_sources(aux_tracking PRIVATE tracking/t_tracker_slam.cpp) 138 + target_link_libraries(aux_tracking PRIVATE xrt-external-slam) 139 endif() 140 141 + # Util library. 142 + add_library( 143 + aux_util STATIC 144 util/u_bitwise.c 145 util/u_bitwise.h 146 util/u_debug.c ··· 198 util/u_verify.h 199 util/u_process.c 200 util/u_process.h 201 + "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c" 202 ) 203 204 + configure_file( 205 + "${CMAKE_CURRENT_SOURCE_DIR}/util/u_git_tag.c.in" "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c" 206 + @ONLY 207 ) 208 + target_link_libraries(aux_util PUBLIC aux-includes xrt-pthreads aux_generated_bindings aux_math) 209 if(XRT_HAVE_JPEG) 210 target_link_libraries(aux_util PRIVATE ${JPEG_LIBRARIES}) 211 target_include_directories(aux_util PRIVATE ${JPEG_INCLUDE_DIRS}) 212 endif() 213 if(XRT_HAVE_SYSTEM_CJSON) 214 target_link_libraries(aux_util PUBLIC cJSON::cJSON) 215 target_compile_definitions(aux_util PRIVATE XRT_HAVE_SYSTEM_CJSON) 216 else() 217 target_link_libraries(aux_util PUBLIC xrt-external-cjson) 218 endif() 219 if(XRT_FEATURE_TRACING AND XRT_HAVE_PERCETTO) 220 target_link_libraries(aux_util PUBLIC Percetto::percetto) 221 endif() ··· 227 target_link_libraries(aux_util PUBLIC ${ANDROID_LOG_LIBRARY}) 228 endif() 229 230 if(XRT_HAVE_VULKAN) 231 # Vulkan library. 232 + add_library( 233 + aux_vk STATIC 234 + vk/vk_command_buffer.c 235 + vk/vk_documentation.h 236 + vk/vk_helpers.c 237 + vk/vk_helpers.h 238 + vk/vk_image_allocator.c 239 + vk/vk_image_allocator.h 240 + vk/vk_state_creators.c 241 + ) 242 target_link_libraries(aux_vk PUBLIC aux_os aux_util) 243 target_link_libraries(aux_vk PUBLIC Vulkan::Vulkan) 244 target_include_directories(aux_vk PUBLIC ${Vulkan_INCLUDE_DIR}) ··· 247 endif() 248 endif() 249 250 + if(XRT_BUILD_DRIVER_VIVE OR XRT_BUILD_DRIVER_SURVIVE) 251 + set(VIVE_CONFIG_SOURCE_FILES vive/vive_config.h vive/vive_config.c) 252 + add_library(aux_vive STATIC ${VIVE_CONFIG_SOURCE_FILES}) 253 + target_link_libraries( 254 + aux_vive 255 + PRIVATE 256 + xrt-interfaces 257 + aux_util 258 + aux_math 259 + aux_tracking 260 + xrt-external-cjson 261 + ${ZLIB_LIBRARIES} 262 + ) 263 + target_include_directories(aux_vive PRIVATE ${ZLIB_INCLUDE_DIRS}) 264 + endif() 265 266 if(ANDROID) 267 + add_library( 268 + android_app_glue STATIC 269 + ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c 270 + ) 271 + target_include_directories( 272 + android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue 273 + ) 274 + # disable these warnings in external code 275 + target_compile_options(android_app_glue PRIVATE -Wno-format-pedantic) 276 + 277 + add_library( 278 + aux_android STATIC 279 + android/android_ahardwarebuffer_allocator.c 280 + android/android_ahardwarebuffer_allocator.h 281 + android/android_custom_surface.cpp 282 + android/android_custom_surface.h 283 + android/android_globals.cpp 284 + android/android_globals.h 285 + android/android_load_class.cpp 286 + android/android_load_class.hpp 287 + android/android_looper.c 288 + android/android_looper.h 289 + android/org.freedesktop.monado.auxiliary.cpp 290 + android/org.freedesktop.monado.auxiliary.hpp 291 + android/org.freedesktop.monado.auxiliary.impl.hpp 292 + ) 293 + target_link_libraries( 294 + aux_android 295 PUBLIC aux_util 296 + PRIVATE 297 + ${ANDROID_LIBRARY} 298 + ${ANDROID_LOG_LIBRARY} 299 + xrt-external-jni-wrap 300 + xrt-external-jnipp 301 + android_app_glue 302 ) 303 target_link_libraries(aux_vk PUBLIC aux_android) 304 endif()
+17 -16
src/xrt/auxiliary/bindings/CMakeLists.txt
··· 1 # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 - ### 5 - # Binding generation 6 - # 7 - 8 - function(bindings_gen output custom_target) 9 - add_custom_command(OUTPUT ${output} 10 - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py 11 ${CMAKE_CURRENT_SOURCE_DIR}/bindings.json 12 - ${output} 13 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py 14 ${CMAKE_CURRENT_SOURCE_DIR}/bindings.json 15 - ) 16 - add_custom_target(${custom_target} DEPENDS ${output}) 17 - endfunction(bindings_gen) 18 19 - bindings_gen(${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.h generated_bindings_h) 20 - bindings_gen(${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.c generated_bindings_c) 21 22 # Bindings library. 23 - add_library(aux_generated_bindings STATIC ${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.c) 24 - add_dependencies(aux_generated_bindings generated_bindings_h) 25 26 # needed globally for steamvr input profile generation in steamvr target 27 set_property(GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP "${CMAKE_CURRENT_SOURCE_DIR}") 28 29 - target_include_directories(aux_generated_bindings PRIVATE aux-includes xrt-interfaces) 30 target_link_libraries(aux_generated_bindings PRIVATE xrt-interfaces aux_util)
··· 1 # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 + # Binding generation: pass filename to generate 5 + function(bindings_gen output) 6 + add_custom_command( 7 + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${output}" 8 + COMMAND 9 + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py 10 ${CMAKE_CURRENT_SOURCE_DIR}/bindings.json 11 + "${CMAKE_CURRENT_BINARY_DIR}/${output}" 12 + VERBATIM 13 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py 14 ${CMAKE_CURRENT_SOURCE_DIR}/bindings.json 15 + COMMENT "Generating ${output}" 16 + ) 17 + endfunction() 18 19 + bindings_gen(b_generated_bindings.h) 20 + bindings_gen(b_generated_bindings.c) 21 22 # Bindings library. 23 + add_library( 24 + aux_generated_bindings STATIC ${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.c 25 + ${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.h 26 + ) 27 28 # needed globally for steamvr input profile generation in steamvr target 29 set_property(GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP "${CMAKE_CURRENT_SOURCE_DIR}") 30 31 target_link_libraries(aux_generated_bindings PRIVATE xrt-interfaces aux_util)
+164 -189
src/xrt/compositor/CMakeLists.txt
··· 1 # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 - spirv_shaders(SHADER_HEADERS 5 - shaders/clear.comp 6 - shaders/distortion.comp 7 - shaders/distortion_timewarp.comp 8 - shaders/mesh.frag 9 - shaders/mesh.vert 10 - shaders/layer.frag 11 - shaders/layer.vert 12 - shaders/equirect1.vert 13 - shaders/equirect1.frag 14 - shaders/equirect2.vert 15 - shaders/equirect2.frag 16 - ) 17 18 - set(CLIENT_SOURCE_FILES) 19 20 - set(UTIL_SOURCE_FILES 21 - util/comp_base.h 22 - util/comp_base.c 23 - util/comp_swapchain.h 24 - util/comp_swapchain.c 25 - util/comp_sync.h 26 - util/comp_sync.c 27 - util/comp_vulkan.h 28 - util/comp_vulkan.c 29 ) 30 - 31 - set(RENDER_SOURCE_FILES 32 - render/comp_buffer.c 33 - render/comp_compute.c 34 - render/comp_render.h 35 - render/comp_rendering.c 36 - render/comp_resources.c 37 - render/comp_shaders.c 38 - render/comp_util.c 39 - ) 40 - 41 - set(MAIN_SOURCE_FILES 42 - main/comp_compositor.c 43 - main/comp_compositor.h 44 - main/comp_documentation.h 45 - main/comp_renderer.c 46 - main/comp_renderer.h 47 - main/comp_settings.c 48 - main/comp_settings.h 49 - main/comp_target.h 50 - main/comp_target_swapchain.c 51 - main/comp_target_swapchain.h 52 - main/comp_window.h 53 - main/comp_layer.h 54 - main/comp_layer.c 55 - main/comp_layer_renderer.h 56 - main/comp_layer_renderer.c 57 - ) 58 - 59 - set(MULTI_SOURCE_FILES 60 - multi/comp_multi_compositor.c 61 - multi/comp_multi_interface.h 62 - multi/comp_multi_private.h 63 - multi/comp_multi_system.c 64 - ) 65 - 66 - 67 - ### 68 - # Client library 69 - # 70 71 if(XRT_HAVE_VULKAN) 72 - list(APPEND CLIENT_SOURCE_FILES 73 - client/comp_vk_client.c 74 - client/comp_vk_client.h 75 - client/comp_vk_glue.c 76 ) 77 endif() 78 if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 79 - list(APPEND CLIENT_SOURCE_FILES 80 - client/comp_gl_client.c 81 - client/comp_gl_client.h 82 - client/comp_gl_memobj_swapchain.c 83 - client/comp_gl_memobj_swapchain.h 84 ) 85 endif() 86 if(XRT_HAVE_OPENGL) 87 - list(APPEND CLIENT_SOURCE_FILES 88 - client/comp_gl_glue.c 89 - ) 90 endif() 91 if(XRT_HAVE_OPENGLES) 92 - list(APPEND CLIENT_SOURCE_FILES 93 - client/comp_gles_glue.c 94 - client/comp_gl_eglimage_swapchain.c 95 - client/comp_gl_eglimage_swapchain.h 96 ) 97 endif() 98 if(XRT_HAVE_OPENGL_GLX AND XRT_HAVE_XLIB) 99 - list(APPEND CLIENT_SOURCE_FILES 100 - client/comp_gl_xlib_client.c 101 - client/comp_gl_xlib_client.h 102 - client/comp_gl_xlib_glue.c 103 - ) 104 - endif() 105 - if(XRT_HAVE_EGL) 106 - list(APPEND CLIENT_SOURCE_FILES 107 - client/comp_egl_client.c 108 - client/comp_egl_client.h 109 ) 110 - endif() 111 - 112 - add_library(comp_client STATIC ${CLIENT_SOURCE_FILES}) 113 - target_link_libraries(comp_client PUBLIC xrt-interfaces PRIVATE aux_util) 114 - target_include_directories(comp_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 115 - 116 - if(XRT_HAVE_VULKAN) 117 - target_link_libraries(comp_client PRIVATE aux_vk) 118 - endif() 119 - if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 120 - target_link_libraries(comp_client PRIVATE aux_ogl) 121 - endif() 122 - 123 - if(XRT_HAVE_OPENGL AND XRT_HAVE_XLIB) 124 target_link_libraries(comp_client PRIVATE OpenGL::GLX) 125 endif() 126 127 128 ## 129 # Util library 130 # 131 132 if(XRT_HAVE_VULKAN) 133 - add_library(comp_util STATIC ${UTIL_SOURCE_FILES}) 134 - target_link_libraries(comp_util PUBLIC xrt-interfaces PRIVATE aux_util aux_os aux_vk) 135 target_include_directories(comp_util PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 136 endif() 137 - 138 139 ## 140 # Render library 141 # 142 143 if(XRT_HAVE_VULKAN) 144 - add_library(comp_render STATIC ${SHADER_HEADERS} ${RENDER_SOURCE_FILES}) 145 - target_link_libraries(comp_render PUBLIC xrt-interfaces PRIVATE aux_util aux_os aux_vk) 146 - target_include_directories(comp_render PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 147 - target_include_directories(comp_render SYSTEM PRIVATE 148 - # Shaders - marked SYSTEM so we get no warnings 149 - ${CMAKE_CURRENT_BINARY_DIR} 150 ) 151 152 add_subdirectory(shaders) 153 endif() 154 - 155 156 ## 157 # Main library ··· 159 160 if(XRT_FEATURE_COMPOSITOR_MAIN) 161 162 if(XRT_HAVE_XCB) 163 - list(APPEND MAIN_SOURCE_FILES 164 - main/comp_window_xcb.c 165 - ) 166 endif() 167 if(XRT_HAVE_XCB AND XRT_HAVE_XLIB) 168 - list(APPEND MAIN_SOURCE_FILES 169 - main/comp_window_direct_randr.c 170 - main/comp_window_direct_nvidia.c 171 ) 172 endif() 173 if(WIN32) 174 - list(APPEND MAIN_SOURCE_FILES 175 - main/comp_window_mswin.c 176 - ) 177 endif() 178 - if (VK_USE_PLATFORM_DISPLAY_KHR) 179 - list(APPEND MAIN_SOURCE_FILES 180 - main/comp_window_vk_display.c 181 - ) 182 endif() 183 - if (VK_USE_PLATFORM_DISPLAY_KHR OR XRT_HAVE_XCB) 184 - list(APPEND MAIN_SOURCE_FILES 185 - main/comp_window_direct.c 186 - ) 187 endif() 188 189 # generate wayland protocols 190 if(XRT_HAVE_WAYLAND) 191 pkg_get_variable(WL_PROTOS_PKG_DIR wayland-protocols pkgdatadir) 192 pkg_get_variable(WL_SCANNER wayland-scanner wayland_scanner) 193 194 set(WL_PROTOS_DIR "${CMAKE_CURRENT_BINARY_DIR}/wayland-protocols") 195 file(MAKE_DIRECTORY "${WL_PROTOS_DIR}") 196 197 - set(WL_PROTOS_XML 198 - ${WL_PROTOS_PKG_DIR}/stable/xdg-shell/xdg-shell.xml 199 - ) 200 201 - list(APPEND MAIN_SOURCE_FILES 202 - main/comp_window_wayland.c 203 - ) 204 205 - if (XRT_HAVE_WAYLAND_DIRECT) 206 - list(APPEND WL_PROTOS_XML 207 ${WL_PROTOS_PKG_DIR}/staging/drm-lease/drm-lease-v1.xml 208 - ) 209 - 210 - list(APPEND MAIN_SOURCE_FILES 211 - main/comp_window_direct_wayland.c 212 ) 213 214 - pkg_check_modules(LIBDRM IMPORTED_TARGET libdrm) 215 - set(WAYLAND_DEPS 216 - ${WAYLAND_LIBRARIES} 217 - PkgConfig::LIBDRM 218 - ) 219 endif() 220 221 - foreach(WL_PROTO_XML ${WL_PROTOS_XML}) 222 - get_filename_component(WL_PROTO ${WL_PROTO_XML} NAME_WE) 223 224 set(WL_PROTO_C "${WL_PROTOS_DIR}/${WL_PROTO}.c") 225 set(WL_PROTO_H "${WL_PROTOS_DIR}/${WL_PROTO}-client-protocol.h") 226 227 add_custom_command( 228 COMMAND 229 - ${WL_SCANNER} private-code "${WL_PROTO_XML}" "${WL_PROTO_C}" 230 - OUTPUT "${WL_PROTO_C}" VERBATIM) 231 232 add_custom_command( 233 COMMAND 234 - ${WL_SCANNER} client-header "${WL_PROTO_XML}" "${WL_PROTO_H}" 235 - OUTPUT "${WL_PROTO_H}" VERBATIM) 236 - 237 - list(APPEND MAIN_SOURCE_FILES 238 - ${WL_PROTO_C} 239 - ${WL_PROTO_H} 240 ) 241 - endforeach() 242 243 - endif() 244 - if(ANDROID) 245 - list(APPEND MAIN_SOURCE_FILES 246 - main/comp_window_android.c 247 - ) 248 - endif() 249 - 250 - add_library(comp_main STATIC ${MAIN_SOURCE_FILES}) 251 - target_link_libraries(comp_main PUBLIC xrt-interfaces PRIVATE aux_util aux_os aux_vk comp_util comp_render) 252 - target_include_directories(comp_main PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 253 - 254 - if(XRT_HAVE_WAYLAND) 255 - target_include_directories(comp_main SYSTEM PRIVATE ${WL_PROTOS_DIR}) 256 - target_link_libraries(comp_main PRIVATE 257 - ${WAYLAND_DEPS} ${WAYLAND_LIBRARIES} 258 - ) 259 - endif() 260 - if(XRT_HAVE_XCB) 261 - target_include_directories(comp_main SYSTEM PRIVATE ${XCB_INCLUDE_DIRS}) 262 - target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES}) 263 - endif() 264 265 - if(XRT_HAVE_XCB AND XRT_HAVE_XLIB) 266 - target_link_libraries(comp_main PRIVATE ${X11_X11_LIB}) 267 - endif() 268 - if(XRT_HAVE_EGL AND XRT_HAVE_XCB) 269 - target_include_directories(comp_main SYSTEM PRIVATE ${EGL_INCLUDE_DIRS}) 270 - target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES}) 271 endif() 272 if(ANDROID) 273 target_link_libraries(comp_main PRIVATE aux_ogl aux_android) 274 endif() 275 endif() 276 277 - 278 ### 279 # Multi client compositor library 280 # 281 282 - add_library(comp_multi STATIC ${MULTI_SOURCE_FILES}) 283 - target_link_libraries(comp_multi PUBLIC xrt-interfaces PRIVATE aux_util aux_os) 284 target_include_directories(comp_multi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 285 - 286 287 if(XRT_FEATURE_COMPOSITOR_MAIN) 288 target_link_libraries(comp_main PRIVATE comp_multi)
··· 1 # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 + ### 5 + # Client library 6 + # 7 8 + add_library(comp_client STATIC) 9 10 + target_link_libraries( 11 + comp_client 12 + PUBLIC xrt-interfaces 13 + PRIVATE aux_util 14 ) 15 + target_include_directories(comp_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 16 17 if(XRT_HAVE_VULKAN) 18 + target_sources( 19 + comp_client PRIVATE client/comp_vk_client.c client/comp_vk_client.h 20 + client/comp_vk_glue.c 21 ) 22 + target_link_libraries(comp_client PRIVATE aux_vk) 23 endif() 24 + 25 if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 26 + target_sources( 27 + comp_client 28 + PRIVATE client/comp_gl_client.c client/comp_gl_client.h 29 + client/comp_gl_memobj_swapchain.c client/comp_gl_memobj_swapchain.h 30 ) 31 + target_link_libraries(comp_client PRIVATE aux_ogl) 32 endif() 33 + 34 if(XRT_HAVE_OPENGL) 35 + target_sources(comp_client PRIVATE client/comp_gl_glue.c) 36 endif() 37 + 38 if(XRT_HAVE_OPENGLES) 39 + target_sources( 40 + comp_client PRIVATE client/comp_gles_glue.c client/comp_gl_eglimage_swapchain.c 41 + client/comp_gl_eglimage_swapchain.h 42 ) 43 endif() 44 + 45 if(XRT_HAVE_OPENGL_GLX AND XRT_HAVE_XLIB) 46 + target_sources( 47 + comp_client PRIVATE client/comp_gl_xlib_client.c client/comp_gl_xlib_client.h 48 + client/comp_gl_xlib_glue.c 49 ) 50 target_link_libraries(comp_client PRIVATE OpenGL::GLX) 51 endif() 52 53 + if(XRT_HAVE_EGL) 54 + target_sources(comp_client PRIVATE client/comp_egl_client.c client/comp_egl_client.h) 55 + endif() 56 57 ## 58 # Util library 59 # 60 61 if(XRT_HAVE_VULKAN) 62 + add_library( 63 + comp_util STATIC 64 + util/comp_base.h 65 + util/comp_base.c 66 + util/comp_swapchain.h 67 + util/comp_swapchain.c 68 + util/comp_sync.h 69 + util/comp_sync.c 70 + util/comp_vulkan.h 71 + util/comp_vulkan.c 72 + ) 73 + target_link_libraries( 74 + comp_util 75 + PUBLIC xrt-interfaces 76 + PRIVATE aux_util aux_os aux_vk 77 + ) 78 target_include_directories(comp_util PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 79 endif() 80 81 ## 82 # Render library 83 # 84 85 if(XRT_HAVE_VULKAN) 86 + spirv_shaders( 87 + SHADER_HEADERS 88 + shaders/clear.comp 89 + shaders/distortion.comp 90 + shaders/distortion_timewarp.comp 91 + shaders/mesh.frag 92 + shaders/mesh.vert 93 + shaders/layer.frag 94 + shaders/layer.vert 95 + shaders/equirect1.vert 96 + shaders/equirect1.frag 97 + shaders/equirect2.vert 98 + shaders/equirect2.frag 99 + ) 100 + 101 + add_library( 102 + comp_render STATIC 103 + ${SHADER_HEADERS} 104 + render/comp_buffer.c 105 + render/comp_compute.c 106 + render/comp_render.h 107 + render/comp_rendering.c 108 + render/comp_resources.c 109 + render/comp_shaders.c 110 + render/comp_util.c 111 ) 112 + target_link_libraries( 113 + comp_render 114 + PUBLIC xrt-interfaces 115 + PRIVATE aux_util aux_os aux_vk 116 + ) 117 + target_include_directories(comp_render PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 118 + # Shaders - marked SYSTEM so we get no warnings 119 + target_include_directories(comp_render SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) 120 121 add_subdirectory(shaders) 122 endif() 123 124 ## 125 # Main library ··· 127 128 if(XRT_FEATURE_COMPOSITOR_MAIN) 129 130 + add_library( 131 + comp_main STATIC 132 + main/comp_compositor.c 133 + main/comp_compositor.h 134 + main/comp_documentation.h 135 + main/comp_renderer.c 136 + main/comp_renderer.h 137 + main/comp_settings.c 138 + main/comp_settings.h 139 + main/comp_target.h 140 + main/comp_target_swapchain.c 141 + main/comp_target_swapchain.h 142 + main/comp_window.h 143 + main/comp_layer.h 144 + main/comp_layer.c 145 + main/comp_layer_renderer.h 146 + main/comp_layer_renderer.c 147 + ) 148 + target_link_libraries( 149 + comp_main 150 + PUBLIC xrt-interfaces 151 + PRIVATE 152 + aux_util 153 + aux_os 154 + aux_vk 155 + comp_util 156 + comp_render 157 + ) 158 + target_include_directories(comp_main PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 159 + 160 if(XRT_HAVE_XCB) 161 + target_sources(comp_main PRIVATE main/comp_window_xcb.c) 162 + target_include_directories(comp_main SYSTEM PRIVATE ${XCB_INCLUDE_DIRS}) 163 + target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES}) 164 + if(XRT_HAVE_EGL) 165 + target_include_directories(comp_main SYSTEM PRIVATE ${EGL_INCLUDE_DIRS}) 166 + target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES}) 167 + endif() 168 endif() 169 if(XRT_HAVE_XCB AND XRT_HAVE_XLIB) 170 + target_sources( 171 + comp_main PRIVATE main/comp_window_direct_randr.c 172 + main/comp_window_direct_nvidia.c 173 ) 174 + target_link_libraries(comp_main PRIVATE ${X11_X11_LIB}) 175 endif() 176 if(WIN32) 177 + target_sources(comp_main PRIVATE main/comp_window_mswin.c) 178 endif() 179 + if(VK_USE_PLATFORM_DISPLAY_KHR) 180 + target_sources(comp_main PRIVATE main/comp_window_vk_display.c) 181 endif() 182 + if(VK_USE_PLATFORM_DISPLAY_KHR OR XRT_HAVE_XCB) 183 + target_sources(comp_main PRIVATE main/comp_window_direct.c) 184 endif() 185 186 # generate wayland protocols 187 if(XRT_HAVE_WAYLAND) 188 + target_sources(comp_main PRIVATE main/comp_window_wayland.c) 189 pkg_get_variable(WL_PROTOS_PKG_DIR wayland-protocols pkgdatadir) 190 pkg_get_variable(WL_SCANNER wayland-scanner wayland_scanner) 191 192 set(WL_PROTOS_DIR "${CMAKE_CURRENT_BINARY_DIR}/wayland-protocols") 193 file(MAKE_DIRECTORY "${WL_PROTOS_DIR}") 194 195 + set(WL_PROTOS_XML ${WL_PROTOS_PKG_DIR}/stable/xdg-shell/xdg-shell.xml) 196 197 + target_include_directories(comp_main SYSTEM PRIVATE ${WL_PROTOS_DIR}) 198 + target_link_libraries(comp_main PRIVATE ${WAYLAND_LIBRARIES}) 199 200 + if(XRT_HAVE_WAYLAND_DIRECT) 201 + list( 202 + APPEND WL_PROTOS_XML 203 ${WL_PROTOS_PKG_DIR}/staging/drm-lease/drm-lease-v1.xml 204 ) 205 206 + target_sources(comp_main PRIVATE main/comp_window_direct_wayland.c) 207 + 208 + target_link_libraries(comp_main PRIVATE PkgConfig::LIBDRM) 209 endif() 210 211 + foreach(wl_proto_xml ${WL_PROTOS_XML}) 212 + get_filename_component(WL_PROTO ${wl_proto_xml} NAME_WE) 213 214 set(WL_PROTO_C "${WL_PROTOS_DIR}/${WL_PROTO}.c") 215 set(WL_PROTO_H "${WL_PROTOS_DIR}/${WL_PROTO}-client-protocol.h") 216 217 add_custom_command( 218 + OUTPUT "${WL_PROTO_C}" 219 COMMAND 220 + "${WL_SCANNER}" private-code "${wl_proto_xml}" 221 + "${WL_PROTO_C}" 222 + VERBATIM 223 + DEPENDS "${WL_SCANNER}" "${wl_proto_xml}" 224 + COMMENT "Generating ${WL_PROTO_C}" 225 + ) 226 227 add_custom_command( 228 + OUTPUT "${WL_PROTO_H}" 229 COMMAND 230 + "${WL_SCANNER}" client-header "${wl_proto_xml}" 231 + "${WL_PROTO_H}" 232 + VERBATIM 233 + DEPENDS "${WL_SCANNER}" "${wl_proto_xml}" 234 + COMMENT "Generating ${WL_PROTO_H}" 235 ) 236 237 + target_sources(comp_main PRIVATE ${WL_PROTO_C} ${WL_PROTO_H}) 238 + endforeach() 239 240 endif() 241 if(ANDROID) 242 + target_sources(comp_main PRIVATE main/comp_window_android.c) 243 target_link_libraries(comp_main PRIVATE aux_ogl aux_android) 244 endif() 245 endif() 246 247 ### 248 # Multi client compositor library 249 # 250 251 + add_library( 252 + comp_multi STATIC multi/comp_multi_compositor.c multi/comp_multi_interface.h 253 + multi/comp_multi_private.h multi/comp_multi_system.c 254 + ) 255 + target_link_libraries( 256 + comp_multi 257 + PUBLIC xrt-interfaces 258 + PRIVATE aux_util aux_os 259 + ) 260 target_include_directories(comp_multi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 261 262 if(XRT_FEATURE_COMPOSITOR_MAIN) 263 target_link_libraries(comp_main PRIVATE comp_multi)
+142 -112
src/xrt/drivers/CMakeLists.txt
··· 2 # 3 # SPDX-License-Identifier: BSL-1.0 4 5 - 6 set(ENABLED_HEADSET_DRIVERS) 7 set(ENABLED_DRIVERS) 8 9 if(XRT_BUILD_DRIVER_ARDUINO) 10 - add_library(drv_arduino STATIC 11 - arduino/arduino_device.c 12 - arduino/arduino_interface.h 13 - arduino/arduino_prober.c) 14 target_link_libraries(drv_arduino PRIVATE xrt-interfaces aux_util aux_os) 15 list(APPEND ENABLED_DRIVERS arduino) 16 endif() 17 18 if(XRT_BUILD_DRIVER_DAYDREAM) 19 - add_library(drv_daydream STATIC 20 - daydream/daydream_device.c 21 - daydream/daydream_device.h 22 - daydream/daydream_interface.h 23 - daydream/daydream_prober.c) 24 target_link_libraries(drv_daydream PRIVATE xrt-interfaces aux_util aux_os) 25 list(APPEND ENABLED_DRIVERS daydream) 26 endif() 27 28 if(XRT_BUILD_DRIVER_DEPTHAI) 29 - add_library(drv_depthai STATIC 30 - depthai/depthai_driver.cpp 31 - depthai/depthai_interface.h) 32 - target_link_libraries(drv_depthai PRIVATE 33 - xrt-interfaces 34 - aux_os 35 - ${OpenCV_LIBRARIES} 36 - depthai::opencv 37 - depthai::core 38 - XLink 39 ) 40 target_include_directories(drv_depthai PRIVATE ${OpenCV_INCLUDE_DIRS}) 41 list(APPEND ENABLED_DRIVERS depthai) 42 endif() 43 44 if(XRT_BUILD_DRIVER_DUMMY) 45 - add_library(drv_dummy STATIC 46 - dummy/dummy_hmd.c 47 - dummy/dummy_interface.h 48 - dummy/dummy_prober.c) 49 target_link_libraries(drv_dummy PRIVATE xrt-interfaces aux_util) 50 list(APPEND ENABLED_HEADSET_DRIVERS dummy) 51 endif() 52 53 if(XRT_BUILD_DRIVER_QWERTY) 54 - add_library(drv_qwerty STATIC 55 qwerty/qwerty_device.c 56 qwerty/qwerty_device.h 57 qwerty/qwerty_interface.h 58 qwerty/qwerty_prober.c 59 - qwerty/qwerty_sdl.c) 60 - target_link_libraries(drv_qwerty PRIVATE 61 - xrt-interfaces 62 - aux_util 63 - ${SDL2_LIBRARIES} 64 - ) 65 - target_include_directories(drv_qwerty PRIVATE 66 - ${SDL2_INCLUDE_DIRS} 67 ) 68 list(APPEND ENABLED_DRIVERS qwerty) 69 70 add_library(drv_qwerty_includes INTERFACE) ··· 72 endif() 73 74 if(XRT_BUILD_DRIVER_HDK) 75 - set(HDK_SOURCE_FILES 76 ) 77 - 78 - add_library(drv_hdk STATIC 79 - hdk/hdk_device.cpp 80 - hdk/hdk_device.h 81 - hdk/hdk_interface.h 82 - hdk/hdk_prober.c) 83 target_link_libraries(drv_hdk PRIVATE xrt-interfaces aux_math) 84 list(APPEND ENABLED_HEADSET_DRIVERS hdk) 85 endif() 86 87 - 88 if(XRT_BUILD_DRIVER_HYDRA) 89 - set(HYDRA_SOURCE_FILES 90 - ) 91 92 - add_library(drv_hydra STATIC 93 - hydra/hydra_driver.c 94 - hydra/hydra_interface.h) 95 target_link_libraries(drv_hydra PRIVATE xrt-interfaces aux_os) 96 list(APPEND ENABLED_DRIVERS hydra) 97 endif() 98 99 if(XRT_BUILD_DRIVER_NS) 100 - add_library(drv_ns STATIC 101 north_star/distortion_3d/utility_northstar.h 102 north_star/distortion_3d/deformation_northstar.h 103 north_star/distortion_3d/deformation_northstar.cpp 104 north_star/ns_hmd.h 105 north_star/ns_hmd.c 106 north_star/ns_interface.h 107 - north_star/ns_prober.c) 108 target_link_libraries(drv_ns PRIVATE xrt-interfaces aux_math xrt-external-cjson) 109 list(APPEND ENABLED_HEADSET_DRIVERS ns) 110 endif() 111 112 if(XRT_BUILD_DRIVER_ULV2) 113 - add_library(drv_ulv2 STATIC 114 - ultraleap_v2/ulv2_driver.cpp 115 - ultraleap_v2/ulv2_interface.h) 116 target_link_libraries(drv_ulv2 PRIVATE xrt-interfaces aux_util aux_math LeapV2::LeapV2) 117 endif() 118 119 if(XRT_BUILD_DRIVER_OHMD) 120 - add_library(drv_ohmd STATIC 121 - ohmd/oh_device.c 122 - ohmd/oh_device.h 123 - ohmd/oh_interface.h 124 - ohmd/oh_prober.c) 125 target_link_libraries(drv_ohmd PRIVATE xrt-interfaces OpenHMD::OpenHMD aux_util aux_math) 126 list(APPEND ENABLED_HEADSET_DRIVERS openhmd) 127 endif() 128 129 - 130 - 131 if(XRT_BUILD_DRIVER_PSMV) 132 - add_library(drv_psmv STATIC 133 - psmv/psmv_driver.c 134 - psmv/psmv_interface.h) 135 - target_link_libraries(drv_psmv PRIVATE xrt-interfaces PUBLIC aux_os aux_tracking) 136 list(APPEND ENABLED_DRIVERS psmv) 137 endif() 138 139 if(XRT_BUILD_DRIVER_PSVR) 140 - add_library(drv_psvr STATIC 141 psvr/psvr_device.c 142 psvr/psvr_device.h 143 psvr/psvr_interface.h 144 psvr/psvr_packet.c 145 - psvr/psvr_prober.c) 146 target_link_libraries(drv_psvr PRIVATE xrt-interfaces HIDAPI::hidapi aux_util) 147 target_include_directories(drv_psvr PRIVATE ${HIDAPI_INCLUDE_DIRS}) 148 list(APPEND ENABLED_HEADSET_DRIVERS psvr) 149 endif() 150 151 if(XRT_BUILD_DRIVER_RS) 152 - add_library(drv_rs STATIC 153 realsense/rs_ddev.c 154 realsense/rs_hdev.c 155 realsense/rs_prober.c 156 realsense/rs_driver.h 157 - realsense/rs_interface.h) 158 target_link_libraries(drv_rs PRIVATE xrt-interfaces realsense2::realsense2 aux_util) 159 list(APPEND ENABLED_HEADSET_DRIVERS rs) 160 endif() 161 162 if(XRT_BUILD_DRIVER_REMOTE) 163 - add_library(drv_remote STATIC 164 remote/r_device.c 165 remote/r_hmd.c 166 remote/r_hub.c 167 remote/r_interface.h 168 - remote/r_internal.h) 169 target_link_libraries(drv_remote PRIVATE xrt-interfaces aux_util) 170 list(APPEND ENABLED_HEADSET_DRIVERS remote) 171 endif() 172 173 set(VIVE_CONFIG_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/vive") 174 if(XRT_BUILD_DRIVER_VIVE) 175 - add_library(drv_vive STATIC 176 vive/vive_device.h 177 vive/vive_device.c 178 vive/vive_prober.h ··· 182 vive/vive_controller.h 183 vive/vive_controller.c 184 vive/vive_lighthouse.h 185 - vive/vive_lighthouse.c) 186 - target_link_libraries(drv_vive PRIVATE xrt-interfaces aux_os aux_util aux_math xrt-external-cjson aux_vive) 187 target_link_libraries(drv_vive PRIVATE ${ZLIB_LIBRARIES}) 188 target_include_directories(drv_vive PRIVATE ${ZLIB_INCLUDE_DIRS}) 189 list(APPEND ENABLED_HEADSET_DRIVERS vive) 190 191 - if (XRT_BUILD_DRIVER_HANDTRACKING) 192 target_link_libraries(drv_vive PRIVATE drv_ht) 193 endif() 194 endif() 195 196 if(XRT_HAVE_V4L2) 197 add_library(drv_v4l2 STATIC v4l2/v4l2_driver.c) 198 - target_link_libraries(drv_v4l2 PRIVATE 199 - xrt-interfaces 200 - aux_os 201 - aux_util 202 - ) 203 list(APPEND ENABLED_DRIVERS v4l2) 204 endif() 205 ··· 211 endif() 212 213 if(XRT_BUILD_DRIVER_HANDTRACKING) 214 - add_library(drv_ht STATIC 215 ht/ht_algorithm.cpp 216 ht/ht_driver.cpp 217 ht/ht_driver.hpp ··· 219 ht/ht_models.cpp 220 ht/ht_hand_math.cpp 221 ht/ht_image_math.cpp 222 - ht/ht_nms.cpp) 223 - target_link_libraries(drv_ht PRIVATE xrt-interfaces aux_os aux_util aux_math aux_gstreamer ONNXRuntime::ONNXRuntime ${OpenCV_LIBRARIES}) 224 target_include_directories(drv_ht PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR}) 225 list(APPEND ENABLED_DRIVERS ht) 226 endif() 227 228 - if (XRT_BUILD_DRIVER_SURVIVE) 229 - add_library(drv_survive STATIC 230 - survive/survive_driver.c 231 - survive/survive_driver.h 232 - survive/survive_interface.h 233 - survive/survive_prober.c) 234 - target_link_libraries(drv_survive PRIVATE xrt-interfaces aux_os aux_util aux_math aux_vive PkgConfig::SURVIVE) 235 list(APPEND ENABLED_HEADSET_DRIVERS survive) 236 237 - if (XRT_BUILD_DRIVER_HANDTRACKING) 238 target_link_libraries(drv_survive PRIVATE drv_ht) 239 endif() 240 endif() 241 242 if(XRT_BUILD_DRIVER_ANDROID) 243 - add_library(drv_android STATIC 244 - android/android_prober.c 245 - android/android_prober.h 246 - android/android_sensors.c 247 - android/android_sensors.h) 248 - target_link_libraries(drv_android PRIVATE xrt-interfaces aux_util aux_os aux_android ${ANDROID_LIBRARY}) 249 list(APPEND ENABLED_DRIVERS android) 250 endif() 251 252 - if (XRT_BUILD_DRIVER_ILLIXR) 253 - add_library(drv_illixr STATIC 254 illixr/illixr_device.cpp 255 illixr/illixr_interface.h 256 illixr/illixr_prober.c 257 illixr/illixr_component.cpp 258 - illixr/illixr_component.h) 259 target_link_libraries(drv_illixr PUBLIC ${CMAKE_DL_LIBS} xrt-interfaces aux_util aux_os) 260 target_include_directories(drv_illixr PUBLIC ${ILLIXR_PATH}) 261 list(APPEND ENABLED_HEADSET_DRIVERS illixr) 262 endif() 263 264 - add_library(drv_multi STATIC 265 - multi_wrapper/multi.c 266 - multi_wrapper/multi.h) 267 target_link_libraries(drv_multi PUBLIC xrt-interfaces aux_util) 268 list(APPEND ENABLED_HEADSET_DRIVERS drv_multi) 269 270 if(XRT_BUILD_DRIVER_WMR) 271 - add_library(drv_wmr STATIC 272 wmr/wmr_common.h 273 wmr/wmr_config.c 274 wmr/wmr_config.h ··· 277 wmr/wmr_interface.h 278 wmr/wmr_prober.c 279 wmr/wmr_protocol.c 280 - wmr/wmr_protocol.h) 281 target_link_libraries(drv_wmr PRIVATE xrt-interfaces aux_util aux_math xrt-external-cjson) 282 list(APPEND ENABLED_HEADSET_DRIVERS wmr) 283 endif() 284 285 if(XRT_BUILD_DRIVER_EUROC) 286 - add_library(drv_euroc STATIC 287 - euroc/euroc_player.cpp 288 - euroc/euroc_driver.h 289 - euroc/euroc_device.c 290 - euroc/euroc_interface.h) 291 - target_link_libraries(drv_euroc PRIVATE xrt-interfaces aux_util aux_tracking ${OpenCV_LIBRARIES}) 292 target_include_directories(drv_euroc PRIVATE ${OpenCV_INCLUDE_DIRS}) 293 list(APPEND ENABLED_DRIVERS euroc) 294 endif() ··· 296 if(XRT_BUILD_SAMPLES) 297 # We build the sample driver to make sure it stays valid, 298 # but it never gets linked into a final target. 299 - add_library(drv_sample STATIC 300 - sample/sample_hmd.c 301 - sample/sample_interface.h 302 - sample/sample_prober.c) 303 target_link_libraries(drv_sample PRIVATE xrt-interfaces aux_util) 304 endif() 305
··· 2 # 3 # SPDX-License-Identifier: BSL-1.0 4 5 set(ENABLED_HEADSET_DRIVERS) 6 set(ENABLED_DRIVERS) 7 + 8 + add_library(drv_includes INTERFACE) 9 + target_include_directories(drv_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 10 11 if(XRT_BUILD_DRIVER_ARDUINO) 12 + add_library( 13 + drv_arduino STATIC arduino/arduino_device.c arduino/arduino_interface.h 14 + arduino/arduino_prober.c 15 + ) 16 target_link_libraries(drv_arduino PRIVATE xrt-interfaces aux_util aux_os) 17 list(APPEND ENABLED_DRIVERS arduino) 18 endif() 19 20 if(XRT_BUILD_DRIVER_DAYDREAM) 21 + add_library( 22 + drv_daydream STATIC daydream/daydream_device.c daydream/daydream_device.h 23 + daydream/daydream_interface.h daydream/daydream_prober.c 24 + ) 25 target_link_libraries(drv_daydream PRIVATE xrt-interfaces aux_util aux_os) 26 list(APPEND ENABLED_DRIVERS daydream) 27 endif() 28 29 if(XRT_BUILD_DRIVER_DEPTHAI) 30 + add_library(drv_depthai STATIC depthai/depthai_driver.cpp depthai/depthai_interface.h) 31 + target_link_libraries( 32 + drv_depthai 33 + PRIVATE 34 + xrt-interfaces 35 + aux_os 36 + ${OpenCV_LIBRARIES} 37 + depthai::opencv 38 + depthai::core 39 + XLink 40 ) 41 target_include_directories(drv_depthai PRIVATE ${OpenCV_INCLUDE_DIRS}) 42 list(APPEND ENABLED_DRIVERS depthai) 43 endif() 44 45 if(XRT_BUILD_DRIVER_DUMMY) 46 + add_library(drv_dummy STATIC dummy/dummy_hmd.c dummy/dummy_interface.h dummy/dummy_prober.c) 47 target_link_libraries(drv_dummy PRIVATE xrt-interfaces aux_util) 48 list(APPEND ENABLED_HEADSET_DRIVERS dummy) 49 endif() 50 51 if(XRT_BUILD_DRIVER_QWERTY) 52 + add_library( 53 + drv_qwerty STATIC 54 qwerty/qwerty_device.c 55 qwerty/qwerty_device.h 56 qwerty/qwerty_interface.h 57 qwerty/qwerty_prober.c 58 + qwerty/qwerty_sdl.c 59 ) 60 + target_link_libraries(drv_qwerty PRIVATE xrt-interfaces aux_util ${SDL2_LIBRARIES}) 61 + target_include_directories(drv_qwerty PRIVATE ${SDL2_INCLUDE_DIRS}) 62 list(APPEND ENABLED_DRIVERS qwerty) 63 64 add_library(drv_qwerty_includes INTERFACE) ··· 66 endif() 67 68 if(XRT_BUILD_DRIVER_HDK) 69 + set(HDK_SOURCE_FILES) 70 + 71 + add_library( 72 + drv_hdk STATIC hdk/hdk_device.cpp hdk/hdk_device.h hdk/hdk_interface.h 73 + hdk/hdk_prober.c 74 ) 75 target_link_libraries(drv_hdk PRIVATE xrt-interfaces aux_math) 76 list(APPEND ENABLED_HEADSET_DRIVERS hdk) 77 endif() 78 79 if(XRT_BUILD_DRIVER_HYDRA) 80 + set(HYDRA_SOURCE_FILES) 81 82 + add_library(drv_hydra STATIC hydra/hydra_driver.c hydra/hydra_interface.h) 83 target_link_libraries(drv_hydra PRIVATE xrt-interfaces aux_os) 84 list(APPEND ENABLED_DRIVERS hydra) 85 endif() 86 87 if(XRT_BUILD_DRIVER_NS) 88 + add_library( 89 + drv_ns STATIC 90 north_star/distortion_3d/utility_northstar.h 91 north_star/distortion_3d/deformation_northstar.h 92 north_star/distortion_3d/deformation_northstar.cpp 93 north_star/ns_hmd.h 94 north_star/ns_hmd.c 95 north_star/ns_interface.h 96 + north_star/ns_prober.c 97 + ) 98 target_link_libraries(drv_ns PRIVATE xrt-interfaces aux_math xrt-external-cjson) 99 list(APPEND ENABLED_HEADSET_DRIVERS ns) 100 endif() 101 102 if(XRT_BUILD_DRIVER_ULV2) 103 + add_library(drv_ulv2 STATIC ultraleap_v2/ulv2_driver.cpp ultraleap_v2/ulv2_interface.h) 104 target_link_libraries(drv_ulv2 PRIVATE xrt-interfaces aux_util aux_math LeapV2::LeapV2) 105 endif() 106 107 if(XRT_BUILD_DRIVER_OHMD) 108 + add_library( 109 + drv_ohmd STATIC ohmd/oh_device.c ohmd/oh_device.h ohmd/oh_interface.h 110 + ohmd/oh_prober.c 111 + ) 112 target_link_libraries(drv_ohmd PRIVATE xrt-interfaces OpenHMD::OpenHMD aux_util aux_math) 113 list(APPEND ENABLED_HEADSET_DRIVERS openhmd) 114 endif() 115 116 if(XRT_BUILD_DRIVER_PSMV) 117 + add_library(drv_psmv STATIC psmv/psmv_driver.c psmv/psmv_interface.h) 118 + target_link_libraries( 119 + drv_psmv 120 + PRIVATE xrt-interfaces 121 + PUBLIC aux_os aux_tracking 122 + ) 123 list(APPEND ENABLED_DRIVERS psmv) 124 endif() 125 126 if(XRT_BUILD_DRIVER_PSVR) 127 + add_library( 128 + drv_psvr STATIC 129 psvr/psvr_device.c 130 psvr/psvr_device.h 131 psvr/psvr_interface.h 132 psvr/psvr_packet.c 133 + psvr/psvr_prober.c 134 + ) 135 target_link_libraries(drv_psvr PRIVATE xrt-interfaces HIDAPI::hidapi aux_util) 136 target_include_directories(drv_psvr PRIVATE ${HIDAPI_INCLUDE_DIRS}) 137 list(APPEND ENABLED_HEADSET_DRIVERS psvr) 138 endif() 139 140 if(XRT_BUILD_DRIVER_RS) 141 + add_library( 142 + drv_rs STATIC 143 realsense/rs_ddev.c 144 realsense/rs_hdev.c 145 realsense/rs_prober.c 146 realsense/rs_driver.h 147 + realsense/rs_interface.h 148 + ) 149 target_link_libraries(drv_rs PRIVATE xrt-interfaces realsense2::realsense2 aux_util) 150 list(APPEND ENABLED_HEADSET_DRIVERS rs) 151 endif() 152 153 if(XRT_BUILD_DRIVER_REMOTE) 154 + add_library( 155 + drv_remote STATIC 156 remote/r_device.c 157 remote/r_hmd.c 158 remote/r_hub.c 159 remote/r_interface.h 160 + remote/r_internal.h 161 + ) 162 target_link_libraries(drv_remote PRIVATE xrt-interfaces aux_util) 163 list(APPEND ENABLED_HEADSET_DRIVERS remote) 164 endif() 165 166 set(VIVE_CONFIG_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/vive") 167 if(XRT_BUILD_DRIVER_VIVE) 168 + add_library( 169 + drv_vive STATIC 170 vive/vive_device.h 171 vive/vive_device.c 172 vive/vive_prober.h ··· 176 vive/vive_controller.h 177 vive/vive_controller.c 178 vive/vive_lighthouse.h 179 + vive/vive_lighthouse.c 180 + ) 181 + target_link_libraries( 182 + drv_vive 183 + PRIVATE 184 + xrt-interfaces 185 + aux_os 186 + aux_util 187 + aux_math 188 + xrt-external-cjson 189 + aux_vive 190 + ) 191 target_link_libraries(drv_vive PRIVATE ${ZLIB_LIBRARIES}) 192 target_include_directories(drv_vive PRIVATE ${ZLIB_INCLUDE_DIRS}) 193 list(APPEND ENABLED_HEADSET_DRIVERS vive) 194 195 + if(XRT_BUILD_DRIVER_HANDTRACKING) 196 target_link_libraries(drv_vive PRIVATE drv_ht) 197 endif() 198 endif() 199 200 if(XRT_HAVE_V4L2) 201 add_library(drv_v4l2 STATIC v4l2/v4l2_driver.c) 202 + target_link_libraries(drv_v4l2 PRIVATE xrt-interfaces aux_os aux_util) 203 list(APPEND ENABLED_DRIVERS v4l2) 204 endif() 205 ··· 211 endif() 212 213 if(XRT_BUILD_DRIVER_HANDTRACKING) 214 + add_library( 215 + drv_ht STATIC 216 ht/ht_algorithm.cpp 217 ht/ht_driver.cpp 218 ht/ht_driver.hpp ··· 220 ht/ht_models.cpp 221 ht/ht_hand_math.cpp 222 ht/ht_image_math.cpp 223 + ht/ht_nms.cpp 224 + ) 225 + target_link_libraries( 226 + drv_ht 227 + PRIVATE 228 + xrt-interfaces 229 + aux_os 230 + aux_util 231 + aux_math 232 + aux_gstreamer 233 + ONNXRuntime::ONNXRuntime 234 + ${OpenCV_LIBRARIES} 235 + ) 236 target_include_directories(drv_ht PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR}) 237 list(APPEND ENABLED_DRIVERS ht) 238 endif() 239 240 + if(XRT_BUILD_DRIVER_SURVIVE) 241 + add_library( 242 + drv_survive STATIC survive/survive_driver.c survive/survive_driver.h 243 + survive/survive_interface.h survive/survive_prober.c 244 + ) 245 + target_link_libraries( 246 + drv_survive 247 + PRIVATE 248 + xrt-interfaces 249 + aux_os 250 + aux_util 251 + aux_math 252 + aux_vive 253 + PkgConfig::SURVIVE 254 + ) 255 list(APPEND ENABLED_HEADSET_DRIVERS survive) 256 257 + if(XRT_BUILD_DRIVER_HANDTRACKING) 258 target_link_libraries(drv_survive PRIVATE drv_ht) 259 endif() 260 endif() 261 262 if(XRT_BUILD_DRIVER_ANDROID) 263 + add_library( 264 + drv_android STATIC android/android_prober.c android/android_prober.h 265 + android/android_sensors.c android/android_sensors.h 266 + ) 267 + target_link_libraries( 268 + drv_android 269 + PRIVATE 270 + xrt-interfaces 271 + aux_util 272 + aux_os 273 + aux_android 274 + ${ANDROID_LIBRARY} 275 + ) 276 list(APPEND ENABLED_DRIVERS android) 277 endif() 278 279 + if(XRT_BUILD_DRIVER_ILLIXR) 280 + add_library( 281 + drv_illixr STATIC 282 illixr/illixr_device.cpp 283 illixr/illixr_interface.h 284 illixr/illixr_prober.c 285 illixr/illixr_component.cpp 286 + illixr/illixr_component.h 287 + ) 288 target_link_libraries(drv_illixr PUBLIC ${CMAKE_DL_LIBS} xrt-interfaces aux_util aux_os) 289 target_include_directories(drv_illixr PUBLIC ${ILLIXR_PATH}) 290 list(APPEND ENABLED_HEADSET_DRIVERS illixr) 291 endif() 292 293 + add_library(drv_multi STATIC multi_wrapper/multi.c multi_wrapper/multi.h) 294 target_link_libraries(drv_multi PUBLIC xrt-interfaces aux_util) 295 list(APPEND ENABLED_HEADSET_DRIVERS drv_multi) 296 297 if(XRT_BUILD_DRIVER_WMR) 298 + add_library( 299 + drv_wmr STATIC 300 wmr/wmr_common.h 301 wmr/wmr_config.c 302 wmr/wmr_config.h ··· 305 wmr/wmr_interface.h 306 wmr/wmr_prober.c 307 wmr/wmr_protocol.c 308 + wmr/wmr_protocol.h 309 + ) 310 target_link_libraries(drv_wmr PRIVATE xrt-interfaces aux_util aux_math xrt-external-cjson) 311 list(APPEND ENABLED_HEADSET_DRIVERS wmr) 312 endif() 313 314 if(XRT_BUILD_DRIVER_EUROC) 315 + add_library( 316 + drv_euroc STATIC euroc/euroc_player.cpp euroc/euroc_driver.h euroc/euroc_device.c 317 + euroc/euroc_interface.h 318 + ) 319 + target_link_libraries( 320 + drv_euroc PRIVATE xrt-interfaces aux_util aux_tracking ${OpenCV_LIBRARIES} 321 + ) 322 target_include_directories(drv_euroc PRIVATE ${OpenCV_INCLUDE_DIRS}) 323 list(APPEND ENABLED_DRIVERS euroc) 324 endif() ··· 326 if(XRT_BUILD_SAMPLES) 327 # We build the sample driver to make sure it stays valid, 328 # but it never gets linked into a final target. 329 + add_library( 330 + drv_sample STATIC sample/sample_hmd.c sample/sample_interface.h 331 + sample/sample_prober.c 332 + ) 333 target_link_libraries(drv_sample PRIVATE xrt-interfaces aux_util) 334 endif() 335
+3 -1
src/xrt/include/CMakeLists.txt
··· 4 add_subdirectory(xrt) 5 6 add_library(xrt-interfaces INTERFACE) 7 - target_include_directories(xrt-interfaces INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
··· 4 add_subdirectory(xrt) 5 6 add_library(xrt-interfaces INTERFACE) 7 + target_include_directories( 8 + xrt-interfaces INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} 9 + )
+9 -14
src/xrt/include/xrt/CMakeLists.txt
··· 1 - # Copyright 2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 # Generate a header containing defines for each enabled driver 5 set(FILE_CONTENTS "") 6 - foreach(DRIVER ${AVAILABLE_DRIVERS}) 7 - if(XRT_BUILD_DRIVER_${DRIVER}) 8 - string(APPEND FILE_CONTENTS "#define XRT_BUILD_DRIVER_${DRIVER}\n") 9 endif() 10 endforeach() 11 12 # First setup all of the config headers. 13 configure_file( 14 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_drivers.h.cmake_in 15 - ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_drivers.h 16 - @ONLY 17 ) 18 configure_file( 19 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_have.h.cmake_in 20 - ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_have.h 21 - @ONLY 22 ) 23 configure_file( 24 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_build.h.cmake_in 25 - ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_build.h 26 - @ONLY 27 ) 28 configure_file( 29 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_vulkan.h.cmake_in 30 - ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_vulkan.h 31 - @ONLY 32 ) 33 34 configure_file( 35 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_android.h.cmake_in 36 - ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_android.h 37 - @ONLY 38 )
··· 1 + # Copyright 2020-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 # Generate a header containing defines for each enabled driver 5 set(FILE_CONTENTS "") 6 + foreach(driver ${AVAILABLE_DRIVERS}) 7 + if(XRT_BUILD_DRIVER_${driver}) 8 + string(APPEND FILE_CONTENTS "#define XRT_BUILD_DRIVER_${driver}\n") 9 endif() 10 endforeach() 11 12 # First setup all of the config headers. 13 configure_file( 14 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_drivers.h.cmake_in 15 + ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_drivers.h @ONLY 16 ) 17 configure_file( 18 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_have.h.cmake_in 19 + ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_have.h @ONLY 20 ) 21 configure_file( 22 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_build.h.cmake_in 23 + ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_build.h @ONLY 24 ) 25 configure_file( 26 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_vulkan.h.cmake_in 27 + ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_vulkan.h @ONLY 28 ) 29 30 configure_file( 31 ${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_android.h.cmake_in 32 + ${CMAKE_CURRENT_BINARY_DIR}/xrt_config_android.h @ONLY 33 )
+63 -81
src/xrt/ipc/CMakeLists.txt
··· 1 - # Copyright 2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 - 4 5 ### 6 # Generator 7 8 - function(proto_gen output) 9 - add_custom_command(OUTPUT ${output} 10 - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py 11 ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json 12 - ${output} 13 - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py 14 ${CMAKE_CURRENT_SOURCE_DIR}/shared/ipcproto/common.py 15 ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json 16 - ) 17 - endfunction(proto_gen) 18 - 19 - proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_protocol_generated.h) 20 - proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.h) 21 - proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.c) 22 - proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.h) 23 - proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.c) 24 25 set(IPC_COMMON_SOURCES 26 - ${CMAKE_CURRENT_BINARY_DIR}/ipc_protocol_generated.h 27 - shared/ipc_shmem.c 28 - shared/ipc_shmem.h 29 - shared/ipc_utils.c 30 - shared/ipc_utils.h) 31 ### 32 # Client 33 34 - add_library(ipc_client STATIC 35 ${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.c 36 ${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.h 37 - ${IPC_COMMON_SOURCES} 38 client/ipc_client.h 39 client/ipc_client_compositor.c 40 client/ipc_client_device.c 41 client/ipc_client_hmd.c 42 client/ipc_client_instance.c 43 ) 44 - target_include_directories(ipc_client INTERFACE 45 - ${CMAKE_CURRENT_SOURCE_DIR} 46 - ${CMAKE_CURRENT_BINARY_DIR} 47 - ) 48 - target_include_directories(ipc_client PRIVATE 49 - ${CMAKE_CURRENT_SOURCE_DIR} 50 - ${CMAKE_CURRENT_BINARY_DIR} 51 - ) 52 - target_link_libraries(ipc_client PRIVATE 53 - aux_util 54 ) 55 - if(ANDROID) 56 - endif() 57 58 ### 59 # Server 60 61 - add_library(ipc_server STATIC 62 ${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.c 63 ${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.h 64 - ${IPC_COMMON_SOURCES} 65 server/ipc_server.h 66 server/ipc_server_handler.c 67 server/ipc_server_per_client_thread.c 68 server/ipc_server_process.c 69 ) 70 - target_include_directories(ipc_server 71 - INTERFACE 72 - ${CMAKE_CURRENT_SOURCE_DIR} 73 - ${CMAKE_CURRENT_BINARY_DIR} 74 - ) 75 - target_include_directories(ipc_server PRIVATE 76 - ${CMAKE_CURRENT_SOURCE_DIR}/../compositor 77 - ${CMAKE_CURRENT_SOURCE_DIR} 78 - ${CMAKE_CURRENT_BINARY_DIR} 79 - ) 80 - target_link_libraries(ipc_server PRIVATE 81 - aux_util 82 ) 83 - 84 - if(RT_LIBRARY) 85 - target_link_libraries(ipc_client PRIVATE 86 - ${RT_LIBRARY} 87 - ) 88 - target_link_libraries(ipc_server PRIVATE 89 - ${RT_LIBRARY} 90 - ) 91 - endif() 92 93 if(XRT_HAVE_SYSTEMD) 94 - target_include_directories(ipc_server PRIVATE 95 - ${SYSTEMD_INCLUDE_DIRS}) 96 - target_link_libraries(ipc_server PRIVATE 97 - ${SYSTEMD_LIBRARIES}) 98 endif() 99 100 if(ANDROID) 101 - add_library(ipc_android STATIC 102 android/ipc_client_android.cpp 103 android/ipc_client_android.h 104 android/org.freedesktop.monado.ipc.cpp 105 android/org.freedesktop.monado.ipc.hpp 106 android/org.freedesktop.monado.ipc.impl.hpp 107 ) 108 - target_link_libraries(ipc_android PUBLIC 109 - xrt-external-jni-wrap 110 - xrt-external-jnipp 111 - aux_android 112 ) 113 - target_sources(ipc_server PRIVATE 114 - ${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_android.c 115 - ) 116 - target_link_libraries(ipc_server PUBLIC 117 - ${ANDROID_LIBRARY} 118 - PRIVATE 119 - aux_android 120 - ipc_android 121 ) 122 - target_link_libraries(ipc_client PUBLIC 123 - ${ANDROID_LIBRARY} 124 - PRIVATE 125 - aux_android 126 - ipc_android 127 ) 128 elseif(XRT_HAVE_LINUX) 129 - target_sources(ipc_server PRIVATE 130 - ${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_linux.c 131 ) 132 endif()
··· 1 + # Copyright 2020-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 ### 5 # Generator 6 7 + foreach( 8 + fn 9 + ipc_protocol_generated.h 10 + ipc_client_generated.h 11 + ipc_client_generated.c 12 + ipc_server_generated.h 13 + ipc_server_generated.c 14 + ) 15 + add_custom_command( 16 + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${fn}" 17 + COMMAND 18 + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py 19 ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json 20 + "${CMAKE_CURRENT_BINARY_DIR}/${fn}" 21 + VERBATIM 22 + DEPENDS 23 + ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py 24 ${CMAKE_CURRENT_SOURCE_DIR}/shared/ipcproto/common.py 25 ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json 26 + COMMENT "Generating ${fn} from protocol JSON description" 27 + ) 28 + endforeach() 29 30 set(IPC_COMMON_SOURCES 31 + ${CMAKE_CURRENT_BINARY_DIR}/ipc_protocol_generated.h 32 + shared/ipc_shmem.c 33 + shared/ipc_shmem.h 34 + shared/ipc_utils.c 35 + shared/ipc_utils.h 36 + ) 37 + 38 + add_library(ipc_shared STATIC ${IPC_COMMON_SOURCES}) 39 + target_include_directories( 40 + ipc_shared PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} 41 + ) 42 + target_link_libraries(ipc_shared PRIVATE aux_util) 43 + 44 + if(RT_LIBRARY) 45 + target_link_libraries(ipc_shared PUBLIC ${RT_LIBRARY}) 46 + endif() 47 + 48 ### 49 # Client 50 51 + add_library( 52 + ipc_client STATIC 53 ${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.c 54 ${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.h 55 client/ipc_client.h 56 client/ipc_client_compositor.c 57 client/ipc_client_device.c 58 client/ipc_client_hmd.c 59 client/ipc_client_instance.c 60 ) 61 + target_include_directories( 62 + ipc_client PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} 63 ) 64 + target_link_libraries(ipc_client PRIVATE aux_util ipc_shared) 65 66 ### 67 # Server 68 69 + add_library( 70 + ipc_server STATIC 71 ${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.c 72 ${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.h 73 server/ipc_server.h 74 server/ipc_server_handler.c 75 server/ipc_server_per_client_thread.c 76 server/ipc_server_process.c 77 ) 78 + target_include_directories( 79 + ipc_server 80 + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} 81 + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} 82 ) 83 + target_link_libraries(ipc_server PRIVATE aux_util ipc_shared) 84 85 if(XRT_HAVE_SYSTEMD) 86 + target_include_directories(ipc_server PRIVATE ${SYSTEMD_INCLUDE_DIRS}) 87 + target_link_libraries(ipc_server PRIVATE ${SYSTEMD_LIBRARIES}) 88 endif() 89 90 if(ANDROID) 91 + add_library( 92 + ipc_android STATIC 93 android/ipc_client_android.cpp 94 android/ipc_client_android.h 95 android/org.freedesktop.monado.ipc.cpp 96 android/org.freedesktop.monado.ipc.hpp 97 android/org.freedesktop.monado.ipc.impl.hpp 98 ) 99 + target_link_libraries( 100 + ipc_android PUBLIC xrt-external-jni-wrap xrt-external-jnipp aux_android 101 ) 102 + target_sources( 103 + ipc_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_android.c 104 ) 105 + target_link_libraries( 106 + ipc_shared 107 + PUBLIC ${ANDROID_LIBRARY} 108 + PRIVATE aux_android ipc_android 109 ) 110 elseif(XRT_HAVE_LINUX) 111 + target_sources( 112 + ipc_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_linux.c 113 ) 114 endif()
+14 -11
src/xrt/state_trackers/gui/CMakeLists.txt
··· 23 gui_window_record.h 24 ) 25 26 - target_link_libraries(st_gui PRIVATE xrt-external-stb aux_util aux_os aux_ogl) 27 - target_include_directories(st_gui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../drivers) 28 29 if(XRT_HAVE_GST) 30 - target_link_libraries(st_gui PRIVATE 31 - aux_gstreamer 32 - ) 33 endif() 34 35 if(XRT_BUILD_DRIVER_DEPTHAI) 36 - target_link_libraries(st_gui PRIVATE 37 - drv_depthai 38 - ) 39 endif() 40 41 if(XRT_BUILD_DRIVER_REMOTE) 42 - target_link_libraries(st_gui PRIVATE 43 - drv_remote 44 - ) 45 endif() 46 47 if(XRT_HAVE_SDL2)
··· 23 gui_window_record.h 24 ) 25 26 + target_link_libraries( 27 + st_gui 28 + PRIVATE 29 + xrt-external-stb 30 + aux_util 31 + aux_os 32 + aux_ogl 33 + drv_includes 34 + xrt-external-imgui 35 + ) 36 + target_include_directories(st_gui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/..) 37 38 if(XRT_HAVE_GST) 39 + target_link_libraries(st_gui PRIVATE aux_gstreamer) 40 endif() 41 42 if(XRT_BUILD_DRIVER_DEPTHAI) 43 + target_link_libraries(st_gui PRIVATE drv_depthai) 44 endif() 45 46 if(XRT_BUILD_DRIVER_REMOTE) 47 + target_link_libraries(st_gui PRIVATE drv_remote) 48 endif() 49 50 if(XRT_HAVE_SDL2)
+32 -48
src/xrt/state_trackers/oxr/CMakeLists.txt
··· 1 - # Copyright 2019-2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 ### 5 # Main code 6 # 7 8 - set(OXR_SOURCE_FILES 9 oxr_api_action.c 10 oxr_api_funcs.h 11 oxr_api_instance.c ··· 39 ) 40 41 if(XRT_HAVE_VULKAN) 42 - list(APPEND OXR_SOURCE_FILES 43 - oxr_session_gfx_vk.c 44 - oxr_swapchain_vk.c 45 - oxr_vulkan.c 46 - ) 47 endif() 48 49 if(XRT_HAVE_OPENGL) 50 - add_definitions(-DXR_USE_GRAPHICS_API_OPENGL) 51 endif() 52 if(XRT_HAVE_OPENGLES) 53 - add_definitions(-DXR_USE_GRAPHICS_API_OPENGL_ES) 54 endif() 55 56 if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 57 - list(APPEND OXR_SOURCE_FILES 58 - oxr_session_gfx_gl.c 59 - oxr_swapchain_gl.c 60 - ) 61 endif() 62 63 if(XRT_HAVE_XLIB) 64 - add_definitions(-DXR_USE_PLATFORM_XLIB) 65 endif() 66 67 if(XRT_HAVE_EGL) 68 - add_definitions(-DXR_USE_PLATFORM_EGL) 69 - list(APPEND OXR_SOURCE_FILES 70 - oxr_session_gfx_egl.c 71 - ) 72 endif() 73 74 - 75 if(ANDROID) 76 - add_definitions(-DXR_USE_PLATFORM_ANDROID) 77 - list(APPEND OXR_SOURCE_FILES 78 - oxr_session_gfx_gles_android.c 79 - ) 80 - endif() 81 - 82 - add_library(st_oxr STATIC ${OXR_SOURCE_FILES}) 83 - target_link_libraries(st_oxr PRIVATE 84 - xrt-interfaces 85 - xrt-external-openxr 86 - aux_util 87 - aux_math 88 - aux_generated_bindings 89 - comp_client 90 - aux-includes 91 - PUBLIC 92 - aux_os 93 - ) 94 - if(XRT_HAVE_VULKAN) 95 - target_link_libraries(st_oxr PUBLIC Vulkan::Vulkan) 96 - endif() 97 - if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 98 - target_link_libraries(st_oxr PUBLIC aux_ogl) 99 - endif() 100 - if(ANDROID) 101 target_link_libraries(st_oxr PRIVATE aux_android) 102 endif() 103 - target_include_directories(st_oxr 104 PRIVATE 105 - ${CMAKE_CURRENT_BINARY_DIR} 106 - INTERFACE 107 - ${CMAKE_CURRENT_SOURCE_DIR}/..)
··· 1 + # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 ### 5 # Main code 6 # 7 8 + add_library( 9 + st_oxr STATIC 10 oxr_api_action.c 11 oxr_api_funcs.h 12 oxr_api_instance.c ··· 40 ) 41 42 if(XRT_HAVE_VULKAN) 43 + target_sources(st_oxr PRIVATE oxr_session_gfx_vk.c oxr_swapchain_vk.c oxr_vulkan.c) 44 + target_link_libraries(st_oxr PUBLIC Vulkan::Vulkan) 45 endif() 46 47 if(XRT_HAVE_OPENGL) 48 + target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_OPENGL) 49 endif() 50 if(XRT_HAVE_OPENGLES) 51 + target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_OPENGL_ES) 52 endif() 53 54 if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES) 55 + target_sources(st_oxr PRIVATE oxr_session_gfx_gl.c oxr_swapchain_gl.c) 56 + target_link_libraries(st_oxr PUBLIC aux_ogl) 57 endif() 58 59 if(XRT_HAVE_XLIB) 60 + target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_XLIB) 61 endif() 62 63 if(XRT_HAVE_EGL) 64 + target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_EGL) 65 + target_sources(st_oxr PRIVATE oxr_session_gfx_egl.c) 66 endif() 67 68 if(ANDROID) 69 + target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_ANDROID) 70 + target_sources(st_oxr PRIVATE oxr_session_gfx_gles_android.c) 71 target_link_libraries(st_oxr PRIVATE aux_android) 72 endif() 73 + 74 + target_link_libraries( 75 + st_oxr 76 PRIVATE 77 + xrt-interfaces 78 + xrt-external-openxr 79 + aux_util 80 + aux_math 81 + aux_generated_bindings 82 + comp_client 83 + aux-includes 84 + PUBLIC aux_os 85 + ) 86 + 87 + target_include_directories( 88 + st_oxr 89 + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} 90 + INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/.. 91 + )
+26 -68
src/xrt/state_trackers/prober/CMakeLists.txt
··· 1 - # Copyright 2019-2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 - set(PROBER_INCLUDES) 5 - 6 - set(PROBER_SOURCE_FILES 7 p_documentation.h 8 p_dump.c 9 p_prober.c ··· 11 p_tracking.c 12 ) 13 14 # Add libudev 15 if(XRT_HAVE_LIBUDEV) 16 - list(APPEND PROBER_SOURCE_FILES 17 - p_udev.c 18 - ) 19 endif() 20 21 # Add libusb 22 if(XRT_HAVE_LIBUSB) 23 - list(APPEND PROBER_SOURCE_FILES 24 - p_libusb.c 25 - ) 26 endif() 27 28 # Add libuvc 29 if(XRT_HAVE_LIBUVC) 30 - list(APPEND PROBER_SOURCE_FILES 31 - p_libuvc.c 32 - ) 33 - endif() 34 - 35 - add_library(st_prober STATIC 36 - ${PROBER_SOURCE_FILES} 37 - ) 38 - target_link_libraries(st_prober PUBLIC 39 - xrt-interfaces 40 - ) 41 - target_link_libraries(st_prober PRIVATE 42 - drv_multi 43 - aux_util 44 - aux_os 45 - aux_tracking 46 - ) 47 - target_include_directories(st_prober PRIVATE 48 - ${CMAKE_CURRENT_SOURCE_DIR}/../../drivers 49 - ) 50 - 51 - if(XRT_HAVE_LIBUDEV) 52 - target_include_directories(st_prober 53 - PRIVATE 54 - ${UDEV_INCLUDE_DIRS} 55 - ) 56 - target_link_libraries(st_prober PRIVATE 57 - ${UDEV_LIBRARIES} 58 - ) 59 - endif() 60 - 61 - if(XRT_HAVE_LIBUSB) 62 - target_include_directories(st_prober 63 - PUBLIC 64 - ${LIBUSB1_INCLUDE_DIRS} 65 - ) 66 - target_link_libraries(st_prober PRIVATE 67 - ${LIBUSB1_LIBRARIES} 68 - ) 69 - endif() 70 - 71 - if(XRT_HAVE_LIBUVC) 72 - target_include_directories(st_prober 73 - PRIVATE 74 - ${LIBUVC_INCLUDES} 75 - ) 76 - target_link_libraries(st_prober PRIVATE 77 - ${LIBUVC_LIBRARIES} 78 - ) 79 endif() 80 81 if(XRT_HAVE_V4L2) 82 # Uses v4l2_fs_create 83 - target_link_libraries(st_prober PRIVATE 84 - drv_v4l2 85 - ) 86 endif() 87 88 if(XRT_BUILD_DRIVER_REMOTE) 89 - target_link_libraries(st_prober PRIVATE 90 - drv_remote 91 - ) 92 endif() 93 94 if(XRT_BUILD_DRIVER_VF) 95 - target_link_libraries(st_prober PRIVATE 96 - drv_vf 97 - ) 98 endif()
··· 1 + # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 + add_library( 5 + st_prober STATIC 6 p_documentation.h 7 p_dump.c 8 p_prober.c ··· 10 p_tracking.c 11 ) 12 13 + target_link_libraries(st_prober PUBLIC xrt-interfaces) 14 + target_link_libraries( 15 + st_prober 16 + PRIVATE 17 + drv_includes 18 + drv_multi 19 + aux_util 20 + aux_os 21 + aux_tracking 22 + ) 23 + 24 # Add libudev 25 if(XRT_HAVE_LIBUDEV) 26 + target_sources(st_prober PRIVATE p_udev.c) 27 + target_include_directories(st_prober PRIVATE ${UDEV_INCLUDE_DIRS}) 28 + target_link_libraries(st_prober PRIVATE ${UDEV_LIBRARIES}) 29 endif() 30 31 # Add libusb 32 if(XRT_HAVE_LIBUSB) 33 + target_sources(st_prober PRIVATE p_libusb.c) 34 + target_include_directories(st_prober PUBLIC ${LIBUSB1_INCLUDE_DIRS}) 35 + target_link_libraries(st_prober PRIVATE ${LIBUSB1_LIBRARIES}) 36 endif() 37 38 # Add libuvc 39 if(XRT_HAVE_LIBUVC) 40 + target_sources(st_prober PRIVATE p_libuvc.c) 41 + target_include_directories(st_prober PRIVATE ${LIBUVC_INCLUDES}) 42 + target_link_libraries(st_prober PRIVATE ${LIBUVC_LIBRARIES}) 43 endif() 44 45 if(XRT_HAVE_V4L2) 46 # Uses v4l2_fs_create 47 + target_link_libraries(st_prober PRIVATE drv_v4l2) 48 endif() 49 50 if(XRT_BUILD_DRIVER_REMOTE) 51 + target_link_libraries(st_prober PRIVATE drv_remote) 52 endif() 53 54 if(XRT_BUILD_DRIVER_VF) 55 + target_link_libraries(st_prober PRIVATE drv_vf) 56 endif()
+5 -16
src/xrt/state_trackers/steamvr_drv/CMakeLists.txt
··· 1 - # Copyright 2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 - set(OVRD_SOURCE_FILES 5 - ovrd_driver.cpp 6 - ovrd_interface.h 7 - ) 8 9 - add_library(st_ovrd STATIC 10 - ${OVRD_SOURCE_FILES} 11 - ) 12 - target_include_directories(st_ovrd INTERFACE 13 - ${CMAKE_CURRENT_SOURCE_DIR} 14 - ) 15 - target_link_libraries(st_ovrd PRIVATE 16 - xrt-interfaces 17 - xrt-external-openvr 18 - aux_math 19 - aux_generated_bindings 20 )
··· 1 + # Copyright 2020-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 + add_library(st_ovrd STATIC ovrd_driver.cpp ovrd_interface.h) 5 6 + target_include_directories(st_ovrd INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 7 + target_link_libraries( 8 + st_ovrd PRIVATE xrt-interfaces xrt-external-openvr aux_math aux_generated_bindings 9 )
-1
src/xrt/targets/CMakeLists.txt
··· 5 # This is where we collect all of the pieces from the different parts of 6 # the source tree and build a complete driver or integration part. 7 8 - 9 add_subdirectory(common) 10 11 if(XRT_FEATURE_OPENXR)
··· 5 # This is where we collect all of the pieces from the different parts of 6 # the source tree and build a complete driver or integration part. 7 8 add_subdirectory(common) 9 10 if(XRT_FEATURE_OPENXR)
+7 -23
src/xrt/targets/cli/CMakeLists.txt
··· 4 ###### 5 # Create a cli interface for Monado. 6 7 - 8 - set(SOURCE_FILES 9 cli_cmd_lighthouse.c 10 cli_cmd_probe.c 11 cli_cmd_test.c 12 cli_common.h 13 cli_main.c 14 ) 15 16 if(NOT WIN32) 17 # No getline on Windows, so until we have a portable impl 18 - list(APPEND SOURCE_FILES 19 - cli_cmd_calibrate.c 20 - ) 21 endif() 22 23 - add_executable(cli 24 - ${SOURCE_FILES} 25 - ) 26 - add_sanitizers(cli) 27 - 28 - set_target_properties(cli PROPERTIES 29 - OUTPUT_NAME monado-cli 30 - PREFIX "" 31 - ) 32 33 - target_link_libraries(cli PRIVATE 34 - aux_os 35 - aux_util 36 - aux_math 37 - target_instance_no_comp 38 - ) 39 40 - install(TARGETS cli 41 - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 42 - )
··· 4 ###### 5 # Create a cli interface for Monado. 6 7 + add_executable( 8 + cli 9 cli_cmd_lighthouse.c 10 cli_cmd_probe.c 11 cli_cmd_test.c 12 cli_common.h 13 cli_main.c 14 ) 15 + add_sanitizers(cli) 16 17 if(NOT WIN32) 18 # No getline on Windows, so until we have a portable impl 19 + target_sources(cli PRIVATE cli_cmd_calibrate.c) 20 endif() 21 22 + set_target_properties(cli PROPERTIES OUTPUT_NAME monado-cli PREFIX "") 23 24 + target_link_libraries(cli PRIVATE aux_os aux_util aux_math target_instance_no_comp) 25 26 + install(TARGETS cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+30 -43
src/xrt/targets/common/CMakeLists.txt
··· 1 - # Copyright 2019-2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 - 4 5 #### 6 # Lists 7 # 8 9 - add_library(target_lists STATIC 10 - target_lists.c 11 ) 12 - target_link_libraries(target_lists PRIVATE 13 - xrt-interfaces 14 - aux_util # TODO Remove this after removing #include "util/u_time.h" from xrt_defines.h 15 - ) 16 - target_include_directories(target_lists PRIVATE 17 - ${CMAKE_CURRENT_SOURCE_DIR}/../../drivers 18 - ) 19 - target_include_directories(target_lists PUBLIC 20 - ${CMAKE_CURRENT_SOURCE_DIR} 21 - ) 22 23 if(XRT_BUILD_DRIVER_ARDUINO) 24 target_link_libraries(target_lists PRIVATE drv_arduino) ··· 114 # Instance 115 # 116 if(XRT_FEATURE_COMPOSITOR_MAIN) 117 - add_library(target_instance STATIC 118 - target_instance.c 119 - ) 120 - target_link_libraries(target_instance PRIVATE 121 - xrt-interfaces 122 - aux_util 123 - st_prober 124 - target_lists 125 - comp_main 126 - ) 127 - target_include_directories(target_instance PRIVATE 128 - ${CMAKE_CURRENT_SOURCE_DIR}/../../drivers 129 - ) 130 - target_include_directories(target_instance PUBLIC 131 - ${CMAKE_CURRENT_SOURCE_DIR} 132 ) 133 endif() 134 135 #### 136 # Instance without Compositor 137 # 138 139 - add_library(target_instance_no_comp STATIC 140 - target_instance_no_comp.c 141 ) 142 - target_link_libraries(target_instance_no_comp PRIVATE 143 - xrt-interfaces 144 - aux_util 145 - st_prober 146 - target_lists 147 - ) 148 - target_include_directories(target_instance_no_comp PRIVATE 149 - ${CMAKE_CURRENT_SOURCE_DIR}/../../drivers 150 - ) 151 - target_include_directories(target_instance_no_comp PUBLIC 152 - ${CMAKE_CURRENT_SOURCE_DIR} 153 - )
··· 1 + # Copyright 2019-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 #### 5 # Lists 6 # 7 8 + add_library(target_lists STATIC target_lists.c) 9 + target_link_libraries( 10 + target_lists 11 + PRIVATE 12 + xrt-interfaces 13 + aux_util # TODO Remove this after removing #include "util/u_time.h" from xrt_defines.h 14 + drv_includes 15 ) 16 + target_include_directories(target_lists PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 17 18 if(XRT_BUILD_DRIVER_ARDUINO) 19 target_link_libraries(target_lists PRIVATE drv_arduino) ··· 109 # Instance 110 # 111 if(XRT_FEATURE_COMPOSITOR_MAIN) 112 + add_library(target_instance STATIC target_instance.c) 113 + target_link_libraries( 114 + target_instance 115 + PRIVATE 116 + xrt-interfaces 117 + aux_util 118 + st_prober 119 + target_lists 120 + comp_main 121 + drv_includes 122 ) 123 + target_include_directories(target_instance PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 124 endif() 125 126 #### 127 # Instance without Compositor 128 # 129 130 + add_library(target_instance_no_comp STATIC target_instance_no_comp.c) 131 + target_link_libraries( 132 + target_instance_no_comp 133 + PRIVATE 134 + xrt-interfaces 135 + aux_util 136 + st_prober 137 + target_lists 138 + drv_includes 139 ) 140 + target_include_directories(target_instance_no_comp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+4 -15
src/xrt/targets/ctl/CMakeLists.txt
··· 1 # Copyright 2020-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 - 5 - add_executable(monado-ctl 6 - main.c 7 - ) 8 add_sanitizers(monado-ctl) 9 10 - target_include_directories(monado-ctl PRIVATE 11 - ipc 12 - ) 13 14 - target_link_libraries(monado-ctl PRIVATE 15 - aux_util 16 - ipc_client 17 - ) 18 19 - install(TARGETS monado-ctl 20 - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 21 - ) 22 -
··· 1 # Copyright 2020-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 + add_executable(monado-ctl main.c) 5 add_sanitizers(monado-ctl) 6 7 + target_include_directories(monado-ctl PRIVATE ipc) 8 9 + target_link_libraries(monado-ctl PRIVATE aux_util ipc_client) 10 11 + install(TARGETS monado-ctl RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+8 -7
src/xrt/targets/gui/CMakeLists.txt
··· 11 12 target_link_libraries( 13 gui 14 - PRIVATE aux_os 15 - aux_ogl 16 - aux_util 17 - aux_math 18 - st_gui 19 - target_instance_no_comp 20 - xrt-external-imgui-sdl2 21 ) 22 if(WIN32) 23 target_link_libraries(gui PRIVATE SDL2::SDL2main)
··· 11 12 target_link_libraries( 13 gui 14 + PRIVATE 15 + aux_os 16 + aux_ogl 17 + aux_util 18 + aux_math 19 + st_gui 20 + target_instance_no_comp 21 + xrt-external-imgui-sdl2 22 ) 23 if(WIN32) 24 target_link_libraries(gui PRIVATE SDL2::SDL2main)
+56 -63
src/xrt/targets/openxr/CMakeLists.txt
··· 7 set(RUNTIME_BARE_SUFFIX monado) 8 set(RUNTIME_SUFFIX _${RUNTIME_BARE_SUFFIX}) 9 10 - set(RUNTIME_TARGET ${RUNTIME_PREFIX}openxr${RUNTIME_SUFFIX} CACHE INTERNAL "" FORCE) 11 12 # OpenXR 1.0 13 set(XR_API_MAJOR "1") 14 15 - set(SOURCE_FILES 16 - target.c 17 - oxr_sdl2_hack.c 18 - libopenxr.def 19 - ) 20 - 21 - # depends on above generated files 22 - add_library(${RUNTIME_TARGET} MODULE 23 - ${MANIFEST_DEV_PATH} 24 - ${MANIFEST_PATH} 25 - ${SOURCE_FILES} 26 - ) 27 28 # Note: Order may matter in these lists! 29 - target_link_libraries(${RUNTIME_TARGET} PUBLIC 30 - aux_vk 31 - aux_os 32 - aux_util 33 - aux_math 34 - ) 35 - 36 - if(XRT_HAVE_OPENGL) 37 - target_link_libraries(${RUNTIME_TARGET} PUBLIC aux_ogl) 38 - endif() 39 - 40 - if(XRT_HAVE_SDL2) 41 - target_link_libraries(${RUNTIME_TARGET} PRIVATE st_gui xrt-external-imgui-sdl2 ${SDL2_LIBRARIES}) 42 - 43 - if(XRT_BUILD_DRIVER_QWERTY) 44 - target_link_libraries(${RUNTIME_TARGET} PRIVATE 45 - drv_qwerty 46 - drv_qwerty_includes 47 - ) 48 - endif() 49 - endif() 50 51 if(XRT_FEATURE_SERVICE) 52 - target_link_libraries(${RUNTIME_TARGET} PUBLIC 53 - st_oxr 54 - ipc_client 55 - comp_client 56 - ) 57 else() 58 - target_link_libraries(${RUNTIME_TARGET} PUBLIC 59 - st_oxr 60 - st_prober 61 - target_lists 62 - target_instance 63 - comp_main 64 - comp_client 65 ) 66 endif() 67 68 if(NOT MSVC) 69 # Force the main "negotiate" symbol's inclusion 70 # and use a version script to ensure that's the only one we expose. 71 - set_property(TARGET ${RUNTIME_TARGET} 72 APPEND_STRING 73 - PROPERTY LINK_FLAGS 74 - "-u xrNegotiateLoaderRuntimeInterface -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version") 75 # Re-link if the version script changes. 76 - set_property(TARGET ${RUNTIME_TARGET} 77 APPEND 78 - PROPERTY LINK_DEPENDS 79 - "${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version") 80 endif() 81 - 82 83 # Install the runtime itself 84 - install(TARGETS ${RUNTIME_TARGET} 85 - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 86 - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 87 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 88 ) 89 - 90 - 91 - # $LIBPATH is a generator expression that is evaluated after configure_file, so we have to use file(GENERATE) instead 92 93 ### 94 # Generate runtime manifest with absolute path to runtime intended for development without installing ··· 116 set(DEV_MANIFEST_OUTPUT "${CMAKE_BINARY_DIR}/${RUNTIME_TARGET}-dev.json") 117 endif() 118 119 - file(GENERATE 120 OUTPUT "${DEV_MANIFEST_OUTPUT}" 121 - INPUT ${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest.json) 122 123 ### 124 # Prepare the installable manifest: will be generated completely at install time, ··· 126 if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 127 set(MANIFEST_RELATIVE_DIR share/openxr/${XR_API_MAJOR}/) 128 if(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME) 129 - configure_file(active_runtime.cmake ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake @ONLY) 130 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake) 131 endif() 132 elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") ··· 137 # If we know where to install the manifest, we can set it up to be installed. 138 if(MANIFEST_RELATIVE_DIR) 139 set(RUNTIME_RELATIVE_DIR ${CMAKE_INSTALL_LIBDIR}) 140 - set(RUNTIME_FILENAME ${CMAKE_SHARED_MODULE_PREFIX}${RUNTIME_TARGET}${CMAKE_SHARED_MODULE_SUFFIX}) 141 configure_file(make_manifest.cmake ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake @ONLY) 142 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake) 143 endif()
··· 7 set(RUNTIME_BARE_SUFFIX monado) 8 set(RUNTIME_SUFFIX _${RUNTIME_BARE_SUFFIX}) 9 10 + set(RUNTIME_TARGET 11 + ${RUNTIME_PREFIX}openxr${RUNTIME_SUFFIX} 12 + CACHE INTERNAL "" FORCE 13 + ) 14 15 # OpenXR 1.0 16 set(XR_API_MAJOR "1") 17 18 + add_library(${RUNTIME_TARGET} MODULE target.c libopenxr.def) 19 20 # Note: Order may matter in these lists! 21 + target_link_libraries(${RUNTIME_TARGET} PUBLIC aux_vk aux_os aux_util aux_math) 22 23 if(XRT_FEATURE_SERVICE) 24 + target_link_libraries(${RUNTIME_TARGET} PUBLIC st_oxr ipc_client comp_client) 25 else() 26 + target_link_libraries( 27 + ${RUNTIME_TARGET} 28 + PUBLIC 29 + st_oxr 30 + st_prober 31 + target_lists 32 + target_instance 33 + comp_main 34 + comp_client 35 ) 36 endif() 37 38 if(NOT MSVC) 39 # Force the main "negotiate" symbol's inclusion 40 # and use a version script to ensure that's the only one we expose. 41 + set_property( 42 + TARGET ${RUNTIME_TARGET} 43 APPEND_STRING 44 + PROPERTY 45 + LINK_FLAGS 46 + "-u xrNegotiateLoaderRuntimeInterface -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version" 47 + ) 48 # Re-link if the version script changes. 49 + set_property( 50 + TARGET ${RUNTIME_TARGET} 51 APPEND 52 + PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version" 53 + ) 54 endif() 55 56 # Install the runtime itself 57 + install( 58 + TARGETS ${RUNTIME_TARGET} # 59 + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # 60 + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # 61 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 62 ) 63 64 ### 65 # Generate runtime manifest with absolute path to runtime intended for development without installing ··· 87 set(DEV_MANIFEST_OUTPUT "${CMAKE_BINARY_DIR}/${RUNTIME_TARGET}-dev.json") 88 endif() 89 90 + file( 91 + GENERATE 92 OUTPUT "${DEV_MANIFEST_OUTPUT}" 93 + INPUT ${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest.json 94 + ) 95 96 ### 97 # Prepare the installable manifest: will be generated completely at install time, ··· 99 if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 100 set(MANIFEST_RELATIVE_DIR share/openxr/${XR_API_MAJOR}/) 101 if(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME) 102 + configure_file( 103 + active_runtime.cmake ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake @ONLY 104 + ) 105 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake) 106 endif() 107 elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") ··· 112 # If we know where to install the manifest, we can set it up to be installed. 113 if(MANIFEST_RELATIVE_DIR) 114 set(RUNTIME_RELATIVE_DIR ${CMAKE_INSTALL_LIBDIR}) 115 + set(RUNTIME_FILENAME 116 + ${CMAKE_SHARED_MODULE_PREFIX}${RUNTIME_TARGET}${CMAKE_SHARED_MODULE_SUFFIX} 117 + ) 118 configure_file(make_manifest.cmake ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake @ONLY) 119 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake) 120 endif() 121 + 122 + ### 123 + # Inelegant but effective SDL2-based debug GUI 124 + add_library(oxr_sdl2 STATIC oxr_sdl2_hack.c) 125 + target_link_libraries(oxr_sdl2 PRIVATE aux_util) 126 + if(XRT_HAVE_OPENGL) 127 + target_link_libraries(oxr_sdl2 PUBLIC aux_ogl) 128 + endif() 129 + if(XRT_HAVE_SDL2) 130 + target_link_libraries(oxr_sdl2 PRIVATE st_gui xrt-external-imgui-sdl2 ${SDL2_LIBRARIES}) 131 + 132 + if(XRT_BUILD_DRIVER_QWERTY) 133 + target_link_libraries(oxr_sdl2 PRIVATE drv_qwerty drv_qwerty_includes) 134 + endif() 135 + endif() 136 + target_link_libraries(${RUNTIME_TARGET} PRIVATE oxr_sdl2)
+8 -6
src/xrt/targets/openxr/active_runtime.cmake
··· 7 set(XR_API_MAJOR @XR_API_MAJOR@) 8 set(RUNTIME_TARGET @RUNTIME_TARGET@) 9 10 - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 11 - ${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json 12 - ${CMAKE_BINARY_DIR}/active_runtime.json) 13 file( 14 INSTALL 15 DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/openxr/${XR_API_MAJOR}" 16 - TYPE FILE 17 - FILES "${CMAKE_BINARY_DIR}/active_runtime.json" 18 - )
··· 7 set(XR_API_MAJOR @XR_API_MAJOR@) 8 set(RUNTIME_TARGET @RUNTIME_TARGET@) 9 10 + execute_process( 11 + COMMAND 12 + ${CMAKE_COMMAND} -E create_symlink 13 + ${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json 14 + ${CMAKE_BINARY_DIR}/active_runtime.json 15 + ) 16 file( 17 INSTALL 18 DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/openxr/${XR_API_MAJOR}" 19 + TYPE FILE FILES "${CMAKE_BINARY_DIR}/active_runtime.json" 20 + )
+15 -14
src/xrt/targets/openxr/make_manifest.cmake
··· 13 string(REGEX REPLACE "/$" "" MANIFEST_RELATIVE_DIR "${MANIFEST_RELATIVE_DIR}") 14 15 if(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH) 16 - # Absolute path to runtime 17 - set(RUNTIME_PATH ${RUNTIME_RELATIVE_DIR}/${RUNTIME_FILENAME}) 18 - if(NOT IS_ABSOLUTE ${RUNTIME_RELATIVE_DIR}) 19 - set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_PATH}) 20 - endif() 21 else() 22 - # Relative path to runtime: requires it exist on the system shared library search path. 23 - set(RUNTIME_PATH ${RUNTIME_FILENAME}) 24 endif() 25 26 set(runtime_path ${RUNTIME_PATH}) 27 28 if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) 29 30 - # Create manifest 31 - configure_file(${MANIFEST_INPUT} ${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json) 32 33 - # Install it 34 - file(INSTALL 35 - DESTINATION "${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}" 36 - TYPE FILE 37 - FILES "${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json") 38 endif()
··· 13 string(REGEX REPLACE "/$" "" MANIFEST_RELATIVE_DIR "${MANIFEST_RELATIVE_DIR}") 14 15 if(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH) 16 + # Absolute path to runtime 17 + set(RUNTIME_PATH ${RUNTIME_RELATIVE_DIR}/${RUNTIME_FILENAME}) 18 + if(NOT IS_ABSOLUTE ${RUNTIME_RELATIVE_DIR}) 19 + set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_PATH}) 20 + endif() 21 else() 22 + # Relative path to runtime: requires it exist on the system shared library search path. 23 + set(RUNTIME_PATH ${RUNTIME_FILENAME}) 24 endif() 25 26 set(runtime_path ${RUNTIME_PATH}) 27 28 if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) 29 30 + # Create manifest 31 + configure_file(${MANIFEST_INPUT} ${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json) 32 33 + # Install it 34 + file( 35 + INSTALL 36 + DESTINATION "${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}" 37 + TYPE FILE FILES "${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json" 38 + ) 39 endif()
+11 -12
src/xrt/targets/service-lib/CMakeLists.txt
··· 1 # Copyright 2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 5 - add_library(monado-service MODULE 6 - service_target.cpp 7 - ) 8 - 9 - target_link_libraries(monado-service PRIVATE 10 - aux_util 11 - st_prober 12 - ipc_server 13 - comp_main 14 - target_lists 15 - target_instance 16 - xrt-external-jni-wrap 17 )
··· 1 # Copyright 2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 + add_library(monado-service MODULE service_target.cpp) 5 6 + target_link_libraries( 7 + monado-service 8 + PRIVATE 9 + aux_util 10 + st_prober 11 + ipc_server 12 + comp_main 13 + target_lists 14 + target_instance 15 + xrt-external-jni-wrap 16 )
+54 -34
src/xrt/targets/service/CMakeLists.txt
··· 1 - # Copyright 2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 - 5 - add_executable(monado-service 6 - main.c 7 - ../openxr/oxr_sdl2_hack.c 8 - ) 9 add_sanitizers(monado-service) 10 11 - target_link_libraries(monado-service PRIVATE 12 - aux_util 13 - st_prober 14 - ipc_server 15 - comp_main 16 - target_lists 17 - target_instance 18 ) 19 20 - install(TARGETS monado-service 21 - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 22 - ) 23 24 if(XRT_HAVE_SYSTEMD) 25 - set(SERVICE_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/monado.in.service) 26 - set(SOCKET_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/monado.in.socket) 27 ### 28 - # Generate systemd unit files with absolute path to service intended for development without installing 29 set(UNIT_NAME monado-dev) 30 set(service_path $<TARGET_FILE:monado-service>) 31 set(conflicts monado) 32 set(exit_on_disconnect ON) 33 set(extra_desc "in build tree") 34 - configure_file(${SOCKET_INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket) 35 - # Need this step because file(GENERATE) only evaluates generator expressions, and not what configure_file does. 36 - configure_file(${SERVICE_INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service) 37 - file(GENERATE 38 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service" 39 - INPUT ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service) 40 41 - configure_file(${SOCKET_INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket @ONLY) 42 43 # Make a custom target to link those in. 44 - add_custom_target(link-systemd-dev-units 45 - COMMAND systemctl --user link ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket 46 - COMMAND systemctl --user link ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service 47 COMMAND systemctl --user daemon-reload 48 VERBATIM 49 - COMMENT "Linking monado-dev.{socket,service} into your local systemd unit directory." 50 - ) 51 endif() 52 53 if(XRT_INSTALL_SYSTEMD_UNIT_FILES) ··· 63 set(XRT_SYSTEMD_UNIT_INSTALL_DIR lib/systemd/user) 64 if(PC_SYSTEMD_USERUNITDIR AND PC_SYSTEMD_PREFIX) 65 # Strip prefix 66 - string(REGEX REPLACE "^${PC_SYSTEMD_PREFIX}/" "" XRT_SYSTEMD_UNIT_INSTALL_DIR "${PC_SYSTEMD_USERUNITDIR}") 67 endif() 68 - set(XRT_SYSTEMD_UNIT_INSTALL_DIR "${XRT_SYSTEMD_UNIT_INSTALL_DIR}" CACHE STRING "The (absolute, or CMAKE_INSTALL_PREFIX-relative) path to install the systemd user unit files.") 69 mark_as_advanced(XRT_SYSTEMD_UNIT_INSTALL_DIR) 70 endif() 71 if(XRT_SYSTEMD_UNIT_INSTALL_DIR MATCHES "^/") ··· 75 # Destination is relative: prepend destdir (implicitly) and install prefix at install time 76 set(UNIT_DIR "\${CMAKE_INSTALL_PREFIX}/${XRT_SYSTEMD_UNIT_INSTALL_DIR}") 77 endif() 78 - configure_file(configure_and_install_units.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake @ONLY) 79 80 # This script will configure the units and install them at install time. 81 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake) 82 endif() 83 84 if(XRT_HAVE_SDL2) 85 - target_link_libraries(monado-service PRIVATE st_gui xrt-external-imgui-sdl2 aux_ogl drv_qwerty_includes) 86 endif()
··· 1 + # Copyright 2020-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 + add_executable(monado-service main.c) 5 add_sanitizers(monado-service) 6 7 + target_link_libraries( 8 + monado-service 9 + PRIVATE 10 + aux_util 11 + st_prober 12 + ipc_server 13 + comp_main 14 + target_lists 15 + target_instance 16 + oxr_sdl2 17 ) 18 19 + install(TARGETS monado-service RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) 20 21 if(XRT_HAVE_SYSTEMD) 22 + set(SERVICE_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/monado.in.service") 23 + set(SOCKET_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/monado.in.socket") 24 ### 25 + # Generate systemd unit files with absolute path to service 26 + # intended for development without installing 27 set(UNIT_NAME monado-dev) 28 set(service_path $<TARGET_FILE:monado-service>) 29 set(conflicts monado) 30 set(exit_on_disconnect ON) 31 set(extra_desc "in build tree") 32 + configure_file(${SOCKET_INPUT} "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket") 33 + 34 + # Need this step because file(GENERATE) only evaluates generator expressions, 35 + # and not what configure_file does. 36 + configure_file( 37 + ${SERVICE_INPUT} "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service" 38 + ) 39 + file( 40 + GENERATE 41 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service" 42 + INPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service" 43 + ) 44 45 + configure_file(${SOCKET_INPUT} "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket" @ONLY) 46 47 # Make a custom target to link those in. 48 + add_custom_target( 49 + link-systemd-dev-units 50 + COMMAND systemctl --user link "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket" 51 + COMMAND systemctl --user link "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service" 52 COMMAND systemctl --user daemon-reload 53 VERBATIM 54 + COMMENT 55 + "Linking monado-dev.{socket,service} into your local systemd unit directory." 56 + ) 57 endif() 58 59 if(XRT_INSTALL_SYSTEMD_UNIT_FILES) ··· 69 set(XRT_SYSTEMD_UNIT_INSTALL_DIR lib/systemd/user) 70 if(PC_SYSTEMD_USERUNITDIR AND PC_SYSTEMD_PREFIX) 71 # Strip prefix 72 + string( 73 + REGEX 74 + REPLACE "^${PC_SYSTEMD_PREFIX}/" "" XRT_SYSTEMD_UNIT_INSTALL_DIR 75 + "${PC_SYSTEMD_USERUNITDIR}" 76 + ) 77 endif() 78 + set(XRT_SYSTEMD_UNIT_INSTALL_DIR 79 + "${XRT_SYSTEMD_UNIT_INSTALL_DIR}" 80 + CACHE 81 + STRING 82 + "The (absolute, or CMAKE_INSTALL_PREFIX-relative) path to install the systemd user unit files." 83 + ) 84 mark_as_advanced(XRT_SYSTEMD_UNIT_INSTALL_DIR) 85 endif() 86 if(XRT_SYSTEMD_UNIT_INSTALL_DIR MATCHES "^/") ··· 90 # Destination is relative: prepend destdir (implicitly) and install prefix at install time 91 set(UNIT_DIR "\${CMAKE_INSTALL_PREFIX}/${XRT_SYSTEMD_UNIT_INSTALL_DIR}") 92 endif() 93 + configure_file( 94 + configure_and_install_units.cmake 95 + ${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake @ONLY 96 + ) 97 98 # This script will configure the units and install them at install time. 99 install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake) 100 endif() 101 102 if(XRT_HAVE_SDL2) 103 + target_link_libraries( 104 + monado-service PRIVATE st_gui xrt-external-imgui-sdl2 aux_ogl drv_qwerty_includes 105 + ) 106 endif()
+9 -8
src/xrt/targets/service/configure_and_install_units.cmake
··· 8 set(exit_on_disconnect @exit_on_disconnect@) 9 set(service_path "monado-service") 10 if(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES) 11 - set(service_path 12 - "${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/${service_path}") 13 endif() 14 15 # Create unit files ··· 18 19 # Install them 20 file( 21 - INSTALL 22 - DESTINATION "@UNIT_DIR@" 23 - TYPE FILE 24 - FILES 25 - "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.socket" 26 - "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.service")
··· 8 set(exit_on_disconnect @exit_on_disconnect@) 9 set(service_path "monado-service") 10 if(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES) 11 + set(service_path "${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/${service_path}") 12 endif() 13 14 # Create unit files ··· 17 18 # Install them 19 file( 20 + INSTALL 21 + DESTINATION "@UNIT_DIR@" 22 + TYPE 23 + FILE 24 + FILES 25 + "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.socket" 26 + "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.service" 27 + )
+35 -42
src/xrt/targets/steamvr_drv/CMakeLists.txt
··· 1 - # Copyright 2020, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 get_property(AUX_BINDINGS_DIR GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP) 5 set(INPUT_PROFILES_INPUT_DIR ${AUX_BINDINGS_DIR}) 6 set(INPUT_PROFILES_OUTPUT_DIR "${PROJECT_BINARY_DIR}/steamvr-monado/resources/input/") 7 8 - function(input_profiles_gen output custom_target) 9 - add_custom_command(OUTPUT ${output} 10 - COMMAND ${PYTHON_EXECUTABLE} ${INPUT_PROFILES_INPUT_DIR}/steamvr_profiles.py 11 - ${INPUT_PROFILES_INPUT_DIR}/bindings.json 12 - ${output} 13 - DEPENDS ${INPUT_PROFILES_INPUT_DIR}/bindings.py 14 - ${INPUT_PROFILES_INPUT_DIR}/bindings.json 15 - ) 16 - add_custom_target(${custom_target} DEPENDS ${output}) 17 - endfunction(input_profiles_gen) 18 - 19 - input_profiles_gen(${INPUT_PROFILES_OUTPUT_DIR} generated_input_profiles) 20 21 add_library(driver_monado MODULE main.c) 22 - add_dependencies(driver_monado generated_input_profiles) 23 24 target_link_libraries( 25 - driver_monado PRIVATE xrt-external-openvr aux_util st_ovrd st_prober target_lists target_instance_no_comp 26 ) 27 28 # meta data that the steamvr plugin needs in the base directory of the steamvr plugin 29 file(COPY driver.vrdrivermanifest DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado) 30 file(COPY resources DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado) 31 32 - #determine the output directory for the steamvr plugin 33 if(WIN32) 34 # FIXME need to account for different architectures 35 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") 36 - set(PLUGINDIR 37 - ${PROJECT_BINARY_DIR}/steamvr-monado/bin/win64 38 - CACHE INTERNAL "" 39 - ) 40 else() 41 - set(PLUGINDIR 42 - ${PROJECT_BINARY_DIR}/steamvr-monado/bin/win32 43 - CACHE INTERNAL "" 44 - ) 45 endif() 46 elseif(APPLE) 47 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") 48 - set(PLUGINDIR 49 - ${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx64 50 - CACHE INTERNAL "" 51 - ) 52 else() 53 - set(PLUGINDIR 54 - ${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx32 55 - CACHE INTERNAL "" 56 - ) 57 endif() 58 elseif(NOT ANDROID) 59 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") 60 - set(PLUGINDIR 61 - ${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux64 62 - CACHE INTERNAL "" 63 - ) 64 else() 65 - set(PLUGINDIR 66 - ${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux32 67 - CACHE INTERNAL "" 68 - ) 69 endif() 70 endif() 71 72 - message("SteamVR plugin path: ${PLUGINDIR}") 73 set_target_properties(driver_monado PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PLUGINDIR}") 74 75 # don't add lib prefix to driver_monado.so 76 set_target_properties(driver_monado PROPERTIES PREFIX "") 77 78 - install(DIRECTORY "${PROJECT_BINARY_DIR}/steamvr-monado" DESTINATION "${CMAKE_INSTALL_PREFIX}/share")
··· 1 + # Copyright 2020-2021, Collabora, Ltd. 2 # SPDX-License-Identifier: BSL-1.0 3 4 get_property(AUX_BINDINGS_DIR GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP) 5 set(INPUT_PROFILES_INPUT_DIR ${AUX_BINDINGS_DIR}) 6 set(INPUT_PROFILES_OUTPUT_DIR "${PROJECT_BINARY_DIR}/steamvr-monado/resources/input/") 7 8 + add_custom_command( 9 + OUTPUT "${INPUT_PROFILES_OUTPUT_DIR}" 10 + COMMAND 11 + ${PYTHON_EXECUTABLE} ${INPUT_PROFILES_INPUT_DIR}/steamvr_profiles.py 12 + ${INPUT_PROFILES_INPUT_DIR}/bindings.json "${INPUT_PROFILES_OUTPUT_DIR}" 13 + DEPENDS ${INPUT_PROFILES_INPUT_DIR}/bindings.py ${INPUT_PROFILES_INPUT_DIR}/bindings.json 14 + COMMENT "Generating SteamVR input profiles to ${INPUT_PROFILES_OUTPUT_DIR}" 15 + ) 16 + add_custom_target( 17 + steamvr_generated_input_profiles 18 + DEPENDS "${INPUT_PROFILES_OUTPUT_DIR}" 19 + COMMENT "Generating SteamVR input profiles" 20 + ) 21 22 add_library(driver_monado MODULE main.c) 23 + add_dependencies(driver_monado steamvr_generated_input_profiles) 24 25 target_link_libraries( 26 + driver_monado 27 + PRIVATE 28 + xrt-external-openvr 29 + aux_util 30 + st_ovrd 31 + st_prober 32 + target_lists 33 + target_instance_no_comp 34 ) 35 36 # meta data that the steamvr plugin needs in the base directory of the steamvr plugin 37 file(COPY driver.vrdrivermanifest DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado) 38 file(COPY resources DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado) 39 40 + # determine the output directory for the steamvr plugin 41 if(WIN32) 42 # FIXME need to account for different architectures 43 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") 44 + set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/win64") 45 else() 46 + set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/win32") 47 endif() 48 elseif(APPLE) 49 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") 50 + set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx64") 51 else() 52 + set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx32") 53 endif() 54 elseif(NOT ANDROID) 55 if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") 56 + set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux64") 57 else() 58 + set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux32") 59 endif() 60 endif() 61 62 + # message("SteamVR plugin path: ${PLUGINDIR}") 63 set_target_properties(driver_monado PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PLUGINDIR}") 64 65 # don't add lib prefix to driver_monado.so 66 set_target_properties(driver_monado PROPERTIES PREFIX "") 67 68 + install( 69 + DIRECTORY "${PROJECT_BINARY_DIR}/steamvr-monado" 70 + DESTINATION "${CMAKE_INSTALL_PREFIX}/share" 71 + )
+3 -6
tests/CMakeLists.txt
··· 9 target_link_libraries(tests_main PUBLIC log) 10 endif() 11 12 - 13 # Input transform test 14 add_executable(tests_input_transform tests_input_transform.cpp) 15 target_link_libraries(tests_input_transform PRIVATE tests_main) 16 - target_link_libraries(tests_input_transform PRIVATE 17 - st_oxr 18 - xrt-interfaces 19 - xrt-external-openxr 20 - aux_util) 21 add_test(NAME input_transform COMMAND tests_input_transform --success) 22 23 # Generic callbacks
··· 9 target_link_libraries(tests_main PUBLIC log) 10 endif() 11 12 # Input transform test 13 add_executable(tests_input_transform tests_input_transform.cpp) 14 target_link_libraries(tests_input_transform PRIVATE tests_main) 15 + target_link_libraries( 16 + tests_input_transform PRIVATE st_oxr xrt-interfaces xrt-external-openxr aux_util 17 + ) 18 add_test(NAME input_transform COMMAND tests_input_transform --success) 19 20 # Generic callbacks