The open source OpenXR runtime
1#!/bin/sh
2# Copyright 2019-2024, Collabora, Ltd.
3# SPDX-License-Identifier: BSL-1.0
4# Author: Rylie Pavlik <rylie.pavlik@collabora.com>
5
6# Formats all the CMake files in this project
7
8set -e
9
10CMAKE_FORMAT=cmake-format
11if ! command -v ${CMAKE_FORMAT} > /dev/null; then
12 echo "cmake-format not found, do pipx install cmakelang" 1>&2
13 exit 1
14fi
15(
16 echo "${CMAKE_FORMAT}"
17 "${CMAKE_FORMAT}" -v
18
19 cd "$(dirname $0)/.."
20 find \
21 CMakeLists.txt \
22 doc \
23 src/xrt \
24 src/external/CMakeLists.txt \
25 src/CMakeLists.txt \
26 tests \
27 \( -name "CMakeLists.txt" -o -name "*.cmake" \) \
28 ! -name ".cmake" \
29 -print0 | \
30 xargs -0 "${CMAKE_FORMAT}" -c "$(pwd)/.cmake-format.py" -i
31)