···99# http://academic.cleardefinition.com
1010# Iowa State University HCI Graduate Program/VRAC
1111#
1212-# Copyright Iowa State University 2009-2010.
1212+# Copyright 2009-2010, Iowa State University.
1313+#
1314# Distributed under the Boost Software License, Version 1.0.
1415# (See accompanying file LICENSE_1_0.txt or copy at
1516# http://www.boost.org/LICENSE_1_0.txt)
1717+#
1618# SPDX-License-Identifier: BSL-1.0
17191820if(__clean_directory_list)
+4
cmake/FindEGL.cmake
···3333# Since pre-1.0.0.
34343535# SPDX-License-Identifier: BSD-3-Clause
3636+#
3737+# Note: This module is originally from the KDE "Extra CMake Modules" repo,
3838+# adapted to work standalone. Original source:
3939+# https://github.com/KDE/extra-cmake-modules/blob/3b0bf71a72789eb2b79310b4f67602115e347f56/find-modules/FindEGL.cmake
3640#=============================================================================
3741# Copyright 2014 Alex Merry <alex.merry@kde.org>
3842# Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
+5-3
cmake/FindHIDAPI.cmake
···4040# ``HIDAPI_LIBRARIES``
4141#
4242# Original Author:
4343-# 2009-2010, 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
4343+# 2009-2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
4444# http://academic.cleardefinition.com
4545#
4646-# Copyright Iowa State University 2009-2010.
4747-# Copyright Collabora, Ltd. 2019, 2021.
4646+# Copyright 2009-2010, Iowa State University
4747+# Copyright 2019-2021, Collabora, Ltd.
4848+#
4849# SPDX-License-Identifier: BSL-1.0
5050+#
4951# Distributed under the Boost Software License, Version 1.0.
5052# (See accompanying file LICENSE_1_0.txt or copy at
5153# http://www.boost.org/LICENSE_1_0.txt)
+2
cmake/FindLeapV2.cmake
···11# Copyright 2019-2021, Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
+4-2
cmake/FindLibcheck.cmake
···11-# Copyright 2019, 2021 Collabora, Ltd.
11+# Copyright 2019-2021 Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
68#
79# Original Author:
88-# 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
1010+# 2019-2021 Ryan Pavlik <ryan.pavlik@collabora.com>
9111012#.rst:
1113# FindCheck
+5-3
cmake/FindLibusb1.cmake
···1414# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
1515#
1616# Original Author:
1717-# 2009-2010, 2021 Ryan Pavlik <ryanpavlik@gmail.com> <abiryan@ryand.net>
1717+# 2009-2021 Ryan Pavlik <ryanpavlik@gmail.com> <abiryan@ryand.net>
1818+# http://academic.cleardefinition.com
1819#
1919-# Copyright Iowa State University 2009-2010.
2020-# Copyright Collabora, Ltd 2021.
2020+# Copyright 2009-2010, Iowa State University
2121+# Copyright 2021, Collabora, Ltd.
2122#
2223# SPDX-License-Identifier: BSL-1.0
2424+#
2325# Distributed under the Boost Software License, Version 1.0.
2426# (See accompanying file LICENSE_1_0.txt or copy at
2527# http://www.boost.org/LICENSE_1_0.txt)
+3-1
cmake/FindONNXRuntime.cmake
···11-# Copyright 2021, Collabora, Ltd.
11+# Copyright 2021-2022, Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
+4-2
cmake/FindOpenGLES.cmake
···11-# Copyright 2020-2021 Collabora, Ltd.
11+# Copyright 2020-2021, Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
68#
79# Original Author:
88-# 2020-2021 Ryan Pavlik <ryan.pavlik@collabora.com>
1010+# 2020-2021, Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
9111012#[[.rst:
1113FindOpenGLES
+4-2
cmake/FindOpenHMD.cmake
···11-# Copyright 2019, 2021 Collabora, Ltd.
11+# Copyright 2019-2021 Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
68#
79# Original Author:
88-# 2019, 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
1010+# 2019-2021 Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
9111012#.rst:
1113# FindOpenHMD
+3-1
cmake/FindPercetto.cmake
···11# Copyright 2021-2022, Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
68#
79# Original Author:
88-# 2021-2022 Ryan Pavlik <ryan.pavlik@collabora.com>
1010+# 2021-2022 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com>
9111012#[[.rst:
1113FindPercetto
+2
cmake/Findbluetooth.cmake
···11# Copyright 2022, Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
+4-2
cmake/FindcJSON.cmake
···11-# Copyright 2019-2020, Collabora, Ltd.
11+# Copyright 2019-2022, Collabora, Ltd.
22+#
23# SPDX-License-Identifier: BSL-1.0
44+#
35# Distributed under the Boost Software License, Version 1.0.
46# (See accompanying file LICENSE_1_0.txt or copy at
57# http://www.boost.org/LICENSE_1_0.txt)
68#
79# Original Author:
88-# 2019-2020 Ryan Pavlik <ryan.pavlik@collabora.com>
1010+# 2019-2022 Ryan Pavlik <ryan.pavlik@collabora.com>
9111012#.rst:
1113# FindcJSON
+2-2
cmake/Findudev.cmake
···1414# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
1515#
1616# Original Authors:
1717-# 2014 Kevin M. Godby <kevin@godby.org>
1818-# 2021 Ryan Pavlik <ryan.pavlik@collabora.com>
1717+# 2014, Kevin M. Godby <kevin@godby.org>
1818+# 2021, Ryan Pavlik <ryan.pavlik@collabora.com> <abiryan@ryand.net>
1919#
2020# Copyright 2014, Kevin M. Godby <kevin@godby.org>
2121# Copyright 2021, Collabora, Ltd.
+148
cmake/GenerateKhrManifest.cmake
···11+# Copyright 2019-2022, Collabora, Ltd.
22+#
33+# SPDX-License-Identifier: BSL-1.0
44+#
55+# Maintained by:
66+# 2019-2022 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com>
77+88+#[[.rst:
99+GenerateKhrManifest
1010+-------------------
1111+1212+This is a utility module, usually wrapped by more usage-specific modules.
1313+The general goal is to be able to generate a (JSON) manifest describing targets
1414+with some absolute, relative, or unspecified path, such as required by the OpenXR
1515+and Vulkan loaders for runtimes and API layers.
1616+1717+The following functions are provided by this module:
1818+1919+- :command:`generate_khr_manifest_buildtree`
2020+- :command:`generate_khr_manifest_at_install`
2121+2222+2323+.. command:: generate_khr_manifest_buildtree
2424+2525+ Generates a manifest suitable for use in the build tree,
2626+ with absolute paths, at configure time::
2727+2828+ generate_khr_manifest_buildtree(
2929+ MANIFEST_TEMPLATE <template> # The template for your manifest file
3030+ TARGET <target> # Name of your target (layer, runtime, etc)
3131+ OUT_FILE <outfile> # Name of the manifest file (with path) to generate
3232+ MANIFEST_DESCRIPTION "<desc>" # A brief description of the thing we're generating (e.g. "Vulkan API layer manifest")
3333+ )
3434+3535+3636+.. command:: generate_khr_manifest_at_install
3737+3838+ Generates a manifest at install time and installs it where desired::
3939+4040+ generate_khr_manifest_at_install(
4141+ MANIFEST_TEMPLATE <template> # The template for your manifest file
4242+ TARGET <target> # Name of your target (layer, runtime, etc)
4343+ DESTINATION <dest> # The install-prefix-relative path to install the manifest to.
4444+ RELATIVE_TARGET_DIR <dir> # The install-prefix-relative path that the target library is installed to.
4545+ MANIFEST_DESCRIPTION "<desc>" # A brief description of the thing we're generating (e.g. "Vulkan API layer manifest")
4646+ [COMPONENT <comp>] # If present, the component to place the manifest in.
4747+ [ABSOLUTE_TARGET_PATH| # If present, path in generated manifest is absolute
4848+ TARGET_DIR_RELATIVE_TO_MANIFEST <dir>]
4949+ # If present (and ABSOLUTE_TARGET_PATH not present), specifies the
5050+ # target directory relative to the manifest directory in the installed layout
5151+ [OUT_FILENAME <outfilename> # Optional: Alternate name of the manifest file to generate (defaults to target name + .json)
5252+ )
5353+#]]
5454+get_filename_component(_KHR_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}"
5555+ PATH)
5656+set(_KHR_MANIFEST_SCRIPT
5757+ "${_KHR_MANIFEST_CMAKE_DIR}/GenerateKhrManifestInternals.cmake.in"
5858+ CACHE INTERNAL "" FORCE)
5959+6060+function(generate_khr_manifest_buildtree)
6161+ set(options)
6262+ set(oneValueArgs MANIFEST_TEMPLATE TARGET OUT_FILE MANIFEST_DESCRIPTION)
6363+ set(multiValueArgs)
6464+ cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
6565+ "${multiValueArgs}" ${ARGN})
6666+6767+ if(NOT _genmanifest_MANIFEST_TEMPLATE)
6868+ message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!")
6969+ endif()
7070+ if(NOT _genmanifest_TARGET)
7171+ message(FATAL_ERROR "Need TARGET specified!")
7272+ endif()
7373+ if(NOT _genmanifest_OUT_FILE)
7474+ message(FATAL_ERROR "Need OUT_FILE specified!")
7575+ endif()
7676+ if(NOT _genmanifest_MANIFEST_DESCRIPTION)
7777+ message(FATAL_ERROR "Need MANIFEST_DESCRIPTION specified!")
7878+ endif()
7979+8080+ # Set template values
8181+ set(_genmanifest_INTERMEDIATE_MANIFEST
8282+ ${CMAKE_CURRENT_BINARY_DIR}/intermediate_manifest_buildtree_${_genmanifest_TARGET}.json
8383+ )
8484+ set(_genmanifest_IS_INSTALL OFF)
8585+8686+ set(_script
8787+ ${CMAKE_CURRENT_BINARY_DIR}/make_build_manifest_${_genmanifest_TARGET}.cmake
8888+ )
8989+ configure_file("${_KHR_MANIFEST_SCRIPT}" "${_script}" @ONLY)
9090+ add_custom_command(
9191+ TARGET ${_genmanifest_TARGET}
9292+ POST_BUILD
9393+ BYPRODUCTS "${_genmanifest_OUT_FILE}"
9494+ COMMAND
9595+ "${CMAKE_COMMAND}" "-DOUT_FILE=${_genmanifest_OUT_FILE}"
9696+ "-DTARGET_PATH=$<TARGET_FILE:${_genmanifest_TARGET}>" -P
9797+ "${_script}" DEPENDS "${_script}"
9898+ COMMENT
9999+ "Generating ${_genmanifest_MANIFEST_DESCRIPTION} named ${_genmanifest_OUT_FILE} for build tree usage"
100100+ )
101101+endfunction()
102102+103103+function(generate_khr_manifest_at_install)
104104+ set(options ABSOLUTE_TARGET_PATH)
105105+ set(oneValueArgs
106106+ MANIFEST_TEMPLATE
107107+ TARGET
108108+ DESTINATION
109109+ OUT_FILENAME
110110+ TARGET_DIR_RELATIVE_TO_MANIFEST
111111+ RELATIVE_TARGET_DIR
112112+ MANIFEST_DESCRIPTION
113113+ COMPONENT)
114114+ set(multiValueArgs)
115115+ cmake_parse_arguments(_genmanifest "${options}" "${oneValueArgs}"
116116+ "${multiValueArgs}" ${ARGN})
117117+118118+ if(NOT _genmanifest_MANIFEST_TEMPLATE)
119119+ message(FATAL_ERROR "Need MANIFEST_TEMPLATE specified!")
120120+ endif()
121121+ if(NOT _genmanifest_TARGET)
122122+ message(FATAL_ERROR "Need TARGET specified!")
123123+ endif()
124124+ if(NOT _genmanifest_DESTINATION)
125125+ message(FATAL_ERROR "Need DESTINATION specified!")
126126+ endif()
127127+ if(NOT _genmanifest_RELATIVE_TARGET_DIR)
128128+ message(FATAL_ERROR "Need RELATIVE_TARGET_DIR specified!")
129129+ endif()
130130+ if(NOT _genmanifest_OUT_FILENAME)
131131+ set(_genmanifest_OUT_FILENAME "${_genmanifest_TARGET}.json")
132132+ endif()
133133+ if(NOT _genmanifest_COMPONENT)
134134+ set(_genmanifest_COMPONENT Unspecified)
135135+ endif()
136136+ set(_genmanifest_INTERMEDIATE_MANIFEST
137137+ "${CMAKE_CURRENT_BINARY_DIR}/${_genmanifest_OUT_FILENAME}")
138138+ set(_genmanifest_IS_INSTALL ON)
139139+ # Template value
140140+ set(TARGET_FILENAME
141141+ ${CMAKE_SHARED_MODULE_PREFIX}${_genmanifest_TARGET}${CMAKE_SHARED_MODULE_SUFFIX}
142142+ )
143143+144144+ set(_script
145145+ ${CMAKE_CURRENT_BINARY_DIR}/make_manifest_${_genmanifest_TARGET}.cmake)
146146+ configure_file("${_KHR_MANIFEST_SCRIPT}" "${_script}" @ONLY)
147147+ install(SCRIPT "${_script}" COMPONENT ${_genmanifest_COMPONENT})
148148+endfunction()
+70
cmake/GenerateKhrManifestInternals.cmake.in
···11+# Copyright 2019-2022, Collabora, Ltd.
22+# Copyright 2019, Benjamin Saunders <ben.e.saunders@gmail.com>
33+#
44+# SPDX-License-Identifier: BSL-1.0
55+#
66+# Maintained by:
77+# 2019-2022 Ryan Pavlik <ryan.pavlik@collabora.com> <ryan.pavlik@gmail.com>
88+99+# Get input from main CMake script
1010+set(MANIFEST_TEMPLATE @_genmanifest_MANIFEST_TEMPLATE@)
1111+set(DESTINATION @_genmanifest_DESTINATION@)
1212+set(OUT_FILENAME @_genmanifest_OUT_FILENAME@)
1313+set(CONFIGURE_OUTPUT_FILE @_genmanifest_INTERMEDIATE_MANIFEST@)
1414+set(IS_INSTALL @_genmanifest_IS_INSTALL@)
1515+set(MANIFEST_DESCRIPTION "@_genmanifest_MANIFEST_DESCRIPTION@")
1616+set(TARGET @_genmanifest_TARGET@)
1717+# Target install dir relative to install prefix
1818+set(RELATIVE_TARGET_DIR @_genmanifest_RELATIVE_TARGET_DIR@)
1919+# Target so/dll filename
2020+set(TARGET_FILENAME @TARGET_FILENAME@)
2121+# The relative path from the manifest dir to the library. Optional.
2222+set(TARGET_DIR_RELATIVE_TO_MANIFEST
2323+ @_genmanifest_TARGET_DIR_RELATIVE_TO_MANIFEST@)
2424+# Config option
2525+set(ABSOLUTE_TARGET_PATH @_genmanifest_ABSOLUTE_TARGET_PATH@)
2626+2727+if(TARGET_PATH)
2828+ # This is at build time, not install time
2929+ set(CONFIGURE_OUTPUT_FILE "${OUT_FILE}")
3030+elseif(ABSOLUTE_TARGET_PATH)
3131+ # Absolute path to TARGET
3232+ message(
3333+ STATUS
3434+ "Installing ${MANIFEST_DESCRIPTION} with absolute path to library")
3535+ set(TARGET_PATH ${RELATIVE_TARGET_DIR}/${TARGET_FILENAME})
3636+ if(NOT IS_ABSOLUTE ${RELATIVE_TARGET_DIR})
3737+ set(TARGET_PATH ${CMAKE_INSTALL_PREFIX}/${TARGET_PATH})
3838+ endif()
3939+elseif(TARGET_DIR_RELATIVE_TO_MANIFEST)
4040+ # Relative path to target.
4141+ message(
4242+ STATUS
4343+ "Installing ${MANIFEST_DESCRIPTION} with JSON-relative path to library"
4444+ )
4545+ set(TARGET_PATH ${TARGET_DIR_RELATIVE_TO_MANIFEST}/${TARGET_FILENAME})
4646+else()
4747+ # Unqualified filename: requires it exist on the system shared library search path.
4848+ message(
4949+ STATUS
5050+ "Installing ${MANIFEST_DESCRIPTION} with unqualified library filename (uses system search path)"
5151+ )
5252+ set(TARGET_PATH ${TARGET_FILENAME})
5353+endif()
5454+5555+if(WIN32)
5656+ # Windows really wants backslashes in the manifest, and they must be escaped.
5757+ string(REPLACE "/" [[\\]] TARGET_PATH ${TARGET_PATH})
5858+endif()
5959+6060+set(target_path ${TARGET_PATH})
6161+# Create manifest
6262+configure_file("${MANIFEST_TEMPLATE}" "${CONFIGURE_OUTPUT_FILE}")
6363+6464+if(IS_INSTALL)
6565+ # Install it
6666+ file(
6767+ INSTALL
6868+ DESTINATION "${CMAKE_INSTALL_PREFIX}/${DESTINATION}"
6969+ TYPE FILE FILES "${CONFIGURE_OUTPUT_FILE}")
7070+endif()
···66# http://academic.cleardefinition.com
77# Iowa State University HCI Graduate Program/VRAC
88#
99-# Copyright Iowa State University 2009-2010.
99+# Copyright 2009-2010, Iowa State University
1010+#
1011# Distributed under the Boost Software License, Version 1.0.
1112# (See accompanying file LICENSE_1_0.txt or copy at
1213# http://www.boost.org/LICENSE_1_0.txt)
1414+#
1315# SPDX-License-Identifier: BSL-1.0
14161517if(__prefix_list_glob)
+3-1
cmake/ProgramFilesGlob.cmake
···99# http://academic.cleardefinition.com
1010# Iowa State University HCI Graduate Program/VRAC
1111#
1212-# Copyright Iowa State University 2009-2010.
1212+# Copyright 2009-2010, Iowa State University
1313+#
1314# Distributed under the Boost Software License, Version 1.0.
1415# (See accompanying file LICENSE_1_0.txt or copy at
1516# http://www.boost.org/LICENSE_1_0.txt)
1717+#
1618# SPDX-License-Identifier: BSL-1.0
17191820include(PrefixListGlob)