aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/kvirc-config.cmake
blob: cfbfcd12e8c6e5a564fed80c3e227555ebc62c16 (about) (plain) (blame)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
#
#   A script for retrieving the latest KVIrc build configuration
#   Mainly used for building plugins out of the source tree
#   The idea is "stolen" from the gtk-config and xmms-config scripts :)
#
#
#   09-04-2000 Szymon Stefanek (Initial release)
#   31-01-2002 Szymon Stefanek (Revised for KVIrc 3.0.0)
#   27-07-2002 Szymon Stefanek (Revised again for KVIrc 3.0.0)
#   01-06-2007 Szymon Stefanek (Revised for SST)
#   ??-10-2007 Szymon Stefanek (Revised for Humor)
#   14-04-2008 CtrlAltCa (adapted to cmake branch)
#
#   This program is FREE software. You can redistribute it and/or
#   modify it under the terms of the GNU General Public License
#   as published by the Free Software Foundation; either version 2
#   of the License, or (at your option) any later version.
#
#   This program is distributed in the HOPE that it will be USEFUL,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#   See the GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program. If not, write to the Free Software Foundation,
#   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

set -e

print_syntax()
{
	echo "@PACKAGE@@VERSION_MAJOR@-config (KVIrc @VERSION_RELEASE@)"
	echo "	A script for retrieving the latest KVIrc build configuration"
	echo ""
	echo "Syntax : @PACKAGE@@VERSION_MAJOR@-config [OPTIONS]"
	echo "  options:"
	echo "    --version         : Version of the KVIrc toolkit."
	echo "    --prefix          : The prefix where KVIrc was installed."
	echo "    --lib-suffix      : The suffix (if any) for the library directory where KVIrc was installed."
	echo "    --revision        : The KVIrc revision number."
	echo "    --date            : The KVIrc build date."
	echo "    --type            : The KVIrc build type (Debug, Release, ..)."
	exit 0
}

if test $# -eq 0; then
	print_syntax 1 1>&2
fi

KVIRC_STUFF_TO_ECHO=""

while test $# -gt 0; do
	case "$1" in
		-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
		*) optarg= ;;
	esac

	case $1 in
		--version)
		KVIRC_STUFF_TO_ECHO="$KVIRC_STUFF_TO_ECHO @VERSION_RELEASE@"
		;;
		--prefix)
		KVIRC_STUFF_TO_ECHO="$KVIRC_STUFF_TO_ECHO @CMAKE_INSTALL_PREFIX@"
		;;
		--lib-suffix)
		KVIRC_STUFF_TO_ECHO="$KVIRC_STUFF_TO_ECHO @LIB_SUFFIX@"
		;;
		--revision)
		KVIRC_STUFF_TO_ECHO="$KVIRC_STUFF_TO_ECHO @CMAKE_KVIRC_BUILD_REVISION@"
		;;
		--date)
		KVIRC_STUFF_TO_ECHO="$KVIRC_STUFF_TO_ECHO @CMAKE_KVIRC_BUILD_DATE@"
		;;
		--type)
		KVIRC_STUFF_TO_ECHO="$KVIRC_STUFF_TO_ECHO @CMAKE_BUILD_TYPE@"
		;;
		*)
		print_syntax 1 1>&2
		;;
	esac
	shift
done

if test -n "$KVIRC_STUFF_TO_ECHO"; then
	echo -n $KVIRC_STUFF_TO_ECHO
fi