summaryrefslogtreecommitdiffstats
path: root/qtinterface/interface_tqt3/tmoc.cmake
blob: c3fe0a24c502fe6d73a0cb71cc640216d5ad17d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

#
# Very simple moc wrapper, for using with cmake
#

if [ -f @BIN_INSTALL_DIR@/tqt-replace-stream ]; then
	if [ -z "$1" ]; then
		echo "Usage: tmoc <input_file> -o <out_file>"
	else
		input_file="$1"
		out_file="$3"
		@BIN_INSTALL_DIR@/tqt-replace-stream "${input_file}" | \
	        @MOC_EXECUTABLE@ | \
	        sed "/#include <ntqmetaobject.h>/ i\\
#undef QT_NO_COMPAT\\
#include \"${input_file}\"\\
" \
		> "${out_file}"
	fi
else
	echo "ERROR: @BIN_INSTALL_DIR@/tqt-replace-stream is not available.  tmoc will fail!"
	exit 1;
fi