summaryrefslogtreecommitdiffstats
path: root/scripts/configure-qtcreator.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/configure-qtcreator.sh')
-rwxr-xr-xscripts/configure-qtcreator.sh118
1 files changed, 118 insertions, 0 deletions
diff --git a/scripts/configure-qtcreator.sh b/scripts/configure-qtcreator.sh
new file mode 100755
index 0000000..4ffe64f
--- /dev/null
+++ b/scripts/configure-qtcreator.sh
@@ -0,0 +1,118 @@
1#!/bin/bash
2#############################################################################
3##
4## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
5##
6## This file is part of the Qt Enterprise Embedded Scripts of the Qt
7## framework.
8##
9## $QT_BEGIN_LICENSE$
10## Commercial License Usage Only
11## Licensees holding valid commercial Qt license agreements with Digia
12## with an appropriate addendum covering the Qt Enterprise Embedded Scripts,
13## may use this file in accordance with the terms contained in said license
14## agreement.
15##
16## For further information use the contact form at
17## http://www.qt.io/contact-us.
18##
19##
20## $QT_END_LICENSE$
21##
22#############################################################################
23
24set -e
25
26MKSPEC="devices/linux-oe-generic-g++"
27ABI="arm-linux-generic-elf-32bit"
28### TBD: detect ABI
29
30printUsage ()
31{
32 echo "Usage: $0 <toolchain-environment-setup-file> [--remove]"
33}
34
35while test -n "$1"; do
36 case "$1" in
37 "--help" | "-h")
38 printUsage
39 exit 0
40 shift
41 ;;
42 "--remove")
43 REMOVEONLY=1
44 shift
45 ;;
46 *)
47 CONFIG=$1
48 shift
49 ;;
50 esac
51done
52
53if [ ! -f "$CONFIG" ]; then
54 printUsage
55 exit 1
56fi
57
58if [ -z "${SDKTOOL}" ]; then
59 SDKTOOL="${HOME}/Qt/Tools/QtCreator/bin/sdktool"
60fi
61if [ ! -x ${SDKTOOL} ]; then
62 echo "Cannot find 'sdktool'"
63 exit 1
64fi
65
66source $CONFIG
67
68if [ ! -d "${OECORE_NATIVE_SYSROOT}/mkspecs/${MKSPEC}" ]; then
69 echo Error: $CONFIG is invalid.
70 exit 1
71fi
72
73MACHINE=$(grep '^MACHINE' ${OECORE_NATIVE_SYSROOT}/mkspecs/qdevice.pri | cut -d'=' -f2 | tr -d ' ')
74
75RELEASE=$(qmake -query QT_VERSION)
76
77BASEID="byos.${RELEASE}.${MACHINE}"
78
79BASENAME="Custom Qt Embedded"
80TOOLCHAINNAME="GCC (${BASENAME} ${RELEASE} ${MACHINE})"
81QTNAME="${BASENAME} ${RELEASE} ${MACHINE}"
82KITNAME="${BASENAME} ${RELEASE} ${MACHINE} Kit"
83
84${SDKTOOL} rmKit --id ${BASEID}.kit 2>/dev/null || true
85${SDKTOOL} rmQt --id ${BASEID}.qt || true
86${SDKTOOL} rmTC --id ProjectExplorer.ToolChain.Gcc:${BASEID}.tc || true
87
88if [ -n "${REMOVEONLY}" ]; then
89 echo "Kit removed: ${KITNAME}"
90 exit 0
91fi
92
93${SDKTOOL} addTC \
94 --id "ProjectExplorer.ToolChain.Gcc:${BASEID}.tc" \
95 --name "${TOOLCHAINNAME}" \
96 --path "$(type -p ${OE_QMAKE_CXX})" \
97 --abi "${ABI}"
98
99${SDKTOOL} addQt \
100 --id "${BASEID}.qt" \
101 --name "${QTNAME}" \
102 --type "Boot2Qt.QtVersionType" \
103 --qmake "$(type -p qmake)"
104
105${SDKTOOL} addKit \
106 --id "${BASEID}.kit" \
107 --name "${KITNAME}" \
108 --qt "${BASEID}.qt" \
109 --debuggerengine "1" \
110 --debugger "$(type -p ${GDB})" \
111 --sysroot "${SDKTARGETSYSROOT}" \
112 --devicetype "Boot2Qt.HwDevice" \
113 --toolchain "ProjectExplorer.ToolChain.Gcc:${BASEID}.tc" \
114 --icon ":/boot2qt/images/B2Qt_QtC_icon.png" \
115 --mkspec "${MKSPEC}"
116
117echo "Configured Qt Creator with new kit:"
118echo " ${KITNAME}"