merge of 4054569b89a8d88485aaad916e178d590735fbc8
[openembedded.git] / classes / qmake.bbclass
1 inherit qmake-base
2
3 qmake_do_configure() {
4         case ${QMAKESPEC} in
5         *linux-oe-g++|*linux-uclibc-oe-g++|*linux-gnueabi-oe-g++)
6                 ;;
7         *-oe-g++)
8                 die Unsupported target ${TARGET_OS} for oe-g++ qmake spec
9                 ;;
10         *)
11                 oenote Searching for qmake spec file
12                 paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-${TARGET_ARCH}-g++"
13                 paths="${QMAKE_MKSPEC_PATH}/${TARGET_OS}-g++ $paths"
14
15                 if (echo "${TARGET_ARCH}"|grep -q 'i.86'); then
16                         paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-x86-g++ $paths"
17                 fi
18                 for i in $paths; do
19                         if test -e $i; then
20                                 export QMAKESPEC=$i
21                                 break
22                         fi
23                 done
24                 ;;
25         esac
26
27         oenote "using qmake spec in ${QMAKESPEC}, using profiles '${QMAKE_PROFILES}'"
28
29         if [ -z "${QMAKE_PROFILES}" ]; then 
30                 PROFILES="`ls *.pro`"
31         else
32                 PROFILES="${QMAKE_PROFILES}"
33         fi
34
35         if [ -z "$PROFILES" ]; then
36                 die "QMAKE_PROFILES not set and no profiles found in $PWD"
37         fi
38
39         if [ ! -z "${EXTRA_QMAKEVARS_POST}" ]; then
40                 AFTER="-after"
41                 QMAKE_VARSUBST_POST="${EXTRA_QMAKEVARS_POST}"
42                 oenote "qmake postvar substitution: ${EXTRA_QMAKEVARS_POST}"
43         fi
44
45         if [ ! -z "${EXTRA_QMAKEVARS_PRE}" ]; then
46                 QMAKE_VARSUBST_PRE="${EXTRA_QMAKEVARS_PRE}"
47                 oenote "qmake prevar substitution: ${EXTRA_QMAKEVARS_PRE}"
48         fi
49
50 #oenote "Calling '${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST'"
51         unset QMAKESPEC || true
52         ${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST || die "Error calling qmake on $PROFILES"
53 }
54
55 EXPORT_FUNCTIONS do_configure
56
57 addtask configure after do_unpack do_patch before do_compile