Commit 4638b0af authored by Ryan Pavlik's avatar Ryan Pavlik
Browse files

build: Switch all CMake options to XRT_... to match what's used in source.

Also revise other small related parts of the build to make them more clear and consistent.
parent 4dd7a603
......@@ -175,7 +175,7 @@ debian:cmake-no-opencv:
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DBUILD_WITH_OPENCV=OFF
CMAKE_ARGS: -DXRT_HAVE_OPENCV=OFF
debian:cmake-no-opengl:
extends:
......@@ -183,7 +183,7 @@ debian:cmake-no-opengl:
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DBUILD_WITH_OPENGL=OFF
CMAKE_ARGS: -DXRT_HAVE_OPENGL=OFF
debian:cmake-no-sdl2:
extends:
......@@ -191,7 +191,7 @@ debian:cmake-no-sdl2:
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DBUILD_WITH_SDL2=OFF
CMAKE_ARGS: -DXRT_HAVE_SDL2=OFF
debian:cmake-no-service:
extends:
......@@ -199,7 +199,7 @@ debian:cmake-no-service:
- .fdo.distribution-image@debian # from ci-templates
- .monado.base-job.build-cmake
variables:
CMAKE_ARGS: -DXRT_BUILD_IPC=OFF
CMAKE_ARGS: -DXRT_FEATURE_SERVICE=OFF
arch:cmake:
extends:
......@@ -257,7 +257,7 @@ debian:cmake:32bit:
- .monado.base-job.build-cmake
variables:
# OpenCV and local OpenHMD doesn't play nicely with us in multi-arch.
CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.gitlab-ci/i386.cmake -DBUILD_WITH_OPENCV=off -DBUILD_WITH_OPENHMD=off
CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=off -DXRT_BUILD_DRIVER_OHMD=off
# Packaging
.monado.base-job.debuild:
......
......@@ -9,10 +9,9 @@ if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
endif()
option(OPENXR_USE_LOADER "Application uses loader" ON)
option(OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH "Use the absolute path to the runtime in the installed manifest, rather than a bare filename." ON)
option(VULKAN_ENABLE_VALIDATION "Enable Vulkan validation for Compositor" ON)
option(INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" 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_VULKAN_ENABLE_VALIDATION "Enable Vulkan validation for Compositor" ON)
option(XRT_OPENXR_INSTALL_ACTIVE_RUNTIME "Make Monado the default OpenXR runtime on install" ON)
###
# Dependencies
......@@ -50,7 +49,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(PkgConfig)
find_package(udev REQUIRED)
set(BUILD_DRIVER_V4L2 TRUE)
set(XRT_HAVE_V4L2 TRUE)
if(PKGCONFIG_FOUND)
pkg_check_modules(XCB xcb xcb-randr x11-xcb)
......@@ -61,180 +60,84 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(OpenGL COMPONENTS GLX)
pkg_search_module(DBUS dbus-1)
pkg_check_modules(SURVIVE IMPORTED_TARGET survive)
else()
find_package(OpenGL)
endif()
cmake_dependent_option(BUILD_WITH_WAYLAND "Enable Wayland support" ON "WAYLAND_FOUND AND WAYLAND_SCANNER_FOUND AND WAYLAND_PROTOCOLS_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_XLIB "Enable xlib support" ON "X11_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_XCB "Enable xcb support" ON "XCB_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_OPENGL "Enable OpenGL Graphics API support" ON "OPENGL_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_EGL "Enable OpenGL on EGL Graphics API support" ON "BUILD_WITH_OPENGL AND EGL_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_DBUS "Enable dbus support (for BLE support)" ON "DBUS_FOUND" OFF)
cmake_dependent_option(BUILD_COMPOSITOR_MAIN "Build main compositor host" ON "BUILD_WITH_WAYLAND OR BUILD_WITH_XCB" OFF)
cmake_dependent_option(XRT_BUILD_IPC "Build OpenXR runtime target" ON "BUILD_COMPOSITOR_MAIN" OFF)
cmake_dependent_option(XRT_HAVE_SYSTEMD "Enable systemd support (for socket activation of service)" ON "Systemd_FOUND AND XRT_BUILD_IPC" 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_XLIB "Enable xlib support" ON "X11_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_XCB "Enable xcb support" ON "XCB_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_OPENGL "Enable OpenGL Graphics API support" ON "OPENGL_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_EGL "Enable OpenGL on EGL Graphics API support" ON "XRT_HAVE_OPENGL AND EGL_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_DBUS "Enable dbus support (for BLE support)" ON "DBUS_FOUND" OFF)
cmake_dependent_option(XRT_FEATURE_COMPOSITOR_MAIN "Build main compositor host functionality" ON "XRT_HAVE_WAYLAND OR XRT_HAVE_XCB" 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 "XRT_FEATURE_COMPOSITOR_MAIN 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)
cmake_dependent_option(BUILD_TARGET_OPENXR "Build OpenXR runtime target" ON "BUILD_COMPOSITOR_MAIN OR XRT_BUILD_IPC" OFF)
# Most users won't touch these.
mark_as_advanced(BUILD_COMPOSITOR_MAIN BUILD_TARGET_OPENXR)
mark_as_advanced(XRT_FEATURE_COMPOSITOR_MAIN XRT_FEATURE_OPENXR)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(BUILD_WITH_LIBUDEV ON)
set(XRT_HAVE_LIBUDEV ON)
set(XRT_HAVE_INTERNAL_HID ON)
else()
cmake_dependent_option(BUILD_WITH_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()
cmake_dependent_option(BUILD_WITH_LIBUSB "Enable libusb (used for most drivers)" ON "LIBUSB1_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_JPEG "Enable jpeg code (used for some video drivers)" ON "JPEG_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_LIBUVC "Enable libuvc video driver" ON "LIBUVC_FOUND AND BUILD_WITH_LIBUSB" OFF)
cmake_dependent_option(BUILD_WITH_FFMPEG "Enable ffmpeg testing video driver" ON "FFMPEG_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_PSVR "Enable PSVR HMD driver" ON "HIDAPI_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_RS "Enable RealSense device driver" ON "realsense2_FOUND" OFF)
option(BUILD_WITH_DUMMY "Enable dummy driver" ON)
cmake_dependent_option(BUILD_WITH_VIVE "Enable Vive driver" ON "ZLIB_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_OPENHMD "Enable OpenHMD driver" ON "OPENHMD_FOUND" OFF)
cmake_dependent_option(BUILD_WITH_SDL2 "Enable SDL2 based test application" ON "SDL2_FOUND AND BUILD_WITH_OPENGL" OFF)
cmake_dependent_option(BUILD_WITH_DAYDREAM "Enable Bluetooth LE via DBUS" ON "BUILD_WITH_DBUS" OFF)
cmake_dependent_option(BUILD_WITH_ARDUINO "Enable Arduino input device with BLE via DBUS" ON "BUILD_WITH_DBUS" OFF)
cmake_dependent_option(BUILD_WITH_SYSTEM_CJSON "Enable cJSON from system, instead of bundled source" ON "CJSON_FOUND" OFF)
# These all use the Monado internal hid wrapper which is assumed to be available.
option(BUILD_WITH_HDK "Enable HDK driver" ON)
option(BUILD_WITH_PSMV "Enable Playstation Move driver" ON)
option(BUILD_WITH_HYDRA "Enable Hydra driver" ON)
option(BUILD_WITH_NS "Enable North Star driver" ON)
option(BUILD_WITH_LIBSURVIVE "Enable libsurvive driver" OFF)
# You can set this from a superproject to add a driver
list(APPEND AVAILABLE_DRIVERS ARDUINO DUMMY HDK HYDRA NS OHMD PSMV PSVR RS V4L2 VIVE DAYDREAM)
###
# Flags
###
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_OPENCV "Enable OpenCV backend" ON "OpenCV_FOUND" OFF)
cmake_dependent_option(XRT_HAVE_LIBUVC "Enable libuvc video driver" ON "LIBUVC_FOUND AND XRT_HAVE_LIBUSB" OFF)
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)
if(BUILD_WITH_LIBUDEV)
set(XRT_HAVE_LIBUDEV TRUE)
endif()
if(BUILD_WITH_DBUS)
set(XRT_HAVE_DBUS TRUE)
endif()
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" OFF)
cmake_dependent_option(XRT_BUILD_DRIVER_OHMD "Enable OpenHMD driver" ON "OPENHMD_FOUND" 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)
if(BUILD_DRIVER_V4L2)
set(XRT_HAVE_V4L2 TRUE)
endif()
if(BUILD_WITH_LIBUSB)
set(XRT_HAVE_LIBUSB TRUE)
endif()
option(XRT_BUILD_DRIVER_DUMMY "Enable dummy driver" ON)
if(BUILD_WITH_OPENCV)
set(XRT_HAVE_OPENCV TRUE)
# 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)
# Tracking requires OpenCV
set(BUILD_TRACKING TRUE)
endif()
# This one defaults to off, even if we find the deps.
cmake_dependent_option(XRT_BUILD_DRIVER_SURVIVE "Enable libsurvive driver" OFF "SURVIVE_FOUND" OFF)
if(BUILD_WITH_JPEG)
set(XRT_HAVE_JPEG TRUE)
endif()
if(BUILD_WITH_LIBUVC)
set(XRT_HAVE_LIBUVC TRUE)
endif()
if(BUILD_WITH_FFMPEG)
set(XRT_HAVE_FFMPEG TRUE)
endif()
# 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!
list(APPEND AVAILABLE_DRIVERS ARDUINO DUMMY HDK HYDRA NS OHMD PSMV PSVR RS V4L2 VIVE DAYDREAM SURVIVE)
if(BUILD_WITH_SDL2)
set(XRT_HAVE_SDL2 TRUE)
###
# Flags
###
if(XRT_HAVE_SDL2)
# Arch work around
if(NOT DEFINED SDL2_LIBRARIES)
set(SDL2_LIBRARIES SDL2::SDL2)
endif()
# SDL2 based gui
set(BUILD_TARGET_GUI TRUE)
endif()
if(BUILD_WITH_ARDUINO)
set(BUILD_DRIVER_ARDUINO TRUE)
endif()
if(BUILD_WITH_DUMMY)
set(BUILD_DRIVER_DUMMY TRUE)
endif()
if(BUILD_WITH_OPENHMD)
set(XRT_HAVE_OPENHMD TRUE)
# Drivers enabled with OpenHMD.
set(BUILD_DRIVER_OHMD TRUE)
endif()
if(BUILD_WITH_NS)
set(BUILD_DRIVER_NS TRUE)
endif()
if (BUILD_WITH_LIBSURVIVE)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SURVIVE REQUIRED IMPORTED_TARGET survive)
add_definitions(-DXRT_BUILD_DRIVER_SURVIVE)
set(BUILD_DRIVER_SURVIVE TRUE)
endif()
if(BUILD_WITH_PSVR)
if (NOT ${HIDAPI_FOUND})
message(FATAL_ERROR "PSVR driver requires hidapi")
endif()
set(BUILD_DRIVER_PSVR TRUE)
endif()
if(BUILD_WITH_RS)
if (NOT ${realsense2_FOUND})
message(FATAL_ERROR "RealSense driver requires librealsense2")
endif()
set(BUILD_DRIVER_RS TRUE)
endif()
if(BUILD_WITH_VIVE)
set(BUILD_DRIVER_VIVE TRUE)
endif()
if(BUILD_WITH_HDK)
set(BUILD_DRIVER_HDK TRUE)
endif()
if(BUILD_WITH_PSMV)
set(BUILD_DRIVER_PSMV TRUE)
endif()
if(BUILD_WITH_HYDRA)
set(BUILD_DRIVER_HYDRA TRUE)
endif()
if(BUILD_WITH_DAYDREAM)
set(BUILD_DRIVER_DAYDREAM TRUE)
endif()
# Vulkan flags for the shared Vulkan code.
if(BUILD_WITH_XCB)
if(XRT_HAVE_XCB)
set(VK_USE_PLATFORM_XCB_KHR TRUE)
endif()
if(BUILD_WITH_XCB AND BUILD_WITH_XLIB)
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB)
set(VK_USE_PLATFORM_XLIB_XRANDR_EXT TRUE)
endif()
if(BUILD_WITH_WAYLAND)
if(XRT_HAVE_WAYLAND)
set(VK_USE_PLATFORM_WAYLAND_KHR TRUE)
endif()
......
......@@ -5,7 +5,7 @@
find_package(Doxygen)
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_EXTRACT_ALL "Extract all entities for documentation, not just documented ones (conflicts with BUILD_DOCS_WARN_UNDOCUMENTED)" ON "DOXYGEN_FOUND; NOT BUILD_DOCS_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)
if(BUILD_DOC)
if(BUILD_DOC_WARN_UNDOCUMENTED)
......
CMake build: Rename (nearly) all build options so they begin with `XRT_` and match the defines used in the source. You will probably want to clear your build directory and reconfigure from scratch.
......@@ -8,7 +8,7 @@ add_library(xrt-external-glad INTERFACE)
target_include_directories(xrt-external-glad INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/glad)
add_library(xrt-external-cjson INTERFACE)
if(BUILD_WITH_SYSTEM_CJSON)
if(XRT_HAVE_SYSTEM_CJSON)
target_link_libraries(xrt-external-cjson INTERFACE cJSON::cJSON)
else()
target_include_directories(xrt-external-cjson INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/cjson)
......
......@@ -8,6 +8,6 @@ add_subdirectory(compositor)
add_subdirectory(state_trackers)
add_subdirectory(targets)
if (XRT_BUILD_IPC)
if(XRT_FEATURE_SERVICE)
add_subdirectory(ipc)
endif()
......@@ -31,7 +31,7 @@ set(OS_SOURCE_FILES
os/os_hid_hidraw.c
os/os_threading.h
)
if(BUILD_WITH_DBUS)
if(XRT_HAVE_DBUS)
list(APPEND OS_SOURCE_FILES
os/os_ble_dbus.c
)
......@@ -46,7 +46,7 @@ set(TRACKING_SOURCE_FILES
tracking/t_lowpass.hpp
tracking/t_tracking.h
)
if(BUILD_TRACKING)
if(XRT_HAVE_OPENCV)
list(APPEND TRACKING_SOURCE_FILES
tracking/t_calibration_opencv.hpp
tracking/t_calibration.cpp
......@@ -112,7 +112,7 @@ add_library(aux-includes INTERFACE)
target_include_directories(aux-includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(aux-includes INTERFACE xrt-interfaces)
if(BUILD_WITH_OPENGL)
if(XRT_HAVE_OPENGL)
# OpenGL library.
add_library(aux_ogl STATIC ${OGL_SOURCE_FILES})
target_link_libraries(aux_ogl PUBLIC aux-includes)
......@@ -123,7 +123,7 @@ endif()
# OS library.
add_library(aux_os STATIC ${OS_SOURCE_FILES})
target_link_libraries(aux_os PUBLIC aux-includes PRIVATE Threads::Threads)
if(BUILD_WITH_DBUS)
if(XRT_HAVE_DBUS)
target_link_libraries(aux_os PRIVATE ${DBUS_LIBRARIES})
target_include_directories(aux_os SYSTEM
PRIVATE
......@@ -145,13 +145,13 @@ add_library(aux_util STATIC ${UTIL_SOURCE_FILES})
target_link_libraries(aux_util PUBLIC aux-includes)
# for u_device
target_link_libraries(aux_util PUBLIC aux_math)
if(BUILD_WITH_JPEG)
if(XRT_HAVE_JPEG)
target_link_libraries(aux_util PRIVATE ${JPEG_LIBRARIES})
endif()
# for cJSON
if(BUILD_WITH_SYSTEM_CJSON)
if(XRT_HAVE_SYSTEM_CJSON)
target_link_libraries(aux_util PUBLIC cJSON::cJSON)
target_compile_definitions(aux_util PRIVATE XRT_USE_SYSTEM_CJSON)
target_compile_definitions(aux_util PRIVATE XRT_HAVE_SYSTEM_CJSON)
else()
target_link_libraries(aux_util PUBLIC xrt-external-cjson)
endif()
......@@ -167,7 +167,7 @@ target_include_directories(aux_tracking SYSTEM
)
# for flexkalman
target_link_libraries(aux_tracking PRIVATE xrt-external-flexkalman)
if(BUILD_TRACKING)
if(XRT_HAVE_OPENCV)
target_include_directories(aux_tracking SYSTEM
PRIVATE
${OpenCV_INCLUDE_DIRS}
......
......@@ -12,7 +12,7 @@
#include <assert.h>
#include <stdio.h>
#ifndef XRT_USE_SYSTEM_CJSON
#ifndef XRT_HAVE_SYSTEM_CJSON
// This includes the c file completely.
#include "cjson/cJSON.c"
#endif
......
......@@ -32,7 +32,7 @@ set(MAIN_SOURCE_FILES
main/comp_window.h
)
if (VULKAN_ENABLE_VALIDATION)
if (XRT_VULKAN_ENABLE_VALIDATION)
add_definitions(-DXRT_ENABLE_VK_VALIDATION)
endif()
......@@ -41,7 +41,7 @@ endif()
# Client library
#
if(BUILD_WITH_OPENGL)
if(XRT_HAVE_OPENGL)
list(APPEND CLIENT_SOURCE_FILES
client/comp_gl_client.c
client/comp_gl_client.h
......@@ -49,14 +49,14 @@ if(BUILD_WITH_OPENGL)
client/comp_gles_glue.c # TODO separate config for GLES
)
endif()
if(BUILD_WITH_OPENGL AND BUILD_WITH_XLIB)
if(XRT_HAVE_OPENGL 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(BUILD_WITH_OPENGL AND BUILD_WITH_EGL)
if(XRT_HAVE_OPENGL AND XRT_HAVE_EGL)
list(APPEND CLIENT_SOURCE_FILES
client/comp_egl_glue.c
)
......@@ -66,25 +66,25 @@ add_library(comp_client STATIC ${CLIENT_SOURCE_FILES})
target_link_libraries(comp_client PUBLIC xrt-interfaces PRIVATE aux_util aux_vk)
target_include_directories(comp_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if(BUILD_WITH_OPENGL)
if(XRT_HAVE_OPENGL)
target_link_libraries(comp_client PRIVATE aux_ogl)
endif()
if(BUILD_WITH_OPENGL AND BUILD_WITH_XLIB)
if(XRT_HAVE_OPENGL AND XRT_HAVE_XLIB)
target_link_libraries(comp_client PRIVATE OpenGL::GLX)
endif()
##
# Main library
#
if(BUILD_COMPOSITOR_MAIN)
if(XRT_FEATURE_COMPOSITOR_MAIN)
if(BUILD_WITH_XCB)
if(XRT_HAVE_XCB)
list(APPEND MAIN_SOURCE_FILES
main/comp_window_xcb.c
)
endif()
if(BUILD_WITH_XCB AND BUILD_WITH_XLIB)
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB)
list(APPEND MAIN_SOURCE_FILES
main/comp_window_direct.c
main/comp_window_direct_randr.c
......@@ -93,7 +93,7 @@ if(BUILD_COMPOSITOR_MAIN)
endif()
# generate wayland protocols
if(BUILD_WITH_WAYLAND)
if(XRT_HAVE_WAYLAND)
pkg_get_variable(WL_PROTOS_PKG_DIR wayland-protocols pkgdatadir)
pkg_get_variable(WL_SCANNER wayland-scanner wayland_scanner)
......@@ -128,19 +128,19 @@ if(BUILD_COMPOSITOR_MAIN)
${CMAKE_CURRENT_BINARY_DIR}
)
if(BUILD_WITH_WAYLAND)
if(XRT_HAVE_WAYLAND)
target_include_directories(comp_main SYSTEM PRIVATE ${WL_PROTOS_DIR})
target_link_libraries(comp_main PRIVATE ${WAYLAND_LIBRARIES})
endif()
if(BUILD_WITH_XCB)
if(XRT_HAVE_XCB)
target_include_directories(comp_main SYSTEM PRIVATE ${XCB_INCLUDE_DIRS})
target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES})
endif()
if(BUILD_WITH_XCB AND BUILD_WITH_XLIB)
if(XRT_HAVE_XCB AND XRT_HAVE_XLIB)
target_link_libraries(comp_main PRIVATE ${X11_X11_LIB})
endif()
if(BUILD_WITH_EGL)
if(XRT_HAVE_EGL)
target_include_directories(comp_main SYSTEM PRIVATE ${EGL_INCLUDE_DIRS})
target_link_libraries(comp_main PRIVATE ${XCB_LIBRARIES})
endif()
......
......@@ -6,7 +6,7 @@ set(ENABLED_HEADSET_DRIVERS)
set(ENABLED_DRIVERS)
if(BUILD_DRIVER_ARDUINO)
if(XRT_BUILD_DRIVER_ARDUINO)
set(ARDUINO_SOURCE_FILES
arduino/arduino_device.c
arduino/arduino_interface.h
......@@ -18,7 +18,7 @@ if(BUILD_DRIVER_ARDUINO)
list(APPEND ENABLED_DRIVERS arduino)
endif()
if(BUILD_DRIVER_DAYDREAM)
if(XRT_BUILD_DRIVER_DAYDREAM)
set(DAYDREAM_SOURCE_FILES
daydream/daydream_device.c
daydream/daydream_device.h
......@@ -31,7 +31,7 @@ if(BUILD_DRIVER_DAYDREAM)
list(APPEND ENABLED_DRIVERS daydream)
endif()
if(BUILD_DRIVER_DUMMY)
if(XRT_BUILD_DRIVER_DUMMY)
set(DUMMY_SOURCE_FILES
dummy/dummy_hmd.c
dummy/dummy_interface.h
......@@ -43,7 +43,7 @@ if(BUILD_DRIVER_DUMMY)
list(APPEND ENABLED_HEADSET_DRIVERS dummy)
endif()
if(BUILD_DRIVER_HDK)
if(XRT_BUILD_DRIVER_HDK)
set(HDK_SOURCE_FILES
hdk/hdk_device.cpp
hdk/hdk_device.h
......@@ -57,7 +57,7 @@ if(BUILD_DRIVER_HDK)
endif()
if(BUILD_DRIVER_HYDRA)
if(XRT_BUILD_DRIVER_HYDRA)
set(HYDRA_SOURCE_FILES
hydra/hydra_driver.c
hydra/hydra_interface.h
......@@ -68,7 +68,7 @@ if(BUILD_DRIVER_HYDRA)
list(APPEND ENABLED_DRIVERS hydra)
endif()
if(BUILD_DRIVER_NS)
if(XRT_BUILD_DRIVER_NS)
set(NS_SOURCE_FILES
north_star/distortion/utility_northstar.h
north_star/distortion/deformation_northstar.h
......@@ -84,7 +84,7 @@ if(BUILD_DRIVER_NS)
list(APPEND ENABLED_HEADSET_DRIVERS ns)
endif()
if(BUILD_DRIVER_OHMD)
if(XRT_BUILD_DRIVER_OHMD)
set(OHMD_SOURCE_FILES
ohmd/oh_device.c
ohmd/oh_device.h
......@@ -98,7 +98,7 @@ if(BUILD_DRIVER_OHMD)
endif()
if(BUILD_DRIVER_PSMV)
if(XRT_BUILD_DRIVER_PSMV)
set(PSMOVE_SOURCE_FILES
psmv/psmv_driver.c
psmv/psmv_interface.h
......@@ -109,7 +109,7 @@ if(BUILD_DRIVER_PSMV)
list(APPEND ENABLED_DRIVERS psmv)
endif()
if(BUILD_DRIVER_PSVR)
if(XRT_BUILD_DRIVER_PSVR)
set(PSVR_SOURCE_FILES
psvr/psvr_device.c
psvr/psvr_device.h
......@@ -123,7 +123,7 @@ if(BUILD_DRIVER_PSVR)
list(APPEND ENABLED_HEADSET_DRIVERS psvr)
endif()
if(BUILD_DRIVER_RS)
if(XRT_BUILD_DRIVER_RS)
set(RS_SOURCE_FILES
realsense/rs_6dof.c
)
......@@ -133,7 +133,7 @@ if(BUILD_DRIVER_RS)
list(APPEND ENABLED_HEADSET_DRIVERS rs)
endif()
if(BUILD_DRIVER_VIVE)
if(XRT_BUILD_DRIVER_VIVE)
set(VIVE_SOURCE_FILES
vive/vive_device.h
vive/vive_device.c
......@@ -152,7 +152,7 @@ if(BUILD_DRIVER_VIVE)
list(APPEND ENABLED_HEADSET_DRIVERS vive)
endif()
if(BUILD_DRIVER_V4L2)
if(XRT_HAVE_V4L2)
set(V4L2_SOURCE_FILES
v4l2/v4l2_driver.c
)
......
......@@ -4,7 +4,7 @@
# Generate a header containing defines for each enabled driver
set(FILE_CONTENTS "")
foreach(DRIVER ${AVAILABLE_DRIVERS})
if(BUILD_DRIVER_${DRIVER})
if(XRT_BUILD_DRIVER_${DRIVER})
string(APPEND FILE_CONTENTS "#define XRT_BUILD_DRIVER_${DRIVER}\n")
endif()
endforeach()
......
......@@ -72,7 +72,7 @@ xrt_config_have = declare_dependency(
build_conf = configuration_data()
if true
build_conf.set('XRT_BUILD_IPC', true)
build_conf.set('XRT_FEATURE_SERVICE', true)
endif
xrt_config_build_h = configure_file(
......
......@@ -9,4 +9,4 @@
#pragma once
#cmakedefine XRT_BUILD_IPC
#cmakedefine XRT_FEATURE_SERVICE
......@@ -25,6 +25,4 @@
#cmakedefine XRT_HAVE_SDL2
#cmakedefine XRT_HAVE_OPENHMD
#cmakedefine XRT_HAVE_SYSTEMD
# Copyright 2019, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
if(BUILD_WITH_OPENGL)
if(XRT_HAVE_OPENGL)
add_subdirectory(gui)
endif()
add_subdirectory