2019-06-18 20:05:20 +00:00
|
|
|
# SPDX-License-Identifier: BSL-1.0
|
|
|
|
|
|
|
|
# Get input from main CMake script
|
|
|
|
set(MANIFEST_INPUT @MANIFEST_INPUT@)
|
|
|
|
set(MANIFEST_RELATIVE_DIR @MANIFEST_RELATIVE_DIR@)
|
2019-06-18 20:09:45 +00:00
|
|
|
set(RUNTIME_RELATIVE_DIR @RUNTIME_RELATIVE_DIR@)
|
|
|
|
set(RUNTIME_FILENAME @RUNTIME_FILENAME@)
|
|
|
|
set(OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH @OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH@)
|
2019-06-18 20:05:20 +00:00
|
|
|
|
|
|
|
# Remove trailing slash
|
|
|
|
string(REGEX REPLACE "/$" "" MANIFEST_RELATIVE_DIR "${MANIFEST_RELATIVE_DIR}")
|
|
|
|
|
2019-06-18 20:09:45 +00:00
|
|
|
if(OPENXR_INSTALL_ABSOLUTE_RUNTIME_PATH)
|
|
|
|
# Absolute path to runtime
|
|
|
|
set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_RELATIVE_DIR}/${RUNTIME_FILENAME})
|
|
|
|
else()
|
|
|
|
# Relative path to runtime: requires it exist on the system shared library search path.
|
|
|
|
set(RUNTIME_PATH ${RUNTIME_FILENAME})
|
|
|
|
endif()
|
2019-06-18 20:05:20 +00:00
|
|
|
|
|
|
|
if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
|
|
|
|
|
|
|
|
# Create manifest
|
|
|
|
configure_file(${MANIFEST_INPUT} ${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json)
|
|
|
|
|
|
|
|
# Install it
|
|
|
|
file(INSTALL
|
|
|
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}"
|
|
|
|
TYPE FILE
|
|
|
|
FILES "${CMAKE_CURRENT_LIST_DIR}/@RUNTIME_TARGET@.json")
|
|
|
|
endif()
|