summaryrefslogtreecommitdiffstats
path: root/win/tools/kmoc
blob: 8f08c9b7d7d0c349794e88249371bf4966f42b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

# Creates KDE-compatible .moc files out of .h files in current directory
# .moc files are saved to tqmoc/ subdirectory.
# Any additional arguments are directories - ktqmoc will be called for each of them.

mkdir -p tqmoc
tqfind . -maxdepth 1 -name \*.h | while read ; do 
	grep Q_OBJECT $REPLY > /dev/null || continue
	tqmoc=tqmoc/`echo $REPLY | sed -e "s/\\.h/\\.moc/;s/\\.\\///"`
	if [ $tqmoc -ot $REPLY ] ; then echo tqmocing $REPLY... ; tqmoc $REPLY -o $tqmoc ; fi
done

pwd=`pwd`
while [ $# -gt 0 ] ; do
	cd $pwd/$1 && ktqmoc
	cd $pwd
	shift
done