File: cmake-helper.sh

package info (click to toggle)
libdeflate 1.23-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,072 kB
  • sloc: ansic: 11,716; sh: 1,388; python: 169; makefile: 31
file content (17 lines) | stat: -rwxr-xr-x 471 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# This script ensures that the 'build' directory has been created and configured
# with the given CMake options and environment.

set -e

TOPDIR="$(dirname "$0")"/..
BUILDDIR="$TOPDIR"/build

flags=$(env; echo "@CMAKEOPTS@=$*")
if [ "$flags" != "$(cat "$BUILDDIR"/.flags 2>/dev/null || true)" ]; then
	rm -rf "$BUILDDIR"/CMakeCache.txt "$BUILDDIR"/CMakeFiles
	mkdir -p "$BUILDDIR"
	cmake -S "$TOPDIR" -B "$BUILDDIR" "$@"
	echo "$flags" > "$BUILDDIR"/.flags
fi