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 lib="${!outputLib}"
10
11 if [ -d "$dir" ]; then
12 find "$dir" -name 'qt_*.pri' | while read pr; do
13 if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
14 echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
15 sed -i "${pr:?}" \
16 -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
17 -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
18 -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$lib/include|g" \
19 -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$lib/bin|g"
20 fi
21 done
22 elif [ -e "$dir" ]; then
23 echo "fixQtModulePaths: Warning: \`$dir' is not a directory"
24 else
25 echo "fixQtModulePaths: Warning: \`$dir' does not exist"
26 fi
27}