mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-27 09:01:46 +00:00
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)
This commit is contained in:
parent
19947a2d27
commit
cc4007a69e
23
.cmake-format.py
Normal file
23
.cmake-format.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021, Collabora, Ltd.
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
with section("format"):
|
||||||
|
line_width = 100
|
||||||
|
tab_size = 8
|
||||||
|
use_tabchars = True
|
||||||
|
fractional_tab_policy = "use-space"
|
||||||
|
|
||||||
|
max_prefix_chars = 4
|
||||||
|
|
||||||
|
dangle_parens = True
|
||||||
|
dangle_align = "prefix-indent"
|
||||||
|
max_pargs_hwrap = 4
|
||||||
|
max_rows_cmdline = 1
|
||||||
|
|
||||||
|
keyword_case = 'upper'
|
||||||
|
|
||||||
|
|
||||||
|
# Do not reflow comments
|
||||||
|
|
||||||
|
with section("markup"):
|
||||||
|
enable_markup = False
|
|
@ -9,7 +9,11 @@ if(POLICY CMP0072)
|
||||||
cmake_policy(SET CMP0072 NEW)
|
cmake_policy(SET CMP0072 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH "Use the absolute path to the runtime in the installed manifest, rather than a bare filename." ON)
|
option(
|
||||||
|
XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH
|
||||||
|
"Use the absolute path to the runtime in the installed manifest, rather than a bare filename."
|
||||||
|
ON
|
||||||
|
)
|
||||||
option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON)
|
option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON)
|
||||||
|
|
||||||
# We use C++17
|
# We use C++17
|
||||||
|
@ -45,7 +49,10 @@ else()
|
||||||
find_program(PYTHON_EXECUTABLE python3)
|
find_program(PYTHON_EXECUTABLE python3)
|
||||||
if(PYTHON_EXECUTABLE MATCHES "WindowsApps")
|
if(PYTHON_EXECUTABLE MATCHES "WindowsApps")
|
||||||
# If you hit this error, you will have to install Python 3 or try harder to tell CMake where it is.
|
# If you hit this error, you will have to install Python 3 or try harder to tell CMake where it is.
|
||||||
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.")
|
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."
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -56,7 +63,18 @@ find_package(Vulkan MODULE)
|
||||||
find_package(EGL MODULE)
|
find_package(EGL MODULE)
|
||||||
find_package(HIDAPI MODULE)
|
find_package(HIDAPI MODULE)
|
||||||
find_package(OpenHMD MODULE)
|
find_package(OpenHMD MODULE)
|
||||||
find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video CONFIG)
|
find_package(
|
||||||
|
OpenCV
|
||||||
|
COMPONENTS
|
||||||
|
core
|
||||||
|
calib3d
|
||||||
|
highgui
|
||||||
|
imgproc
|
||||||
|
imgcodecs
|
||||||
|
features2d
|
||||||
|
video
|
||||||
|
CONFIG
|
||||||
|
)
|
||||||
find_package(Libusb1 MODULE)
|
find_package(Libusb1 MODULE)
|
||||||
find_package(JPEG MODULE)
|
find_package(JPEG MODULE)
|
||||||
find_package(realsense2 CONFIG)
|
find_package(realsense2 CONFIG)
|
||||||
|
@ -94,7 +112,6 @@ if(PKGCONFIG_FOUND AND NOT ANDROID)
|
||||||
pkg_check_modules(FFMPEG libavcodec)
|
pkg_check_modules(FFMPEG libavcodec)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
set(OPENGL_WITHOUT_GLX_FOUND ${OPENGL_FOUND})
|
set(OPENGL_WITHOUT_GLX_FOUND ${OPENGL_FOUND})
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
@ -112,23 +129,19 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
pkg_search_module(WAYLAND wayland-client)
|
pkg_search_module(WAYLAND wayland-client)
|
||||||
pkg_search_module(WAYLAND_SCANNER wayland-scanner)
|
pkg_search_module(WAYLAND_SCANNER wayland-scanner)
|
||||||
pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols)
|
pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols)
|
||||||
pkg_search_module(LIBDRM libdrm)
|
pkg_search_module(LIBDRM IMPORTED_TARGET libdrm)
|
||||||
endif()
|
endif()
|
||||||
find_package(OpenGL COMPONENTS GLX)
|
find_package(OpenGL COMPONENTS GLX)
|
||||||
pkg_search_module(DBUS dbus-1)
|
pkg_search_module(DBUS dbus-1)
|
||||||
pkg_search_module(LIBBSD libbsd)
|
pkg_search_module(LIBBSD libbsd)
|
||||||
|
|
||||||
pkg_check_modules(GST
|
pkg_check_modules(GST gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0)
|
||||||
gstreamer-1.0
|
|
||||||
gstreamer-app-1.0
|
|
||||||
gstreamer-video-1.0
|
|
||||||
)
|
|
||||||
|
|
||||||
pkg_check_modules(SURVIVE IMPORTED_TARGET survive)
|
pkg_check_modules(SURVIVE IMPORTED_TARGET survive)
|
||||||
else()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(RT_LIBRARY rt)
|
find_library(RT_LIBRARY rt)
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
find_library(ANDROID_LIBRARY android)
|
find_library(ANDROID_LIBRARY android)
|
||||||
find_library(ANDROID_LOG_LIBRARY log)
|
find_library(ANDROID_LOG_LIBRARY log)
|
||||||
|
@ -149,9 +162,17 @@ foreach(slam_system IN LISTS EXTERNAL_SLAM_SYSTEMS)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
# ILLIXR
|
||||||
|
set(ILLIXR_PATH
|
||||||
|
""
|
||||||
|
CACHE PATH "Path to ILLIXR headers"
|
||||||
|
)
|
||||||
|
|
||||||
# This one is named differently because that's what CTest uses
|
# This one is named differently because that's what CTest uses
|
||||||
option(BUILD_TESTING "Enable building of the test suite?" ON)
|
option(BUILD_TESTING "Enable building of the test suite?" ON)
|
||||||
|
|
||||||
|
# cmake-format: off
|
||||||
|
|
||||||
option(XRT_FEATURE_COLOR_LOG "Enable logging in color on supported platforms" ON)
|
option(XRT_FEATURE_COLOR_LOG "Enable logging in color on supported platforms" ON)
|
||||||
cmake_dependent_option(XRT_HAVE_PERCETTO "Enable percetto support" ON "PERCETTO_FOUND" OFF)
|
cmake_dependent_option(XRT_HAVE_PERCETTO "Enable percetto support" ON "PERCETTO_FOUND" OFF)
|
||||||
cmake_dependent_option(XRT_FEATURE_TRACING "Enable debug tracing on supported platforms" OFF "XRT_HAVE_PERCETTO" OFF)
|
cmake_dependent_option(XRT_FEATURE_TRACING "Enable debug tracing on supported platforms" OFF "XRT_HAVE_PERCETTO" OFF)
|
||||||
|
@ -198,8 +219,6 @@ endif()
|
||||||
# Most users won't touch these.
|
# Most users won't touch these.
|
||||||
mark_as_advanced(XRT_FEATURE_COMPOSITOR_MAIN XRT_FEATURE_OPENXR)
|
mark_as_advanced(XRT_FEATURE_COMPOSITOR_MAIN XRT_FEATURE_OPENXR)
|
||||||
|
|
||||||
# ILLIXR
|
|
||||||
set(ILLIXR_PATH "" CACHE PATH "Path to ILLIXR headers")
|
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(XRT_HAVE_LIBUDEV ON)
|
set(XRT_HAVE_LIBUDEV ON)
|
||||||
|
@ -207,6 +226,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
else()
|
else()
|
||||||
cmake_dependent_option(XRT_HAVE_LIBUDEV "Enable libudev (used for device probing on Linux)" ON "UDEV_FOUND" OFF)
|
cmake_dependent_option(XRT_HAVE_LIBUDEV "Enable libudev (used for device probing on Linux)" ON "UDEV_FOUND" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_dependent_option(XRT_HAVE_LIBUSB "Enable libusb (used for most drivers)" ON "LIBUSB1_FOUND" OFF)
|
cmake_dependent_option(XRT_HAVE_LIBUSB "Enable libusb (used for most drivers)" ON "LIBUSB1_FOUND" OFF)
|
||||||
cmake_dependent_option(XRT_HAVE_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF)
|
cmake_dependent_option(XRT_HAVE_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF)
|
||||||
cmake_dependent_option(XRT_HAVE_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF)
|
cmake_dependent_option(XRT_HAVE_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF)
|
||||||
|
@ -248,9 +268,13 @@ cmake_dependent_option(XRT_BUILD_DRIVER_ANDROID "Enable Android sensors driver"
|
||||||
cmake_dependent_option(XRT_BUILD_DRIVER_QWERTY "Enable Qwerty driver" ON "XRT_HAVE_SDL2" OFF)
|
cmake_dependent_option(XRT_BUILD_DRIVER_QWERTY "Enable Qwerty driver" ON "XRT_HAVE_SDL2" OFF)
|
||||||
cmake_dependent_option(XRT_BUILD_DRIVER_EUROC "Enable EuRoC dataset driver for SLAM evaluation" ON "XRT_HAVE_OPENCV" OFF)
|
cmake_dependent_option(XRT_BUILD_DRIVER_EUROC "Enable EuRoC dataset driver for SLAM evaluation" ON "XRT_HAVE_OPENCV" OFF)
|
||||||
|
|
||||||
|
# cmake-format: on
|
||||||
|
|
||||||
# You can set this from a superproject to add a driver
|
# You can set this from a superproject to add a driver
|
||||||
# All drivers must be listed in here to be included in the generated header!
|
# All drivers must be listed in here to be included in the generated header!
|
||||||
list(APPEND AVAILABLE_DRIVERS
|
list(
|
||||||
|
APPEND
|
||||||
|
AVAILABLE_DRIVERS
|
||||||
"ANDROID"
|
"ANDROID"
|
||||||
"ARDUINO"
|
"ARDUINO"
|
||||||
"DAYDREAM"
|
"DAYDREAM"
|
||||||
|
@ -276,7 +300,6 @@ list(APPEND AVAILABLE_DRIVERS
|
||||||
"EUROC"
|
"EUROC"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# Package name needs to be known by the native code itself.
|
# Package name needs to be known by the native code itself.
|
||||||
# Can be overridden from outside/command line
|
# Can be overridden from outside/command line
|
||||||
if(ANDROID AND NOT XRT_ANDROID_PACKAGE)
|
if(ANDROID AND NOT XRT_ANDROID_PACKAGE)
|
||||||
|
@ -313,7 +336,10 @@ endif()
|
||||||
if(XRT_HAVE_XCB)
|
if(XRT_HAVE_XCB)
|
||||||
set(VK_USE_PLATFORM_XCB_KHR TRUE)
|
set(VK_USE_PLATFORM_XCB_KHR TRUE)
|
||||||
endif()
|
endif()
|
||||||
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB AND XRT_HAVE_XRANDR)
|
if(XRT_HAVE_XCB
|
||||||
|
AND XRT_HAVE_XLIB
|
||||||
|
AND XRT_HAVE_XRANDR
|
||||||
|
)
|
||||||
set(VK_USE_PLATFORM_XLIB_XRANDR_EXT TRUE)
|
set(VK_USE_PLATFORM_XLIB_XRANDR_EXT TRUE)
|
||||||
endif()
|
endif()
|
||||||
if(XRT_HAVE_WAYLAND)
|
if(XRT_HAVE_WAYLAND)
|
||||||
|
@ -325,19 +351,11 @@ endif()
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(VK_USE_PLATFORM_WIN32_KHR TRUE)
|
set(VK_USE_PLATFORM_WIN32_KHR TRUE)
|
||||||
endif()
|
endif()
|
||||||
if (XRT_HAVE_VULKAN AND NOT ANDROID)
|
if(XRT_HAVE_VULKAN AND NOT ANDROID)
|
||||||
set(VK_USE_PLATFORM_DISPLAY_KHR TRUE)
|
set(VK_USE_PLATFORM_DISPLAY_KHR TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC)
|
include(CompilerFlags.cmake)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Werror=incompatible-pointer-types")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
|
|
||||||
|
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
|
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Default to PIC code
|
# Default to PIC code
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
@ -348,18 +366,18 @@ if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Make sure we have pretty colours
|
# Make sure we have pretty colours
|
||||||
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
|
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
|
||||||
|
|
||||||
if ("${FORCE_COLORED_OUTPUT}")
|
if(FORCE_COLORED_OUTPUT)
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
add_compile_options (-fdiagnostics-color=always)
|
add_compile_options(-fdiagnostics-color=always)
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
add_compile_options (-fcolor-diagnostics)
|
add_compile_options(-fcolor-diagnostics)
|
||||||
endif ()
|
endif()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
###
|
###
|
||||||
# Decend into madness.
|
# Descend into the source
|
||||||
###
|
###
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
14
CompilerFlags.cmake
Normal file
14
CompilerFlags.cmake
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Copyright 2018-2021, Collabora, Ltd.
|
||||||
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
|
||||||
|
set(CMAKE_C_FLAGS
|
||||||
|
"${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Werror=incompatible-pointer-types"
|
||||||
|
)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-conversion")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wall -Wextra -Wno-unused-parameter")
|
||||||
|
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
|
||||||
|
endif()
|
|
@ -3,10 +3,15 @@
|
||||||
|
|
||||||
# check if Doxygen is installed
|
# check if Doxygen is installed
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
|
|
||||||
|
# cmake-format: off
|
||||||
|
|
||||||
cmake_dependent_option(BUILD_DOC "Build documentation" ON "DOXYGEN_FOUND" OFF)
|
cmake_dependent_option(BUILD_DOC "Build documentation" ON "DOXYGEN_FOUND" OFF)
|
||||||
cmake_dependent_option(BUILD_DOC_WARN_UNDOCUMENTED "Warn on undocumented entities when building documentation" OFF "DOXYGEN_FOUND" OFF)
|
cmake_dependent_option(BUILD_DOC_WARN_UNDOCUMENTED "Warn on undocumented entities when building documentation" OFF "DOXYGEN_FOUND" OFF)
|
||||||
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)
|
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)
|
||||||
|
|
||||||
|
# cmake-format: on
|
||||||
|
|
||||||
if(BUILD_DOC)
|
if(BUILD_DOC)
|
||||||
if(BUILD_DOC_WARN_UNDOCUMENTED)
|
if(BUILD_DOC_WARN_UNDOCUMENTED)
|
||||||
set(DOXYGEN_WARN_UNDOCUMENTED YES)
|
set(DOXYGEN_WARN_UNDOCUMENTED YES)
|
||||||
|
@ -30,15 +35,18 @@ if(BUILD_DOC)
|
||||||
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
|
||||||
|
|
||||||
# copy the schema
|
# copy the schema
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json
|
configure_file(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json
|
${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json
|
||||||
@ONLY)
|
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json @ONLY
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json.license
|
)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json.license
|
configure_file(
|
||||||
@ONLY)
|
${CMAKE_CURRENT_SOURCE_DIR}/example_configs/config_v0.schema.json.license
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/html/config_v0.schema.json.license @ONLY
|
||||||
|
)
|
||||||
|
|
||||||
# note the option ALL which allows to build the docs together with the application
|
# note the option ALL which allows to build the docs together with the application
|
||||||
add_custom_target(doc_doxygen ALL
|
add_custom_target(
|
||||||
|
doc_doxygen ALL
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMENT "Generating API documentation with Doxygen"
|
COMMENT "Generating API documentation with Doxygen"
|
||||||
|
|
66
src/external/CMakeLists.txt
vendored
66
src/external/CMakeLists.txt
vendored
|
@ -5,8 +5,9 @@
|
||||||
add_library(xrt-external-catch2 INTERFACE)
|
add_library(xrt-external-catch2 INTERFACE)
|
||||||
target_include_directories(xrt-external-catch2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Catch2)
|
target_include_directories(xrt-external-catch2 INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/Catch2)
|
||||||
add_library(xrt-external-openvr INTERFACE)
|
add_library(xrt-external-openvr INTERFACE)
|
||||||
target_include_directories(xrt-external-openvr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openvr_includes)
|
target_include_directories(
|
||||||
|
xrt-external-openvr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openvr_includes
|
||||||
|
)
|
||||||
|
|
||||||
# cJSON
|
# cJSON
|
||||||
add_library(xrt-external-cjson INTERFACE)
|
add_library(xrt-external-cjson INTERFACE)
|
||||||
|
@ -31,26 +32,30 @@ target_include_directories(xrt-external-hungarian INTERFACE ${CMAKE_CURRENT_SOUR
|
||||||
|
|
||||||
# JNIPP and Android JNI wrappers
|
# JNIPP and Android JNI wrappers
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
add_library(xrt-external-jnipp STATIC
|
add_library(xrt-external-jnipp STATIC jnipp/jnipp.cpp)
|
||||||
jnipp/jnipp.cpp)
|
|
||||||
target_include_directories(xrt-external-jnipp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/jnipp)
|
target_include_directories(xrt-external-jnipp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/jnipp)
|
||||||
|
|
||||||
file(GLOB WRAP_SOURCES android-jni-wrap/wrap/*.cpp)
|
file(GLOB WRAP_SOURCES android-jni-wrap/wrap/*.cpp)
|
||||||
add_library(xrt-external-jni-wrap STATIC
|
add_library(xrt-external-jni-wrap STATIC ${WRAP_SOURCES})
|
||||||
${WRAP_SOURCES})
|
target_include_directories(
|
||||||
target_include_directories(xrt-external-jni-wrap PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/android-jni-wrap)
|
xrt-external-jni-wrap PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/android-jni-wrap
|
||||||
|
)
|
||||||
target_link_libraries(xrt-external-jni-wrap PUBLIC xrt-external-jnipp)
|
target_link_libraries(xrt-external-jni-wrap PUBLIC xrt-external-jnipp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# OpenXR
|
# OpenXR
|
||||||
add_library(xrt-external-openxr INTERFACE)
|
add_library(xrt-external-openxr INTERFACE)
|
||||||
target_include_directories(xrt-external-openxr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openxr_includes)
|
target_include_directories(
|
||||||
|
xrt-external-openxr INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/openxr_includes
|
||||||
|
)
|
||||||
|
|
||||||
# External SLAM tracking
|
# External SLAM tracking
|
||||||
if (SLAM)
|
if(SLAM)
|
||||||
add_library(xrt-external-slam STATIC slam_tracker/slam_tracker.hpp)
|
add_library(xrt-external-slam STATIC slam_tracker/slam_tracker.hpp)
|
||||||
set_target_properties(xrt-external-slam PROPERTIES LINKER_LANGUAGE CXX)
|
set_target_properties(xrt-external-slam PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
target_include_directories(xrt-external-slam INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/slam_tracker)
|
target_include_directories(
|
||||||
|
xrt-external-slam INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/slam_tracker
|
||||||
|
)
|
||||||
target_include_directories(xrt-external-slam INTERFACE ${SLAM_INCLUDE_DIRS})
|
target_include_directories(xrt-external-slam INTERFACE ${SLAM_INCLUDE_DIRS})
|
||||||
target_link_libraries(xrt-external-slam INTERFACE ${SLAM_LIBRARIES})
|
target_link_libraries(xrt-external-slam INTERFACE ${SLAM_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
@ -60,9 +65,7 @@ add_library(xrt-external-stb INTERFACE)
|
||||||
target_include_directories(xrt-external-stb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/stb)
|
target_include_directories(xrt-external-stb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/stb)
|
||||||
|
|
||||||
# imgui
|
# imgui
|
||||||
if(XRT_HAVE_SDL2)
|
if(XRT_HAVE_OPENGL)
|
||||||
# c-imgui doesn't do well with IPO - lots of warnings.
|
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF)
|
|
||||||
add_library(
|
add_library(
|
||||||
xrt-external-imgui STATIC
|
xrt-external-imgui STATIC
|
||||||
imgui/imgui/cimgui.cpp
|
imgui/imgui/cimgui.cpp
|
||||||
|
@ -88,17 +91,34 @@ if(XRT_HAVE_SDL2)
|
||||||
imgui/imgui/imstb_truetype.h
|
imgui/imgui/imstb_truetype.h
|
||||||
imgui/imgui_monado/imgui_monado.cpp
|
imgui/imgui_monado/imgui_monado.cpp
|
||||||
)
|
)
|
||||||
target_include_directories(xrt-external-imgui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui)
|
|
||||||
|
|
||||||
target_compile_definitions(xrt-external-imgui PUBLIC CIMGUI_NO_EXPORT)
|
target_include_directories(
|
||||||
target_link_libraries(xrt-external-imgui PRIVATE xrt-external-glad)
|
xrt-external-imgui SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui
|
||||||
|
|
||||||
add_library(
|
|
||||||
xrt-external-imgui-sdl2 STATIC imgui/imgui/cimgui_sdl.cpp imgui/imgui/imgui_impl_sdl.cpp
|
|
||||||
imgui/imgui/imgui_impl_sdl.h
|
|
||||||
)
|
)
|
||||||
target_link_libraries(xrt-external-imgui-sdl2 PRIVATE xrt-external-imgui ${SDL2_LIBRARIES})
|
target_include_directories(xrt-external-imgui PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/imgui)
|
||||||
|
target_compile_definitions(xrt-external-imgui PUBLIC CIMGUI_NO_EXPORT)
|
||||||
|
set_target_properties(xrt-external-imgui PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF)
|
||||||
|
target_link_libraries(xrt-external-imgui PUBLIC xrt-external-glad)
|
||||||
|
|
||||||
|
if(XRT_HAVE_SDL2)
|
||||||
|
add_library(
|
||||||
|
xrt-external-imgui-sdl2 STATIC
|
||||||
|
imgui/imgui/cimgui_sdl.cpp imgui/imgui/imgui_impl_sdl.cpp
|
||||||
|
imgui/imgui/imgui_impl_sdl.h
|
||||||
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
xrt-external-imgui-sdl2
|
||||||
|
PUBLIC xrt-external-imgui
|
||||||
|
PRIVATE ${SDL2_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(xrt-external-imgui-sdl2 PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||||
|
target_include_directories(
|
||||||
|
xrt-external-imgui-sdl2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui
|
||||||
|
)
|
||||||
|
set_target_properties(
|
||||||
|
xrt-external-imgui-sdl2 PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(xrt-external-imgui-sdl2 PRIVATE ${SDL2_INCLUDE_DIRS})
|
|
||||||
target_include_directories(xrt-external-imgui-sdl2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/imgui)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,25 +1,37 @@
|
||||||
# Copyright 2019-2020, Collabora, Ltd.
|
# Copyright 2019-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
add_subdirectory(bindings)
|
add_subdirectory(bindings)
|
||||||
|
|
||||||
set(ANDROID_SOURCE_FILES
|
# Common includes
|
||||||
android/android_ahardwarebuffer_allocator.c
|
add_library(aux-includes INTERFACE)
|
||||||
android/android_ahardwarebuffer_allocator.h
|
target_include_directories(
|
||||||
android/android_custom_surface.cpp
|
aux-includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
android/android_custom_surface.h
|
|
||||||
android/android_globals.cpp
|
|
||||||
android/android_globals.h
|
|
||||||
android/android_load_class.cpp
|
|
||||||
android/android_load_class.hpp
|
|
||||||
android/android_looper.c
|
|
||||||
android/android_looper.h
|
|
||||||
android/org.freedesktop.monado.auxiliary.cpp
|
|
||||||
android/org.freedesktop.monado.auxiliary.hpp
|
|
||||||
android/org.freedesktop.monado.auxiliary.impl.hpp
|
|
||||||
)
|
)
|
||||||
|
target_link_libraries(aux-includes INTERFACE xrt-interfaces)
|
||||||
|
|
||||||
set(MATH_SOURCE_FILES
|
# OpenGL library.
|
||||||
|
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
||||||
|
add_library(
|
||||||
|
aux_ogl STATIC
|
||||||
|
ogl/ogl_documentation.h
|
||||||
|
ogl/ogl_api.c
|
||||||
|
ogl/ogl_api.h
|
||||||
|
ogl/ogl_helpers.c
|
||||||
|
ogl/ogl_helpers.h
|
||||||
|
)
|
||||||
|
target_link_libraries(aux_ogl PUBLIC aux-includes xrt-external-glad)
|
||||||
|
if(XRT_HAVE_EGL)
|
||||||
|
target_sources(aux_ogl PRIVATE ogl/egl_api.c ogl/egl_api.h)
|
||||||
|
endif()
|
||||||
|
if(XRT_HAVE_OPENGLES)
|
||||||
|
target_link_libraries(aux_ogl PUBLIC EGL::EGL)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Math library.
|
||||||
|
add_library(
|
||||||
|
aux_math STATIC
|
||||||
math/m_api.h
|
math/m_api.h
|
||||||
math/m_base.cpp
|
math/m_base.cpp
|
||||||
math/m_eigen_interop.hpp
|
math/m_eigen_interop.hpp
|
||||||
|
@ -45,47 +57,43 @@ set(MATH_SOURCE_FILES
|
||||||
math/m_vec2.h
|
math/m_vec2.h
|
||||||
math/m_vec3.h
|
math/m_vec3.h
|
||||||
)
|
)
|
||||||
|
target_link_libraries(aux_math PUBLIC aux-includes aux_util)
|
||||||
|
target_include_directories(aux_math SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
|
||||||
|
|
||||||
set(OGL_SOURCE_FILES
|
# OS library.
|
||||||
ogl/ogl_documentation.h
|
add_library(
|
||||||
)
|
aux_os STATIC
|
||||||
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
|
||||||
list(APPEND OGL_SOURCE_FILES
|
|
||||||
ogl/ogl_api.c
|
|
||||||
ogl/ogl_api.h
|
|
||||||
ogl/ogl_helpers.c
|
|
||||||
ogl/ogl_helpers.h
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_EGL)
|
|
||||||
list(APPEND OGL_SOURCE_FILES
|
|
||||||
ogl/egl_api.c
|
|
||||||
ogl/egl_api.h
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(OS_SOURCE_FILES
|
|
||||||
os/os_ble.h
|
os/os_ble.h
|
||||||
os/os_documentation.h
|
os/os_documentation.h
|
||||||
os/os_hid.h
|
os/os_hid.h
|
||||||
os/os_hid_hidraw.c
|
os/os_hid_hidraw.c
|
||||||
os/os_threading.h
|
os/os_threading.h
|
||||||
)
|
)
|
||||||
|
target_link_libraries(aux_os PUBLIC aux-includes xrt-pthreads)
|
||||||
if(XRT_HAVE_DBUS)
|
if(XRT_HAVE_DBUS)
|
||||||
list(APPEND OS_SOURCE_FILES
|
target_sources(aux_os PRIVATE os/os_ble_dbus.c)
|
||||||
os/os_ble_dbus.c
|
target_link_libraries(aux_os PRIVATE ${DBUS_LIBRARIES})
|
||||||
)
|
target_include_directories(aux_os SYSTEM PRIVATE ${DBUS_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(GSTREAMER_SOURCE_FILES
|
# GStreamer library.
|
||||||
gstreamer/gst_internal.h
|
if(XRT_HAVE_GST)
|
||||||
gstreamer/gst_sink.h
|
add_library(
|
||||||
gstreamer/gst_sink.c
|
aux_gstreamer STATIC
|
||||||
gstreamer/gst_pipeline.h
|
gstreamer/gst_internal.h
|
||||||
gstreamer/gst_pipeline.c
|
gstreamer/gst_sink.h
|
||||||
)
|
gstreamer/gst_sink.c
|
||||||
|
gstreamer/gst_pipeline.h
|
||||||
|
gstreamer/gst_pipeline.c
|
||||||
|
)
|
||||||
|
target_link_libraries(aux_gstreamer PUBLIC aux-includes)
|
||||||
|
target_link_libraries(aux_gstreamer PRIVATE xrt-interfaces aux_math aux_os ${GST_LIBRARIES})
|
||||||
|
target_include_directories(aux_gstreamer PRIVATE ${GST_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
set(TRACKING_SOURCE_FILES
|
# Tracking library.
|
||||||
|
add_library(
|
||||||
|
aux_tracking STATIC
|
||||||
tracking/t_data_utils.c
|
tracking/t_data_utils.c
|
||||||
tracking/t_imu_fusion.hpp
|
tracking/t_imu_fusion.hpp
|
||||||
tracking/t_imu.cpp
|
tracking/t_imu.cpp
|
||||||
|
@ -94,33 +102,45 @@ set(TRACKING_SOURCE_FILES
|
||||||
tracking/t_lowpass.hpp
|
tracking/t_lowpass.hpp
|
||||||
tracking/t_tracking.h
|
tracking/t_tracking.h
|
||||||
)
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
aux_tracking
|
||||||
|
PUBLIC aux-includes
|
||||||
|
PRIVATE aux_math aux_util xrt-external-flexkalman xrt-external-hungarian
|
||||||
|
)
|
||||||
|
target_include_directories(aux_tracking SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR})
|
||||||
if(XRT_HAVE_OPENCV)
|
if(XRT_HAVE_OPENCV)
|
||||||
list(APPEND TRACKING_SOURCE_FILES
|
target_sources(
|
||||||
tracking/t_calibration_opencv.hpp
|
aux_tracking
|
||||||
tracking/t_calibration.cpp
|
PRIVATE
|
||||||
tracking/t_convert.cpp
|
tracking/t_calibration_opencv.hpp
|
||||||
tracking/t_debug_hsv_filter.cpp
|
tracking/t_calibration.cpp
|
||||||
tracking/t_debug_hsv_picker.cpp
|
tracking/t_convert.cpp
|
||||||
tracking/t_debug_hsv_viewer.cpp
|
tracking/t_debug_hsv_filter.cpp
|
||||||
tracking/t_file.cpp
|
tracking/t_debug_hsv_picker.cpp
|
||||||
tracking/t_frame_cv_mat_wrapper.cpp
|
tracking/t_debug_hsv_viewer.cpp
|
||||||
tracking/t_frame_cv_mat_wrapper.hpp
|
tracking/t_file.cpp
|
||||||
tracking/t_fusion.hpp
|
tracking/t_frame_cv_mat_wrapper.cpp
|
||||||
tracking/t_helper_debug_sink.hpp
|
tracking/t_frame_cv_mat_wrapper.hpp
|
||||||
tracking/t_hsv_filter.c
|
tracking/t_fusion.hpp
|
||||||
tracking/t_kalman.cpp
|
tracking/t_helper_debug_sink.hpp
|
||||||
tracking/t_tracker_psmv_fusion.hpp
|
tracking/t_hsv_filter.c
|
||||||
tracking/t_tracker_psmv.cpp
|
tracking/t_kalman.cpp
|
||||||
tracking/t_tracker_psvr.cpp
|
tracking/t_tracker_psmv_fusion.hpp
|
||||||
tracking/t_tracker_hand.cpp
|
tracking/t_tracker_psmv.cpp
|
||||||
|
tracking/t_tracker_psvr.cpp
|
||||||
|
tracking/t_tracker_hand.cpp
|
||||||
)
|
)
|
||||||
|
target_include_directories(aux_tracking SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(aux_tracking PUBLIC ${OpenCV_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
if(XRT_HAVE_SLAM)
|
if(XRT_HAVE_SLAM)
|
||||||
list(APPEND TRACKING_SOURCE_FILES tracking/t_tracker_slam.cpp)
|
target_sources(aux_tracking PRIVATE tracking/t_tracker_slam.cpp)
|
||||||
|
target_link_libraries(aux_tracking PRIVATE xrt-external-slam)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(UTIL_SOURCE_FILES
|
# Util library.
|
||||||
|
add_library(
|
||||||
|
aux_util STATIC
|
||||||
util/u_bitwise.c
|
util/u_bitwise.c
|
||||||
util/u_bitwise.h
|
util/u_bitwise.h
|
||||||
util/u_debug.c
|
util/u_debug.c
|
||||||
|
@ -178,75 +198,24 @@ set(UTIL_SOURCE_FILES
|
||||||
util/u_verify.h
|
util/u_verify.h
|
||||||
util/u_process.c
|
util/u_process.c
|
||||||
util/u_process.h
|
util/u_process.h
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c"
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/util/u_git_tag.c.in" "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c" @ONLY)
|
configure_file(
|
||||||
list(APPEND UTIL_SOURCE_FILES "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c")
|
"${CMAKE_CURRENT_SOURCE_DIR}/util/u_git_tag.c.in" "${CMAKE_CURRENT_BINARY_DIR}/u_git_tag.c"
|
||||||
|
@ONLY
|
||||||
set(VK_SOURCE_FILES
|
|
||||||
vk/vk_command_buffer.c
|
|
||||||
vk/vk_documentation.h
|
|
||||||
vk/vk_helpers.c
|
|
||||||
vk/vk_helpers.h
|
|
||||||
vk/vk_image_allocator.c
|
|
||||||
vk/vk_image_allocator.h
|
|
||||||
vk/vk_state_creators.c
|
|
||||||
)
|
)
|
||||||
|
target_link_libraries(aux_util PUBLIC aux-includes xrt-pthreads aux_generated_bindings aux_math)
|
||||||
# Common includes
|
|
||||||
add_library(aux-includes INTERFACE)
|
|
||||||
target_include_directories(aux-includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
target_link_libraries(aux-includes INTERFACE xrt-interfaces)
|
|
||||||
|
|
||||||
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
|
||||||
# OpenGL library.
|
|
||||||
add_library(aux_ogl STATIC ${OGL_SOURCE_FILES})
|
|
||||||
target_link_libraries(aux_ogl PUBLIC aux-includes)
|
|
||||||
# for GLAD
|
|
||||||
target_link_libraries(aux_ogl PUBLIC xrt-external-glad)
|
|
||||||
if(XRT_HAVE_OPENGLES)
|
|
||||||
target_link_libraries(aux_ogl PUBLIC EGL::EGL)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# OS library.
|
|
||||||
add_library(aux_os STATIC ${OS_SOURCE_FILES})
|
|
||||||
target_link_libraries(aux_os PUBLIC aux-includes xrt-pthreads)
|
|
||||||
if(XRT_HAVE_DBUS)
|
|
||||||
target_link_libraries(aux_os PRIVATE ${DBUS_LIBRARIES})
|
|
||||||
target_include_directories(aux_os SYSTEM
|
|
||||||
PRIVATE
|
|
||||||
${DBUS_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# Math library.
|
|
||||||
add_library(aux_math STATIC ${MATH_SOURCE_FILES})
|
|
||||||
target_link_libraries(aux_math PUBLIC aux-includes aux_util)
|
|
||||||
|
|
||||||
# Math files has extra include(s).
|
|
||||||
target_include_directories(aux_math SYSTEM
|
|
||||||
PRIVATE ${EIGEN3_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Util library.
|
|
||||||
add_library(aux_util STATIC ${UTIL_SOURCE_FILES})
|
|
||||||
target_link_libraries(aux_util PUBLIC aux-includes xrt-pthreads aux_generated_bindings)
|
|
||||||
# for u_device
|
|
||||||
target_link_libraries(aux_util PUBLIC aux_math)
|
|
||||||
if(XRT_HAVE_JPEG)
|
if(XRT_HAVE_JPEG)
|
||||||
target_link_libraries(aux_util PRIVATE ${JPEG_LIBRARIES})
|
target_link_libraries(aux_util PRIVATE ${JPEG_LIBRARIES})
|
||||||
target_include_directories(aux_util PRIVATE ${JPEG_INCLUDE_DIRS})
|
target_include_directories(aux_util PRIVATE ${JPEG_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
# for cJSON
|
|
||||||
if(XRT_HAVE_SYSTEM_CJSON)
|
if(XRT_HAVE_SYSTEM_CJSON)
|
||||||
target_link_libraries(aux_util PUBLIC cJSON::cJSON)
|
target_link_libraries(aux_util PUBLIC cJSON::cJSON)
|
||||||
target_compile_definitions(aux_util PRIVATE XRT_HAVE_SYSTEM_CJSON)
|
target_compile_definitions(aux_util PRIVATE XRT_HAVE_SYSTEM_CJSON)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(aux_util PUBLIC xrt-external-cjson)
|
target_link_libraries(aux_util PUBLIC xrt-external-cjson)
|
||||||
endif()
|
endif()
|
||||||
# For u_trace_marker
|
|
||||||
if(XRT_FEATURE_TRACING AND XRT_HAVE_PERCETTO)
|
if(XRT_FEATURE_TRACING AND XRT_HAVE_PERCETTO)
|
||||||
target_link_libraries(aux_util PUBLIC Percetto::percetto)
|
target_link_libraries(aux_util PUBLIC Percetto::percetto)
|
||||||
endif()
|
endif()
|
||||||
|
@ -258,62 +227,18 @@ if(ANDROID)
|
||||||
target_link_libraries(aux_util PUBLIC ${ANDROID_LOG_LIBRARY})
|
target_link_libraries(aux_util PUBLIC ${ANDROID_LOG_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# GStreamer library.
|
|
||||||
if(XRT_HAVE_GST)
|
|
||||||
add_library(aux_gstreamer STATIC ${GSTREAMER_SOURCE_FILES})
|
|
||||||
target_link_libraries(aux_gstreamer PUBLIC
|
|
||||||
aux-includes
|
|
||||||
)
|
|
||||||
target_link_libraries(aux_gstreamer PRIVATE
|
|
||||||
xrt-interfaces
|
|
||||||
aux_math
|
|
||||||
aux_os
|
|
||||||
${GST_LIBRARIES}
|
|
||||||
)
|
|
||||||
target_include_directories(aux_gstreamer PRIVATE
|
|
||||||
${GST_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Tracking library.
|
|
||||||
add_library(aux_tracking STATIC ${TRACKING_SOURCE_FILES})
|
|
||||||
target_link_libraries(aux_tracking PUBLIC aux-includes PRIVATE aux_math aux_util)
|
|
||||||
|
|
||||||
# Tracking files have extra includes.
|
|
||||||
target_include_directories(aux_tracking SYSTEM
|
|
||||||
PRIVATE
|
|
||||||
${EIGEN3_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
target_link_libraries(aux_tracking PRIVATE
|
|
||||||
xrt-external-flexkalman
|
|
||||||
xrt-external-hungarian
|
|
||||||
)
|
|
||||||
if(XRT_HAVE_OPENCV)
|
|
||||||
target_include_directories(aux_tracking SYSTEM
|
|
||||||
PRIVATE
|
|
||||||
${OpenCV_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
target_link_libraries(aux_tracking PUBLIC ${OpenCV_LIBRARIES})
|
|
||||||
if(XRT_HAVE_SLAM)
|
|
||||||
target_link_libraries(aux_tracking PRIVATE xrt-external-slam)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (XRT_BUILD_DRIVER_VIVE OR XRT_BUILD_DRIVER_SURVIVE)
|
|
||||||
set(VIVE_CONFIG_SOURCE_FILES
|
|
||||||
vive/vive_config.h
|
|
||||||
vive/vive_config.c
|
|
||||||
)
|
|
||||||
add_library(aux_vive STATIC ${VIVE_CONFIG_SOURCE_FILES})
|
|
||||||
target_link_libraries(aux_vive PRIVATE xrt-interfaces aux_util aux_math aux_tracking xrt-external-cjson)
|
|
||||||
target_link_libraries(aux_vive PRIVATE ${ZLIB_LIBRARIES})
|
|
||||||
target_include_directories(aux_vive PRIVATE ${ZLIB_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XRT_HAVE_VULKAN)
|
if(XRT_HAVE_VULKAN)
|
||||||
# Vulkan library.
|
# Vulkan library.
|
||||||
add_library(aux_vk STATIC ${VK_SOURCE_FILES})
|
add_library(
|
||||||
|
aux_vk STATIC
|
||||||
|
vk/vk_command_buffer.c
|
||||||
|
vk/vk_documentation.h
|
||||||
|
vk/vk_helpers.c
|
||||||
|
vk/vk_helpers.h
|
||||||
|
vk/vk_image_allocator.c
|
||||||
|
vk/vk_image_allocator.h
|
||||||
|
vk/vk_state_creators.c
|
||||||
|
)
|
||||||
target_link_libraries(aux_vk PUBLIC aux_os aux_util)
|
target_link_libraries(aux_vk PUBLIC aux_os aux_util)
|
||||||
target_link_libraries(aux_vk PUBLIC Vulkan::Vulkan)
|
target_link_libraries(aux_vk PUBLIC Vulkan::Vulkan)
|
||||||
target_include_directories(aux_vk PUBLIC ${Vulkan_INCLUDE_DIR})
|
target_include_directories(aux_vk PUBLIC ${Vulkan_INCLUDE_DIR})
|
||||||
|
@ -322,15 +247,58 @@ if(XRT_HAVE_VULKAN)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(XRT_BUILD_DRIVER_VIVE OR XRT_BUILD_DRIVER_SURVIVE)
|
||||||
|
set(VIVE_CONFIG_SOURCE_FILES vive/vive_config.h vive/vive_config.c)
|
||||||
|
add_library(aux_vive STATIC ${VIVE_CONFIG_SOURCE_FILES})
|
||||||
|
target_link_libraries(
|
||||||
|
aux_vive
|
||||||
|
PRIVATE
|
||||||
|
xrt-interfaces
|
||||||
|
aux_util
|
||||||
|
aux_math
|
||||||
|
aux_tracking
|
||||||
|
xrt-external-cjson
|
||||||
|
${ZLIB_LIBRARIES}
|
||||||
|
)
|
||||||
|
target_include_directories(aux_vive PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
add_library(android_app_glue STATIC
|
add_library(
|
||||||
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
|
android_app_glue STATIC
|
||||||
target_include_directories(android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue)
|
${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c
|
||||||
add_library(aux_android STATIC ${ANDROID_SOURCE_FILES})
|
)
|
||||||
target_link_libraries(aux_android
|
target_include_directories(
|
||||||
|
android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue
|
||||||
|
)
|
||||||
|
# disable these warnings in external code
|
||||||
|
target_compile_options(android_app_glue PRIVATE -Wno-format-pedantic)
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
aux_android STATIC
|
||||||
|
android/android_ahardwarebuffer_allocator.c
|
||||||
|
android/android_ahardwarebuffer_allocator.h
|
||||||
|
android/android_custom_surface.cpp
|
||||||
|
android/android_custom_surface.h
|
||||||
|
android/android_globals.cpp
|
||||||
|
android/android_globals.h
|
||||||
|
android/android_load_class.cpp
|
||||||
|
android/android_load_class.hpp
|
||||||
|
android/android_looper.c
|
||||||
|
android/android_looper.h
|
||||||
|
android/org.freedesktop.monado.auxiliary.cpp
|
||||||
|
android/org.freedesktop.monado.auxiliary.hpp
|
||||||
|
android/org.freedesktop.monado.auxiliary.impl.hpp
|
||||||
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
aux_android
|
||||||
PUBLIC aux_util
|
PUBLIC aux_util
|
||||||
PRIVATE ${ANDROID_LIBRARY} ${ANDROID_LOG_LIBRARY} xrt-external-jni-wrap xrt-external-jnipp android_app_glue
|
PRIVATE
|
||||||
|
${ANDROID_LIBRARY}
|
||||||
|
${ANDROID_LOG_LIBRARY}
|
||||||
|
xrt-external-jni-wrap
|
||||||
|
xrt-external-jnipp
|
||||||
|
android_app_glue
|
||||||
)
|
)
|
||||||
target_link_libraries(aux_vk PUBLIC aux_android)
|
target_link_libraries(aux_vk PUBLIC aux_android)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,30 +1,31 @@
|
||||||
# Copyright 2019-2021, Collabora, Ltd.
|
# Copyright 2019-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
###
|
# Binding generation: pass filename to generate
|
||||||
# Binding generation
|
function(bindings_gen output)
|
||||||
#
|
add_custom_command(
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${output}"
|
||||||
function(bindings_gen output custom_target)
|
COMMAND
|
||||||
add_custom_command(OUTPUT ${output}
|
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/bindings.json
|
${CMAKE_CURRENT_SOURCE_DIR}/bindings.json
|
||||||
${output}
|
"${CMAKE_CURRENT_BINARY_DIR}/${output}"
|
||||||
|
VERBATIM
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bindings.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/bindings.json
|
${CMAKE_CURRENT_SOURCE_DIR}/bindings.json
|
||||||
)
|
COMMENT "Generating ${output}"
|
||||||
add_custom_target(${custom_target} DEPENDS ${output})
|
)
|
||||||
endfunction(bindings_gen)
|
endfunction()
|
||||||
|
|
||||||
bindings_gen(${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.h generated_bindings_h)
|
bindings_gen(b_generated_bindings.h)
|
||||||
bindings_gen(${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.c generated_bindings_c)
|
bindings_gen(b_generated_bindings.c)
|
||||||
|
|
||||||
# Bindings library.
|
# Bindings library.
|
||||||
add_library(aux_generated_bindings STATIC ${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.c)
|
add_library(
|
||||||
add_dependencies(aux_generated_bindings generated_bindings_h)
|
aux_generated_bindings STATIC ${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.c
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/b_generated_bindings.h
|
||||||
|
)
|
||||||
|
|
||||||
# needed globally for steamvr input profile generation in steamvr target
|
# needed globally for steamvr input profile generation in steamvr target
|
||||||
set_property(GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP "${CMAKE_CURRENT_SOURCE_DIR}")
|
set_property(GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
target_include_directories(aux_generated_bindings PRIVATE aux-includes xrt-interfaces)
|
|
||||||
target_link_libraries(aux_generated_bindings PRIVATE xrt-interfaces aux_util)
|
target_link_libraries(aux_generated_bindings PRIVATE xrt-interfaces aux_util)
|
||||||
|
|
|
@ -1,289 +1,264 @@
|
||||||
# Copyright 2019-2021, Collabora, Ltd.
|
# Copyright 2019-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
spirv_shaders(SHADER_HEADERS
|
|
||||||
shaders/clear.comp
|
|
||||||
shaders/distortion.comp
|
|
||||||
shaders/distortion_timewarp.comp
|
|
||||||
shaders/mesh.frag
|
|
||||||
shaders/mesh.vert
|
|
||||||
shaders/layer.frag
|
|
||||||
shaders/layer.vert
|
|
||||||
shaders/equirect1.vert
|
|
||||||
shaders/equirect1.frag
|
|
||||||
shaders/equirect2.vert
|
|
||||||
shaders/equirect2.frag
|
|
||||||
)
|
|
||||||
|
|
||||||
set(CLIENT_SOURCE_FILES)
|
|
||||||
|
|
||||||
set(UTIL_SOURCE_FILES
|
|
||||||
util/comp_base.h
|
|
||||||
util/comp_base.c
|
|
||||||
util/comp_swapchain.h
|
|
||||||
util/comp_swapchain.c
|
|
||||||
util/comp_sync.h
|
|
||||||
util/comp_sync.c
|
|
||||||
util/comp_vulkan.h
|
|
||||||
util/comp_vulkan.c
|
|
||||||
)
|
|
||||||
|
|
||||||
set(RENDER_SOURCE_FILES
|
|
||||||
render/comp_buffer.c
|
|
||||||
render/comp_compute.c
|
|
||||||
render/comp_render.h
|
|
||||||
render/comp_rendering.c
|
|
||||||
render/comp_resources.c
|
|
||||||
render/comp_shaders.c
|
|
||||||
render/comp_util.c
|
|
||||||
)
|
|
||||||
|
|
||||||
set(MAIN_SOURCE_FILES
|
|
||||||
main/comp_compositor.c
|
|
||||||
main/comp_compositor.h
|
|
||||||
main/comp_documentation.h
|
|
||||||
main/comp_renderer.c
|
|
||||||
main/comp_renderer.h
|
|
||||||
main/comp_settings.c
|
|
||||||
main/comp_settings.h
|
|
||||||
main/comp_target.h
|
|
||||||
main/comp_target_swapchain.c
|
|
||||||
main/comp_target_swapchain.h
|
|
||||||
main/comp_window.h
|
|
||||||
main/comp_layer.h
|
|
||||||
main/comp_layer.c
|
|
||||||
main/comp_layer_renderer.h
|
|
||||||
main/comp_layer_renderer.c
|
|
||||||
)
|
|
||||||
|
|
||||||
set(MULTI_SOURCE_FILES
|
|
||||||
multi/comp_multi_compositor.c
|
|
||||||
multi/comp_multi_interface.h
|
|
||||||
multi/comp_multi_private.h
|
|
||||||
multi/comp_multi_system.c
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# Client library
|
# Client library
|
||||||
#
|
#
|
||||||
|
|
||||||
if(XRT_HAVE_VULKAN)
|
add_library(comp_client STATIC)
|
||||||
list(APPEND CLIENT_SOURCE_FILES
|
|
||||||
client/comp_vk_client.c
|
|
||||||
client/comp_vk_client.h
|
|
||||||
client/comp_vk_glue.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
|
||||||
list(APPEND CLIENT_SOURCE_FILES
|
|
||||||
client/comp_gl_client.c
|
|
||||||
client/comp_gl_client.h
|
|
||||||
client/comp_gl_memobj_swapchain.c
|
|
||||||
client/comp_gl_memobj_swapchain.h
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_OPENGL)
|
|
||||||
list(APPEND CLIENT_SOURCE_FILES
|
|
||||||
client/comp_gl_glue.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_OPENGLES)
|
|
||||||
list(APPEND CLIENT_SOURCE_FILES
|
|
||||||
client/comp_gles_glue.c
|
|
||||||
client/comp_gl_eglimage_swapchain.c
|
|
||||||
client/comp_gl_eglimage_swapchain.h
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_OPENGL_GLX AND XRT_HAVE_XLIB)
|
|
||||||
list(APPEND CLIENT_SOURCE_FILES
|
|
||||||
client/comp_gl_xlib_client.c
|
|
||||||
client/comp_gl_xlib_client.h
|
|
||||||
client/comp_gl_xlib_glue.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_EGL)
|
|
||||||
list(APPEND CLIENT_SOURCE_FILES
|
|
||||||
client/comp_egl_client.c
|
|
||||||
client/comp_egl_client.h
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(comp_client STATIC ${CLIENT_SOURCE_FILES})
|
target_link_libraries(
|
||||||
target_link_libraries(comp_client PUBLIC xrt-interfaces PRIVATE aux_util)
|
comp_client
|
||||||
|
PUBLIC xrt-interfaces
|
||||||
|
PRIVATE aux_util
|
||||||
|
)
|
||||||
target_include_directories(comp_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(comp_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
if(XRT_HAVE_VULKAN)
|
if(XRT_HAVE_VULKAN)
|
||||||
|
target_sources(
|
||||||
|
comp_client PRIVATE client/comp_vk_client.c client/comp_vk_client.h
|
||||||
|
client/comp_vk_glue.c
|
||||||
|
)
|
||||||
target_link_libraries(comp_client PRIVATE aux_vk)
|
target_link_libraries(comp_client PRIVATE aux_vk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
||||||
|
target_sources(
|
||||||
|
comp_client
|
||||||
|
PRIVATE client/comp_gl_client.c client/comp_gl_client.h
|
||||||
|
client/comp_gl_memobj_swapchain.c client/comp_gl_memobj_swapchain.h
|
||||||
|
)
|
||||||
target_link_libraries(comp_client PRIVATE aux_ogl)
|
target_link_libraries(comp_client PRIVATE aux_ogl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_OPENGL AND XRT_HAVE_XLIB)
|
if(XRT_HAVE_OPENGL)
|
||||||
|
target_sources(comp_client PRIVATE client/comp_gl_glue.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(XRT_HAVE_OPENGLES)
|
||||||
|
target_sources(
|
||||||
|
comp_client PRIVATE client/comp_gles_glue.c client/comp_gl_eglimage_swapchain.c
|
||||||
|
client/comp_gl_eglimage_swapchain.h
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(XRT_HAVE_OPENGL_GLX AND XRT_HAVE_XLIB)
|
||||||
|
target_sources(
|
||||||
|
comp_client PRIVATE client/comp_gl_xlib_client.c client/comp_gl_xlib_client.h
|
||||||
|
client/comp_gl_xlib_glue.c
|
||||||
|
)
|
||||||
target_link_libraries(comp_client PRIVATE OpenGL::GLX)
|
target_link_libraries(comp_client PRIVATE OpenGL::GLX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(XRT_HAVE_EGL)
|
||||||
|
target_sources(comp_client PRIVATE client/comp_egl_client.c client/comp_egl_client.h)
|
||||||
|
endif()
|
||||||
|
|
||||||
##
|
##
|
||||||
# Util library
|
# Util library
|
||||||
#
|
#
|
||||||
|
|
||||||
if(XRT_HAVE_VULKAN)
|
if(XRT_HAVE_VULKAN)
|
||||||
add_library(comp_util STATIC ${UTIL_SOURCE_FILES})
|
add_library(
|
||||||
target_link_libraries(comp_util PUBLIC xrt-interfaces PRIVATE aux_util aux_os aux_vk)
|
comp_util STATIC
|
||||||
|
util/comp_base.h
|
||||||
|
util/comp_base.c
|
||||||
|
util/comp_swapchain.h
|
||||||
|
util/comp_swapchain.c
|
||||||
|
util/comp_sync.h
|
||||||
|
util/comp_sync.c
|
||||||
|
util/comp_vulkan.h
|
||||||
|
util/comp_vulkan.c
|
||||||
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
comp_util
|
||||||
|
PUBLIC xrt-interfaces
|
||||||
|
PRIVATE aux_util aux_os aux_vk
|
||||||
|
)
|
||||||
target_include_directories(comp_util PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(comp_util PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Render library
|
# Render library
|
||||||
#
|
#
|
||||||
|
|
||||||
if(XRT_HAVE_VULKAN)
|
if(XRT_HAVE_VULKAN)
|
||||||
add_library(comp_render STATIC ${SHADER_HEADERS} ${RENDER_SOURCE_FILES})
|
spirv_shaders(
|
||||||
target_link_libraries(comp_render PUBLIC xrt-interfaces PRIVATE aux_util aux_os aux_vk)
|
SHADER_HEADERS
|
||||||
target_include_directories(comp_render PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
shaders/clear.comp
|
||||||
target_include_directories(comp_render SYSTEM PRIVATE
|
shaders/distortion.comp
|
||||||
# Shaders - marked SYSTEM so we get no warnings
|
shaders/distortion_timewarp.comp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
shaders/mesh.frag
|
||||||
|
shaders/mesh.vert
|
||||||
|
shaders/layer.frag
|
||||||
|
shaders/layer.vert
|
||||||
|
shaders/equirect1.vert
|
||||||
|
shaders/equirect1.frag
|
||||||
|
shaders/equirect2.vert
|
||||||
|
shaders/equirect2.frag
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
comp_render STATIC
|
||||||
|
${SHADER_HEADERS}
|
||||||
|
render/comp_buffer.c
|
||||||
|
render/comp_compute.c
|
||||||
|
render/comp_render.h
|
||||||
|
render/comp_rendering.c
|
||||||
|
render/comp_resources.c
|
||||||
|
render/comp_shaders.c
|
||||||
|
render/comp_util.c
|
||||||
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
comp_render
|
||||||
|
PUBLIC xrt-interfaces
|
||||||
|
PRIVATE aux_util aux_os aux_vk
|
||||||
|
)
|
||||||
|
target_include_directories(comp_render PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
# Shaders - marked SYSTEM so we get no warnings
|
||||||
|
target_include_directories(comp_render SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
add_subdirectory(shaders)
|
add_subdirectory(shaders)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Main library
|
# Main library
|
||||||
#
|
#
|
||||||
|
|
||||||
if(XRT_FEATURE_COMPOSITOR_MAIN)
|
if(XRT_FEATURE_COMPOSITOR_MAIN)
|
||||||
|
|
||||||
|
add_library(
|
||||||
|
comp_main STATIC
|
||||||
|
main/comp_compositor.c
|
||||||
|
main/comp_compositor.h
|
||||||
|
main/comp_documentation.h
|
||||||
|
main/comp_renderer.c
|
||||||
|
main/comp_renderer.h
|
||||||
|
main/comp_settings.c
|
||||||
|
main/comp_settings.h
|
||||||
|
main/comp_target.h
|
||||||
|
main/comp_target_swapchain.c
|
||||||
|
main/comp_target_swapchain.h
|
||||||
|
main/comp_window.h
|
||||||
|
main/comp_layer.h
|
||||||
|
main/comp_layer.c
|
||||||
|
main/comp_layer_renderer.h
|
||||||
|
main/comp_layer_renderer.c
|
||||||
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
comp_main
|
||||||
|
PUBLIC xrt-interfaces
|
||||||
|
PRIVATE
|
||||||
|
aux_util
|
||||||
|
aux_os
|
||||||
|
aux_vk
|
||||||
|
comp_util
|
||||||
|
comp_render
|
||||||
|
)
|
||||||
|
target_include_directories(comp_main PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
if(XRT_HAVE_XCB)
|
if(XRT_HAVE_XCB)
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
target_sources(comp_main PRIVATE main/comp_window_xcb.c)
|
||||||
main/comp_window_xcb.c
|
target_include_directories(comp_main SYSTEM PRIVATE ${XCB_INCLUDE_DIRS})
|
||||||
)
|
target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES})
|
||||||
|
if(XRT_HAVE_EGL)
|
||||||
|
target_include_directories(comp_main SYSTEM PRIVATE ${EGL_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB)
|
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB)
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
target_sources(
|
||||||
main/comp_window_direct_randr.c
|
comp_main PRIVATE main/comp_window_direct_randr.c
|
||||||
main/comp_window_direct_nvidia.c
|
main/comp_window_direct_nvidia.c
|
||||||
)
|
)
|
||||||
|
target_link_libraries(comp_main PRIVATE ${X11_X11_LIB})
|
||||||
endif()
|
endif()
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
target_sources(comp_main PRIVATE main/comp_window_mswin.c)
|
||||||
main/comp_window_mswin.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
if (VK_USE_PLATFORM_DISPLAY_KHR)
|
if(VK_USE_PLATFORM_DISPLAY_KHR)
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
target_sources(comp_main PRIVATE main/comp_window_vk_display.c)
|
||||||
main/comp_window_vk_display.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
if (VK_USE_PLATFORM_DISPLAY_KHR OR XRT_HAVE_XCB)
|
if(VK_USE_PLATFORM_DISPLAY_KHR OR XRT_HAVE_XCB)
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
target_sources(comp_main PRIVATE main/comp_window_direct.c)
|
||||||
main/comp_window_direct.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# generate wayland protocols
|
# generate wayland protocols
|
||||||
if(XRT_HAVE_WAYLAND)
|
if(XRT_HAVE_WAYLAND)
|
||||||
|
target_sources(comp_main PRIVATE main/comp_window_wayland.c)
|
||||||
pkg_get_variable(WL_PROTOS_PKG_DIR wayland-protocols pkgdatadir)
|
pkg_get_variable(WL_PROTOS_PKG_DIR wayland-protocols pkgdatadir)
|
||||||
pkg_get_variable(WL_SCANNER wayland-scanner wayland_scanner)
|
pkg_get_variable(WL_SCANNER wayland-scanner wayland_scanner)
|
||||||
|
|
||||||
set(WL_PROTOS_DIR "${CMAKE_CURRENT_BINARY_DIR}/wayland-protocols")
|
set(WL_PROTOS_DIR "${CMAKE_CURRENT_BINARY_DIR}/wayland-protocols")
|
||||||
file(MAKE_DIRECTORY "${WL_PROTOS_DIR}")
|
file(MAKE_DIRECTORY "${WL_PROTOS_DIR}")
|
||||||
|
|
||||||
set(WL_PROTOS_XML
|
set(WL_PROTOS_XML ${WL_PROTOS_PKG_DIR}/stable/xdg-shell/xdg-shell.xml)
|
||||||
${WL_PROTOS_PKG_DIR}/stable/xdg-shell/xdg-shell.xml
|
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
target_include_directories(comp_main SYSTEM PRIVATE ${WL_PROTOS_DIR})
|
||||||
main/comp_window_wayland.c
|
target_link_libraries(comp_main PRIVATE ${WAYLAND_LIBRARIES})
|
||||||
)
|
|
||||||
|
|
||||||
if (XRT_HAVE_WAYLAND_DIRECT)
|
if(XRT_HAVE_WAYLAND_DIRECT)
|
||||||
list(APPEND WL_PROTOS_XML
|
list(
|
||||||
|
APPEND WL_PROTOS_XML
|
||||||
${WL_PROTOS_PKG_DIR}/staging/drm-lease/drm-lease-v1.xml
|
${WL_PROTOS_PKG_DIR}/staging/drm-lease/drm-lease-v1.xml
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
|
||||||
main/comp_window_direct_wayland.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg_check_modules(LIBDRM IMPORTED_TARGET libdrm)
|
target_sources(comp_main PRIVATE main/comp_window_direct_wayland.c)
|
||||||
set(WAYLAND_DEPS
|
|
||||||
${WAYLAND_LIBRARIES}
|
target_link_libraries(comp_main PRIVATE PkgConfig::LIBDRM)
|
||||||
PkgConfig::LIBDRM
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(WL_PROTO_XML ${WL_PROTOS_XML})
|
foreach(wl_proto_xml ${WL_PROTOS_XML})
|
||||||
get_filename_component(WL_PROTO ${WL_PROTO_XML} NAME_WE)
|
get_filename_component(WL_PROTO ${wl_proto_xml} NAME_WE)
|
||||||
|
|
||||||
set(WL_PROTO_C "${WL_PROTOS_DIR}/${WL_PROTO}.c")
|
set(WL_PROTO_C "${WL_PROTOS_DIR}/${WL_PROTO}.c")
|
||||||
set(WL_PROTO_H "${WL_PROTOS_DIR}/${WL_PROTO}-client-protocol.h")
|
set(WL_PROTO_H "${WL_PROTOS_DIR}/${WL_PROTO}-client-protocol.h")
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
OUTPUT "${WL_PROTO_C}"
|
||||||
COMMAND
|
COMMAND
|
||||||
${WL_SCANNER} private-code "${WL_PROTO_XML}" "${WL_PROTO_C}"
|
"${WL_SCANNER}" private-code "${wl_proto_xml}"
|
||||||
OUTPUT "${WL_PROTO_C}" VERBATIM)
|
"${WL_PROTO_C}"
|
||||||
|
VERBATIM
|
||||||
|
DEPENDS "${WL_SCANNER}" "${wl_proto_xml}"
|
||||||
|
COMMENT "Generating ${WL_PROTO_C}"
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
OUTPUT "${WL_PROTO_H}"
|
||||||
COMMAND
|
COMMAND
|
||||||
${WL_SCANNER} client-header "${WL_PROTO_XML}" "${WL_PROTO_H}"
|
"${WL_SCANNER}" client-header "${wl_proto_xml}"
|
||||||
OUTPUT "${WL_PROTO_H}" VERBATIM)
|
"${WL_PROTO_H}"
|
||||||
|
VERBATIM
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
DEPENDS "${WL_SCANNER}" "${wl_proto_xml}"
|
||||||
${WL_PROTO_C}
|
COMMENT "Generating ${WL_PROTO_H}"
|
||||||
${WL_PROTO_H}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_sources(comp_main PRIVATE ${WL_PROTO_C} ${WL_PROTO_H})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
list(APPEND MAIN_SOURCE_FILES
|
target_sources(comp_main PRIVATE main/comp_window_android.c)
|
||||||
main/comp_window_android.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(comp_main STATIC ${MAIN_SOURCE_FILES})
|
|
||||||
target_link_libraries(comp_main PUBLIC xrt-interfaces PRIVATE aux_util aux_os aux_vk comp_util comp_render)
|
|
||||||
target_include_directories(comp_main PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
|
|
||||||
if(XRT_HAVE_WAYLAND)
|
|
||||||
target_include_directories(comp_main SYSTEM PRIVATE ${WL_PROTOS_DIR})
|
|
||||||
target_link_libraries(comp_main PRIVATE
|
|
||||||
${WAYLAND_DEPS} ${WAYLAND_LIBRARIES}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_XCB)
|
|
||||||
target_include_directories(comp_main SYSTEM PRIVATE ${XCB_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB)
|
|
||||||
target_link_libraries(comp_main PRIVATE ${X11_X11_LIB})
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_EGL AND XRT_HAVE_XCB)
|
|
||||||
target_include_directories(comp_main SYSTEM PRIVATE ${EGL_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
if(ANDROID)
|
|
||||||
target_link_libraries(comp_main PRIVATE aux_ogl aux_android)
|
target_link_libraries(comp_main PRIVATE aux_ogl aux_android)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# Multi client compositor library
|
# Multi client compositor library
|
||||||
#
|
#
|
||||||
|
|
||||||
add_library(comp_multi STATIC ${MULTI_SOURCE_FILES})
|
add_library(
|
||||||
target_link_libraries(comp_multi PUBLIC xrt-interfaces PRIVATE aux_util aux_os)
|
comp_multi STATIC multi/comp_multi_compositor.c multi/comp_multi_interface.h
|
||||||
|
multi/comp_multi_private.h multi/comp_multi_system.c
|
||||||
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
comp_multi
|
||||||
|
PUBLIC xrt-interfaces
|
||||||
|
PRIVATE aux_util aux_os
|
||||||
|
)
|
||||||
target_include_directories(comp_multi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(comp_multi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
|
||||||
if(XRT_FEATURE_COMPOSITOR_MAIN)
|
if(XRT_FEATURE_COMPOSITOR_MAIN)
|
||||||
target_link_libraries(comp_main PRIVATE comp_multi)
|
target_link_libraries(comp_main PRIVATE comp_multi)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -2,69 +2,63 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
|
||||||
set(ENABLED_HEADSET_DRIVERS)
|
set(ENABLED_HEADSET_DRIVERS)
|
||||||
set(ENABLED_DRIVERS)
|
set(ENABLED_DRIVERS)
|
||||||
|
|
||||||
|
add_library(drv_includes INTERFACE)
|
||||||
|
target_include_directories(drv_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_ARDUINO)
|
if(XRT_BUILD_DRIVER_ARDUINO)
|
||||||
add_library(drv_arduino STATIC
|
add_library(
|
||||||
arduino/arduino_device.c
|
drv_arduino STATIC arduino/arduino_device.c arduino/arduino_interface.h
|
||||||
arduino/arduino_interface.h
|
arduino/arduino_prober.c
|
||||||
arduino/arduino_prober.c)
|
)
|
||||||
target_link_libraries(drv_arduino PRIVATE xrt-interfaces aux_util aux_os)
|
target_link_libraries(drv_arduino PRIVATE xrt-interfaces aux_util aux_os)
|
||||||
list(APPEND ENABLED_DRIVERS arduino)
|
list(APPEND ENABLED_DRIVERS arduino)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_DAYDREAM)
|
if(XRT_BUILD_DRIVER_DAYDREAM)
|
||||||
add_library(drv_daydream STATIC
|
add_library(
|
||||||
daydream/daydream_device.c
|
drv_daydream STATIC daydream/daydream_device.c daydream/daydream_device.h
|
||||||
daydream/daydream_device.h
|
daydream/daydream_interface.h daydream/daydream_prober.c
|
||||||
daydream/daydream_interface.h
|
)
|
||||||
daydream/daydream_prober.c)
|
|
||||||
target_link_libraries(drv_daydream PRIVATE xrt-interfaces aux_util aux_os)
|
target_link_libraries(drv_daydream PRIVATE xrt-interfaces aux_util aux_os)
|
||||||
list(APPEND ENABLED_DRIVERS daydream)
|
list(APPEND ENABLED_DRIVERS daydream)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_DEPTHAI)
|
if(XRT_BUILD_DRIVER_DEPTHAI)
|
||||||
add_library(drv_depthai STATIC
|
add_library(drv_depthai STATIC depthai/depthai_driver.cpp depthai/depthai_interface.h)
|
||||||
depthai/depthai_driver.cpp
|
target_link_libraries(
|
||||||
depthai/depthai_interface.h)
|
drv_depthai
|
||||||
target_link_libraries(drv_depthai PRIVATE
|
PRIVATE
|
||||||
xrt-interfaces
|
xrt-interfaces
|
||||||
aux_os
|
aux_os
|
||||||
${OpenCV_LIBRARIES}
|
${OpenCV_LIBRARIES}
|
||||||
depthai::opencv
|
depthai::opencv
|
||||||
depthai::core
|
depthai::core
|
||||||
XLink
|
XLink
|
||||||
)
|
)
|
||||||
target_include_directories(drv_depthai PRIVATE ${OpenCV_INCLUDE_DIRS})
|
target_include_directories(drv_depthai PRIVATE ${OpenCV_INCLUDE_DIRS})
|
||||||
list(APPEND ENABLED_DRIVERS depthai)
|
list(APPEND ENABLED_DRIVERS depthai)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_DUMMY)
|
if(XRT_BUILD_DRIVER_DUMMY)
|
||||||
add_library(drv_dummy STATIC
|
add_library(drv_dummy STATIC dummy/dummy_hmd.c dummy/dummy_interface.h dummy/dummy_prober.c)
|
||||||
dummy/dummy_hmd.c
|
|
||||||
dummy/dummy_interface.h
|
|
||||||
dummy/dummy_prober.c)
|
|
||||||
target_link_libraries(drv_dummy PRIVATE xrt-interfaces aux_util)
|
target_link_libraries(drv_dummy PRIVATE xrt-interfaces aux_util)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS dummy)
|
list(APPEND ENABLED_HEADSET_DRIVERS dummy)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_QWERTY)
|
if(XRT_BUILD_DRIVER_QWERTY)
|
||||||
add_library(drv_qwerty STATIC
|
add_library(
|
||||||
|
drv_qwerty STATIC
|
||||||
qwerty/qwerty_device.c
|
qwerty/qwerty_device.c
|
||||||
qwerty/qwerty_device.h
|
qwerty/qwerty_device.h
|
||||||
qwerty/qwerty_interface.h
|
qwerty/qwerty_interface.h
|
||||||
qwerty/qwerty_prober.c
|
qwerty/qwerty_prober.c
|
||||||
qwerty/qwerty_sdl.c)
|
qwerty/qwerty_sdl.c
|
||||||
target_link_libraries(drv_qwerty PRIVATE
|
|
||||||
xrt-interfaces
|
|
||||||
aux_util
|
|
||||||
${SDL2_LIBRARIES}
|
|
||||||
)
|
|
||||||
target_include_directories(drv_qwerty PRIVATE
|
|
||||||
${SDL2_INCLUDE_DIRS}
|
|
||||||
)
|
)
|
||||||
|
target_link_libraries(drv_qwerty PRIVATE xrt-interfaces aux_util ${SDL2_LIBRARIES})
|
||||||
|
target_include_directories(drv_qwerty PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||||
list(APPEND ENABLED_DRIVERS qwerty)
|
list(APPEND ENABLED_DRIVERS qwerty)
|
||||||
|
|
||||||
add_library(drv_qwerty_includes INTERFACE)
|
add_library(drv_qwerty_includes INTERFACE)
|
||||||
|
@ -72,107 +66,107 @@ if(XRT_BUILD_DRIVER_QWERTY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_HDK)
|
if(XRT_BUILD_DRIVER_HDK)
|
||||||
set(HDK_SOURCE_FILES
|
set(HDK_SOURCE_FILES)
|
||||||
)
|
|
||||||
|
|
||||||
add_library(drv_hdk STATIC
|
add_library(
|
||||||
hdk/hdk_device.cpp
|
drv_hdk STATIC hdk/hdk_device.cpp hdk/hdk_device.h hdk/hdk_interface.h
|
||||||
hdk/hdk_device.h
|
hdk/hdk_prober.c
|
||||||
hdk/hdk_interface.h
|
)
|
||||||
hdk/hdk_prober.c)
|
|
||||||
target_link_libraries(drv_hdk PRIVATE xrt-interfaces aux_math)
|
target_link_libraries(drv_hdk PRIVATE xrt-interfaces aux_math)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS hdk)
|
list(APPEND ENABLED_HEADSET_DRIVERS hdk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_HYDRA)
|
if(XRT_BUILD_DRIVER_HYDRA)
|
||||||
set(HYDRA_SOURCE_FILES
|
set(HYDRA_SOURCE_FILES)
|
||||||
)
|
|
||||||
|
|
||||||
add_library(drv_hydra STATIC
|
add_library(drv_hydra STATIC hydra/hydra_driver.c hydra/hydra_interface.h)
|
||||||
hydra/hydra_driver.c
|
|
||||||
hydra/hydra_interface.h)
|
|
||||||
target_link_libraries(drv_hydra PRIVATE xrt-interfaces aux_os)
|
target_link_libraries(drv_hydra PRIVATE xrt-interfaces aux_os)
|
||||||
list(APPEND ENABLED_DRIVERS hydra)
|
list(APPEND ENABLED_DRIVERS hydra)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_NS)
|
if(XRT_BUILD_DRIVER_NS)
|
||||||
add_library(drv_ns STATIC
|
add_library(
|
||||||
|
drv_ns STATIC
|
||||||
north_star/distortion_3d/utility_northstar.h
|
north_star/distortion_3d/utility_northstar.h
|
||||||
north_star/distortion_3d/deformation_northstar.h
|
north_star/distortion_3d/deformation_northstar.h
|
||||||
north_star/distortion_3d/deformation_northstar.cpp
|
north_star/distortion_3d/deformation_northstar.cpp
|
||||||
north_star/ns_hmd.h
|
north_star/ns_hmd.h
|
||||||
north_star/ns_hmd.c
|
north_star/ns_hmd.c
|
||||||
north_star/ns_interface.h
|
north_star/ns_interface.h
|
||||||
north_star/ns_prober.c)
|
north_star/ns_prober.c
|
||||||
|
)
|
||||||
target_link_libraries(drv_ns PRIVATE xrt-interfaces aux_math xrt-external-cjson)
|
target_link_libraries(drv_ns PRIVATE xrt-interfaces aux_math xrt-external-cjson)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS ns)
|
list(APPEND ENABLED_HEADSET_DRIVERS ns)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_ULV2)
|
if(XRT_BUILD_DRIVER_ULV2)
|
||||||
add_library(drv_ulv2 STATIC
|
add_library(drv_ulv2 STATIC ultraleap_v2/ulv2_driver.cpp ultraleap_v2/ulv2_interface.h)
|
||||||
ultraleap_v2/ulv2_driver.cpp
|
|
||||||
ultraleap_v2/ulv2_interface.h)
|
|
||||||
target_link_libraries(drv_ulv2 PRIVATE xrt-interfaces aux_util aux_math LeapV2::LeapV2)
|
target_link_libraries(drv_ulv2 PRIVATE xrt-interfaces aux_util aux_math LeapV2::LeapV2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_OHMD)
|
if(XRT_BUILD_DRIVER_OHMD)
|
||||||
add_library(drv_ohmd STATIC
|
add_library(
|
||||||
ohmd/oh_device.c
|
drv_ohmd STATIC ohmd/oh_device.c ohmd/oh_device.h ohmd/oh_interface.h
|
||||||
ohmd/oh_device.h
|
ohmd/oh_prober.c
|
||||||
ohmd/oh_interface.h
|
)
|
||||||
ohmd/oh_prober.c)
|
|
||||||
target_link_libraries(drv_ohmd PRIVATE xrt-interfaces OpenHMD::OpenHMD aux_util aux_math)
|
target_link_libraries(drv_ohmd PRIVATE xrt-interfaces OpenHMD::OpenHMD aux_util aux_math)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS openhmd)
|
list(APPEND ENABLED_HEADSET_DRIVERS openhmd)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_PSMV)
|
if(XRT_BUILD_DRIVER_PSMV)
|
||||||
add_library(drv_psmv STATIC
|
add_library(drv_psmv STATIC psmv/psmv_driver.c psmv/psmv_interface.h)
|
||||||
psmv/psmv_driver.c
|
target_link_libraries(
|
||||||
psmv/psmv_interface.h)
|
drv_psmv
|
||||||
target_link_libraries(drv_psmv PRIVATE xrt-interfaces PUBLIC aux_os aux_tracking)
|
PRIVATE xrt-interfaces
|
||||||
|
PUBLIC aux_os aux_tracking
|
||||||
|
)
|
||||||
list(APPEND ENABLED_DRIVERS psmv)
|
list(APPEND ENABLED_DRIVERS psmv)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_PSVR)
|
if(XRT_BUILD_DRIVER_PSVR)
|
||||||
add_library(drv_psvr STATIC
|
add_library(
|
||||||
|
drv_psvr STATIC
|
||||||
psvr/psvr_device.c
|
psvr/psvr_device.c
|
||||||
psvr/psvr_device.h
|
psvr/psvr_device.h
|
||||||
psvr/psvr_interface.h
|
psvr/psvr_interface.h
|
||||||
psvr/psvr_packet.c
|
psvr/psvr_packet.c
|
||||||
psvr/psvr_prober.c)
|
psvr/psvr_prober.c
|
||||||
|
)
|
||||||
target_link_libraries(drv_psvr PRIVATE xrt-interfaces HIDAPI::hidapi aux_util)
|
target_link_libraries(drv_psvr PRIVATE xrt-interfaces HIDAPI::hidapi aux_util)
|
||||||
target_include_directories(drv_psvr PRIVATE ${HIDAPI_INCLUDE_DIRS})
|
target_include_directories(drv_psvr PRIVATE ${HIDAPI_INCLUDE_DIRS})
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS psvr)
|
list(APPEND ENABLED_HEADSET_DRIVERS psvr)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_RS)
|
if(XRT_BUILD_DRIVER_RS)
|
||||||
add_library(drv_rs STATIC
|
add_library(
|
||||||
|
drv_rs STATIC
|
||||||
realsense/rs_ddev.c
|
realsense/rs_ddev.c
|
||||||
realsense/rs_hdev.c
|
realsense/rs_hdev.c
|
||||||
realsense/rs_prober.c
|
realsense/rs_prober.c
|
||||||
realsense/rs_driver.h
|
realsense/rs_driver.h
|
||||||
realsense/rs_interface.h)
|
realsense/rs_interface.h
|
||||||
|
)
|
||||||
target_link_libraries(drv_rs PRIVATE xrt-interfaces realsense2::realsense2 aux_util)
|
target_link_libraries(drv_rs PRIVATE xrt-interfaces realsense2::realsense2 aux_util)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS rs)
|
list(APPEND ENABLED_HEADSET_DRIVERS rs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_REMOTE)
|
if(XRT_BUILD_DRIVER_REMOTE)
|
||||||
add_library(drv_remote STATIC
|
add_library(
|
||||||
|
drv_remote STATIC
|
||||||
remote/r_device.c
|
remote/r_device.c
|
||||||
remote/r_hmd.c
|
remote/r_hmd.c
|
||||||
remote/r_hub.c
|
remote/r_hub.c
|
||||||
remote/r_interface.h
|
remote/r_interface.h
|
||||||
remote/r_internal.h)
|
remote/r_internal.h
|
||||||
|
)
|
||||||
target_link_libraries(drv_remote PRIVATE xrt-interfaces aux_util)
|
target_link_libraries(drv_remote PRIVATE xrt-interfaces aux_util)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS remote)
|
list(APPEND ENABLED_HEADSET_DRIVERS remote)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(VIVE_CONFIG_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/vive")
|
set(VIVE_CONFIG_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/vive")
|
||||||
if(XRT_BUILD_DRIVER_VIVE)
|
if(XRT_BUILD_DRIVER_VIVE)
|
||||||
add_library(drv_vive STATIC
|
add_library(
|
||||||
|
drv_vive STATIC
|
||||||
vive/vive_device.h
|
vive/vive_device.h
|
||||||
vive/vive_device.c
|
vive/vive_device.c
|
||||||
vive/vive_prober.h
|
vive/vive_prober.h
|
||||||
|
@ -182,24 +176,30 @@ if(XRT_BUILD_DRIVER_VIVE)
|
||||||
vive/vive_controller.h
|
vive/vive_controller.h
|
||||||
vive/vive_controller.c
|
vive/vive_controller.c
|
||||||
vive/vive_lighthouse.h
|
vive/vive_lighthouse.h
|
||||||
vive/vive_lighthouse.c)
|
vive/vive_lighthouse.c
|
||||||
target_link_libraries(drv_vive PRIVATE xrt-interfaces aux_os aux_util aux_math xrt-external-cjson aux_vive)
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
drv_vive
|
||||||
|
PRIVATE
|
||||||
|
xrt-interfaces
|
||||||
|
aux_os
|
||||||
|
aux_util
|
||||||
|
aux_math
|
||||||
|
xrt-external-cjson
|
||||||
|
aux_vive
|
||||||
|
)
|
||||||
target_link_libraries(drv_vive PRIVATE ${ZLIB_LIBRARIES})
|
target_link_libraries(drv_vive PRIVATE ${ZLIB_LIBRARIES})
|
||||||
target_include_directories(drv_vive PRIVATE ${ZLIB_INCLUDE_DIRS})
|
target_include_directories(drv_vive PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS vive)
|
list(APPEND ENABLED_HEADSET_DRIVERS vive)
|
||||||
|
|
||||||
if (XRT_BUILD_DRIVER_HANDTRACKING)
|
if(XRT_BUILD_DRIVER_HANDTRACKING)
|
||||||
target_link_libraries(drv_vive PRIVATE drv_ht)
|
target_link_libraries(drv_vive PRIVATE drv_ht)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_V4L2)
|
if(XRT_HAVE_V4L2)
|
||||||
add_library(drv_v4l2 STATIC v4l2/v4l2_driver.c)
|
add_library(drv_v4l2 STATIC v4l2/v4l2_driver.c)
|
||||||
target_link_libraries(drv_v4l2 PRIVATE
|
target_link_libraries(drv_v4l2 PRIVATE xrt-interfaces aux_os aux_util)
|
||||||
xrt-interfaces
|
|
||||||
aux_os
|
|
||||||
aux_util
|
|
||||||
)
|
|
||||||
list(APPEND ENABLED_DRIVERS v4l2)
|
list(APPEND ENABLED_DRIVERS v4l2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -211,7 +211,8 @@ if(XRT_BUILD_DRIVER_VF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_HANDTRACKING)
|
if(XRT_BUILD_DRIVER_HANDTRACKING)
|
||||||
add_library(drv_ht STATIC
|
add_library(
|
||||||
|
drv_ht STATIC
|
||||||
ht/ht_algorithm.cpp
|
ht/ht_algorithm.cpp
|
||||||
ht/ht_driver.cpp
|
ht/ht_driver.cpp
|
||||||
ht/ht_driver.hpp
|
ht/ht_driver.hpp
|
||||||
|
@ -219,56 +220,83 @@ if(XRT_BUILD_DRIVER_HANDTRACKING)
|
||||||
ht/ht_models.cpp
|
ht/ht_models.cpp
|
||||||
ht/ht_hand_math.cpp
|
ht/ht_hand_math.cpp
|
||||||
ht/ht_image_math.cpp
|
ht/ht_image_math.cpp
|
||||||
ht/ht_nms.cpp)
|
ht/ht_nms.cpp
|
||||||
target_link_libraries(drv_ht PRIVATE xrt-interfaces aux_os aux_util aux_math aux_gstreamer ONNXRuntime::ONNXRuntime ${OpenCV_LIBRARIES})
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
drv_ht
|
||||||
|
PRIVATE
|
||||||
|
xrt-interfaces
|
||||||
|
aux_os
|
||||||
|
aux_util
|
||||||
|
aux_math
|
||||||
|
aux_gstreamer
|
||||||
|
ONNXRuntime::ONNXRuntime
|
||||||
|
${OpenCV_LIBRARIES}
|
||||||
|
)
|
||||||
target_include_directories(drv_ht PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR})
|
target_include_directories(drv_ht PRIVATE ${OpenCV_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR})
|
||||||
list(APPEND ENABLED_DRIVERS ht)
|
list(APPEND ENABLED_DRIVERS ht)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (XRT_BUILD_DRIVER_SURVIVE)
|
if(XRT_BUILD_DRIVER_SURVIVE)
|
||||||
add_library(drv_survive STATIC
|
add_library(
|
||||||
survive/survive_driver.c
|
drv_survive STATIC survive/survive_driver.c survive/survive_driver.h
|
||||||
survive/survive_driver.h
|
survive/survive_interface.h survive/survive_prober.c
|
||||||
survive/survive_interface.h
|
)
|
||||||
survive/survive_prober.c)
|
target_link_libraries(
|
||||||
target_link_libraries(drv_survive PRIVATE xrt-interfaces aux_os aux_util aux_math aux_vive PkgConfig::SURVIVE)
|
drv_survive
|
||||||
|
PRIVATE
|
||||||
|
xrt-interfaces
|
||||||
|
aux_os
|
||||||
|
aux_util
|
||||||
|
aux_math
|
||||||
|
aux_vive
|
||||||
|
PkgConfig::SURVIVE
|
||||||
|
)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS survive)
|
list(APPEND ENABLED_HEADSET_DRIVERS survive)
|
||||||
|
|
||||||
if (XRT_BUILD_DRIVER_HANDTRACKING)
|
if(XRT_BUILD_DRIVER_HANDTRACKING)
|
||||||
target_link_libraries(drv_survive PRIVATE drv_ht)
|
target_link_libraries(drv_survive PRIVATE drv_ht)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_ANDROID)
|
if(XRT_BUILD_DRIVER_ANDROID)
|
||||||
add_library(drv_android STATIC
|
add_library(
|
||||||
android/android_prober.c
|
drv_android STATIC android/android_prober.c android/android_prober.h
|
||||||
android/android_prober.h
|
android/android_sensors.c android/android_sensors.h
|
||||||
android/android_sensors.c
|
)
|
||||||
android/android_sensors.h)
|
target_link_libraries(
|
||||||
target_link_libraries(drv_android PRIVATE xrt-interfaces aux_util aux_os aux_android ${ANDROID_LIBRARY})
|
drv_android
|
||||||
|
PRIVATE
|
||||||
|
xrt-interfaces
|
||||||
|
aux_util
|
||||||
|
aux_os
|
||||||
|
aux_android
|
||||||
|
${ANDROID_LIBRARY}
|
||||||
|
)
|
||||||
list(APPEND ENABLED_DRIVERS android)
|
list(APPEND ENABLED_DRIVERS android)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (XRT_BUILD_DRIVER_ILLIXR)
|
if(XRT_BUILD_DRIVER_ILLIXR)
|
||||||
add_library(drv_illixr STATIC
|
add_library(
|
||||||
|
drv_illixr STATIC
|
||||||
illixr/illixr_device.cpp
|
illixr/illixr_device.cpp
|
||||||
illixr/illixr_interface.h
|
illixr/illixr_interface.h
|
||||||
illixr/illixr_prober.c
|
illixr/illixr_prober.c
|
||||||
illixr/illixr_component.cpp
|
illixr/illixr_component.cpp
|
||||||
illixr/illixr_component.h)
|
illixr/illixr_component.h
|
||||||
|
)
|
||||||
target_link_libraries(drv_illixr PUBLIC ${CMAKE_DL_LIBS} xrt-interfaces aux_util aux_os)
|
target_link_libraries(drv_illixr PUBLIC ${CMAKE_DL_LIBS} xrt-interfaces aux_util aux_os)
|
||||||
target_include_directories(drv_illixr PUBLIC ${ILLIXR_PATH})
|
target_include_directories(drv_illixr PUBLIC ${ILLIXR_PATH})
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS illixr)
|
list(APPEND ENABLED_HEADSET_DRIVERS illixr)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(drv_multi STATIC
|
add_library(drv_multi STATIC multi_wrapper/multi.c multi_wrapper/multi.h)
|
||||||
multi_wrapper/multi.c
|
|
||||||
multi_wrapper/multi.h)
|
|
||||||
target_link_libraries(drv_multi PUBLIC xrt-interfaces aux_util)
|
target_link_libraries(drv_multi PUBLIC xrt-interfaces aux_util)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS drv_multi)
|
list(APPEND ENABLED_HEADSET_DRIVERS drv_multi)
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_WMR)
|
if(XRT_BUILD_DRIVER_WMR)
|
||||||
add_library(drv_wmr STATIC
|
add_library(
|
||||||
|
drv_wmr STATIC
|
||||||
wmr/wmr_common.h
|
wmr/wmr_common.h
|
||||||
wmr/wmr_config.c
|
wmr/wmr_config.c
|
||||||
wmr/wmr_config.h
|
wmr/wmr_config.h
|
||||||
|
@ -277,18 +305,20 @@ if(XRT_BUILD_DRIVER_WMR)
|
||||||
wmr/wmr_interface.h
|
wmr/wmr_interface.h
|
||||||
wmr/wmr_prober.c
|
wmr/wmr_prober.c
|
||||||
wmr/wmr_protocol.c
|
wmr/wmr_protocol.c
|
||||||
wmr/wmr_protocol.h)
|
wmr/wmr_protocol.h
|
||||||
|
)
|
||||||
target_link_libraries(drv_wmr PRIVATE xrt-interfaces aux_util aux_math xrt-external-cjson)
|
target_link_libraries(drv_wmr PRIVATE xrt-interfaces aux_util aux_math xrt-external-cjson)
|
||||||
list(APPEND ENABLED_HEADSET_DRIVERS wmr)
|
list(APPEND ENABLED_HEADSET_DRIVERS wmr)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_EUROC)
|
if(XRT_BUILD_DRIVER_EUROC)
|
||||||
add_library(drv_euroc STATIC
|
add_library(
|
||||||
euroc/euroc_player.cpp
|
drv_euroc STATIC euroc/euroc_player.cpp euroc/euroc_driver.h euroc/euroc_device.c
|
||||||
euroc/euroc_driver.h
|
euroc/euroc_interface.h
|
||||||
euroc/euroc_device.c
|
)
|
||||||
euroc/euroc_interface.h)
|
target_link_libraries(
|
||||||
target_link_libraries(drv_euroc PRIVATE xrt-interfaces aux_util aux_tracking ${OpenCV_LIBRARIES})
|
drv_euroc PRIVATE xrt-interfaces aux_util aux_tracking ${OpenCV_LIBRARIES}
|
||||||
|
)
|
||||||
target_include_directories(drv_euroc PRIVATE ${OpenCV_INCLUDE_DIRS})
|
target_include_directories(drv_euroc PRIVATE ${OpenCV_INCLUDE_DIRS})
|
||||||
list(APPEND ENABLED_DRIVERS euroc)
|
list(APPEND ENABLED_DRIVERS euroc)
|
||||||
endif()
|
endif()
|
||||||
|
@ -296,10 +326,10 @@ endif()
|
||||||
if(XRT_BUILD_SAMPLES)
|
if(XRT_BUILD_SAMPLES)
|
||||||
# We build the sample driver to make sure it stays valid,
|
# We build the sample driver to make sure it stays valid,
|
||||||
# but it never gets linked into a final target.
|
# but it never gets linked into a final target.
|
||||||
add_library(drv_sample STATIC
|
add_library(
|
||||||
sample/sample_hmd.c
|
drv_sample STATIC sample/sample_hmd.c sample/sample_interface.h
|
||||||
sample/sample_interface.h
|
sample/sample_prober.c
|
||||||
sample/sample_prober.c)
|
)
|
||||||
target_link_libraries(drv_sample PRIVATE xrt-interfaces aux_util)
|
target_link_libraries(drv_sample PRIVATE xrt-interfaces aux_util)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,6 @@
|
||||||
add_subdirectory(xrt)
|
add_subdirectory(xrt)
|
||||||
|
|
||||||
add_library(xrt-interfaces INTERFACE)
|
add_library(xrt-interfaces INTERFACE)
|
||||||
target_include_directories(xrt-interfaces INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(
|
||||||
|
xrt-interfaces INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
|
@ -1,38 +1,33 @@
|
||||||
# Copyright 2020, Collabora, Ltd.
|
# Copyright 2020-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
# Generate a header containing defines for each enabled driver
|
# Generate a header containing defines for each enabled driver
|
||||||
set(FILE_CONTENTS "")
|
set(FILE_CONTENTS "")
|
||||||
foreach(DRIVER ${AVAILABLE_DRIVERS})
|
foreach(driver ${AVAILABLE_DRIVERS})
|
||||||
if(XRT_BUILD_DRIVER_${DRIVER})
|
if(XRT_BUILD_DRIVER_${driver})
|
||||||
string(APPEND FILE_CONTENTS "#define XRT_BUILD_DRIVER_${DRIVER}\n")
|
string(APPEND FILE_CONTENTS "#define XRT_BUILD_DRIVER_${driver}\n")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# First setup all of the config headers.
|
# First setup all of the config headers.
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_drivers.h.cmake_in
|
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_drivers.h.cmake_in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_drivers.h
|
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_drivers.h @ONLY
|
||||||
@ONLY
|
|
||||||
)
|
)
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_have.h.cmake_in
|
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_have.h.cmake_in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_have.h
|
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_have.h @ONLY
|
||||||
@ONLY
|
|
||||||
)
|
)
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_build.h.cmake_in
|
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_build.h.cmake_in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_build.h
|
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_build.h @ONLY
|
||||||
@ONLY
|
|
||||||
)
|
)
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_vulkan.h.cmake_in
|
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_vulkan.h.cmake_in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_vulkan.h
|
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_vulkan.h @ONLY
|
||||||
@ONLY
|
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_android.h.cmake_in
|
${CMAKE_CURRENT_SOURCE_DIR}/xrt_config_android.h.cmake_in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_android.h
|
${CMAKE_CURRENT_BINARY_DIR}/xrt_config_android.h @ONLY
|
||||||
@ONLY
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,132 +1,114 @@
|
||||||
# Copyright 2020, Collabora, Ltd.
|
# Copyright 2020-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# Generator
|
# Generator
|
||||||
|
|
||||||
function(proto_gen output)
|
foreach(
|
||||||
add_custom_command(OUTPUT ${output}
|
fn
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py
|
ipc_protocol_generated.h
|
||||||
|
ipc_client_generated.h
|
||||||
|
ipc_client_generated.c
|
||||||
|
ipc_server_generated.h
|
||||||
|
ipc_server_generated.c
|
||||||
|
)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${fn}"
|
||||||
|
COMMAND
|
||||||
|
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json
|
${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json
|
||||||
${output}
|
"${CMAKE_CURRENT_BINARY_DIR}/${fn}"
|
||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py
|
VERBATIM
|
||||||
|
DEPENDS
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/shared/ipcproto/common.py
|
${CMAKE_CURRENT_SOURCE_DIR}/shared/ipcproto/common.py
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json
|
${CMAKE_CURRENT_SOURCE_DIR}/shared/proto.json
|
||||||
)
|
COMMENT "Generating ${fn} from protocol JSON description"
|
||||||
endfunction(proto_gen)
|
)
|
||||||
|
endforeach()
|
||||||
proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_protocol_generated.h)
|
|
||||||
proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.h)
|
|
||||||
proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.c)
|
|
||||||
proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.h)
|
|
||||||
proto_gen(${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.c)
|
|
||||||
|
|
||||||
set(IPC_COMMON_SOURCES
|
set(IPC_COMMON_SOURCES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/ipc_protocol_generated.h
|
${CMAKE_CURRENT_BINARY_DIR}/ipc_protocol_generated.h
|
||||||
shared/ipc_shmem.c
|
shared/ipc_shmem.c
|
||||||
shared/ipc_shmem.h
|
shared/ipc_shmem.h
|
||||||
shared/ipc_utils.c
|
shared/ipc_utils.c
|
||||||
shared/ipc_utils.h)
|
shared/ipc_utils.h
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(ipc_shared STATIC ${IPC_COMMON_SOURCES})
|
||||||
|
target_include_directories(
|
||||||
|
ipc_shared PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
target_link_libraries(ipc_shared PRIVATE aux_util)
|
||||||
|
|
||||||
|
if(RT_LIBRARY)
|
||||||
|
target_link_libraries(ipc_shared PUBLIC ${RT_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
###
|
###
|
||||||
# Client
|
# Client
|
||||||
|
|
||||||
add_library(ipc_client STATIC
|
add_library(
|
||||||
|
ipc_client STATIC
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.c
|
${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.c
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.h
|
${CMAKE_CURRENT_BINARY_DIR}/ipc_client_generated.h
|
||||||
${IPC_COMMON_SOURCES}
|
|
||||||
client/ipc_client.h
|
client/ipc_client.h
|
||||||
client/ipc_client_compositor.c
|
client/ipc_client_compositor.c
|
||||||
client/ipc_client_device.c
|
client/ipc_client_device.c
|
||||||
client/ipc_client_hmd.c
|
client/ipc_client_hmd.c
|
||||||
client/ipc_client_instance.c
|
client/ipc_client_instance.c
|
||||||
)
|
)
|
||||||
target_include_directories(ipc_client INTERFACE
|
target_include_directories(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
ipc_client PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
)
|
||||||
target_include_directories(ipc_client PRIVATE
|
target_link_libraries(ipc_client PRIVATE aux_util ipc_shared)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
target_link_libraries(ipc_client PRIVATE
|
|
||||||
aux_util
|
|
||||||
)
|
|
||||||
if(ANDROID)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# Server
|
# Server
|
||||||
|
|
||||||
add_library(ipc_server STATIC
|
add_library(
|
||||||
|
ipc_server STATIC
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.c
|
${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.c
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.h
|
${CMAKE_CURRENT_BINARY_DIR}/ipc_server_generated.h
|
||||||
${IPC_COMMON_SOURCES}
|
|
||||||
server/ipc_server.h
|
server/ipc_server.h
|
||||||
server/ipc_server_handler.c
|
server/ipc_server_handler.c
|
||||||
server/ipc_server_per_client_thread.c
|
server/ipc_server_per_client_thread.c
|
||||||
server/ipc_server_process.c
|
server/ipc_server_process.c
|
||||||
)
|
)
|
||||||
target_include_directories(ipc_server
|
target_include_directories(
|
||||||
INTERFACE
|
ipc_server
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
target_include_directories(ipc_server PRIVATE
|
target_link_libraries(ipc_server PRIVATE aux_util ipc_shared)
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../compositor
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
target_link_libraries(ipc_server PRIVATE
|
|
||||||
aux_util
|
|
||||||
)
|
|
||||||
|
|
||||||
if(RT_LIBRARY)
|
|
||||||
target_link_libraries(ipc_client PRIVATE
|
|
||||||
${RT_LIBRARY}
|
|
||||||
)
|
|
||||||
target_link_libraries(ipc_server PRIVATE
|
|
||||||
${RT_LIBRARY}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XRT_HAVE_SYSTEMD)
|
if(XRT_HAVE_SYSTEMD)
|
||||||
target_include_directories(ipc_server PRIVATE
|
target_include_directories(ipc_server PRIVATE ${SYSTEMD_INCLUDE_DIRS})
|
||||||
${SYSTEMD_INCLUDE_DIRS})
|
target_link_libraries(ipc_server PRIVATE ${SYSTEMD_LIBRARIES})
|
||||||
target_link_libraries(ipc_server PRIVATE
|
|
||||||
${SYSTEMD_LIBRARIES})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
add_library(ipc_android STATIC
|
add_library(
|
||||||
|
ipc_android STATIC
|
||||||
android/ipc_client_android.cpp
|
android/ipc_client_android.cpp
|
||||||
android/ipc_client_android.h
|
android/ipc_client_android.h
|
||||||
android/org.freedesktop.monado.ipc.cpp
|
android/org.freedesktop.monado.ipc.cpp
|
||||||
android/org.freedesktop.monado.ipc.hpp
|
android/org.freedesktop.monado.ipc.hpp
|
||||||
android/org.freedesktop.monado.ipc.impl.hpp
|
android/org.freedesktop.monado.ipc.impl.hpp
|
||||||
)
|
)
|
||||||
target_link_libraries(ipc_android PUBLIC
|
target_link_libraries(
|
||||||
xrt-external-jni-wrap
|
ipc_android PUBLIC xrt-external-jni-wrap xrt-external-jnipp aux_android
|
||||||
xrt-external-jnipp
|
|
||||||
aux_android
|
|
||||||
)
|
)
|
||||||
target_sources(ipc_server PRIVATE
|
target_sources(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_android.c
|
ipc_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_android.c
|
||||||
)
|
)
|
||||||
target_link_libraries(ipc_server PUBLIC
|
target_link_libraries(
|
||||||
${ANDROID_LIBRARY}
|
ipc_shared
|
||||||
PRIVATE
|
PUBLIC ${ANDROID_LIBRARY}
|
||||||
aux_android
|
PRIVATE aux_android ipc_android
|
||||||
ipc_android
|
|
||||||
)
|
|
||||||
target_link_libraries(ipc_client PUBLIC
|
|
||||||
${ANDROID_LIBRARY}
|
|
||||||
PRIVATE
|
|
||||||
aux_android
|
|
||||||
ipc_android
|
|
||||||
)
|
)
|
||||||
elseif(XRT_HAVE_LINUX)
|
elseif(XRT_HAVE_LINUX)
|
||||||
target_sources(ipc_server PRIVATE
|
target_sources(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_linux.c
|
ipc_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/server/ipc_server_mainloop_linux.c
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -23,25 +23,28 @@ add_library(
|
||||||
gui_window_record.h
|
gui_window_record.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(st_gui PRIVATE xrt-external-stb aux_util aux_os aux_ogl)
|
target_link_libraries(
|
||||||
target_include_directories(st_gui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../drivers)
|
st_gui
|
||||||
|
PRIVATE
|
||||||
|
xrt-external-stb
|
||||||
|
aux_util
|
||||||
|
aux_os
|
||||||
|
aux_ogl
|
||||||
|
drv_includes
|
||||||
|
xrt-external-imgui
|
||||||
|
)
|
||||||
|
target_include_directories(st_gui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||||
|
|
||||||
if(XRT_HAVE_GST)
|
if(XRT_HAVE_GST)
|
||||||
target_link_libraries(st_gui PRIVATE
|
target_link_libraries(st_gui PRIVATE aux_gstreamer)
|
||||||
aux_gstreamer
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_DEPTHAI)
|
if(XRT_BUILD_DRIVER_DEPTHAI)
|
||||||
target_link_libraries(st_gui PRIVATE
|
target_link_libraries(st_gui PRIVATE drv_depthai)
|
||||||
drv_depthai
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_REMOTE)
|
if(XRT_BUILD_DRIVER_REMOTE)
|
||||||
target_link_libraries(st_gui PRIVATE
|
target_link_libraries(st_gui PRIVATE drv_remote)
|
||||||
drv_remote
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_SDL2)
|
if(XRT_HAVE_SDL2)
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
# Copyright 2019-2020, Collabora, Ltd.
|
# Copyright 2019-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
###
|
###
|
||||||
# Main code
|
# Main code
|
||||||
#
|
#
|
||||||
|
|
||||||
set(OXR_SOURCE_FILES
|
add_library(
|
||||||
|
st_oxr STATIC
|
||||||
oxr_api_action.c
|
oxr_api_action.c
|
||||||
oxr_api_funcs.h
|
oxr_api_funcs.h
|
||||||
oxr_api_instance.c
|
oxr_api_instance.c
|
||||||
|
@ -39,69 +40,52 @@ set(OXR_SOURCE_FILES
|
||||||
)
|
)
|
||||||
|
|
||||||
if(XRT_HAVE_VULKAN)
|
if(XRT_HAVE_VULKAN)
|
||||||
list(APPEND OXR_SOURCE_FILES
|
target_sources(st_oxr PRIVATE oxr_session_gfx_vk.c oxr_swapchain_vk.c oxr_vulkan.c)
|
||||||
oxr_session_gfx_vk.c
|
target_link_libraries(st_oxr PUBLIC Vulkan::Vulkan)
|
||||||
oxr_swapchain_vk.c
|
|
||||||
oxr_vulkan.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_OPENGL)
|
if(XRT_HAVE_OPENGL)
|
||||||
add_definitions(-DXR_USE_GRAPHICS_API_OPENGL)
|
target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_OPENGL)
|
||||||
endif()
|
endif()
|
||||||
if(XRT_HAVE_OPENGLES)
|
if(XRT_HAVE_OPENGLES)
|
||||||
add_definitions(-DXR_USE_GRAPHICS_API_OPENGL_ES)
|
target_compile_definitions(st_oxr PRIVATE XR_USE_GRAPHICS_API_OPENGL_ES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
||||||
list(APPEND OXR_SOURCE_FILES
|
target_sources(st_oxr PRIVATE oxr_session_gfx_gl.c oxr_swapchain_gl.c)
|
||||||
oxr_session_gfx_gl.c
|
target_link_libraries(st_oxr PUBLIC aux_ogl)
|
||||||
oxr_swapchain_gl.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_XLIB)
|
if(XRT_HAVE_XLIB)
|
||||||
add_definitions(-DXR_USE_PLATFORM_XLIB)
|
target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_XLIB)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_EGL)
|
if(XRT_HAVE_EGL)
|
||||||
add_definitions(-DXR_USE_PLATFORM_EGL)
|
target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_EGL)
|
||||||
list(APPEND OXR_SOURCE_FILES
|
target_sources(st_oxr PRIVATE oxr_session_gfx_egl.c)
|
||||||
oxr_session_gfx_egl.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(ANDROID)
|
|
||||||
add_definitions(-DXR_USE_PLATFORM_ANDROID)
|
|
||||||
list(APPEND OXR_SOURCE_FILES
|
|
||||||
oxr_session_gfx_gles_android.c
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(st_oxr STATIC ${OXR_SOURCE_FILES})
|
|
||||||
target_link_libraries(st_oxr PRIVATE
|
|
||||||
xrt-interfaces
|
|
||||||
xrt-external-openxr
|
|
||||||
aux_util
|
|
||||||
aux_math
|
|
||||||
aux_generated_bindings
|
|
||||||
comp_client
|
|
||||||
aux-includes
|
|
||||||
PUBLIC
|
|
||||||
aux_os
|
|
||||||
)
|
|
||||||
if(XRT_HAVE_VULKAN)
|
|
||||||
target_link_libraries(st_oxr PUBLIC Vulkan::Vulkan)
|
|
||||||
endif()
|
|
||||||
if(XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES)
|
|
||||||
target_link_libraries(st_oxr PUBLIC aux_ogl)
|
|
||||||
endif()
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
|
target_compile_definitions(st_oxr PRIVATE XR_USE_PLATFORM_ANDROID)
|
||||||
|
target_sources(st_oxr PRIVATE oxr_session_gfx_gles_android.c)
|
||||||
target_link_libraries(st_oxr PRIVATE aux_android)
|
target_link_libraries(st_oxr PRIVATE aux_android)
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(st_oxr
|
|
||||||
|
target_link_libraries(
|
||||||
|
st_oxr
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
xrt-interfaces
|
||||||
INTERFACE
|
xrt-external-openxr
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/..)
|
aux_util
|
||||||
|
aux_math
|
||||||
|
aux_generated_bindings
|
||||||
|
comp_client
|
||||||
|
aux-includes
|
||||||
|
PUBLIC aux_os
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(
|
||||||
|
st_oxr
|
||||||
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||||
|
)
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
# Copyright 2019-2020, Collabora, Ltd.
|
# Copyright 2019-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
set(PROBER_INCLUDES)
|
add_library(
|
||||||
|
st_prober STATIC
|
||||||
set(PROBER_SOURCE_FILES
|
|
||||||
p_documentation.h
|
p_documentation.h
|
||||||
p_dump.c
|
p_dump.c
|
||||||
p_prober.c
|
p_prober.c
|
||||||
|
@ -11,88 +10,47 @@ set(PROBER_SOURCE_FILES
|
||||||
p_tracking.c
|
p_tracking.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(st_prober PUBLIC xrt-interfaces)
|
||||||
|
target_link_libraries(
|
||||||
|
st_prober
|
||||||
|
PRIVATE
|
||||||
|
drv_includes
|
||||||
|
drv_multi
|
||||||
|
aux_util
|
||||||
|
aux_os
|
||||||
|
aux_tracking
|
||||||
|
)
|
||||||
|
|
||||||
# Add libudev
|
# Add libudev
|
||||||
if(XRT_HAVE_LIBUDEV)
|
if(XRT_HAVE_LIBUDEV)
|
||||||
list(APPEND PROBER_SOURCE_FILES
|
target_sources(st_prober PRIVATE p_udev.c)
|
||||||
p_udev.c
|
target_include_directories(st_prober PRIVATE ${UDEV_INCLUDE_DIRS})
|
||||||
)
|
target_link_libraries(st_prober PRIVATE ${UDEV_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add libusb
|
# Add libusb
|
||||||
if(XRT_HAVE_LIBUSB)
|
if(XRT_HAVE_LIBUSB)
|
||||||
list(APPEND PROBER_SOURCE_FILES
|
target_sources(st_prober PRIVATE p_libusb.c)
|
||||||
p_libusb.c
|
target_include_directories(st_prober PUBLIC ${LIBUSB1_INCLUDE_DIRS})
|
||||||
)
|
target_link_libraries(st_prober PRIVATE ${LIBUSB1_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add libuvc
|
# Add libuvc
|
||||||
if(XRT_HAVE_LIBUVC)
|
if(XRT_HAVE_LIBUVC)
|
||||||
list(APPEND PROBER_SOURCE_FILES
|
target_sources(st_prober PRIVATE p_libuvc.c)
|
||||||
p_libuvc.c
|
target_include_directories(st_prober PRIVATE ${LIBUVC_INCLUDES})
|
||||||
)
|
target_link_libraries(st_prober PRIVATE ${LIBUVC_LIBRARIES})
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(st_prober STATIC
|
|
||||||
${PROBER_SOURCE_FILES}
|
|
||||||
)
|
|
||||||
target_link_libraries(st_prober PUBLIC
|
|
||||||
xrt-interfaces
|
|
||||||
)
|
|
||||||
target_link_libraries(st_prober PRIVATE
|
|
||||||
drv_multi
|
|
||||||
aux_util
|
|
||||||
aux_os
|
|
||||||
aux_tracking
|
|
||||||
)
|
|
||||||
target_include_directories(st_prober PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../drivers
|
|
||||||
)
|
|
||||||
|
|
||||||
if(XRT_HAVE_LIBUDEV)
|
|
||||||
target_include_directories(st_prober
|
|
||||||
PRIVATE
|
|
||||||
${UDEV_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
target_link_libraries(st_prober PRIVATE
|
|
||||||
${UDEV_LIBRARIES}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XRT_HAVE_LIBUSB)
|
|
||||||
target_include_directories(st_prober
|
|
||||||
PUBLIC
|
|
||||||
${LIBUSB1_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
target_link_libraries(st_prober PRIVATE
|
|
||||||
${LIBUSB1_LIBRARIES}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XRT_HAVE_LIBUVC)
|
|
||||||
target_include_directories(st_prober
|
|
||||||
PRIVATE
|
|
||||||
${LIBUVC_INCLUDES}
|
|
||||||
)
|
|
||||||
target_link_libraries(st_prober PRIVATE
|
|
||||||
${LIBUVC_LIBRARIES}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_V4L2)
|
if(XRT_HAVE_V4L2)
|
||||||
# Uses v4l2_fs_create
|
# Uses v4l2_fs_create
|
||||||
target_link_libraries(st_prober PRIVATE
|
target_link_libraries(st_prober PRIVATE drv_v4l2)
|
||||||
drv_v4l2
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_REMOTE)
|
if(XRT_BUILD_DRIVER_REMOTE)
|
||||||
target_link_libraries(st_prober PRIVATE
|
target_link_libraries(st_prober PRIVATE drv_remote)
|
||||||
drv_remote
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_VF)
|
if(XRT_BUILD_DRIVER_VF)
|
||||||
target_link_libraries(st_prober PRIVATE
|
target_link_libraries(st_prober PRIVATE drv_vf)
|
||||||
drv_vf
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,20 +1,9 @@
|
||||||
# Copyright 2020, Collabora, Ltd.
|
# Copyright 2020-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
set(OVRD_SOURCE_FILES
|
add_library(st_ovrd STATIC ovrd_driver.cpp ovrd_interface.h)
|
||||||
ovrd_driver.cpp
|
|
||||||
ovrd_interface.h
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(st_ovrd STATIC
|
target_include_directories(st_ovrd INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${OVRD_SOURCE_FILES}
|
target_link_libraries(
|
||||||
)
|
st_ovrd PRIVATE xrt-interfaces xrt-external-openvr aux_math aux_generated_bindings
|
||||||
target_include_directories(st_ovrd INTERFACE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
target_link_libraries(st_ovrd PRIVATE
|
|
||||||
xrt-interfaces
|
|
||||||
xrt-external-openvr
|
|
||||||
aux_math
|
|
||||||
aux_generated_bindings
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
# This is where we collect all of the pieces from the different parts of
|
# This is where we collect all of the pieces from the different parts of
|
||||||
# the source tree and build a complete driver or integration part.
|
# the source tree and build a complete driver or integration part.
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(common)
|
add_subdirectory(common)
|
||||||
|
|
||||||
if(XRT_FEATURE_OPENXR)
|
if(XRT_FEATURE_OPENXR)
|
||||||
|
|
|
@ -4,39 +4,23 @@
|
||||||
######
|
######
|
||||||
# Create a cli interface for Monado.
|
# Create a cli interface for Monado.
|
||||||
|
|
||||||
|
add_executable(
|
||||||
set(SOURCE_FILES
|
cli
|
||||||
cli_cmd_lighthouse.c
|
cli_cmd_lighthouse.c
|
||||||
cli_cmd_probe.c
|
cli_cmd_probe.c
|
||||||
cli_cmd_test.c
|
cli_cmd_test.c
|
||||||
cli_common.h
|
cli_common.h
|
||||||
cli_main.c
|
cli_main.c
|
||||||
)
|
)
|
||||||
|
add_sanitizers(cli)
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
# No getline on Windows, so until we have a portable impl
|
# No getline on Windows, so until we have a portable impl
|
||||||
list(APPEND SOURCE_FILES
|
target_sources(cli PRIVATE cli_cmd_calibrate.c)
|
||||||
cli_cmd_calibrate.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(cli
|
set_target_properties(cli PROPERTIES OUTPUT_NAME monado-cli PREFIX "")
|
||||||
${SOURCE_FILES}
|
|
||||||
)
|
|
||||||
add_sanitizers(cli)
|
|
||||||
|
|
||||||
set_target_properties(cli PROPERTIES
|
target_link_libraries(cli PRIVATE aux_os aux_util aux_math target_instance_no_comp)
|
||||||
OUTPUT_NAME monado-cli
|
|
||||||
PREFIX ""
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(cli PRIVATE
|
install(TARGETS cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
aux_os
|
|
||||||
aux_util
|
|
||||||
aux_math
|
|
||||||
target_instance_no_comp
|
|
||||||
)
|
|
||||||
|
|
||||||
install(TARGETS cli
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
)
|
|
||||||
|
|
|
@ -1,24 +1,19 @@
|
||||||
# Copyright 2019-2020, Collabora, Ltd.
|
# Copyright 2019-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
|
||||||
####
|
####
|
||||||
# Lists
|
# Lists
|
||||||
#
|
#
|
||||||
|
|
||||||
add_library(target_lists STATIC
|
add_library(target_lists STATIC target_lists.c)
|
||||||
target_lists.c
|
target_link_libraries(
|
||||||
)
|
target_lists
|
||||||
target_link_libraries(target_lists PRIVATE
|
PRIVATE
|
||||||
xrt-interfaces
|
xrt-interfaces
|
||||||
aux_util # TODO Remove this after removing #include "util/u_time.h" from xrt_defines.h
|
aux_util # TODO Remove this after removing #include "util/u_time.h" from xrt_defines.h
|
||||||
)
|
drv_includes
|
||||||
target_include_directories(target_lists PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../drivers
|
|
||||||
)
|
|
||||||
target_include_directories(target_lists PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
)
|
||||||
|
target_include_directories(target_lists PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_ARDUINO)
|
if(XRT_BUILD_DRIVER_ARDUINO)
|
||||||
target_link_libraries(target_lists PRIVATE drv_arduino)
|
target_link_libraries(target_lists PRIVATE drv_arduino)
|
||||||
|
@ -114,40 +109,32 @@ endif()
|
||||||
# Instance
|
# Instance
|
||||||
#
|
#
|
||||||
if(XRT_FEATURE_COMPOSITOR_MAIN)
|
if(XRT_FEATURE_COMPOSITOR_MAIN)
|
||||||
add_library(target_instance STATIC
|
add_library(target_instance STATIC target_instance.c)
|
||||||
target_instance.c
|
target_link_libraries(
|
||||||
)
|
target_instance
|
||||||
target_link_libraries(target_instance PRIVATE
|
PRIVATE
|
||||||
xrt-interfaces
|
xrt-interfaces
|
||||||
aux_util
|
aux_util
|
||||||
st_prober
|
st_prober
|
||||||
target_lists
|
target_lists
|
||||||
comp_main
|
comp_main
|
||||||
)
|
drv_includes
|
||||||
target_include_directories(target_instance PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../drivers
|
|
||||||
)
|
|
||||||
target_include_directories(target_instance PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
)
|
||||||
|
target_include_directories(target_instance PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
####
|
####
|
||||||
# Instance without Compositor
|
# Instance without Compositor
|
||||||
#
|
#
|
||||||
|
|
||||||
add_library(target_instance_no_comp STATIC
|
add_library(target_instance_no_comp STATIC target_instance_no_comp.c)
|
||||||
target_instance_no_comp.c
|
target_link_libraries(
|
||||||
)
|
target_instance_no_comp
|
||||||
target_link_libraries(target_instance_no_comp PRIVATE
|
PRIVATE
|
||||||
xrt-interfaces
|
xrt-interfaces
|
||||||
aux_util
|
aux_util
|
||||||
st_prober
|
st_prober
|
||||||
target_lists
|
target_lists
|
||||||
)
|
drv_includes
|
||||||
target_include_directories(target_instance_no_comp PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../drivers
|
|
||||||
)
|
|
||||||
target_include_directories(target_instance_no_comp PUBLIC
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
)
|
||||||
|
target_include_directories(target_instance_no_comp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
|
@ -1,22 +1,11 @@
|
||||||
# Copyright 2020-2021, Collabora, Ltd.
|
# Copyright 2020-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
add_executable(monado-ctl main.c)
|
||||||
add_executable(monado-ctl
|
|
||||||
main.c
|
|
||||||
)
|
|
||||||
add_sanitizers(monado-ctl)
|
add_sanitizers(monado-ctl)
|
||||||
|
|
||||||
target_include_directories(monado-ctl PRIVATE
|
target_include_directories(monado-ctl PRIVATE ipc)
|
||||||
ipc
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(monado-ctl PRIVATE
|
target_link_libraries(monado-ctl PRIVATE aux_util ipc_client)
|
||||||
aux_util
|
|
||||||
ipc_client
|
|
||||||
)
|
|
||||||
|
|
||||||
install(TARGETS monado-ctl
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
install(TARGETS monado-ctl RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
|
@ -11,13 +11,14 @@ add_sanitizers(gui)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
gui
|
gui
|
||||||
PRIVATE aux_os
|
PRIVATE
|
||||||
aux_ogl
|
aux_os
|
||||||
aux_util
|
aux_ogl
|
||||||
aux_math
|
aux_util
|
||||||
st_gui
|
aux_math
|
||||||
target_instance_no_comp
|
st_gui
|
||||||
xrt-external-imgui-sdl2
|
target_instance_no_comp
|
||||||
|
xrt-external-imgui-sdl2
|
||||||
)
|
)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(gui PRIVATE SDL2::SDL2main)
|
target_link_libraries(gui PRIVATE SDL2::SDL2main)
|
||||||
|
|
|
@ -7,89 +7,60 @@
|
||||||
set(RUNTIME_BARE_SUFFIX monado)
|
set(RUNTIME_BARE_SUFFIX monado)
|
||||||
set(RUNTIME_SUFFIX _${RUNTIME_BARE_SUFFIX})
|
set(RUNTIME_SUFFIX _${RUNTIME_BARE_SUFFIX})
|
||||||
|
|
||||||
set(RUNTIME_TARGET ${RUNTIME_PREFIX}openxr${RUNTIME_SUFFIX} CACHE INTERNAL "" FORCE)
|
set(RUNTIME_TARGET
|
||||||
|
${RUNTIME_PREFIX}openxr${RUNTIME_SUFFIX}
|
||||||
|
CACHE INTERNAL "" FORCE
|
||||||
|
)
|
||||||
|
|
||||||
# OpenXR 1.0
|
# OpenXR 1.0
|
||||||
set(XR_API_MAJOR "1")
|
set(XR_API_MAJOR "1")
|
||||||
|
|
||||||
set(SOURCE_FILES
|
add_library(${RUNTIME_TARGET} MODULE target.c libopenxr.def)
|
||||||
target.c
|
|
||||||
oxr_sdl2_hack.c
|
|
||||||
libopenxr.def
|
|
||||||
)
|
|
||||||
|
|
||||||
# depends on above generated files
|
|
||||||
add_library(${RUNTIME_TARGET} MODULE
|
|
||||||
${MANIFEST_DEV_PATH}
|
|
||||||
${MANIFEST_PATH}
|
|
||||||
${SOURCE_FILES}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Note: Order may matter in these lists!
|
# Note: Order may matter in these lists!
|
||||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
target_link_libraries(${RUNTIME_TARGET} PUBLIC aux_vk aux_os aux_util aux_math)
|
||||||
aux_vk
|
|
||||||
aux_os
|
|
||||||
aux_util
|
|
||||||
aux_math
|
|
||||||
)
|
|
||||||
|
|
||||||
if(XRT_HAVE_OPENGL)
|
|
||||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC aux_ogl)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XRT_HAVE_SDL2)
|
|
||||||
target_link_libraries(${RUNTIME_TARGET} PRIVATE st_gui xrt-external-imgui-sdl2 ${SDL2_LIBRARIES})
|
|
||||||
|
|
||||||
if(XRT_BUILD_DRIVER_QWERTY)
|
|
||||||
target_link_libraries(${RUNTIME_TARGET} PRIVATE
|
|
||||||
drv_qwerty
|
|
||||||
drv_qwerty_includes
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(XRT_FEATURE_SERVICE)
|
if(XRT_FEATURE_SERVICE)
|
||||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
target_link_libraries(${RUNTIME_TARGET} PUBLIC st_oxr ipc_client comp_client)
|
||||||
st_oxr
|
|
||||||
ipc_client
|
|
||||||
comp_client
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${RUNTIME_TARGET} PUBLIC
|
target_link_libraries(
|
||||||
st_oxr
|
${RUNTIME_TARGET}
|
||||||
st_prober
|
PUBLIC
|
||||||
target_lists
|
st_oxr
|
||||||
target_instance
|
st_prober
|
||||||
comp_main
|
target_lists
|
||||||
comp_client
|
target_instance
|
||||||
|
comp_main
|
||||||
|
comp_client
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
# Force the main "negotiate" symbol's inclusion
|
# Force the main "negotiate" symbol's inclusion
|
||||||
# and use a version script to ensure that's the only one we expose.
|
# and use a version script to ensure that's the only one we expose.
|
||||||
set_property(TARGET ${RUNTIME_TARGET}
|
set_property(
|
||||||
|
TARGET ${RUNTIME_TARGET}
|
||||||
APPEND_STRING
|
APPEND_STRING
|
||||||
PROPERTY LINK_FLAGS
|
PROPERTY
|
||||||
"-u xrNegotiateLoaderRuntimeInterface -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version")
|
LINK_FLAGS
|
||||||
|
"-u xrNegotiateLoaderRuntimeInterface -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version"
|
||||||
|
)
|
||||||
# Re-link if the version script changes.
|
# Re-link if the version script changes.
|
||||||
set_property(TARGET ${RUNTIME_TARGET}
|
set_property(
|
||||||
|
TARGET ${RUNTIME_TARGET}
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY LINK_DEPENDS
|
PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/libopenxr.version")
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Install the runtime itself
|
# Install the runtime itself
|
||||||
install(TARGETS ${RUNTIME_TARGET}
|
install(
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
TARGETS ${RUNTIME_TARGET} #
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} #
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} #
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# $LIBPATH is a generator expression that is evaluated after configure_file, so we have to use file(GENERATE) instead
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# Generate runtime manifest with absolute path to runtime intended for development without installing
|
# Generate runtime manifest with absolute path to runtime intended for development without installing
|
||||||
set(MANIFEST_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/openxr_monado.in.json)
|
set(MANIFEST_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/openxr_monado.in.json)
|
||||||
|
@ -116,9 +87,11 @@ else()
|
||||||
set(DEV_MANIFEST_OUTPUT "${CMAKE_BINARY_DIR}/${RUNTIME_TARGET}-dev.json")
|
set(DEV_MANIFEST_OUTPUT "${CMAKE_BINARY_DIR}/${RUNTIME_TARGET}-dev.json")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GENERATE
|
file(
|
||||||
|
GENERATE
|
||||||
OUTPUT "${DEV_MANIFEST_OUTPUT}"
|
OUTPUT "${DEV_MANIFEST_OUTPUT}"
|
||||||
INPUT ${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest.json)
|
INPUT ${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest.json
|
||||||
|
)
|
||||||
|
|
||||||
###
|
###
|
||||||
# Prepare the installable manifest: will be generated completely at install time,
|
# Prepare the installable manifest: will be generated completely at install time,
|
||||||
|
@ -126,7 +99,9 @@ file(GENERATE
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(MANIFEST_RELATIVE_DIR share/openxr/${XR_API_MAJOR}/)
|
set(MANIFEST_RELATIVE_DIR share/openxr/${XR_API_MAJOR}/)
|
||||||
if(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME)
|
if(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME)
|
||||||
configure_file(active_runtime.cmake ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake @ONLY)
|
configure_file(
|
||||||
|
active_runtime.cmake ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake @ONLY
|
||||||
|
)
|
||||||
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake)
|
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake)
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
@ -137,7 +112,25 @@ endif()
|
||||||
# If we know where to install the manifest, we can set it up to be installed.
|
# If we know where to install the manifest, we can set it up to be installed.
|
||||||
if(MANIFEST_RELATIVE_DIR)
|
if(MANIFEST_RELATIVE_DIR)
|
||||||
set(RUNTIME_RELATIVE_DIR ${CMAKE_INSTALL_LIBDIR})
|
set(RUNTIME_RELATIVE_DIR ${CMAKE_INSTALL_LIBDIR})
|
||||||
set(RUNTIME_FILENAME ${CMAKE_SHARED_MODULE_PREFIX}${RUNTIME_TARGET}${CMAKE_SHARED_MODULE_SUFFIX})
|
set(RUNTIME_FILENAME
|
||||||
|
${CMAKE_SHARED_MODULE_PREFIX}${RUNTIME_TARGET}${CMAKE_SHARED_MODULE_SUFFIX}
|
||||||
|
)
|
||||||
configure_file(make_manifest.cmake ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake @ONLY)
|
configure_file(make_manifest.cmake ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake @ONLY)
|
||||||
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake)
|
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/make_manifest.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
###
|
||||||
|
# Inelegant but effective SDL2-based debug GUI
|
||||||
|
add_library(oxr_sdl2 STATIC oxr_sdl2_hack.c)
|
||||||
|
target_link_libraries(oxr_sdl2 PRIVATE aux_util)
|
||||||
|
if(XRT_HAVE_OPENGL)
|
||||||
|
target_link_libraries(oxr_sdl2 PUBLIC aux_ogl)
|
||||||
|
endif()
|
||||||
|
if(XRT_HAVE_SDL2)
|
||||||
|
target_link_libraries(oxr_sdl2 PRIVATE st_gui xrt-external-imgui-sdl2 ${SDL2_LIBRARIES})
|
||||||
|
|
||||||
|
if(XRT_BUILD_DRIVER_QWERTY)
|
||||||
|
target_link_libraries(oxr_sdl2 PRIVATE drv_qwerty drv_qwerty_includes)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${RUNTIME_TARGET} PRIVATE oxr_sdl2)
|
||||||
|
|
|
@ -7,12 +7,14 @@ set(MANIFEST_RELATIVE_DIR @MANIFEST_RELATIVE_DIR@)
|
||||||
set(XR_API_MAJOR @XR_API_MAJOR@)
|
set(XR_API_MAJOR @XR_API_MAJOR@)
|
||||||
set(RUNTIME_TARGET @RUNTIME_TARGET@)
|
set(RUNTIME_TARGET @RUNTIME_TARGET@)
|
||||||
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
|
execute_process(
|
||||||
${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json
|
COMMAND
|
||||||
${CMAKE_BINARY_DIR}/active_runtime.json)
|
${CMAKE_COMMAND} -E create_symlink
|
||||||
|
${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json
|
||||||
|
${CMAKE_BINARY_DIR}/active_runtime.json
|
||||||
|
)
|
||||||
file(
|
file(
|
||||||
INSTALL
|
INSTALL
|
||||||
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/openxr/${XR_API_MAJOR}"
|
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/openxr/${XR_API_MAJOR}"
|
||||||
TYPE FILE
|
TYPE FILE FILES "${CMAKE_BINARY_DIR}/active_runtime.json"
|
||||||
FILES "${CMAKE_BINARY_DIR}/active_runtime.json"
|
)
|
||||||
)
|
|
||||||
|
|
|
@ -13,26 +13,27 @@ set(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH @XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIM
|
||||||
string(REGEX REPLACE "/$" "" MANIFEST_RELATIVE_DIR "${MANIFEST_RELATIVE_DIR}")
|
string(REGEX REPLACE "/$" "" MANIFEST_RELATIVE_DIR "${MANIFEST_RELATIVE_DIR}")
|
||||||
|
|
||||||
if(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH)
|
if(XRT_OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH)
|
||||||
# Absolute path to runtime
|
# Absolute path to runtime
|
||||||
set(RUNTIME_PATH ${RUNTIME_RELATIVE_DIR}/${RUNTIME_FILENAME})
|
set(RUNTIME_PATH ${RUNTIME_RELATIVE_DIR}/${RUNTIME_FILENAME})
|
||||||
if(NOT IS_ABSOLUTE ${RUNTIME_RELATIVE_DIR})
|
if(NOT IS_ABSOLUTE ${RUNTIME_RELATIVE_DIR})
|
||||||
set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_PATH})
|
set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_PATH})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
# Relative path to runtime: requires it exist on the system shared library search path.
|
# Relative path to runtime: requires it exist on the system shared library search path.
|
||||||
set(RUNTIME_PATH ${RUNTIME_FILENAME})
|
set(RUNTIME_PATH ${RUNTIME_FILENAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(runtime_path ${RUNTIME_PATH})
|
set(runtime_path ${RUNTIME_PATH})
|
||||||
|
|
||||||
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
|
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
|
||||||
|
|
||||||
# Create manifest
|
# Create manifest
|
||||||
configure_file(${MANIFEST_INPUT} ${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json)
|
configure_file(${MANIFEST_INPUT} ${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json)
|
||||||
|
|
||||||
# Install it
|
# Install it
|
||||||
file(INSTALL
|
file(
|
||||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}"
|
INSTALL
|
||||||
TYPE FILE
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}"
|
||||||
FILES "${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json")
|
TYPE FILE FILES "${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
# Copyright 2020, Collabora, Ltd.
|
# Copyright 2020, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
add_library(monado-service MODULE service_target.cpp)
|
||||||
|
|
||||||
add_library(monado-service MODULE
|
target_link_libraries(
|
||||||
service_target.cpp
|
monado-service
|
||||||
)
|
PRIVATE
|
||||||
|
aux_util
|
||||||
target_link_libraries(monado-service PRIVATE
|
st_prober
|
||||||
aux_util
|
ipc_server
|
||||||
st_prober
|
comp_main
|
||||||
ipc_server
|
target_lists
|
||||||
comp_main
|
target_instance
|
||||||
target_lists
|
xrt-external-jni-wrap
|
||||||
target_instance
|
|
||||||
xrt-external-jni-wrap
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,53 +1,59 @@
|
||||||
# Copyright 2020, Collabora, Ltd.
|
# Copyright 2020-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
|
add_executable(monado-service main.c)
|
||||||
add_executable(monado-service
|
|
||||||
main.c
|
|
||||||
../openxr/oxr_sdl2_hack.c
|
|
||||||
)
|
|
||||||
add_sanitizers(monado-service)
|
add_sanitizers(monado-service)
|
||||||
|
|
||||||
target_link_libraries(monado-service PRIVATE
|
target_link_libraries(
|
||||||
aux_util
|
monado-service
|
||||||
st_prober
|
PRIVATE
|
||||||
ipc_server
|
aux_util
|
||||||
comp_main
|
st_prober
|
||||||
target_lists
|
ipc_server
|
||||||
target_instance
|
comp_main
|
||||||
|
target_lists
|
||||||
|
target_instance
|
||||||
|
oxr_sdl2
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS monado-service
|
install(TARGETS monado-service RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(XRT_HAVE_SYSTEMD)
|
if(XRT_HAVE_SYSTEMD)
|
||||||
set(SERVICE_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/monado.in.service)
|
set(SERVICE_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/monado.in.service")
|
||||||
set(SOCKET_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/monado.in.socket)
|
set(SOCKET_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/monado.in.socket")
|
||||||
###
|
###
|
||||||
# Generate systemd unit files with absolute path to service intended for development without installing
|
# Generate systemd unit files with absolute path to service
|
||||||
|
# intended for development without installing
|
||||||
set(UNIT_NAME monado-dev)
|
set(UNIT_NAME monado-dev)
|
||||||
set(service_path $<TARGET_FILE:monado-service>)
|
set(service_path $<TARGET_FILE:monado-service>)
|
||||||
set(conflicts monado)
|
set(conflicts monado)
|
||||||
set(exit_on_disconnect ON)
|
set(exit_on_disconnect ON)
|
||||||
set(extra_desc "in build tree")
|
set(extra_desc "in build tree")
|
||||||
configure_file(${SOCKET_INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket)
|
configure_file(${SOCKET_INPUT} "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket")
|
||||||
# Need this step because file(GENERATE) only evaluates generator expressions, and not what configure_file does.
|
|
||||||
configure_file(${SERVICE_INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service)
|
|
||||||
file(GENERATE
|
|
||||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service"
|
|
||||||
INPUT ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service)
|
|
||||||
|
|
||||||
configure_file(${SOCKET_INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket @ONLY)
|
# Need this step because file(GENERATE) only evaluates generator expressions,
|
||||||
|
# and not what configure_file does.
|
||||||
|
configure_file(
|
||||||
|
${SERVICE_INPUT} "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service"
|
||||||
|
)
|
||||||
|
file(
|
||||||
|
GENERATE
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service"
|
||||||
|
INPUT "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}-intermediate.service"
|
||||||
|
)
|
||||||
|
|
||||||
|
configure_file(${SOCKET_INPUT} "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket" @ONLY)
|
||||||
|
|
||||||
# Make a custom target to link those in.
|
# Make a custom target to link those in.
|
||||||
add_custom_target(link-systemd-dev-units
|
add_custom_target(
|
||||||
COMMAND systemctl --user link ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket
|
link-systemd-dev-units
|
||||||
COMMAND systemctl --user link ${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service
|
COMMAND systemctl --user link "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.socket"
|
||||||
|
COMMAND systemctl --user link "${CMAKE_CURRENT_BINARY_DIR}/${UNIT_NAME}.service"
|
||||||
COMMAND systemctl --user daemon-reload
|
COMMAND systemctl --user daemon-reload
|
||||||
VERBATIM
|
VERBATIM
|
||||||
COMMENT "Linking monado-dev.{socket,service} into your local systemd unit directory."
|
COMMENT
|
||||||
)
|
"Linking monado-dev.{socket,service} into your local systemd unit directory."
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_INSTALL_SYSTEMD_UNIT_FILES)
|
if(XRT_INSTALL_SYSTEMD_UNIT_FILES)
|
||||||
|
@ -63,9 +69,18 @@ if(XRT_INSTALL_SYSTEMD_UNIT_FILES)
|
||||||
set(XRT_SYSTEMD_UNIT_INSTALL_DIR lib/systemd/user)
|
set(XRT_SYSTEMD_UNIT_INSTALL_DIR lib/systemd/user)
|
||||||
if(PC_SYSTEMD_USERUNITDIR AND PC_SYSTEMD_PREFIX)
|
if(PC_SYSTEMD_USERUNITDIR AND PC_SYSTEMD_PREFIX)
|
||||||
# Strip prefix
|
# Strip prefix
|
||||||
string(REGEX REPLACE "^${PC_SYSTEMD_PREFIX}/" "" XRT_SYSTEMD_UNIT_INSTALL_DIR "${PC_SYSTEMD_USERUNITDIR}")
|
string(
|
||||||
|
REGEX
|
||||||
|
REPLACE "^${PC_SYSTEMD_PREFIX}/" "" XRT_SYSTEMD_UNIT_INSTALL_DIR
|
||||||
|
"${PC_SYSTEMD_USERUNITDIR}"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
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.")
|
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."
|
||||||
|
)
|
||||||
mark_as_advanced(XRT_SYSTEMD_UNIT_INSTALL_DIR)
|
mark_as_advanced(XRT_SYSTEMD_UNIT_INSTALL_DIR)
|
||||||
endif()
|
endif()
|
||||||
if(XRT_SYSTEMD_UNIT_INSTALL_DIR MATCHES "^/")
|
if(XRT_SYSTEMD_UNIT_INSTALL_DIR MATCHES "^/")
|
||||||
|
@ -75,12 +90,17 @@ if(XRT_INSTALL_SYSTEMD_UNIT_FILES)
|
||||||
# Destination is relative: prepend destdir (implicitly) and install prefix at install time
|
# Destination is relative: prepend destdir (implicitly) and install prefix at install time
|
||||||
set(UNIT_DIR "\${CMAKE_INSTALL_PREFIX}/${XRT_SYSTEMD_UNIT_INSTALL_DIR}")
|
set(UNIT_DIR "\${CMAKE_INSTALL_PREFIX}/${XRT_SYSTEMD_UNIT_INSTALL_DIR}")
|
||||||
endif()
|
endif()
|
||||||
configure_file(configure_and_install_units.cmake ${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake @ONLY)
|
configure_file(
|
||||||
|
configure_and_install_units.cmake
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake @ONLY
|
||||||
|
)
|
||||||
|
|
||||||
# This script will configure the units and install them at install time.
|
# This script will configure the units and install them at install time.
|
||||||
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake)
|
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/configure_and_install_units.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(XRT_HAVE_SDL2)
|
if(XRT_HAVE_SDL2)
|
||||||
target_link_libraries(monado-service PRIVATE st_gui xrt-external-imgui-sdl2 aux_ogl drv_qwerty_includes)
|
target_link_libraries(
|
||||||
|
monado-service PRIVATE st_gui xrt-external-imgui-sdl2 aux_ogl drv_qwerty_includes
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -8,8 +8,7 @@ set(conflicts @conflicts@)
|
||||||
set(exit_on_disconnect @exit_on_disconnect@)
|
set(exit_on_disconnect @exit_on_disconnect@)
|
||||||
set(service_path "monado-service")
|
set(service_path "monado-service")
|
||||||
if(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES)
|
if(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES)
|
||||||
set(service_path
|
set(service_path "${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/${service_path}")
|
||||||
"${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@/${service_path}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Create unit files
|
# Create unit files
|
||||||
|
@ -18,9 +17,11 @@ configure_file(@SERVICE_INPUT@ "@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.service")
|
||||||
|
|
||||||
# Install them
|
# Install them
|
||||||
file(
|
file(
|
||||||
INSTALL
|
INSTALL
|
||||||
DESTINATION "@UNIT_DIR@"
|
DESTINATION "@UNIT_DIR@"
|
||||||
TYPE FILE
|
TYPE
|
||||||
FILES
|
FILE
|
||||||
"@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.socket"
|
FILES
|
||||||
"@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.service")
|
"@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.socket"
|
||||||
|
"@CMAKE_CURRENT_BINARY_DIR@/@UNIT_NAME@.service"
|
||||||
|
)
|
||||||
|
|
|
@ -1,78 +1,71 @@
|
||||||
# Copyright 2020, Collabora, Ltd.
|
# Copyright 2020-2021, Collabora, Ltd.
|
||||||
# SPDX-License-Identifier: BSL-1.0
|
# SPDX-License-Identifier: BSL-1.0
|
||||||
|
|
||||||
get_property(AUX_BINDINGS_DIR GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP)
|
get_property(AUX_BINDINGS_DIR GLOBAL PROPERTY AUX_BINDINGS_DIR_PROP)
|
||||||
set(INPUT_PROFILES_INPUT_DIR ${AUX_BINDINGS_DIR})
|
set(INPUT_PROFILES_INPUT_DIR ${AUX_BINDINGS_DIR})
|
||||||
set(INPUT_PROFILES_OUTPUT_DIR "${PROJECT_BINARY_DIR}/steamvr-monado/resources/input/")
|
set(INPUT_PROFILES_OUTPUT_DIR "${PROJECT_BINARY_DIR}/steamvr-monado/resources/input/")
|
||||||
|
|
||||||
function(input_profiles_gen output custom_target)
|
add_custom_command(
|
||||||
add_custom_command(OUTPUT ${output}
|
OUTPUT "${INPUT_PROFILES_OUTPUT_DIR}"
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${INPUT_PROFILES_INPUT_DIR}/steamvr_profiles.py
|
COMMAND
|
||||||
${INPUT_PROFILES_INPUT_DIR}/bindings.json
|
${PYTHON_EXECUTABLE} ${INPUT_PROFILES_INPUT_DIR}/steamvr_profiles.py
|
||||||
${output}
|
${INPUT_PROFILES_INPUT_DIR}/bindings.json "${INPUT_PROFILES_OUTPUT_DIR}"
|
||||||
DEPENDS ${INPUT_PROFILES_INPUT_DIR}/bindings.py
|
DEPENDS ${INPUT_PROFILES_INPUT_DIR}/bindings.py ${INPUT_PROFILES_INPUT_DIR}/bindings.json
|
||||||
${INPUT_PROFILES_INPUT_DIR}/bindings.json
|
COMMENT "Generating SteamVR input profiles to ${INPUT_PROFILES_OUTPUT_DIR}"
|
||||||
)
|
)
|
||||||
add_custom_target(${custom_target} DEPENDS ${output})
|
add_custom_target(
|
||||||
endfunction(input_profiles_gen)
|
steamvr_generated_input_profiles
|
||||||
|
DEPENDS "${INPUT_PROFILES_OUTPUT_DIR}"
|
||||||
input_profiles_gen(${INPUT_PROFILES_OUTPUT_DIR} generated_input_profiles)
|
COMMENT "Generating SteamVR input profiles"
|
||||||
|
)
|
||||||
|
|
||||||
add_library(driver_monado MODULE main.c)
|
add_library(driver_monado MODULE main.c)
|
||||||
add_dependencies(driver_monado generated_input_profiles)
|
add_dependencies(driver_monado steamvr_generated_input_profiles)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
driver_monado PRIVATE xrt-external-openvr aux_util st_ovrd st_prober target_lists target_instance_no_comp
|
driver_monado
|
||||||
|
PRIVATE
|
||||||
|
xrt-external-openvr
|
||||||
|
aux_util
|
||||||
|
st_ovrd
|
||||||
|
st_prober
|
||||||
|
target_lists
|
||||||
|
target_instance_no_comp
|
||||||
)
|
)
|
||||||
|
|
||||||
# meta data that the steamvr plugin needs in the base directory of the steamvr plugin
|
# meta data that the steamvr plugin needs in the base directory of the steamvr plugin
|
||||||
file(COPY driver.vrdrivermanifest DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado)
|
file(COPY driver.vrdrivermanifest DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado)
|
||||||
file(COPY resources DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado)
|
file(COPY resources DESTINATION ${PROJECT_BINARY_DIR}/steamvr-monado)
|
||||||
|
|
||||||
#determine the output directory for the steamvr plugin
|
# determine the output directory for the steamvr plugin
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# FIXME need to account for different architectures
|
# FIXME need to account for different architectures
|
||||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||||
set(PLUGINDIR
|
set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/win64")
|
||||||
${PROJECT_BINARY_DIR}/steamvr-monado/bin/win64
|
|
||||||
CACHE INTERNAL ""
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
set(PLUGINDIR
|
set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/win32")
|
||||||
${PROJECT_BINARY_DIR}/steamvr-monado/bin/win32
|
|
||||||
CACHE INTERNAL ""
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||||
set(PLUGINDIR
|
set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx64")
|
||||||
${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx64
|
|
||||||
CACHE INTERNAL ""
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
set(PLUGINDIR
|
set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx32")
|
||||||
${PROJECT_BINARY_DIR}/steamvr-monado/bin/osx32
|
|
||||||
CACHE INTERNAL ""
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
elseif(NOT ANDROID)
|
elseif(NOT ANDROID)
|
||||||
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||||
set(PLUGINDIR
|
set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux64")
|
||||||
${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux64
|
|
||||||
CACHE INTERNAL ""
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
set(PLUGINDIR
|
set(PLUGINDIR "${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux32")
|
||||||
${PROJECT_BINARY_DIR}/steamvr-monado/bin/linux32
|
|
||||||
CACHE INTERNAL ""
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message("SteamVR plugin path: ${PLUGINDIR}")
|
# message("SteamVR plugin path: ${PLUGINDIR}")
|
||||||
set_target_properties(driver_monado PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PLUGINDIR}")
|
set_target_properties(driver_monado PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PLUGINDIR}")
|
||||||
|
|
||||||
# don't add lib prefix to driver_monado.so
|
# don't add lib prefix to driver_monado.so
|
||||||
set_target_properties(driver_monado PROPERTIES PREFIX "")
|
set_target_properties(driver_monado PROPERTIES PREFIX "")
|
||||||
|
|
||||||
install(DIRECTORY "${PROJECT_BINARY_DIR}/steamvr-monado" DESTINATION "${CMAKE_INSTALL_PREFIX}/share")
|
install(
|
||||||
|
DIRECTORY "${PROJECT_BINARY_DIR}/steamvr-monado"
|
||||||
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/share"
|
||||||
|
)
|
||||||
|
|
|
@ -9,15 +9,12 @@ if(ANDROID)
|
||||||
target_link_libraries(tests_main PUBLIC log)
|
target_link_libraries(tests_main PUBLIC log)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Input transform test
|
# Input transform test
|
||||||
add_executable(tests_input_transform tests_input_transform.cpp)
|
add_executable(tests_input_transform tests_input_transform.cpp)
|
||||||
target_link_libraries(tests_input_transform PRIVATE tests_main)
|
target_link_libraries(tests_input_transform PRIVATE tests_main)
|
||||||
target_link_libraries(tests_input_transform PRIVATE
|
target_link_libraries(
|
||||||
st_oxr
|
tests_input_transform PRIVATE st_oxr xrt-interfaces xrt-external-openxr aux_util
|
||||||
xrt-interfaces
|
)
|
||||||
xrt-external-openxr
|
|
||||||
aux_util)
|
|
||||||
add_test(NAME input_transform COMMAND tests_input_transform --success)
|
add_test(NAME input_transform COMMAND tests_input_transform --success)
|
||||||
|
|
||||||
# Generic callbacks
|
# Generic callbacks
|
||||||
|
|
Loading…
Reference in a new issue