Files
comaps/tools/autobuild/detect_cmake.sh
Filip Czaplicki 0971c47e84 Portable bash shebang
Signed-off-by: Filip Czaplicki <git@starsep.com>
2025-07-20 15:08:44 +02:00

17 lines
306 B
Bash
Executable File

#!/usr/bin/env bash
set -e -u
# If CMAKE variable is set, use it
[ -n "${CMAKE-}" -a -x "${CMAKE-}" ] && return 0
# Find cmake, prefer cmake3
for name in cmake3 cmake; do
if command -v "$name" > /dev/null; then
CMAKE="$name"
return 0
fi
done
echo 'Error: cmake is not installed.' >&2
exit 1