1# fixQtModulePaths
2#
3# Usage: fixQtModulePaths _dir_
4#
5# Find Qt module definitions in directory _dir_ and patch the module paths.
6#
7fixQtModulePaths () {
8 local dir="$1"
9 local bin="${!outputBin}"
10 local dev="${!outputDev}"
11 local lib="${!outputLib}"
12
13 if [ -d "$dir" ]; then
14 find "$dir" -name 'qt_*.pri' | while read pr; do
15 if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
16 echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
17 sed -i "${pr:?}" \
18 -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
19 -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
20 -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$dev/include|g" \
21 -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$dev/bin|g"
22 fi
23 done
24 elif [ -e "$dir" ]; then
25 echo "fixQtModulePaths: Warning: \`$dir' is not a directory"
26 else
27 echo "fixQtModulePaths: Warning: \`$dir' does not exist"
28 fi
29
30 if [ "z$bin" != "z$dev" ]; then
31 if [ -d "$bin/bin" ]; then
32 mkdir -p "$dev/bin"
33 lndir -silent "$bin/bin" "$dev/bin"
34 fi
35 fi
36}