diff --git a/.cmake-format.py b/.cmake-format.py index 62e9c0a82..a75c5f0ef 100644 --- a/.cmake-format.py +++ b/.cmake-format.py @@ -1,6 +1,27 @@ -# SPDX-FileCopyrightText: 2021, Collabora, Ltd. +# SPDX-FileCopyrightText: 2021-2022, Collabora, Ltd. # SPDX-License-Identifier: CC0-1.0 +with section("parse"): + + # Specify structure for custom cmake functions + additional_commands = { + "generate_openxr_runtime_manifest_at_install": { + "kwargs": { + "DESTINATION": 1, + "MANIFEST_TEMPLATE": 1, + "OUT_FILENAME": 1, + "RELATIVE_RUNTIME_DIR": 1, + "RUNTIME_DIR_RELATIVE_TO_MANIFEST": 1, + "RUNTIME_TARGET": 1, + }, + "pargs": {"flags": ["ABSOLUTE_RUNTIME_PATH"], "nargs": "*"}, + }, + "generate_openxr_runtime_manifest_buildtree": { + "kwargs": {"MANIFEST_TEMPLATE": 1, "OUT_FILE": 1, "RUNTIME_TARGET": 1}, + "pargs": {"flags": [], "nargs": "*"}, + }, + } + with section("format"): line_width = 100 tab_size = 8 @@ -14,7 +35,7 @@ with section("format"): max_pargs_hwrap = 4 max_rows_cmdline = 1 - keyword_case = 'upper' + keyword_case = "upper" # Do not reflow comments diff --git a/cmake/GenerateOpenXRRuntimeManifest.cmake b/cmake/GenerateOpenXRRuntimeManifest.cmake new file mode 100644 index 000000000..a63cf34c0 --- /dev/null +++ b/cmake/GenerateOpenXRRuntimeManifest.cmake @@ -0,0 +1,120 @@ +# Copyright 2019-2022, Collabora, Ltd. +# SPDX-License-Identifier: BSL-1.0 +#[[.rst: +GenerateOpenXRRuntimeManifest +--------------- + +The following functions are provided by this module: + +- :command:`generate_openxr_runtime_manifest_buildtree` +- :command:`generate_openxr_runtime_manifest_at_install` + + +.. command:: generate_openxr_runtime_manifest_buildtree + + Generates a runtime manifest suitable for use in the build tree, + with absolute paths, at configure time:: + + generate_openxr_runtime_manifest_buildtree( + RUNTIME_TARGET # Name of your runtime target + OUT_FILE # Name of the manifest file (with path) to generate + [MANIFEST_TEMPLATE