File: find-missing-moc_srcs.sh

package info (click to toggle)
kadu 4.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 54,532 kB
  • sloc: cpp: 128,331; sh: 988; awk: 105; makefile: 75
file content (24 lines) | stat: -rwxr-xr-x 655 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash

echo "The following header files need to be included in MOC_SRCS part of respecting CMakeLists.txt files:"

for header in $(find kadu-core modules -name "*\.h" -not -regex ".*libiris.*"); do
	if [ $(grep -c "Q_OBJECT" ${header}) -ge 1 ]; then
		if [[ "$header" = "modules/"* ]]; then
			dir=$(echo $header | sed 's/\(modules\/[^\/]*\).*/\1/')
		else
			dir="kadu-core"
		fi

		header=${header#kadu-core/}
		header=${header#modules/*/}

		if [ $(grep -ce "^[^#]*${header}" ${dir}/CMakeLists.txt) -lt 1 ]; then
			if [[ "${dir}" != "${lastDir}" ]]; then
				echo "DIR: ${dir}"
				lastDir=$dir
			fi
			echo "    $header"
		fi
	fi
done