Commit 7058a4e8 authored by Ryan Pavlik's avatar Ryan Pavlik
Browse files

Merge branch 'debian/sid' into debian/buster-backports

parents 4a706d48 7dc10934
# To use this config on you editor, follow the instructions at:
# To use this config on your editor, follow the instructions at:
# http://editorconfig.org
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2020 Collabora, Ltd. and the Monado contributors
# SPDX-FileCopyrightText: 2018-2021 Collabora, Ltd. and the Monado contributors
root = true
......@@ -13,7 +13,7 @@ insert_final_newline = true
[*.{c,h,cpp}]
indent_style = tab
indent_size = 8
max_line_length = 80
max_line_length = 120
[*.py]
indent_size = 4
......
......@@ -9,19 +9,34 @@ CMakeLists.txt.user.*
*Makefile
*cmake_install.cmake
*libopenxr_monado.so
*.a
CMakeDoxyfile.in
CMakeDoxygenDefaults.cmake
CTestTestfile.cmake
DartConfiguration.tcl
doc/Doxyfile
doc/html/
doc/latex/
openxr_monado-dev.json
openxr_monado.json
src/xrt/auxiliary/bindings/b_generated_bindings.*
src/xrt/auxiliary/u_git_tag.c
src/xrt/compositor/shaders/*.vert.h
src/xrt/compositor/shaders/*.frag.h
src/xrt/compositor/shaders/*.comp.h
src/xrt/include/xrt/xrt_config_*.h
src/xrt/ipc/*_generated.*
src/xrt/targets/cli/monado-cli
src/xrt/targets/ctl/monado-ctl
src/xrt/targets/gui/monado-gui
src/xrt/targets/service/monado-service
src/xrt/targets/openxr/active_runtime.cmake
src/xrt/targets/openxr/intermediate_manifest.json
src/xrt/targets/openxr/make_manifest.cmake
src/xrt/targets/targets_enabled_drivers.h
steamvr-monado/
tests/tests_generic_callbacks
tests/tests_input_transform
# Ignore Python caches
__pycache__/
......@@ -71,7 +86,16 @@ local.properties
.cxx
.settings
.project
.classpath
gradlew
gradlew.bat
gradle-wrapper.jar
# Ignore Sourcetrail things
*.srctrlbm
*.srctrldb
*.srctrlprj
# Ignore clangd things
.cache/
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2020 Collabora, Ltd. and the Monado contributors
# SPDX-FileCopyrightText: 2018-2021 Collabora, Ltd. and the Monado contributors
variables:
FDO_UPSTREAM_REPO: monado/monado
.templates_sha: &templates_sha 322bf2b8f29b6491caeb13861201e96969ddc169
.package_only_branch: &package_only_branch master
.templates_sha: &templates_sha db8eb22cd1abb036560faaebd36a38565a3ebda2
# Variables listing packages for Debian-based distros
.monado.variables.debian-based-packages:
variables:
CORE_REQUIRED_PACKAGES: "build-essential git wget unzip cmake meson ninja-build libeigen3-dev curl patch python3 pkg-config libx11-dev libx11-xcb-dev libxxf86vm-dev libxrandr-dev libxcb-randr0-dev libvulkan-dev glslang-tools libglvnd-dev libgl1-mesa-dev ca-certificates libusb-1.0-0-dev libudev-dev"
FEATURE_PACKAGES: "libhidapi-dev libwayland-dev libuvc-dev libavcodec-dev libopencv-dev libv4l-dev libcjson-dev libsdl2-dev libegl1-mesa-dev libdbus-1-dev"
PACKAGING_PACKAGES: "devscripts debhelper osc osc-plugins-dput dput-ng gettext-base markdown"
# Packages required for build and some other basic jobs
CORE_REQUIRED_PACKAGES: "build-essential git wget unzip cmake meson ninja-build libeigen3-dev curl patch python3 pkg-config libx11-dev libx11-xcb-dev libxxf86vm-dev libxrandr-dev libxcb-randr0-dev libvulkan-dev glslang-tools libglvnd-dev libgl1-mesa-dev ca-certificates libusb-1.0-0-dev libudev-dev"
# These are optional packages, that we're building against to ensure we build as much code as possible
FEATURE_PACKAGES: "libhidapi-dev libwayland-dev libuvc-dev libavcodec-dev libopencv-dev libv4l-dev libcjson-dev libsdl2-dev libegl1-mesa-dev libdbus-1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsystemd-dev libbsd-dev"
# Only used for building packages
PACKAGING_PACKAGES: "devscripts debhelper dput-ng gettext-base markdown doxygen graphviz"
# Used for ancillary "not compilation" jobs/features, like docs, changelogs, formatting, etc.
TOOLS_REQUIRED_PACKAGES: "clang-format-7 codespell doxygen graphviz python3-pip python3-click"
# The NDK builder uses only these packages
NDK_PACKAGES: "git wget unzip cmake meson ninja-build libeigen3-dev python3 pkg-config ca-certificates glslang-tools"
# Variables for build and usage of Debian 10 (Buster) image
.monado.variables.debian:buster:
variables:
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_TAG: "2020-07-10.0"
FDO_DISTRIBUTION_TAG: "2021-04-15.0"
# Variables for build and usage of Ubuntu 20.04 LTS (Focal) image
.monado.variables.ubuntu:focal:
variables:
FDO_DISTRIBUTION_VERSION: "20.04"
FDO_DISTRIBUTION_TAG: "2020-07-10.0"
FDO_DISTRIBUTION_TAG: "2021-04-15.0"
# Variables for build and usage of Ubuntu 20.10 (Groovy) image
.monado.variables.ubuntu:groovy:
variables:
FDO_DISTRIBUTION_VERSION: "20.10"
FDO_DISTRIBUTION_TAG: "2021-04-15.0"
# Variables for build and usage of Debian 10 (Buster) + Android NDK image
.monado.variables.debian:buster-ndk:
......@@ -38,7 +52,7 @@ variables:
# Variables for build and usage of Arch Linux image
.monado.variables.arch:rolling:
variables:
FDO_DISTRIBUTION_TAG: "2020-05-12.0"
FDO_DISTRIBUTION_TAG: "2021-09-14.0"
include:
- project: "freedesktop/ci-templates"
......@@ -95,7 +109,7 @@ arch:container_prep:
FDO_DISTRIBUTION_PACKAGES: "git gcc clang cmake meson ninja pkgconfig python3 diffutils patch doxygen graphviz eigen hidapi libxrandr mesa glslang vulkan-headers vulkan-icd-loader check glfw-x11 libusb opencv gtk3 ffmpeg v4l-utils qt5-base"
# Ubuntu Focal (x64)
ubuntu:container_prep:
ubuntu:focal:container_prep:
stage: container_prep
extends:
- .monado.variables.ubuntu:focal
......@@ -106,6 +120,18 @@ ubuntu:container_prep:
# a list of packages to install - assembled from .monado.variables.debian-based-packages
FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES}"
# Ubuntu Groovy (x64)
ubuntu:groovy:container_prep:
stage: container_prep
extends:
- .monado.variables.ubuntu:groovy
- .monado.variables.container-prep-base
- .monado.variables.debian-based-packages
- .fdo.container-build@ubuntu # from ci-templates
variables:
# a list of packages to install - assembled from .monado.variables.debian-based-packages
FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES}"
# Debian Buster + the Android NDK in /opt/android-ndk
# The NDK itself gets installed by .gitlab-ci/ndk:container_prep.sh
ndk:container_prep:
......@@ -117,7 +143,7 @@ ndk:container_prep:
variables:
# Repo suffix is set in .monado.variables.debian:buster-ndk
# a list of packages to install
FDO_DISTRIBUTION_PACKAGES: "git wget unzip cmake meson ninja-build libeigen3-dev python3 pkg-config ca-certificates glslang-tools"
FDO_DISTRIBUTION_PACKAGES: "${NDK_PACKAGES}"
# Style check job
format-and-spellcheck:
......@@ -133,10 +159,20 @@ format-and-spellcheck:
expire_in: 1 week
when: on_failure
# Verify REUSE compliance
reuse:
stage: build
image:
name: fsfe/reuse:latest
entrypoint: [""]
script:
- reuse lint
# "Base" job for a CMake build
.monado.base-job.build-cmake:
stage: build
script:
- rm -rf build
- mkdir build
- pushd build
- cmake -GNinja .. $CMAKE_ARGS
......@@ -149,6 +185,7 @@ format-and-spellcheck:
.monado.base-job.build-meson:
stage: build
script:
- rm -rf build
- mkdir build
- pushd build
- meson .. $MESON_ARGS
......@@ -260,11 +297,46 @@ debian:cmake:32bit:
# OpenCV and local OpenHMD doesn't play nicely with us in multi-arch.
CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=off -DXRT_BUILD_DRIVER_OHMD=off
# Base of Android NDK builds.
# Takes the last :-delimited part of the name as the ABI to build for,
# so you don't need to do anything other than "extends" in the job
.monado.ndk:build-base:
stage: build
extends:
- .monado.variables.debian:buster-ndk
- .fdo.suffixed-image@debian # from ci-templates
variables:
ANDROID_PLATFORM: 26
script:
- mkdir build
- pushd build
# This extracts the ABI from the job name
- export ABI=$(echo $CI_JOB_NAME | cut --delimiter=":" -f 2)
# Note we are pointing CMake to the host install of Eigen3 because it's header-only
# and thus this is safe to do.
- cmake -GNinja .. -DANDROID_PLATFORM=$ANDROID_PLATFORM -DANDROID_ABI=$ABI -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/
- grep "^XRT_" CMakeCache.txt
- ninja
ndk:armeabi-v7a:
extends: .monado.ndk:build-base
ndk:arm64-v8a:
extends: .monado.ndk:build-base
# Packaging
.monado.packaging.conditions:
rules:
# Only the default branch of the "upstream" repo.
- if: "$CI_PROJECT_PATH == $FDO_UPSTREAM_REPO && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
when: on_success
# Otherwise, don't build packages.
- when: never
.monado.base-job.debuild:
extends:
- .monado.packaging.conditions
stage: package
only:
- *package_only_branch
before_script:
# Configure git - needed despite not actually committing here.
- git config --global user.email "ryan.pavlik@collabora.com"
......@@ -273,7 +345,7 @@ debian:cmake:32bit:
# Prep the source tree
- git clean -dfx
- git merge origin/${PACKAGE_BRANCH} --no-commit
- FULLNAME="Monado CI <ryan.pavlik@collabora.com>" debian/extra/prepare-commit-package.sh ${CI_COMMIT_SHA} 1~${BACKPORT_SUFFIX}~ci$(date --utc "+%Y%m%d")
- DEBFULLNAME="Monado CI" DEBEMAIL="ryan.pavlik@collabora.com" debian/extra/prepare-commit-package.sh ${CI_COMMIT_SHA} 1~${BACKPORT_SUFFIX}~ci$(date --utc "+%Y%m%d")
# Build the package
- debuild -uc -us
# Use dput-ng to move the package-related files into some artifacts.
......@@ -308,16 +380,27 @@ ubuntu:focal:package:
PACKAGE_BRANCH: ubuntu/focal
DISTRO: focal
ubuntu:groovy:package:
extends:
- .monado.variables.ubuntu:groovy
- .fdo.distribution-image@ubuntu # from ci-templates
- .monado.base-job.debuild
variables:
BACKPORT_SUFFIX: ubuntu20.04
PACKAGE_BRANCH: ubuntu/focal
DISTRO: focal
reprepro:package:
stage: reprepro
only:
- *package_only_branch
extends:
- .monado.variables.debian:buster
- .monado.packaging.conditions
- .fdo.distribution-image@debian # from ci-templates
dependencies:
- debian:buster:package
- ubuntu:focal:package
- ubuntu:groovy:package
before_script:
# Convince gnupg to work properly in CI
- mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
......@@ -353,33 +436,6 @@ reprepro:package:
- "repo/"
expire_in: 2 days
# Base of Android NDK builds.
# Takes the last :-delimited part of the name as the ABI to build for,
# so you don't need to do anything other than "extends" in the job
.monado.ndk:build-base:
stage: build
extends:
- .monado.variables.debian:buster-ndk
- .fdo.suffixed-image@debian # from ci-templates
variables:
ANDROID_PLATFORM: 26
script:
- mkdir build
- pushd build
# This extracts the ABI from the job name
- export ABI=$(echo $CI_JOB_NAME | cut --delimiter=":" -f 2)
# Note we are pointing CMake to the host install of Eigen3 because it's header-only
# and thus this is safe to do.
- cmake -GNinja .. -DANDROID_PLATFORM=$ANDROID_PLATFORM -DANDROID_ABI=$ABI -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/
- grep "^XRT_" CMakeCache.txt
- ninja
ndk:armeabi-v7a:
extends: .monado.ndk:build-base
ndk:arm64-v8a:
extends: .monado.ndk:build-base
###
# Pages
###
......
#!/bin/bash
# Copyright 2021, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
# Nothing really needed.
......@@ -10,17 +10,11 @@ Files: doc/changes/drivers/*
doc/changes/xrt/*
doc/changes/auxiliary/*
doc/changes/compositor/*
Copyright: 2020, Collabora, Ltd. and the Monado contributors
doc/changes/big/*
Copyright: 2020-2021, Collabora, Ltd. and the Monado contributors
License: CC0-1.0
Comment: Prevents needing a license header per fragment between releases.
Files: src/external/flexkalman/.clang-format
src/external/flexkalman/flexkalman/README.md
Copyright: 2015, 2016, Sensics, Inc.
2019, Collabora, Ltd.
License: Apache-2.0
Comment: Copyright statement and license identifier missing.
Files: src/external/cjson/*
Copyright: 2009-2017, Dave Gamble and cJSON contributors
License: MIT
......@@ -32,14 +26,6 @@ Copyright: 2020, Two Blue Cubes Ltd.
License: BSL-1.0
Comment: SPDX-License-Identifier missing.
Files: src/external/openxr_includes/loader_interfaces.h
Copyright: 2017, LunarG, Inc.
2017, Valve Corporation
2017-2019, The Khronos Group Inc.
License: Apache-2.0
Comment: SPDX-License-Identifier missing.
Files: src/external/jnipp/*
Copyright: 2016-2020, Mitchell Dowd
2020, Collabora, Ltd.
......@@ -52,6 +38,11 @@ Copyright: 2016, mcximing
License: BSD-2-Clause
Comment: SPDX-License-Identifier missing.
Files: src/external/openvr_includes/*
Copyright: 2015-2020, Valve Corporation
License: BSD-3-Clause
Comment: License identifier missing.
Files: src/external/imgui/imgui*
src/external/imgui/imconfig.h
Copyright: 2014-2020, Omar Cornut
......
# Copyright 2018-2020, Collabora, Ltd.
# Copyright 2018-2021, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
cmake_minimum_required(VERSION 3.10.2)
......@@ -12,10 +12,18 @@ 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_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON)
# We use C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# So that clangd/Intellisense/Sourcetrail know how to parse our code.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
###
# Dependencies
###
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sanitizers")
include(CMakeDependentOption)
include(SPIR-V)
include(GNUInstallDirs)
......@@ -26,36 +34,46 @@ if(NOT ${CMAKE_VERSION} VERSION_LESS 3.9)
check_ipo_supported(RESULT HAS_IPO)
endif()
# Redundant mention of version is required because module defaults to looking for 2.91-compatible,
# which the config file for a 3.x says it's not compatible with.
find_package(Eigen3 3 REQUIRED)
find_package(Vulkan)
find_package(EGL)
find_package(HIDAPI)
find_package(OpenHMD)
find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video CONFIG)
find_package(Libusb1)
find_package(JPEG)
find_package(realsense2 CONFIG)
find_package(SDL2 CONFIG)
find_package(ZLIB)
find_package(cJSON)
find_package(Systemd)
find_package(OpenGLES COMPONENTS V3)
# Android SDK doesn't look for 3.8 and 3.9, which is what new distros ship with.
set(Python_ADDITIONAL_VERSIONS 3.8 3.9)
if(NOT CMAKE_VERSION VERSION_LESS 3.12)
find_package(Python3 REQUIRED Interpreter)
set(PYTHON_EXECUTABLE Python3::Interpreter)
else()
find_package(PythonInterp REQUIRED VERSION 3)
find_program(PYTHON_EXECUTABLE python3)
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.
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()
# Redundant mention of version is required because module defaults to looking for 2.91-compatible,
# which the config file for a 3.x says it's not compatible with.
find_package(Eigen3 3 REQUIRED)
find_package(Vulkan MODULE)
find_package(EGL MODULE)
find_package(HIDAPI MODULE)
find_package(OpenHMD MODULE)
find_package(OpenCV COMPONENTS core calib3d highgui imgproc imgcodecs features2d video CONFIG)
find_package(Libusb1 MODULE)
find_package(JPEG MODULE)
find_package(realsense2 CONFIG)
find_package(depthai CONFIG)
find_package(SDL2 CONFIG)
find_package(ZLIB MODULE)
find_package(cJSON MODULE)
find_package(Systemd MODULE)
find_package(OpenGLES MODULE COMPONENTS V3)
find_package(LeapV2 MODULE)
find_package(ONNXRuntime MODULE)
find_package(Percetto MODULE)
if(NOT ANDROID)
find_package(PkgConfig MODULE)
endif()
#https://github.com/arsenm/sanitizers-cmake
find_package(Sanitizers MODULE)
add_library(xrt-pthreads INTERFACE)
if(WIN32)
find_package(pthreads_windows REQUIRED)
......@@ -66,7 +84,7 @@ else()
target_link_libraries(xrt-pthreads INTERFACE Threads::Threads)
endif()
if(NOT ANDROID)
if(PKGCONFIG_FOUND AND NOT ANDROID)
# @TODO Turn into a find_package LIBUVC file.
pkg_check_modules(LIBUVC libuvc)
......@@ -79,7 +97,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(XRT_HAVE_LINUX YES)
# Compositor backend
find_package(X11)
find_package(PkgConfig)
find_package(udev REQUIRED)
set(XRT_HAVE_V4L2 TRUE)
......@@ -91,9 +108,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
pkg_search_module(WAYLAND wayland-client)
pkg_search_module(WAYLAND_SCANNER wayland-scanner)
pkg_search_module(WAYLAND_PROTOCOLS wayland-protocols)
pkg_search_module(LIBDRM libdrm)
endif()
find_package(OpenGL COMPONENTS GLX)
pkg_search_module(DBUS dbus-1)
pkg_search_module(LIBBSD libbsd)
pkg_check_modules(GST
gstreamer-1.0
......@@ -112,13 +131,31 @@ if(ANDROID)
find_library(ANDROID_LOG_LIBRARY log)
endif()
# Find a external SLAM implementation
set(EXTERNAL_SLAM_SYSTEMS kimera_vio)
foreach(slam_system IN LISTS EXTERNAL_SLAM_SYSTEMS)
if(PKGCONFIG_FOUND)
pkg_check_modules(${slam_system} ${slam_system})
endif()
if(${slam_system}_FOUND)
set(SLAM ON)
set(SLAM_NAME ${slam_system})
set(SLAM_LIBRARIES ${${slam_system}_LIBRARIES})
set(SLAM_INCLUDE_DIRS ${${slam_system}_INCLUDE_DIRS})
break()
endif()
endforeach()
# This one is named differently because that's what CTest uses
option(BUILD_TESTING "Enable building of the test suite?" 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_FEATURE_TRACING "Enable debug tracing on supported platforms" OFF "XRT_HAVE_PERCETTO" OFF)
cmake_dependent_option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "Enable inter-procedural (link-time) optimization" OFF "HAS_IPO" OFF)
cmake_dependent_option(XRT_HAVE_WAYLAND "Enable Wayland support" ON "WAYLAND_FOUND AND WAYLAND_SCANNER_FOUND AND WAYLAND_PROTOCOLS_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_WAYLAND "Enable Wayland support" ON "WAYLAND_FOUND AND WAYLAND_SCANNER_FOUND AND WAYLAND_PROTOCOLS_FOUND AND LIBDRM_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_WAYLAND_DIRECT "Enable Wayland direct support" ON "XRT_HAVE_WAYLAND AND LIBDRM_FOUND AND WAYLAND_PROTOCOLS_VERSION VERSION_GREATER_EQUAL 1.22" OFF)
cmake_dependent_option(XRT_HAVE_XLIB "Enable xlib support" ON "X11_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_XRANDR "Enable xlib-xrandr support" ON "XRANDR_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_XCB "Enable xcb support" ON "XCB_FOUND" OFF)
......@@ -128,10 +165,10 @@ cmake_dependent_option(XRT_HAVE_OPENGL "Enable OpenGL Graphics API support" ON "
cmake_dependent_option(XRT_HAVE_OPENGLES "Enable OpenGL-ES Graphics API support" ON "OpenGLES_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_EGL "Enable OpenGL on EGL Graphics API support" ON "EGL_FOUND; XRT_HAVE_OPENGL OR XRT_HAVE_OPENGLES" OFF)
cmake_dependent_option(XRT_HAVE_DBUS "Enable dbus support (for BLE support)" ON "DBUS_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_VF "Enable gstreamer support (for video file support)" ON "GST_FOUND" OFF)
cmake_dependent_option(XRT_FEATURE_COMPOSITOR_MAIN "Build main compositor host functionality" ON "XRT_HAVE_VULKAN; XRT_HAVE_WAYLAND OR XRT_HAVE_XCB OR ANDROID OR WIN32" OFF)
cmake_dependent_option(XRT_HAVE_LIBBSD "Enable libbsd support" ON "LIBBSD_FOUND" OFF)
cmake_dependent_option(XRT_FEATURE_OPENXR "Build OpenXR runtime target" ON "XRT_FEATURE_COMPOSITOR_MAIN" OFF)
cmake_dependent_option(XRT_FEATURE_SERVICE "Enable separate service module for OpenXR runtime" ON "NOT WIN32" OFF)
cmake_dependent_option(XRT_FEATURE_SERVICE "Enable separate service module for OpenXR runtime" ON "NOT WIN32 AND XRT_FEATURE_OPENXR" OFF)
cmake_dependent_option(XRT_HAVE_SYSTEMD "Enable systemd support (for socket activation of service)" ON "Systemd_FOUND AND XRT_FEATURE_SERVICE" OFF)
cmake_dependent_option(XRT_INSTALL_SYSTEMD_UNIT_FILES "Install user unit files for systemd socket activation on installation" ON "XRT_HAVE_SYSTEMD" OFF)
cmake_dependent_option(XRT_INSTALL_ABSOLUTE_SYSTEMD_UNIT_FILES "Use an absolute path to monado-system in installed user unit files for systemd socket activation" ON "XRT_INSTALL_SYSTEMD_UNIT_FILES" OFF)
......@@ -172,30 +209,37 @@ cmake_dependent_option(XRT_HAVE_LIBUVC "Enable libuvc video driver" ON "LIBUVC_F
cmake_dependent_option(XRT_HAVE_FFMPEG "Enable ffmpeg testing video driver" ON "FFMPEG_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_SDL2 "Enable use of SDL2" ON "SDL2_FOUND AND XRT_HAVE_OPENGL" OFF)
cmake_dependent_option(XRT_HAVE_SYSTEM_CJSON "Enable cJSON from system, instead of bundled source" ON "CJSON_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_GST "Enable gstreamer" ON "GST_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_ONNXRUNTIME "Enable ONNX runtime support" ON "ONNXRUNTIME_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_KIMERA_SLAM "Enable Kimera support" ON "kimera_vio_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_SLAM "Enable SLAM tracking support" ON "SLAM;XRT_HAVE_OPENCV" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_PSVR "Enable PSVR HMD driver" ON "HIDAPI_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_RS "Enable RealSense device driver" ON "realsense2_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_VIVE "Enable driver for HTC Vive, Vive Pro, Valve Index, and their controllers" ON "ZLIB_FOUND AND XRT_HAVE_LINUX" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_OHMD "Enable OpenHMD driver" ON "OPENHMD_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_HANDTRACKING "Enable Camera Hand Tracking driver" ON "XRT_HAVE_V4L2" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_HANDTRACKING "Enable Camera Hand Tracking driver" ON "XRT_HAVE_ONNXRUNTIME AND XRT_HAVE_OPENCV AND XRT_HAVE_V4L2" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_DAYDREAM "Enable the Google Daydream View controller driver (BLE, via D-Bus)" ON "XRT_HAVE_DBUS" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_ARDUINO "Enable Arduino input device with BLE via via D-Bus" ON "XRT_HAVE_DBUS" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_ILLIXR "Enable ILLIXR driver" ON "ILLIXR_PATH" OFF)
option(XRT_BUILD_DRIVER_DUMMY "Enable dummy driver" ON)
cmake_dependent_option(XRT_BUILD_DRIVER_ULV2 "Enable Ultraleap v2 driver" ON "LeapV2_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_REMOTE "Enable remote debugging driver" ON "XRT_HAVE_LINUX OR ANDROID" OFF)
option(XRT_BUILD_DRIVER_WMR "Enable Windows Mixed Reality driver" ON)
# These all use the Monado internal hid wrapper.
cmake_dependent_option(XRT_BUILD_DRIVER_HDK "Enable HDK driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_PSMV "Enable Playstation Move driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_HYDRA "Enable Hydra driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_NS "Enable North Star driver" ON "XRT_HAVE_INTERNAL_HID" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_VF "Build video frame driver (for video file support, uses gstreamer)" ON "XRT_HAVE_GST" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_DEPTHAI "DepthAI" ON "depthai_FOUND" OFF)
# This one defaults to off, even if we find the deps.
cmake_dependent_option(XRT_BUILD_DRIVER_SURVIVE "Enable libsurvive driver" ON "SURVIVE_FOUND" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_ANDROID "Enable Android sensors driver" ON "ANDROID" 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)
# 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!
......@@ -216,7 +260,13 @@ list(APPEND AVAILABLE_DRIVERS
"REMOTE"
"SURVIVE"
"V4L2"
"ULV2"
"VF"
"DEPTHAI"
"VIVE"
"QWERTY"
"WMR"
"EUROC"
)
......@@ -290,6 +340,17 @@ if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
message(STATUS "Inter-procedural optimization enabled")
endif()
# Make sure we have pretty colours
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
if ("${FORCE_COLORED_OUTPUT}")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options (-fdiagnostics-color=always)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
endif ()
endif ()
###
# Decend into madness.
###
......@@ -298,30 +359,37 @@ add_subdirectory(src)
add_subdirectory(doc)
if(BUILD_TESTING)
include(CTest)
add_subdirectory(tests)
include(CTest)
add_subdirectory(tests)
endif()
message(STATUS "#####----- Config -----#####")
message(STATUS "# GIT_DESC: ${GIT_DESC}")
message(STATUS "# GIT_DESC: ${GIT_DESC}")
message(STATUS "#")
message(STATUS "# WAYLAND: ${XRT_HAVE_WAYLAND}")
message(STATUS "# XLIB: ${XRT_HAVE_XLIB}")
message(STATUS "# XRANDR: ${XRT_HAVE_XRANDR}")
message(STATUS "# XCB: ${XRT_HAVE_XCB}")
message(STATUS "# OPENGL: ${XRT_HAVE_OPENGL}")
message(STATUS "# OPENGLES: ${XRT_HAVE_OPENGLES}")
message(STATUS "# VULKAN: ${XRT_HAVE_VULKAN}")
message(STATUS "# EGL: ${XRT_HAVE_EGL}")
message(STATUS "# DBUS: ${XRT_HAVE_DBUS}")
message(STATUS "# VF: ${XRT_HAVE_VF}")
message(STATUS "# LIBUSB: ${XRT_HAVE_LIBUSB}")
message(STATUS "# JPEG: ${XRT_HAVE_JPEG}")
message(STATUS "# OPENCV: ${XRT_HAVE_OPENCV}")
message(STATUS "# LIBUVC: ${XRT_HAVE_LIBUVC}")
message(STATUS "# FFMPEG: ${XRT_HAVE_FFMPEG}")
message(STATUS "# SDL2: ${XRT_HAVE_SDL2}")
message(STATUS "# SYSTEM_CJSON: ${XRT_HAVE_SYSTEM_CJSON}")
message(STATUS "# GST (GStreamer): ${XRT_HAVE_GST}")
message(STATUS "# WAYLAND: ${XRT_HAVE_WAYLAND}")
message(STATUS "# WAYLAND_DIRECT: ${XRT_HAVE_WAYLAND_DIRECT}")