From c4e81d3b7ca3a6d3bf7f540dcdc0815d575b32a1 Mon Sep 17 00:00:00 2001 From: Rylie Pavlik Date: Wed, 15 Nov 2023 11:16:49 -0600 Subject: [PATCH] cmake: Update cmake modules from upstream collection. Upstream is https://github.com/rpavlik/cmake-modules --- cmake/CleanDirectoryList.cmake | 4 +- cmake/FindEGL.cmake | 4 + cmake/FindHIDAPI.cmake | 8 +- cmake/FindLeapV2.cmake | 2 + cmake/FindLibcheck.cmake | 6 +- cmake/FindLibusb1.cmake | 8 +- cmake/FindONNXRuntime.cmake | 4 +- cmake/FindOpenGLES.cmake | 6 +- cmake/FindOpenHMD.cmake | 6 +- cmake/FindPercetto.cmake | 4 +- cmake/Findbluetooth.cmake | 2 + cmake/FindcJSON.cmake | 6 +- cmake/Findudev.cmake | 4 +- cmake/GenerateKhrManifest.cmake | 148 ++++++++++++++++++ cmake/GenerateKhrManifestInternals.cmake.in | 70 +++++++++ cmake/GenerateOpenXRRuntimeManifest.cmake | 111 +++++++------ ...erateOpenXRRuntimeManifestInstall.cmake.in | 69 -------- cmake/GenerateVulkanApiLayerManifest.cmake | 140 +++++++++++++++++ cmake/GetGitRevisionDescription.cmake | 5 +- cmake/GetGitRevisionDescription.cmake.in | 40 +++-- cmake/OptionWithDeps.cmake | 2 +- cmake/PrefixListGlob.cmake | 4 +- cmake/ProgramFilesGlob.cmake | 4 +- cmake/SPIR-V.cmake | 1 + ...monado.in.json => openxr_manifest.in.json} | 0 cmake/openxr_manifest.in.json.license | 3 + cmake/openxr_monado.in.json.license | 2 - 27 files changed, 506 insertions(+), 157 deletions(-) create mode 100644 cmake/GenerateKhrManifest.cmake create mode 100644 cmake/GenerateKhrManifestInternals.cmake.in delete mode 100644 cmake/GenerateOpenXRRuntimeManifestInstall.cmake.in create mode 100644 cmake/GenerateVulkanApiLayerManifest.cmake rename cmake/{openxr_monado.in.json => openxr_manifest.in.json} (100%) create mode 100644 cmake/openxr_manifest.in.json.license delete mode 100644 cmake/openxr_monado.in.json.license diff --git a/cmake/CleanDirectoryList.cmake b/cmake/CleanDirectoryList.cmake index 4f5b88bab..c1e7c4ddf 100644 --- a/cmake/CleanDirectoryList.cmake +++ b/cmake/CleanDirectoryList.cmake @@ -9,10 +9,12 @@ # http://academic.cleardefinition.com # Iowa State University HCI Graduate Program/VRAC # -# Copyright Iowa State University 2009-2010. +# Copyright 2009-2010, Iowa State University. +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +# # SPDX-License-Identifier: BSL-1.0 if(__clean_directory_list) diff --git a/cmake/FindEGL.cmake b/cmake/FindEGL.cmake index 6c3e015d8..c4f6c8b47 100644 --- a/cmake/FindEGL.cmake +++ b/cmake/FindEGL.cmake @@ -33,6 +33,10 @@ # Since pre-1.0.0. # SPDX-License-Identifier: BSD-3-Clause +# +# Note: This module is originally from the KDE "Extra CMake Modules" repo, +# adapted to work standalone. Original source: +# https://github.com/KDE/extra-cmake-modules/blob/3b0bf71a72789eb2b79310b4f67602115e347f56/find-modules/FindEGL.cmake #============================================================================= # Copyright 2014 Alex Merry # Copyright 2014 Martin Gräßlin diff --git a/cmake/FindHIDAPI.cmake b/cmake/FindHIDAPI.cmake index 3d97b8113..abfb161bf 100644 --- a/cmake/FindHIDAPI.cmake +++ b/cmake/FindHIDAPI.cmake @@ -40,12 +40,14 @@ # ``HIDAPI_LIBRARIES`` # # Original Author: -# 2009-2010, 2019, 2021 Ryan Pavlik +# 2009-2021 Ryan Pavlik # http://academic.cleardefinition.com # -# Copyright Iowa State University 2009-2010. -# Copyright Collabora, Ltd. 2019, 2021. +# Copyright 2009-2010, Iowa State University +# Copyright 2019-2021, Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) diff --git a/cmake/FindLeapV2.cmake b/cmake/FindLeapV2.cmake index d914a62d3..aa070eaf3 100644 --- a/cmake/FindLeapV2.cmake +++ b/cmake/FindLeapV2.cmake @@ -1,5 +1,7 @@ # Copyright 2019-2021, Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) diff --git a/cmake/FindLibcheck.cmake b/cmake/FindLibcheck.cmake index 25b583c21..d67c822a6 100644 --- a/cmake/FindLibcheck.cmake +++ b/cmake/FindLibcheck.cmake @@ -1,11 +1,13 @@ -# Copyright 2019, 2021 Collabora, Ltd. +# Copyright 2019-2021 Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # # Original Author: -# 2019, 2021 Ryan Pavlik +# 2019-2021 Ryan Pavlik #.rst: # FindCheck diff --git a/cmake/FindLibusb1.cmake b/cmake/FindLibusb1.cmake index ea5aae1b4..ed8c978e4 100644 --- a/cmake/FindLibusb1.cmake +++ b/cmake/FindLibusb1.cmake @@ -14,12 +14,14 @@ # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) # # Original Author: -# 2009-2010, 2021 Ryan Pavlik +# 2009-2021 Ryan Pavlik +# http://academic.cleardefinition.com # -# Copyright Iowa State University 2009-2010. -# Copyright Collabora, Ltd 2021. +# Copyright 2009-2010, Iowa State University +# Copyright 2021, Collabora, Ltd. # # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) diff --git a/cmake/FindONNXRuntime.cmake b/cmake/FindONNXRuntime.cmake index 4b2890344..7840df7e3 100644 --- a/cmake/FindONNXRuntime.cmake +++ b/cmake/FindONNXRuntime.cmake @@ -1,5 +1,7 @@ -# Copyright 2021, Collabora, Ltd. +# Copyright 2021-2022, Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) diff --git a/cmake/FindOpenGLES.cmake b/cmake/FindOpenGLES.cmake index b16a1d33a..f552ba33f 100644 --- a/cmake/FindOpenGLES.cmake +++ b/cmake/FindOpenGLES.cmake @@ -1,11 +1,13 @@ -# Copyright 2020-2021 Collabora, Ltd. +# Copyright 2020-2021, Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # # Original Author: -# 2020-2021 Ryan Pavlik +# 2020-2021, Ryan Pavlik #[[.rst: FindOpenGLES diff --git a/cmake/FindOpenHMD.cmake b/cmake/FindOpenHMD.cmake index ea36f2e91..c67114199 100644 --- a/cmake/FindOpenHMD.cmake +++ b/cmake/FindOpenHMD.cmake @@ -1,11 +1,13 @@ -# Copyright 2019, 2021 Collabora, Ltd. +# Copyright 2019-2021 Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # # Original Author: -# 2019, 2021 Ryan Pavlik +# 2019-2021 Ryan Pavlik #.rst: # FindOpenHMD diff --git a/cmake/FindPercetto.cmake b/cmake/FindPercetto.cmake index 6ae8c5ca6..161883838 100644 --- a/cmake/FindPercetto.cmake +++ b/cmake/FindPercetto.cmake @@ -1,11 +1,13 @@ # Copyright 2021-2022, Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # # Original Author: -# 2021-2022 Ryan Pavlik +# 2021-2022 Ryan Pavlik #[[.rst: FindPercetto diff --git a/cmake/Findbluetooth.cmake b/cmake/Findbluetooth.cmake index ce89a5695..9cf8f4559 100644 --- a/cmake/Findbluetooth.cmake +++ b/cmake/Findbluetooth.cmake @@ -1,5 +1,7 @@ # Copyright 2022, Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) diff --git a/cmake/FindcJSON.cmake b/cmake/FindcJSON.cmake index 531115d28..984e55ea0 100644 --- a/cmake/FindcJSON.cmake +++ b/cmake/FindcJSON.cmake @@ -1,11 +1,13 @@ -# Copyright 2019-2020, Collabora, Ltd. +# Copyright 2019-2022, Collabora, Ltd. +# # SPDX-License-Identifier: BSL-1.0 +# # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # # Original Author: -# 2019-2020 Ryan Pavlik +# 2019-2022 Ryan Pavlik #.rst: # FindcJSON diff --git a/cmake/Findudev.cmake b/cmake/Findudev.cmake index 6ad89ea54..b8fe84292 100644 --- a/cmake/Findudev.cmake +++ b/cmake/Findudev.cmake @@ -14,8 +14,8 @@ # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) # # Original Authors: -# 2014 Kevin M. Godby -# 2021 Ryan Pavlik +# 2014, Kevin M. Godby +# 2021, Ryan Pavlik # # Copyright 2014, Kevin M. Godby # Copyright 2021, Collabora, Ltd. diff --git a/cmake/GenerateKhrManifest.cmake b/cmake/GenerateKhrManifest.cmake new file mode 100644 index 000000000..edf81f232 --- /dev/null +++ b/cmake/GenerateKhrManifest.cmake @@ -0,0 +1,148 @@ +# Copyright 2019-2022, Collabora, Ltd. +# +# SPDX-License-Identifier: BSL-1.0 +# +# Maintained by: +# 2019-2022 Ryan Pavlik + +#[[.rst: +GenerateKhrManifest +------------------- + +This is a utility module, usually wrapped by more usage-specific modules. +The general goal is to be able to generate a (JSON) manifest describing targets +with some absolute, relative, or unspecified path, such as required by the OpenXR +and Vulkan loaders for runtimes and API layers. + +The following functions are provided by this module: + +- :command:`generate_khr_manifest_buildtree` +- :command:`generate_khr_manifest_at_install` + + +.. command:: generate_khr_manifest_buildtree + + Generates a manifest suitable for use in the build tree, + with absolute paths, at configure time:: + + generate_khr_manifest_buildtree( + MANIFEST_TEMPLATE