Build Qt for Tizen
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine. Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean. |
[toc align_right="yes"]
Qt for Tizen: Build
Authors: "Jaroslaw Staniek":http://qt.io/member/6526 (staniek at kde.org), "Tomasz Olszak":http://qt.io/mebmer/125046 . Feedback welcome!
Introduction
This HOWTO explains full process of installation and configuration Qt SDK for Tizen, needed for developing software with Qt for Tizen smartphone (developer device "RD-PQ":https://wiki.tizen.org/wiki/Reference_Device-PQ and emulator), Tizen "NUC":http://www.intel.com/content/www/us/en/nuc/overview.html which is reference device for Tizen Common profile and Tizen IVI devices. This process applies to Qt for Tizen Alpha 7 and has been tested with Ubuntu 14.04 64bit. Other versions have not been tested (feedback is welcome). Version of Tizen SDK is 2.2.1. Version of Qt
While the process has been highly automatized, it consists of several steps.
Tizen Common profile (base of IVI profle)
Following steps describe creating Tizen Common cross compilation tools. But you can also use the same steps for IVI (just change profile parameter passed to prepare_developer_tools script)
- Install "tizen development tools":http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
- Download and install Qt 5.4.0, see instructions in " Qt installation":http://wiki.qt.io/Build-Qt-for-Tizen#e17f66a5cb160b4eb49231b706a325e1
- Download appropriate cross compilers:
- Arm and i586 cross compilers are available from Tizen Mobile SDK (see "Install Tizen SDK":http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721)
- For x86_64 architecture you can use system compiler
- Create developer tools
- for arm wayland
cd tizenbuildtools/profiles
./prepare_developer_tools -b armv7l -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
- for x86 wayland
cd tizenbuildtools/profiles
./prepare_developer_tools -b i586 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
- for x86_64 wayland
cd tizenbuildtools/profiles
./prepare_developer_tools -b x86_64 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
- Configure Qt Creator remote access to "Intel NUC":http://www.intel.com/content/www/us/en/nuc/overview.html
Tizen Mobile profile
- Install "development tools":http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
- Download and install Qt 5.4.0, see instructions in " Qt installation":http://wiki.qt.io/Build-Qt-for-Tizen/#e17f66a5cb160b4eb49231b706a325e1
- Download "Tizen Mobile SDK":http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721
- Create developer tools
- For arm mobile device ( "RD-PQ":https://wiki.tizen.org/wiki/Reference_Device-PQ)
cd tizenbuildtools/profiles
./prepare_developer_tools -b armv7l -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
- for x86 mobile emulator (see -e switch)
cd tizenbuildtools/profiles
./prepare_developer_tools -b i586 -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake -e
- Build "Qt Creator plugin":http://wiki.qt.io/Build-Qt-for-Tizen/#00b2d759558c279641a474b3190dc4c3
- "Configure Qt Creator":http://wiki.qt.io/Build-Qt-for-Tizen/#dfa8292bf407276a9cc00706b52b7a8e
- Please follow the steps described at Creating Hello World Application to validate configuration
h2. Qt installation
Download official Qt installer suitable for your architecture. 5.4.0 version is placed in following remote directory: http://download.qt.io/official_releases/qt/5.4/5.4.0 Make the binary executable (chmod u+x qt-opensource-linux-[x86|x64]–5.4.0.run), and install it in location writable by current user (write access is needed for tizen Qt Creator plugin)
Tizen Development Tools installation
Bash installation
Be sure that you have bash as your shell. By default Ubuntu has dash. To change the shell to bash invoke:
sudo dpkg-reconfigure dash
#can be cheked with "file -L $SHELL" should print ":/bin/bash:"
Gbs installation
Use command line for most of steps explained here. Install development tools (such as gbs) as specified at "https://source.tizen.org/documentation/developer-guide/installing-development-tools":https://source.tizen.org/documentation/developer-guide/installing-development-tools. Please note version of the distribution should be correctly specified when adding repository, so for Ubuntu 13.04:
sudo vim /etc/apt/sources.list.d<code>
In /etc/apt/sources.list.d/tizen.list add the folowing line to add repository (please note space before "/"):
deb http://download.tizen.org/tools/latest-release/${YOUR_UBUNTU_VERSION} /
All most recent Ubuntu and debian) versions are supported. See http://download.tizen.org/tools/latest-release
Then:
sudo apt-get update<code>
and:
sudo apt-get install gbs
this will show:
The following extra packages will be installed:
…..
The following NEW packages will be installed:
…..
Do you want to continue [Y/n]?
Answer "y" here.
This can show:
WARNING: The following packages cannot be authenticated!
….
Install these packages without verification [y/N]?
Answer "y" here again.
tizenbuildtools installation
Clone the tizenbuildtools git repository:
git clone -b alpha7 git://gitorious.org/tizenbuildtools/tizenbuildtools.git
cd tizenbuildtools
git checkout v_alpha7.0
h2. Tizen SDK installation
Even while Qt developers prefer using Qt Creator (or their beloved text editor plus command line) over Tizen SDK's Eclipse-based Integrated development environment, at least two tools are still needed:
- Tizen emulator for running Qt applications in emulated environment on the PC workstation without a need to use Tizen device(s)
- Compilation tools for building software (Qt and applications) for both emulator and actual Tizen device(s).
These tools are bundled and distributed in a single Tizen SDK so it should be installed first. To do so, perform following steps:
- Take look at "prerequisites":https://developer.tizen.org/downloads/sdk/installing-sdk/prerequisites-tizen-sdk. Install required software for your OS.
- Download "SDK Image":https://developer.tizen.org/downloads/tizen-sdk#sdk-images for Ubuntu® 64bits: tizen-sdk-image-2.2.x-ubuntu64.zip, about 1.4GB. It's useful for a kind of "offline installation", which is recommended.
- Download "Install Manager":https://developer.tizen.org/downloads/tizen-sdk#installmanager for Ubuntu® 64bits: tizen-sdk-ubuntu64-v2.2.x.bin, about 4MB.
- Use the Install Manager as explained "here":https://developer.tizen.org/downloads/sdk/installing-tizen-sdk#sdk to install previously downloaded "SDK Image".
About 5 GB of free disk space is needed for these steps.
Result: You should be able to:
- run the installed Tizen IDE by clicking "Applications > Tizen SDK > Tizen IDE" in the system menu
- run the installed Emulator Manager by clicking "Applications > Tizen SDK > Emulator Manager" in the system menu and then, create Tizen virtual machine that would be used in the development process
If you want to develop for mobile profile (Tizen Mobile device or emulator) you need to add author certificate. The certificate generator tool is a cross-platform command line tool used to generate developer private keys and certificates from their intermediate CA certificates. The private keys and certificates are used for signing and verifying Tizen applications. To create and register certificate in the Tizen IDE as explained "here":https://developer.tizen.org/help/index.jsp?topic=/org.tizen.gettingstarted/html/dev_env/setting_author_certificate.htm.
h2. Build Tizen plugin for Qt Creator
After installing "Qt SDK":http://wiki.qt.io/Build-Qt-for-Tizen/edit/#e17f66a5cb160b4eb49231b706a325e1 (by default to $HOME/Qt5.4.0 directory), follow the README file placed in tizenbuildtools/README. After that start Qt Creator. The Tizen plugin should be available.
h2. Configure Qt Creator
h3. Tizen Common and IVI
Follow this steps to build,. deploy, debug and run Qt applications on Tizen Common or Tizen IVI (or other Tizen profiles where ssh server is available on device)
h5. Prepare device
By default "app" user (used for development) doesn't have a password, so if you want to connect using ssh you need to set password:
ssh root@${device_ip}
#password tizen
$> passwd app
and (if you want to log in without password) copy you public key:
#on your host
ssh-copy-id app@device_ip
Also you need to install Qt libraries on device:
#invoke on device from rot account
zypper in qt*
h5. Connect device to Qt Creator
- Go to Tools-Options
- In Build&Run section
- Add corresponding Qt version (like in mobile profile)
- Add New Kit
- Set previously added Qt Version
- As compiler set cross compilers from Tizen SDK or host compiler in case if device and host architectures are the same
- The same with debugger
- As device type set Generic Linux Device
- Click manage button in device section to add Generic Linux Device, next click add, choose Generic Linux Device. In dialog box set name of a device (like Tizen NUC), device's IP, user name to log in using ssh and password or key authentication.
Qt Creator Generic Device configuration
- After adding the device Qt Creator will test if connection work.
- Create new test project:
- File->New File or Project->Qt Quick Application
- Choose name and directory, then Next, check The kit you created before and click Finish.
- Edit .pro file and add
target.path = /home/app/temporary/deploy<code>
before
include(deployment.pri)
- It should be possible to build and run application on device from Qt Creator. If you have debugger set you should also be able to debug applications.
h3. Tizen Mobile
All configuration steps listed below should be performed and in specified order.
Tizen configuration: ' Run Emulator Manager by clicking "Applications > Tizen SDK > Emulator Manager" in the system menu and then use it to run the Emulator virtual machine you have created before. Note: Always run Emulator before running Qt Creator, not the other way around.' ' Run the installed Qt Creator ' Click Tools -> Options, and in the dialog select "Tizen" item ' Near "Tizen SDK Path" click Browse button ' Select Tizen SDK's instalation directory (default is $HOME/tizen-sdk), click OK; this will automatically fill several entries: SDK data directory, sdb executable, native-packaging executable ' Near "Author certificate" click Browse button ' Select author certificate, by default a file in $HOME/tizen-sdk-data/keystore/author/ ' Fill the "Author certificate password" field with password you have provided in the step "Configure Development Tools" before
- Tizen emulator-related configuration:
- In the Options dialog, select "Devices" item
- In the Device combo box select "tizen (default for Tizen Device)
- Change Name to Tizen Emulator to indicate the device
- In the Options dialog, select "Build & Run" item
- Click "Qt Versions" tab
- Click "Add" button
- Select qmake for working for tizen emulator builds. The path should be $HOME/dev/src/tizenbuildtools/emulator/qt5CrossCompileToolsBUILD_ARCHEmulator/bin/qmake. Please change $HOME/dev/src to your top level source code directory if you have picked different one in the beginning.
- Click "Apply" button on the bottom of the dialog to accept addition of the new Qt version.
- Click "Kits" tab
- Click "Add" button to add a new kit. It will be used for building and deploying apps to Tizen emulator.
- By default the new kit has name "Unnamed", change it in the "Name" text box to "Tizen Emulator"
- In "Device type" combo box select "Tizen Device"
- In "Compiler" combo box select "Tizen GCC (x86)"
- In "Qt Version" combo box select "Qt 5.4.0 (Tizen emulator)"
- Click "Apply" button on the bottom of the dialog to accept addition of the new kit.