cmake: Adjust build so that CPack makes a better deb file.

Not as good as the native one, but better.
This commit is contained in:
Ryan Pavlik 2023-05-22 13:59:20 -05:00
parent 1af711ec8b
commit e3ce528703
2 changed files with 14 additions and 9 deletions

View file

@ -2,7 +2,11 @@
# SPDX-License-Identifier: BSL-1.0
cmake_minimum_required(VERSION 3.10.2)
project(XRT VERSION 21.0.0)
project(
XRT
VERSION 21.0.0
LANGUAGES C CXX
)
# CMake 3.11 introduced CMP0072 - Prefer GLVND
if(POLICY CMP0072)

View file

@ -1,21 +1,22 @@
# Copyright 2019, Benjamin Saunders <ben.e.saunders@gmail.com>
# Copyright 2019-2023, Collabora, Ltd.
# 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@)
set(CURRENT_BIN_DIR @CMAKE_CURRENT_BINARY_DIR@)
set(CMAKE_INSTALL_SYSCONFDIR @CMAKE_INSTALL_SYSCONFDIR@)
execute_process(COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_BINARY_DIR}/active_runtime.json)
execute_process(COMMAND "${CMAKE_COMMAND}" -E rm -f "${CURRENT_BIN_DIR}/active_runtime.json")
execute_process(
COMMAND
${CMAKE_COMMAND} -E create_symlink
${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json
${CMAKE_BINARY_DIR}/active_runtime.json
"${CMAKE_COMMAND}" -E create_symlink
"${CMAKE_INSTALL_PREFIX}/${MANIFEST_RELATIVE_DIR}/${RUNTIME_TARGET}.json"
"${CURRENT_BIN_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"
DESTINATION "/${CMAKE_INSTALL_SYSCONFDIR}/xdg/openxr/${XR_API_MAJOR}"
TYPE FILE FILES "${CURRENT_BIN_DIR}/active_runtime.json"
)