Build Qt for Tizen: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
(Decode HTML entity names)
(This one also belongs to Tizen.)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
[[Category:Build]]
 
[[Category:Developing Qt::Ports::Tizen]]
[toc align_right="yes"]
{{LangSwitch}}
 
''Written by Jaroslaw Staniek (staniek at kde.org) and Tomasz Olszak.
= [[Tizen|Qt for Tizen]]: Build =
 
Authors: [http://qt.io/member/6526 Jaroslaw Staniek] (staniek at kde.org), [http://qt.io/mebmer/125046 Tomasz Olszak] . Feedback welcome!


== Introduction ==
== Introduction ==
Line 17: Line 14:
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)
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 [http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a tizen development tools]
1. Install [http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a tizen development tools]
# Download and install Qt 5.4.0, see instructions in [http://wiki.qt.io/Build-Qt-for-Tizen#e17f66a5cb160b4eb49231b706a325e1  Qt installation]
 
# Download appropriate cross compilers:
2. Download and install Qt 5.4.0, see instructions in [http://wiki.qt.io/Build-Qt-for-Tizen#e17f66a5cb160b4eb49231b706a325e1  Qt installation]
## Arm and i586 cross compilers are available from Tizen Mobile SDK (see [http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721 Install Tizen SDK])
 
## For x86_64 architecture you can use system compiler
3. Download appropriate cross compilers:
# Create developer tools
:* Arm and i586 cross compilers are available from Tizen Mobile SDK (see [http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721 Install Tizen SDK])
## for arm wayland
:* For x86_64 architecture you can use system compiler
4. Create developer tools
:* for arm wayland
<code>cd tizenbuildtools/profiles
<code>cd tizenbuildtools/profiles
./prepare_developer_tools -b armv7l -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
./prepare_developer_tools -b armv7l -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
</code>
</code>
## for x86 wayland
:* for x86 wayland
<code>cd tizenbuildtools/profiles
<code>cd tizenbuildtools/profiles
./prepare_developer_tools -b i586 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
./prepare_developer_tools -b i586 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
</code>
</code>
## for x86_64 wayland
:* for x86_64 wayland
<code>cd tizenbuildtools/profiles
<code>cd tizenbuildtools/profiles
./prepare_developer_tools -b x86_64 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
./prepare_developer_tools -b x86_64 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
</code>
</code>
# Configure Qt Creator remote access to [http://www.intel.com/content/www/us/en/nuc/overview.html Intel NUC]
5. Configure Qt Creator remote access to [http://www.intel.com/content/www/us/en/nuc/overview.html Intel NUC]


== Tizen Mobile profile ==
== Tizen Mobile profile ==


# Install [http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a development tools]
1. Install [http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a development tools]
# Download and install Qt 5.4.0, see instructions in [http://wiki.qt.io/Build-Qt-for-Tizen/#e17f66a5cb160b4eb49231b706a325e1  Qt installation]
 
# Download [http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721 Tizen Mobile SDK]
2. Download and install Qt 5.4.0, see instructions in [http://wiki.qt.io/Build-Qt-for-Tizen/#e17f66a5cb160b4eb49231b706a325e1  Qt installation]
# Create developer tools
 
## For arm mobile device ( [https://wiki.tizen.org/wiki/Reference_Device-PQ RD-PQ])
3. Download [http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721 Tizen Mobile SDK]
 
4. Create developer tools
:* For arm mobile device ( [https://wiki.tizen.org/wiki/Reference_Device-PQ RD-PQ])
<code>cd tizenbuildtools/profiles
<code>cd tizenbuildtools/profiles
./prepare_developer_tools -b armv7l -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
./prepare_developer_tools -b armv7l -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake
</code>
</code>
## for x86 mobile emulator (see -e switch)
:* for x86 mobile emulator (see -e switch)
<code>cd tizenbuildtools/profiles
<code>cd tizenbuildtools/profiles
./prepare_developer_tools -b i586 -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake -e
./prepare_developer_tools -b i586 -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake -e
</code>
</code>
# Build [http://wiki.qt.io/Build-Qt-for-Tizen/#00b2d759558c279641a474b3190dc4c3 Qt Creator plugin]
5. Build [http://wiki.qt.io/Build-Qt-for-Tizen/#00b2d759558c279641a474b3190dc4c3 Qt Creator plugin]
# [http://wiki.qt.io/Build-Qt-for-Tizen/#dfa8292bf407276a9cc00706b52b7a8e Configure Qt Creator]
6. [http://wiki.qt.io/Build-Qt-for-Tizen/#dfa8292bf407276a9cc00706b52b7a8e Configure Qt Creator]
# Please follow the steps described at [[Creating Hello World Application]] to validate configuration
7. Please follow the steps described at [[Creating Hello World Application]] to validate configuration


== Qt installation ==
== Qt installation ==
Line 75: Line 77:
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:
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:


<code>sudo vim /etc/apt/sources.list.d<code>
<code>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 "/"):
In /etc/apt/sources.list.d/tizen.list add the folowing line to add repository (please note space before "/"):


</code>deb http://download.tizen.org/tools/latest-release/${YOUR_UBUNTU_VERSION} /</code>
<code>deb http://download.tizen.org/tools/latest-release/${YOUR_UBUNTU_VERSION} /</code>


All most recent Ubuntu and debian) versions are supported. See http://download.tizen.org/tools/latest-release
All most recent Ubuntu and debian) versions are supported. See http://download.tizen.org/tools/latest-release


Then:
Then:
<code>sudo apt-get update<code>
<code>sudo apt-get update</code>


and:
and:


</code>sudo apt-get install gbs</code>
<code>sudo apt-get install gbs</code>


this will show:
this will show:
Line 173: Line 175:
### As device type set Generic Linux Device
### 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.
### 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.
[[Image:https://drive.google.com/uc?id=0Bwa77UXf_zhhcEl5bjFZX2gyZ28|Qt Creator Generic Device configuration]]
[[Image:GenericLinuxDG.png|Qt Creator Generic Device configuration]]
### After adding the device Qt Creator will test if connection work.
:::6. After adding the device Qt Creator will test if connection work.
# Create new test project:
3. Create new test project:
## File->New File or Project->Qt Quick Application
# File->New File or Project->Qt Quick Application
## Choose name and directory, then Next, check The kit you created before and click Finish.
# Choose name and directory, then Next, check The kit you created before and click Finish.
## Edit '''.pro file and add
# Edit '''.pro file and add
<code>target.path = /home/app/temporary/deploy<code>
<code>target.path = /home/app/temporary/deploy</code>
before
before
</code>include(deployment.pri)</code>
<code>include(deployment.pri)</code>
## 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.
:4. 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.


=== Tizen Mobile ===
=== Tizen Mobile ===

Latest revision as of 15:12, 25 November 2016

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

Written by Jaroslaw Staniek (staniek at kde.org) and Tomasz Olszak.

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 and emulator), Tizen NUC 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)

1. Install tizen development tools

2. Download and install Qt 5.4.0, see instructions in Qt installation

3. Download appropriate cross compilers:

  • Arm and i586 cross compilers are available from Tizen Mobile SDK (see Install Tizen SDK)
  • For x86_64 architecture you can use system compiler

4. 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

5. Configure Qt Creator remote access to Intel NUC

Tizen Mobile profile

1. Install development tools

2. Download and install Qt 5.4.0, see instructions in Qt installation

3. Download Tizen Mobile SDK

4. Create developer tools

  • For arm mobile device ( RD-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

5. Build Qt Creator plugin 6. Configure Qt Creator 7. Please follow the steps described at Creating Hello World Application to validate configuration

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. 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

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

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


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. Install required software for your OS.
  • Download SDK Image 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 for Ubuntu® 64bits: tizen-sdk-ubuntu64-v2.2.x.bin, about 4MB.
  • Use the Install Manager as explained here 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.


Build Tizen plugin for Qt Creator

After installing Qt SDK (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.


Configure Qt Creator

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)

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*
Connect device to Qt Creator
  1. Go to Tools-Options
  2. In Build&Run section
    1. Add corresponding Qt version (like in mobile profile)
    2. Add New Kit
      1. Set previously added Qt Version
      2. As compiler set cross compilers from Tizen SDK or host compiler in case if device and host architectures are the same
      3. The same with debugger
      4. As device type set Generic Linux Device
      5. 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

6. After adding the device Qt Creator will test if connection work.

3. Create new test project:

  1. File->New File or Project->Qt Quick Application
  2. Choose name and directory, then Next, check The kit you created before and click Finish.
  3. Edit .pro file and add
target.path = /home/app/temporary/deploy

before

include(deployment.pri)
4. 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.

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.