The open source OpenXR runtime

cmake: Update cmake modules from upstream collection.

Upstream is https://github.com/rpavlik/cmake-modules

authored by

Rylie Pavlik and committed by
Jakob Bornecrantz
c4e81d3b e6d54689

+505 -156
+3 -1
cmake/CleanDirectoryList.cmake
··· 9 9 # http://academic.cleardefinition.com 10 10 # Iowa State University HCI Graduate Program/VRAC 11 11 # 12 - # Copyright Iowa State University 2009-2010. 12 + # Copyright 2009-2010, Iowa State University. 13 + # 13 14 # Distributed under the Boost Software License, Version 1.0. 14 15 # (See accompanying file LICENSE_1_0.txt or copy at 15 16 # http://www.boost.org/LICENSE_1_0.txt) 17 + # 16 18 # SPDX-License-Identifier: BSL-1.0 17 19 18 20 if(__clean_directory_list)
+4
cmake/FindEGL.cmake
··· 33 33 # Since pre-1.0.0. 34 34 35 35 # SPDX-License-Identifier: BSD-3-Clause 36 + # 37 + # Note: This module is originally from the KDE "Extra CMake Modules" repo, 38 + # adapted to work standalone. Original source: 39 + # https://github.com/KDE/extra-cmake-modules/blob/3b0bf71a72789eb2b79310b4f67602115e347f56/find-modules/FindEGL.cmake 36 40 #============================================================================= 37 41 # Copyright 2014 Alex Merry <alex.merry@kde.org> 38 42 # Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
+5 -3
cmake/FindHIDAPI.cmake
··· 40 40 # ``HIDAPI_LIBRARIES`` 41 41 # 42 42 # Original Author: 43 - # 2009-2010, 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net> 43 + # 2009-2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net> 44 44 # http://academic.cleardefinition.com 45 45 # 46 - # Copyright Iowa State University 2009-2010. 47 - # Copyright Collabora, Ltd. 2019, 2021. 46 + # Copyright 2009-2010, Iowa State University 47 + # Copyright 2019-2021, Collabora, Ltd. 48 + # 48 49 # SPDX-License-Identifier: BSL-1.0 50 + # 49 51 # Distributed under the Boost Software License, Version 1.0. 50 52 # (See accompanying file LICENSE_1_0.txt or copy at 51 53 # http://www.boost.org/LICENSE_1_0.txt)
+2
cmake/FindLeapV2.cmake
··· 1 1 # Copyright 2019-2021, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt)
+4 -2
cmake/FindLibcheck.cmake
··· 1 - # Copyright 2019, 2021 Collabora, Ltd. 1 + # Copyright 2019-2021 Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt) 6 8 # 7 9 # Original Author: 8 - # 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com> 10 + # 2019-2021 Ryan Pavlik <ryan.pavlik@collabora.com> 9 11 10 12 #.rst: 11 13 # FindCheck
+5 -3
cmake/FindLibusb1.cmake
··· 14 14 # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) 15 15 # 16 16 # Original Author: 17 - # 2009-2010, 2021 Ryan Pavlik <ryanpavlik@gmail.com> <abiryan@ryand.net> 17 + # 2009-2021 Ryan Pavlik <ryanpavlik@gmail.com> <abiryan@ryand.net> 18 + # http://academic.cleardefinition.com 18 19 # 19 - # Copyright Iowa State University 2009-2010. 20 - # Copyright Collabora, Ltd 2021. 20 + # Copyright 2009-2010, Iowa State University 21 + # Copyright 2021, Collabora, Ltd. 21 22 # 22 23 # SPDX-License-Identifier: BSL-1.0 24 + # 23 25 # Distributed under the Boost Software License, Version 1.0. 24 26 # (See accompanying file LICENSE_1_0.txt or copy at 25 27 # http://www.boost.org/LICENSE_1_0.txt)
+3 -1
cmake/FindONNXRuntime.cmake
··· 1 - # Copyright 2021, Collabora, Ltd. 1 + # Copyright 2021-2022, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt)
+4 -2
cmake/FindOpenGLES.cmake
··· 1 - # Copyright 2020-2021 Collabora, Ltd. 1 + # Copyright 2020-2021, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt) 6 8 # 7 9 # Original Author: 8 - # 2020-2021 Ryan Pavlik <ryan.pavlik@collabora.com> 10 + # 2020-2021, Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net> 9 11 10 12 #[[.rst: 11 13 FindOpenGLES
+4 -2
cmake/FindOpenHMD.cmake
··· 1 - # Copyright 2019, 2021 Collabora, Ltd. 1 + # Copyright 2019-2021 Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt) 6 8 # 7 9 # Original Author: 8 - # 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com> 10 + # 2019-2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net> 9 11 10 12 #.rst: 11 13 # FindOpenHMD
+3 -1
cmake/FindPercetto.cmake
··· 1 1 # Copyright 2021-2022, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt) 6 8 # 7 9 # Original Author: 8 - # 2021-2022 Ryan Pavlik <ryan.pavlik@collabora.com> 10 + # 2021-2022 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com> 9 11 10 12 #[[.rst: 11 13 FindPercetto
+2
cmake/Findbluetooth.cmake
··· 1 1 # Copyright 2022, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt)
+4 -2
cmake/FindcJSON.cmake
··· 1 - # Copyright 2019-2020, Collabora, Ltd. 1 + # Copyright 2019-2022, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 3 5 # Distributed under the Boost Software License, Version 1.0. 4 6 # (See accompanying file LICENSE_1_0.txt or copy at 5 7 # http://www.boost.org/LICENSE_1_0.txt) 6 8 # 7 9 # Original Author: 8 - # 2019-2020 Ryan Pavlik <ryan.pavlik@collabora.com> 10 + # 2019-2022 Ryan Pavlik <ryan.pavlik@collabora.com> 9 11 10 12 #.rst: 11 13 # FindcJSON
+2 -2
cmake/Findudev.cmake
··· 14 14 # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) 15 15 # 16 16 # Original Authors: 17 - # 2014 Kevin M. Godby <kevin@godby.org> 18 - # 2021 Ryan Pavlik <ryan.pavlik@collabora.com> 17 + # 2014, Kevin M. Godby <kevin@godby.org> 18 + # 2021, Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net> 19 19 # 20 20 # Copyright 2014, Kevin M. Godby <kevin@godby.org> 21 21 # Copyright 2021, Collabora, Ltd.
+148
cmake/GenerateKhrManifest.cmake
··· 1 + # Copyright 2019-2022, Collabora, Ltd. 2 + # 3 + # SPDX-License-Identifier: BSL-1.0 4 + # 5 + # Maintained by: 6 + # 2019-2022 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com> 7 + 8 + #[[.rst: 9 + GenerateKhrManifest 10 + ------------------- 11 + 12 + This is a utility module, usually wrapped by more usage-specific modules. 13 + The general goal is to be able to generate a (JSON) manifest describing targets 14 + with some absolute, relative, or unspecified path, such as required by the OpenXR 15 + and Vulkan loaders for runtimes and API layers. 16 + 17 + The following functions are provided by this module: 18 + 19 + - :command:`generate_khr_manifest_buildtree` 20 + - :command:`generate_khr_manifest_at_install` 21 + 22 + 23 + .. command:: generate_khr_manifest_buildtree 24 + 25 + Generates a manifest suitable for use in the build tree, 26 + with absolute paths, at configure time:: 27 + 28 + generate_khr_manifest_buildtree( 29 + MANIFEST_TEMPLATE <template> # The template for your manifest file 30 + TARGET <target> # Name of your target (layer, runtime, etc) 31 + OUT_FILE <outfile> # Name of the manifest file (with path) to generate 32 + MANIFEST_DESCRIPTION "<desc>" # A brief description of the thing we're generating (e.g. "Vulkan API layer manifest") 33 + ) 34 + 35 + 36 + .. command:: generate_khr_manifest_at_install 37 + 38 + Generates a manifest at install time and installs it where desired:: 39 + 40 + generate_khr_manifest_at_install( 41 + MANIFEST_TEMPLATE <template> # The template for your manifest file 42 + TARGET <target> # Name of your target (layer, runtime, etc) 43 + DESTINATION <dest> # The install-prefix-relative path to install the manifest to. 44 + RELATIVE_TARGET_DIR <dir> # The install-prefix-relative path that the target library is installed to. 45 + MANIFEST_DESCRIPTION "<desc>" # A brief description of the thing we're generating (e.g. "Vulkan API layer manifest") 46 + [COMPONENT <comp>] # If present, the component to place the manifest in. 47 + [ABSOLUTE_TARGET_PATH| # If present, path in generated manifest is absolute 48 + TARGET_DIR_RELATIVE_TO_MANIFEST <dir>] 49 + # If present (and ABSOLUTE_TARGET_PATH not present), specifies the 50 + # target directory relative to the manifest directory in the installed layout 51 + [OUT_FILENAME <outfilename> # Optional: Alternate name of the manifest file to generate (defaults to target name + .json) 52 + ) 53 + #]] 54 + get_filename_component(_KHR_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" 55 + PATH) 56 + set(_KHR_MANIFEST_SCRIPT 57 + "${_KHR_MANIFEST_CMAKE_DIR}/GenerateKhrManifestInternals.cmake.in" 58 + CACHE INTERNAL "" FORCE) 59 + 60 + function(generate_khr_manifest_buildtree) 61 + set(options) 62 + set(oneValueArgs MANIFEST_TEMPLATE TARGET OUT_FILE MANIFEST_DESCRIPTION) 63 + set(multiValueArgs) 64 + cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}" 65 + "${multiValueArgs}" ${ARGN}) 66 + 67 + if(NOT _genmanifest_MANIFEST_TEMPLATE) 68 + message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!") 69 + endif() 70 + if(NOT _genmanifest_TARGET) 71 + message(FATAL_ERROR "Need TARGET specified!") 72 + endif() 73 + if(NOT _genmanifest_OUT_FILE) 74 + message(FATAL_ERROR "Need OUT_FILE specified!") 75 + endif() 76 + if(NOT _genmanifest_MANIFEST_DESCRIPTION) 77 + message(FATAL_ERROR "Need MANIFEST_DESCRIPTION specified!") 78 + endif() 79 + 80 + # Set template values 81 + set(_genmanifest_INTERMEDIATE_MANIFEST 82 + ${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest_buildtree_${_genmanifest_TARGET}.json 83 + ) 84 + set(_genmanifest_IS_INSTALL OFF) 85 + 86 + set(_script 87 + ${CMAKE_CURRENT_BINARY_DIR}/make_build_manifest_${_genmanifest_TARGET}.cmake 88 + ) 89 + configure_file("${_KHR_MANIFEST_SCRIPT}" "${_script}" @ONLY) 90 + add_custom_command( 91 + TARGET ${_genmanifest_TARGET} 92 + POST_BUILD 93 + BYPRODUCTS "${_genmanifest_OUT_FILE}" 94 + COMMAND 95 + "${CMAKE_COMMAND}" "-DOUT_FILE=${_genmanifest_OUT_FILE}" 96 + "-DTARGET_PATH=$<TARGET_FILE:${_genmanifest_TARGET}>" -P 97 + "${_script}" DEPENDS "${_script}" 98 + COMMENT 99 + "Generating ${_genmanifest_MANIFEST_DESCRIPTION} named ${_genmanifest_OUT_FILE} for build tree usage" 100 + ) 101 + endfunction() 102 + 103 + function(generate_khr_manifest_at_install) 104 + set(options ABSOLUTE_TARGET_PATH) 105 + set(oneValueArgs 106 + MANIFEST_TEMPLATE 107 + TARGET 108 + DESTINATION 109 + OUT_FILENAME 110 + TARGET_DIR_RELATIVE_TO_MANIFEST 111 + RELATIVE_TARGET_DIR 112 + MANIFEST_DESCRIPTION 113 + COMPONENT) 114 + set(multiValueArgs) 115 + cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}" 116 + "${multiValueArgs}" ${ARGN}) 117 + 118 + if(NOT _genmanifest_MANIFEST_TEMPLATE) 119 + message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!") 120 + endif() 121 + if(NOT _genmanifest_TARGET) 122 + message(FATAL_ERROR "Need TARGET specified!") 123 + endif() 124 + if(NOT _genmanifest_DESTINATION) 125 + message(FATAL_ERROR "Need DESTINATION specified!") 126 + endif() 127 + if(NOT _genmanifest_RELATIVE_TARGET_DIR) 128 + message(FATAL_ERROR "Need RELATIVE_TARGET_DIR specified!") 129 + endif() 130 + if(NOT _genmanifest_OUT_FILENAME) 131 + set(_genmanifest_OUT_FILENAME "${_genmanifest_TARGET}.json") 132 + endif() 133 + if(NOT _genmanifest_COMPONENT) 134 + set(_genmanifest_COMPONENT Unspecified) 135 + endif() 136 + set(_genmanifest_INTERMEDIATE_MANIFEST 137 + "${CMAKE_CURRENT_BINARY_DIR}/${_genmanifest_OUT_FILENAME}") 138 + set(_genmanifest_IS_INSTALL ON) 139 + # Template value 140 + set(TARGET_FILENAME 141 + ${CMAKE_SHARED_MODULE_PREFIX}${_genmanifest_TARGET}${CMAKE_SHARED_MODULE_SUFFIX} 142 + ) 143 + 144 + set(_script 145 + ${CMAKE_CURRENT_BINARY_DIR}/make_manifest_${_genmanifest_TARGET}.cmake) 146 + configure_file("${_KHR_MANIFEST_SCRIPT}" "${_script}" @ONLY) 147 + install(SCRIPT "${_script}" COMPONENT ${_genmanifest_COMPONENT}) 148 + endfunction()
+70
cmake/GenerateKhrManifestInternals.cmake.in
··· 1 + # Copyright 2019-2022, Collabora, Ltd. 2 + # Copyright 2019, Benjamin Saunders <ben.e.saunders@gmail.com> 3 + # 4 + # SPDX-License-Identifier: BSL-1.0 5 + # 6 + # Maintained by: 7 + # 2019-2022 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com> 8 + 9 + # Get input from main CMake script 10 + set(MANIFEST_TEMPLATE @_genmanifest_MANIFEST_TEMPLATE@) 11 + set(DESTINATION @_genmanifest_DESTINATION@) 12 + set(OUT_FILENAME @_genmanifest_OUT_FILENAME@) 13 + set(CONFIGURE_OUTPUT_FILE @_genmanifest_INTERMEDIATE_MANIFEST@) 14 + set(IS_INSTALL @_genmanifest_IS_INSTALL@) 15 + set(MANIFEST_DESCRIPTION "@_genmanifest_MANIFEST_DESCRIPTION@") 16 + set(TARGET @_genmanifest_TARGET@) 17 + # Target install dir relative to install prefix 18 + set(RELATIVE_TARGET_DIR @_genmanifest_RELATIVE_TARGET_DIR@) 19 + # Target so/dll filename 20 + set(TARGET_FILENAME @TARGET_FILENAME@) 21 + # The relative path from the manifest dir to the library. Optional. 22 + set(TARGET_DIR_RELATIVE_TO_MANIFEST 23 + @_genmanifest_TARGET_DIR_RELATIVE_TO_MANIFEST@) 24 + # Config option 25 + set(ABSOLUTE_TARGET_PATH @_genmanifest_ABSOLUTE_TARGET_PATH@) 26 + 27 + if(TARGET_PATH) 28 + # This is at build time, not install time 29 + set(CONFIGURE_OUTPUT_FILE "${OUT_FILE}") 30 + elseif(ABSOLUTE_TARGET_PATH) 31 + # Absolute path to TARGET 32 + message( 33 + STATUS 34 + "Installing ${MANIFEST_DESCRIPTION} with absolute path to library") 35 + set(TARGET_PATH ${RELATIVE_TARGET_DIR}/${TARGET_FILENAME}) 36 + if(NOT IS_ABSOLUTE ${RELATIVE_TARGET_DIR}) 37 + set(TARGET_PATH ${CMAKE_INSTALL_PREFIX}/${TARGET_PATH}) 38 + endif() 39 + elseif(TARGET_DIR_RELATIVE_TO_MANIFEST) 40 + # Relative path to target. 41 + message( 42 + STATUS 43 + "Installing ${MANIFEST_DESCRIPTION} with JSON-relative path to library" 44 + ) 45 + set(TARGET_PATH ${TARGET_DIR_RELATIVE_TO_MANIFEST}/${TARGET_FILENAME}) 46 + else() 47 + # Unqualified filename: requires it exist on the system shared library search path. 48 + message( 49 + STATUS 50 + "Installing ${MANIFEST_DESCRIPTION} with unqualified library filename (uses system search path)" 51 + ) 52 + set(TARGET_PATH ${TARGET_FILENAME}) 53 + endif() 54 + 55 + if(WIN32) 56 + # Windows really wants backslashes in the manifest, and they must be escaped. 57 + string(REPLACE "/" [[\\]] TARGET_PATH ${TARGET_PATH}) 58 + endif() 59 + 60 + set(target_path ${TARGET_PATH}) 61 + # Create manifest 62 + configure_file("${MANIFEST_TEMPLATE}" "${CONFIGURE_OUTPUT_FILE}") 63 + 64 + if(IS_INSTALL) 65 + # Install it 66 + file( 67 + INSTALL 68 + DESTINATION "${CMAKE_INSTALL_PREFIX}/${DESTINATION}" 69 + TYPE FILE FILES "${CONFIGURE_OUTPUT_FILE}") 70 + endif()
+64 -45
cmake/GenerateOpenXRRuntimeManifest.cmake
··· 1 - # Copyright 2019-2022, Collabora, Ltd. 1 + # Copyright 2019-2023, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 4 + # 5 + # Maintained by: 6 + # 2019-2023 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com> 7 + 3 8 #[[.rst: 4 9 GenerateOpenXRRuntimeManifest 5 10 --------------- ··· 30 35 RUNTIME_TARGET <target> # Name of your runtime target 31 36 DESTINATION <dest> # The install-prefix-relative path to install the manifest to. 32 37 RELATIVE_RUNTIME_DIR <dir> # The install-prefix-relative path that the runtime library is installed to. 38 + [COMPONENT <comp>] # If present, the component to place the manifest in. 33 39 [ABSOLUTE_RUNTIME_PATH| # If present, path in generated manifest is absolute 34 40 RUNTIME_DIR_RELATIVE_TO_MANIFEST <dir>] 35 41 # If present (and ABSOLUTE_RUNTIME_PATH not present), specifies the ··· 38 44 [MANIFEST_TEMPLATE <template>] # Optional: Specify an alternate template to use 39 45 ) 40 46 #]] 41 - get_filename_component(_OXR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 42 - set(_OXR_MANIFEST_SCRIPT 43 - "${_OXR_CMAKE_DIR}/GenerateOpenXRRuntimeManifestInstall.cmake.in" 44 - CACHE INTERNAL "" FORCE) 47 + 48 + # This module is mostly just argument parsing, the guts are in GenerateKhrManifest 49 + 50 + get_filename_component(_OXR_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" 51 + PATH) 52 + include("${_OXR_MANIFEST_CMAKE_DIR}/GenerateKhrManifest.cmake") 45 53 46 54 set(_OXR_MANIFEST_TEMPLATE 47 - "${_OXR_CMAKE_DIR}/openxr_monado.in.json" 55 + "${_OXR_MANIFEST_CMAKE_DIR}/openxr_manifest.in.json" 48 56 CACHE INTERNAL "" FORCE) 49 57 50 58 function(generate_openxr_runtime_manifest_buildtree) 51 59 set(options) 52 - set(oneValueArgs RUNTIME_TARGET OUT_FILE MANIFEST_TEMPLATE) 60 + set(oneValueArgs MANIFEST_TEMPLATE RUNTIME_TARGET OUT_FILE) 53 61 set(multiValueArgs) 54 62 cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}" 55 63 "${multiValueArgs}" ${ARGN}) 56 64 65 + if(NOT _genmanifest_MANIFEST_TEMPLATE) 66 + set(_genmanifest_MANIFEST_TEMPLATE "${_OXR_MANIFEST_TEMPLATE}") 67 + endif() 57 68 if(NOT _genmanifest_RUNTIME_TARGET) 58 69 message(FATAL_ERROR "Need RUNTIME_TARGET specified!") 59 70 endif() 60 71 if(NOT _genmanifest_OUT_FILE) 61 72 message(FATAL_ERROR "Need OUT_FILE specified!") 62 - endif() 63 - if(NOT _genmanifest_MANIFEST_TEMPLATE) 64 - set(_genmanifest_MANIFEST_TEMPLATE "${_OXR_MANIFEST_TEMPLATE}") 65 73 endif() 66 74 67 - # Set template values 68 - set(_genmanifest_INTERMEDIATE_MANIFEST 69 - ${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest_buildtree_${_genmanifest_RUNTIME_TARGET}.json 70 - ) 71 - set(_genmanifest_IS_INSTALL OFF) 75 + generate_khr_manifest_buildtree( 76 + MANIFEST_DESCRIPTION 77 + "OpenXR runtime manifest" 78 + MANIFEST_TEMPLATE 79 + "${_genmanifest_MANIFEST_TEMPLATE}" 80 + TARGET 81 + "${_genmanifest_RUNTIME_TARGET}" 82 + OUT_FILE 83 + "${_genmanifest_OUT_FILE}") 72 84 73 - set(_script 74 - ${CMAKE_CURRENT_BINARY_DIR}/make_build_manifest_${_genmanifest_RUNTIME_TARGET}.cmake 75 - ) 76 - configure_file("${_OXR_MANIFEST_SCRIPT}" "${_script}" @ONLY) 77 - add_custom_command( 78 - TARGET ${_genmanifest_RUNTIME_TARGET} 79 - POST_BUILD 80 - BYPRODUCTS "${_genmanifest_OUT_FILE}" 81 - # "${_genmanifest_INTERMEDIATE_MANIFEST}" 82 - COMMAND 83 - "${CMAKE_COMMAND}" 84 - "-DOUT_FILE=${_genmanifest_OUT_FILE}" 85 - "-DRUNTIME_PATH=$<TARGET_FILE:${_genmanifest_RUNTIME_TARGET}>" -P 86 - "${_script}" DEPENDS "${_script}") 87 85 endfunction() 88 86 89 87 function(generate_openxr_runtime_manifest_at_install) 90 88 set(options ABSOLUTE_RUNTIME_PATH) 91 89 set(oneValueArgs 92 - RUNTIME_TARGET DESTINATION OUT_FILENAME 93 - RUNTIME_DIR_RELATIVE_TO_MANIFEST RELATIVE_RUNTIME_DIR MANIFEST_TEMPLATE) 90 + MANIFEST_TEMPLATE 91 + DESTINATION 92 + OUT_FILENAME 93 + COMPONENT 94 + RUNTIME_TARGET 95 + RUNTIME_DIR_RELATIVE_TO_MANIFEST 96 + RELATIVE_RUNTIME_DIR) 94 97 set(multiValueArgs) 95 98 cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}" 96 99 "${multiValueArgs}" ${ARGN}) 97 100 101 + if(NOT _genmanifest_MANIFEST_TEMPLATE) 102 + set(_genmanifest_MANIFEST_TEMPLATE "${_OXR_MANIFEST_TEMPLATE}") 103 + endif() 98 104 if(NOT _genmanifest_RUNTIME_TARGET) 99 105 message(FATAL_ERROR "Need RUNTIME_TARGET specified!") 100 106 endif() ··· 107 113 if(NOT _genmanifest_OUT_FILENAME) 108 114 set(_genmanifest_OUT_FILENAME "${_genmanifest_RUNTIME_TARGET}.json") 109 115 endif() 110 - if(NOT _genmanifest_MANIFEST_TEMPLATE) 111 - set(_genmanifest_MANIFEST_TEMPLATE "${_OXR_MANIFEST_TEMPLATE}") 116 + 117 + set(_genmanifest_fwdargs) 118 + 119 + if(_genmanifest_ABSOLUTE_RUNTIME_PATH) 120 + list(APPEND _genmanifest_fwdargs ABSOLUTE_TARGET_PATH) 112 121 endif() 113 - set(_genmanifest_INTERMEDIATE_MANIFEST 114 - "${CMAKE_CURRENT_BINARY_DIR}/${_genmanifest_OUT_FILENAME}") 115 - set(_genmanifest_IS_INSTALL ON) 116 - # Template value 117 - set(RUNTIME_FILENAME 118 - ${CMAKE_SHARED_MODULE_PREFIX}${_genmanifest_RUNTIME_TARGET}${CMAKE_SHARED_MODULE_SUFFIX} 119 - ) 120 122 121 - set(_script 122 - ${CMAKE_CURRENT_BINARY_DIR}/make_manifest_${_genmanifest_RUNTIME_TARGET}.cmake 123 - ) 124 - configure_file("${_OXR_MANIFEST_SCRIPT}" "${_script}" @ONLY) 125 - install(SCRIPT "${_script}") 123 + if(_genmanifest_RUNTIME_DIR_RELATIVE_TO_MANIFEST) 124 + list(APPEND _genmanifest_fwdargs TARGET_DIR_RELATIVE_TO_MANIFEST 125 + "${_genmanifest_RUNTIME_DIR_RELATIVE_TO_MANIFEST}") 126 + endif() 127 + if(_genmanifest_COMPONENT) 128 + list(APPEND _genmanifest_fwdargs COMPONENT "${_genmanifest_COMPONENT}") 129 + endif() 130 + 131 + generate_khr_manifest_at_install( 132 + ${_genmanifest_fwdargs} 133 + MANIFEST_DESCRIPTION 134 + "OpenXR runtime manifest" 135 + MANIFEST_TEMPLATE 136 + "${_genmanifest_MANIFEST_TEMPLATE}" 137 + TARGET 138 + "${_genmanifest_RUNTIME_TARGET}" 139 + DESTINATION 140 + "${_genmanifest_DESTINATION}" 141 + RELATIVE_TARGET_DIR 142 + "${_genmanifest_RELATIVE_RUNTIME_DIR}" 143 + OUT_FILENAME 144 + "${_genmanifest_OUT_FILENAME}") 126 145 endfunction()
-69
cmake/GenerateOpenXRRuntimeManifestInstall.cmake.in
··· 1 - # Copyright 2019-2022, Collabora, Ltd. 2 - # Copyright 2019, Benjamin Saunders <ben.e.saunders@gmail.com> 3 - # SPDX-License-Identifier: BSL-1.0 4 - 5 - # Get input from main CMake script 6 - set(MANIFEST_TEMPLATE @_genmanifest_MANIFEST_TEMPLATE@) 7 - set(DESTINATION @_genmanifest_DESTINATION@) 8 - set(OUT_FILENAME @_genmanifest_OUT_FILENAME@) 9 - set(CONFIGURE_OUTPUT_FILE @_genmanifest_INTERMEDIATE_MANIFEST@) 10 - set(IS_INSTALL @_genmanifest_IS_INSTALL@) 11 - set(RUNTIME_TARGET @_genmanifest_RUNTIME_TARGET@) 12 - # Runtime install dir relative to install prefix 13 - set(RELATIVE_RUNTIME_DIR @_genmanifest_RELATIVE_RUNTIME_DIR@) 14 - # Runtime so/dll filename 15 - set(RUNTIME_FILENAME @RUNTIME_FILENAME@) 16 - # The relative path from the manifest dir to the runtime. Optional. 17 - set(RUNTIME_DIR_RELATIVE_TO_MANIFEST 18 - @_genmanifest_RUNTIME_DIR_RELATIVE_TO_MANIFEST@) 19 - # Config option 20 - set(ABSOLUTE_RUNTIME_PATH @_genmanifest_ABSOLUTE_RUNTIME_PATH@) 21 - 22 - if(RUNTIME_PATH) 23 - # This is at build time, not install time 24 - set(CONFIGURE_OUTPUT_FILE "${OUT_FILE}") 25 - elseif(ABSOLUTE_RUNTIME_PATH) 26 - # Absolute path to runtime 27 - message( 28 - STATUS 29 - "Installing OpenXR runtime manifest with absolute path to runtime") 30 - set(RUNTIME_PATH ${RELATIVE_RUNTIME_DIR}/${RUNTIME_FILENAME}) 31 - if(NOT IS_ABSOLUTE ${RELATIVE_RUNTIME_DIR}) 32 - set(RUNTIME_PATH ${CMAKE_INSTALL_PREFIX}/${RUNTIME_PATH}) 33 - endif() 34 - elseif(RUNTIME_DIR_RELATIVE_TO_MANIFEST) 35 - # Relative path to runtime. 36 - message( 37 - STATUS 38 - "Installing OpenXR runtime manifest with JSON-relative path to runtime" 39 - ) 40 - set(RUNTIME_PATH ${RUNTIME_DIR_RELATIVE_TO_MANIFEST}/${RUNTIME_FILENAME}) 41 - else() 42 - # Unqualified runtime filename: requires it exist on the system shared library search path. 43 - message( 44 - STATUS 45 - "Installing OpenXR runtime manifest with unqualified runtime filename (uses system search path)" 46 - ) 47 - set(RUNTIME_PATH ${RUNTIME_FILENAME}) 48 - endif() 49 - 50 - if(WIN32) 51 - # Windows really wants backslashes in the manifest, and they must be escaped. 52 - string(REPLACE "/" [[\\]] RUNTIME_PATH ${RUNTIME_PATH}) 53 - endif() 54 - 55 - set(runtime_path ${RUNTIME_PATH}) 56 - # Create manifest 57 - configure_file("${MANIFEST_TEMPLATE}" "${CONFIGURE_OUTPUT_FILE}") 58 - 59 - if(IS_INSTALL) 60 - if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" 61 - OR NOT CMAKE_INSTALL_COMPONENT) 62 - 63 - # Install it 64 - file( 65 - INSTALL 66 - DESTINATION "${CMAKE_INSTALL_PREFIX}/${DESTINATION}" 67 - TYPE FILE FILES "${CONFIGURE_OUTPUT_FILE}") 68 - endif() 69 - endif()
+140
cmake/GenerateVulkanApiLayerManifest.cmake
··· 1 + # Copyright 2019-2023, Collabora, Ltd. 2 + # 3 + # SPDX-License-Identifier: BSL-1.0 4 + # 5 + # Maintained by: 6 + # 2019-2023 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com> 7 + 8 + #[[.rst: 9 + GenerateVulkanApiLayerManifest 10 + --------------- 11 + 12 + The following functions are provided by this module: 13 + 14 + - :command:`generate_vulkan_api_layer_manifest_buildtree` 15 + - :command:`generate_vulkan_api_layer_manifest_at_install` 16 + 17 + 18 + .. command:: generate_vulkan_api_layer_manifest_buildtree 19 + 20 + Generates a layer manifest suitable for use in the build tree, 21 + with absolute paths, at configure time:: 22 + 23 + generate_vulkan_api_layer_manifest_buildtree( 24 + MANIFEST_TEMPLATE <template> # The template for your manifest file 25 + LAYER_TARGET <target> # Name of your layer target 26 + OUT_FILE <outfile> # Name of the manifest file (with path) to generate 27 + ) 28 + 29 + 30 + .. command:: generate_vulkan_api_layer_manifest_at_install 31 + 32 + Generates a layer manifest at install time and installs it where desired:: 33 + 34 + generate_vulkan_api_layer_manifest_at_install( 35 + MANIFEST_TEMPLATE <template> # The template for your manifest file 36 + LAYER_TARGET <target> # Name of your layer target 37 + DESTINATION <dest> # The install-prefix-relative path to install the manifest to. 38 + RELATIVE_LAYER_DIR <dir> # The install-prefix-relative path that the layer library is installed to. 39 + [COMPONENT <comp>] # If present, the component to place the manifest in. 40 + [ABSOLUTE_LAYER_PATH| # If present, path in generated manifest is absolute 41 + LAYER_DIR_RELATIVE_TO_MANIFEST <dir>] 42 + # If present (and ABSOLUTE_LAYER_PATH not present), specifies the 43 + # layer directory relative to the manifest directory in the installed layout 44 + [OUT_FILENAME <outfilename> # Optional: Alternate name of the manifest file to generate 45 + ) 46 + #]] 47 + 48 + # This module is mostly just argument parsing, the guts are in GenerateKhrManifest 49 + 50 + get_filename_component(_VK_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 51 + include("${_VK_MANIFEST_CMAKE_DIR}/GenerateKhrManifest.cmake") 52 + 53 + function(generate_vulkan_api_layer_manifest_buildtree) 54 + set(options) 55 + set(oneValueArgs MANIFEST_TEMPLATE LAYER_TARGET OUT_FILE) 56 + set(multiValueArgs) 57 + cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}" 58 + "${multiValueArgs}" ${ARGN}) 59 + 60 + if(NOT _genmanifest_MANIFEST_TEMPLATE) 61 + message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!") 62 + endif() 63 + if(NOT _genmanifest_LAYER_TARGET) 64 + message(FATAL_ERROR "Need LAYER_TARGET specified!") 65 + endif() 66 + if(NOT _genmanifest_OUT_FILE) 67 + message(FATAL_ERROR "Need OUT_FILE specified!") 68 + endif() 69 + 70 + generate_khr_manifest_buildtree( 71 + MANIFEST_DESCRIPTION 72 + "Vulkan API layer manifest" 73 + MANIFEST_TEMPLATE 74 + "${_genmanifest_MANIFEST_TEMPLATE}" 75 + TARGET 76 + "${_genmanifest_LAYER_TARGET}" 77 + OUT_FILE 78 + "${_genmanifest_OUT_FILE}") 79 + 80 + endfunction() 81 + 82 + function(generate_vulkan_api_layer_manifest_at_install) 83 + set(options ABSOLUTE_LAYER_PATH) 84 + set(oneValueArgs 85 + MANIFEST_TEMPLATE 86 + DESTINATION 87 + OUT_FILENAME 88 + COMPONENT 89 + LAYER_TARGET 90 + LAYER_DIR_RELATIVE_TO_MANIFEST 91 + RELATIVE_LAYER_DIR) 92 + set(multiValueArgs) 93 + cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}" 94 + "${multiValueArgs}" ${ARGN}) 95 + 96 + if(NOT _genmanifest_MANIFEST_TEMPLATE) 97 + message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!") 98 + endif() 99 + if(NOT _genmanifest_LAYER_TARGET) 100 + message(FATAL_ERROR "Need LAYER_TARGET specified!") 101 + endif() 102 + if(NOT _genmanifest_DESTINATION) 103 + message(FATAL_ERROR "Need DESTINATION specified!") 104 + endif() 105 + if(NOT _genmanifest_RELATIVE_LAYER_DIR) 106 + message(FATAL_ERROR "Need RELATIVE_LAYER_DIR specified!") 107 + endif() 108 + if(NOT _genmanifest_OUT_FILENAME) 109 + set(_genmanifest_OUT_FILENAME "${_genmanifest_LAYER_TARGET}.json") 110 + endif() 111 + 112 + set(_genmanifest_fwdargs) 113 + 114 + if(_genmanifest_ABSOLUTE_LAYER_PATH) 115 + list(APPEND _genmanifest_fwdargs ABSOLUTE_TARGET_PATH) 116 + endif() 117 + 118 + if(_genmanifest_LAYER_DIR_RELATIVE_TO_MANIFEST) 119 + list(APPEND _genmanifest_fwdargs TARGET_DIR_RELATIVE_TO_MANIFEST 120 + "${_genmanifest_LAYER_DIR_RELATIVE_TO_MANIFEST}") 121 + endif() 122 + if(_genmanifest_COMPONENT) 123 + list(APPEND _genmanifest_fwdargs COMPONENT "${_genmanifest_COMPONENT}") 124 + endif() 125 + 126 + generate_khr_manifest_at_install( 127 + ${_genmanifest_fwdargs} 128 + MANIFEST_DESCRIPTION 129 + "Vulkan API layer manifest" 130 + MANIFEST_TEMPLATE 131 + "${_genmanifest_MANIFEST_TEMPLATE}" 132 + TARGET 133 + "${_genmanifest_LAYER_TARGET}" 134 + DESTINATION 135 + "${_genmanifest_DESTINATION}" 136 + RELATIVE_TARGET_DIR 137 + "${_genmanifest_RELATIVE_LAYER_DIR}" 138 + OUT_FILENAME 139 + "${_genmanifest_OUT_FILENAME}") 140 + endfunction()
+4 -1
cmake/GetGitRevisionDescription.cmake
··· 38 38 # Copyright 2009-2013, Iowa State University. 39 39 # Copyright 2013-2020, Ryan Pavlik 40 40 # Copyright 2013-2020, Contributors 41 + # 41 42 # SPDX-License-Identifier: BSL-1.0 43 + # 42 44 # Distributed under the Boost Software License, Version 1.0. 43 45 # (See accompanying file LICENSE_1_0.txt or copy at 44 46 # http://www.boost.org/LICENSE_1_0.txt) ··· 94 96 if(NOT "${GIT_DIR}" STREQUAL "") 95 97 file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}" 96 98 "${GIT_DIR}") 97 - if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR) 99 + if("${_relative_to_source_dir}" MATCHES "[.][.]" 100 + AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR) 98 101 # We've gone above the CMake root dir. 99 102 set(GIT_DIR "") 100 103 endif()
+23 -17
cmake/GetGitRevisionDescription.cmake.in
··· 4 4 # Requires CMake 2.6 or newer (uses the 'function' command) 5 5 # 6 6 # Original Author: 7 - # 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> 7 + # 2009-2023 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> 8 8 # http://academic.cleardefinition.com 9 9 # Iowa State University HCI Graduate Program/VRAC 10 10 # 11 - # Copyright Iowa State University 2009-2010. 11 + # Copyright 2009-2012, Iowa State University 12 + # Copyright 2011-2023, Contributors 13 + # 12 14 # Distributed under the Boost Software License, Version 1.0. 13 15 # (See accompanying file LICENSE_1_0.txt or copy at 14 16 # http://www.boost.org/LICENSE_1_0.txt) 17 + # 15 18 # SPDX-License-Identifier: BSL-1.0 16 19 17 20 set(HEAD_HASH) ··· 20 23 21 24 string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 22 25 if(HEAD_CONTENTS MATCHES "ref") 23 - # named branch 24 - string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 25 - if(EXISTS "@GIT_DIR@/${HEAD_REF}") 26 - configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 27 - else() 28 - configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 29 - file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 30 - if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 31 - set(HEAD_HASH "${CMAKE_MATCH_1}") 32 - endif() 33 - endif() 26 + # named branch 27 + string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 28 + if(EXISTS "@GIT_DIR@/${HEAD_REF}") 29 + configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 30 + else() 31 + if(EXISTS "@GIT_DIR@/packed-refs") 32 + configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" 33 + COPYONLY) 34 + file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 35 + if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 36 + set(HEAD_HASH "${CMAKE_MATCH_1}") 37 + endif() 38 + endif() 39 + endif() 34 40 else() 35 - # detached HEAD 36 - configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 41 + # detached HEAD 42 + configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 37 43 endif() 38 44 39 45 if(NOT HEAD_HASH) 40 - file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 41 - string(STRIP "${HEAD_HASH}" HEAD_HASH) 46 + file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 47 + string(STRIP "${HEAD_HASH}" HEAD_HASH) 42 48 endif()
+1 -1
cmake/OptionWithDeps.cmake
··· 1 1 # Copyright 2022, Collabora, Ltd. 2 - # Copyright 2000-2022 Kitware, Inc., Insight Software Consortium 2 + # Copyright 2000-2022, Kitware, Inc., Insight Software Consortium 3 3 # 4 4 # SPDX-License-Identifier: BSD-3-Clause 5 5 #
+3 -1
cmake/PrefixListGlob.cmake
··· 6 6 # http://academic.cleardefinition.com 7 7 # Iowa State University HCI Graduate Program/VRAC 8 8 # 9 - # Copyright Iowa State University 2009-2010. 9 + # Copyright 2009-2010, Iowa State University 10 + # 10 11 # Distributed under the Boost Software License, Version 1.0. 11 12 # (See accompanying file LICENSE_1_0.txt or copy at 12 13 # http://www.boost.org/LICENSE_1_0.txt) 14 + # 13 15 # SPDX-License-Identifier: BSL-1.0 14 16 15 17 if(__prefix_list_glob)
+3 -1
cmake/ProgramFilesGlob.cmake
··· 9 9 # http://academic.cleardefinition.com 10 10 # Iowa State University HCI Graduate Program/VRAC 11 11 # 12 - # Copyright Iowa State University 2009-2010. 12 + # Copyright 2009-2010, Iowa State University 13 + # 13 14 # Distributed under the Boost Software License, Version 1.0. 14 15 # (See accompanying file LICENSE_1_0.txt or copy at 15 16 # http://www.boost.org/LICENSE_1_0.txt) 17 + # 16 18 # SPDX-License-Identifier: BSL-1.0 17 19 18 20 include(PrefixListGlob)
+1
cmake/SPIR-V.cmake
··· 1 1 # Copyright 2019, Collabora, Ltd. 2 + # 2 3 # SPDX-License-Identifier: BSL-1.0 3 4 4 5 find_program(GLSLANGVALIDATOR_COMMAND
+3
cmake/openxr_manifest.in.json.license
··· 1 + Copyright 2018-2020, Collabora, Ltd. 2 + 3 + SPDX-License-Identifier: BSL-1.0
cmake/openxr_monado.in.json cmake/openxr_manifest.in.json
-2
cmake/openxr_monado.in.json.license
··· 1 - Copyright 2018-2023, Collabora, Ltd. 2 - SPDX-License-Identifier: BSL-1.0