Commit c111f528 authored by Benjamin Saunders's avatar Benjamin Saunders Committed by Ryan Pavlik
Browse files

oxr: Optionally install as the default runtime

parent a0fcaf9b
......@@ -12,6 +12,7 @@ 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)
###
# Dependencies
......
......@@ -85,7 +85,10 @@ file(GENERATE
# by a script we generate now.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(MANIFEST_RELATIVE_DIR share/openxr/${XR_API_MAJOR}/)
if(INSTALL_ACTIVE_RUNTIME)
configure_file(active_runtime.cmake ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake @ONLY)
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/active_runtime.cmake)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# TODO: install target on windows just needs to know where to install manifest
set(MANIFEST_RELATIVE_DIR)
......
# SPDX-License-Identifier: BSL-1.0
include(GNUInstallDirs)
set(MANIFEST_RELATIVE_DIR @MANIFEST_RELATIVE_DIR@)
set(XR_API_MAJOR @XR_API_MAJOR@)
set(RUNTIME_TARGET @RUNTIME_TARGET@)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json
${CMAKE_BINARY_DIR}/active_runtime.json)
file(
INSTALL
DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/openxr/${XR_API_MAJOR}"
TYPE FILE
FILES "${CMAKE_BINARY_DIR}/active_runtime.json"
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment