File: configure

package info (click to toggle)
nvidia-texture-tools 2.0.8-1%2Bdfsg-8.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,284 kB
  • sloc: cpp: 22,495; ansic: 1,097; sh: 61; makefile: 13
file content (72 lines) | stat: -rwxr-xr-x 1,594 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env sh

BOLD="\033[1m"
RED="\033[91m"
GREEN="\033[92m"
YELLOW="\033[93m"
CYAN="\033[96m"
NORMAL="\033[0m"

# Make sure cmake is available.
if command -v cmake >/dev/null 2>&1;
then
	CMAKE=cmake
else
	echo "Error - cmake is not available!"
	exit 2
fi


help=false
build="Debug"	# release
prefix=/usr/local

# Parse the args
for i in "$@"
do
	case $i in
		--help )				help=true ;;
		--debug )				build="Debug" ;;
		--release )				build="Release" ;;
		--prefix=* )			prefix="${i#--prefix=}" ;;
		--prefix=* )			prefix="${i#--prefix=}" ;;
		* )						echo "Unrecognised argument $i" ;;
	esac
done

if [ "$help" = "true" ]
then
    echo "-----------------------------------------------"
    echo "nvidia-texture-tools "`cat VERSION`" configuration script"
    echo "-----------------------------------------------"
	echo
	echo "--help			Show this message."
	echo "--debug			Configure debug build."
	echo "--release			Configure release build."
	echo "--prefix=path		Installation prefix."
	echo "--include=path	Include path."
	echo "--lib=path		Library path."
	exit 0
fi

echo "-- Configuring nvidia-texture-tools "`cat VERSION`

mkdir -p ./build
cd ./build
$CMAKE .. -DNVTT_SHARED=1 -DCMAKE_BUILD_TYPE=$build -DCMAKE_INSTALL_PREFIX=$prefix -G "Unix Makefiles" || exit 1
cd ..

echo ""
echo -e "Your configure completed "$GREEN"successfully"$NORMAL", now type "$BOLD"make"$NORMAL
echo ""

cat > Makefile << EOF
all:
	@make --no-print-directory -C build/
install:
	@make install --no-print-directory -C build/
clean:
	@make clean --no-print-directory -C build/
distclean:
	@rm -Rf build/
EOF