Files
omath/scripts/cmake-format.sh
2026-02-20 08:52:26 +03:00

15 lines
426 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Format all CMakeLists.txt and *.cmake files in the repo (excluding common build dirs)
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$REPO_ROOT"
find . \
-path "./build" -prune -o \
-path "./cmake-build-*" -prune -o \
-path "./out" -prune -o \
-path "./.git" -prune -o \
\( -name "CMakeLists.txt" -o -name "*.cmake" \) -print0 \
| xargs -0 cmake-format -i