1234567891011121314151617181920212223242526272829 |
- #!/bin/bash
- curPWD=$PWD
- cd $(dirname $0)
- export gbs_root=$(echo $PWD | sed "s/\/usr\/bin\/host-tools$//gi")
- cd $curPWD
- isQueryParameter=0
- escapedArgs=""
- if [[ "$1" = *.pro ]]; then
- sourceDir=$(dirname $1)
- cd "$sourceDir"
- mountSourceDir="--mount $PWD"
- cd $curPWD
- fi
- for i in $(seq 1 ${#}); do
- if [ "${!i}" == "-query" ]; then
- isQueryParameter=1
- fi
- escapedArgs="$escapedArgs \"${!i}\""
- done
- if [ "$isQueryParameter" == "1" ]; then
- echo "cd $PWD; qmake $escapedArgs" | gbs chroot --silent --mount $PWD $mountSourceDir $gbs_root | sed "s#:/#:$gbs_root/#gi"
- else
- echo "cd $PWD; qmake $escapedArgs" | gbs chroot --silent --mount $PWD $mountSourceDir $gbs_root | sed "s#/usr/include/#$gbs_root/usr/include/#gi"
- fi
|