Build Qt for Tizen: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[toc align_right="yes"]


= [[Tizen|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<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b armv7l -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## for x86 wayland<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## for x86_64 wayland<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b x86_64 -p common -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
# Configure Qt Creator remote access to &quot;Intel NUC&amp;quot;:http://www.intel.com/content/www/us/en/nuc/overview.html
== Tizen Mobile profile ==
# Install &quot;development tools&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#e5129e03d708d7fbbe5e3e22b30f2d9a
# Download and install Qt 5.4.0, see instructions in &quot; Qt installation&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#e17f66a5cb160b4eb49231b706a325e1
# Download &quot;Tizen Mobile SDK&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#03671ee18b8489596b11f5b70d6ff721
# Create developer tools
## For arm mobile device ( &quot;RD-PQ&amp;quot;:https://wiki.tizen.org/wiki/Reference_Device-PQ)<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b armv7l -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake<br /></code>
## for x86 mobile emulator (see -e switch)<br /><code>cd tizenbuildtools/profiles<br />./prepare_developer_tools -b i586 -p mobile -q /home/user/Qt5.4.0/5.4/gcc_64/bin/qmake <s>e<br /></code><br /># Build &quot;Qt Creator plugin&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#00b2d759558c279641a474b3190dc4c3<br /># &quot;Configure Qt Creator&amp;quot;:http://wiki.qt.io/Build-Qt-for-Tizen/#dfa8292bf407276a9cc00706b52b7a8e<br /># Please follow the steps described at [[Creating Hello World Application]] to validate configuration
<br />h2. Qt installation
<br />Download official Qt installer suitable for your architecture. 5.4.0 version is placed in following remote directory:<br />http://download.qt.io/official_releases/qt/5.4/5.4.0<br />Make the binary executable (chmod u+x qt-opensource-linux</s>[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:<br /><code><br />sudo dpkg-reconfigure dash
#can be cheked with &quot;file -L $SHELL&amp;quot; should print &quot;:/bin/bash:&quot;<br /></code>
=== Gbs installation ===
Use command line for most of steps explained here. Install development tools (such as gbs) as specified at &quot;https://source.tizen.org/documentation/developer-guide/installing-development-tools&amp;quot;: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>
In /etc/apt/sources.list.d/tizen.list add the folowing line to add repository (please note space before &quot;/&amp;quot;):
</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
Then:<br /><code>sudo apt-get update<code>
and:
</code>sudo apt-get install gbs</code>
this will show:<br /><code>The following extra packages will be installed:<br /> …..<br />The following NEW packages will be installed:<br /> …..<br />Do you want to continue [Y/n]? </code>
Answer &quot;y&amp;quot; here.
This can show:
<code>WARNING: The following packages cannot be authenticated!<br /> ….<br />Install these packages without verification [y/N]? </code>
Answer &quot;y&amp;quot; here again.
=== tizenbuildtools installation ===
Clone the tizenbuildtools git repository:
<code>git clone <s>b alpha7 git://gitorious.org/tizenbuildtools/tizenbuildtools.git<br />cd tizenbuildtools<br />git checkout v_alpha7.0<br /></code>
<br />h2. Tizen SDK installation
<br />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:<br />* '''Tizen emulator''' for running Qt applications in emulated environment on the PC workstation without a need to use Tizen device(s)<br />* '''Compilation tools''' for building software (Qt and applications) for both emulator and actual Tizen device(s).
<br />These tools are bundled and distributed in a single Tizen SDK so it should be installed first. To do so, perform following steps:
<br />* Take look at &quot;prerequisites&amp;quot;:https://developer.tizen.org/downloads/sdk/installing-sdk/prerequisites-tizen-sdk. Install required software for your OS.<br />* Download &quot;SDK Image&amp;quot;: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 &quot;offline installation&amp;quot;, which is recommended.<br />* Download &quot;Install Manager&amp;quot;:https://developer.tizen.org/downloads/tizen-sdk#installmanager for Ubuntu® 64bits: tizen-sdk-ubuntu64-v2.2.x.bin, about 4MB.<br />* Use the Install Manager as explained &quot;here&amp;quot;:https://developer.tizen.org/downloads/sdk/installing-tizen-sdk#sdk to install previously downloaded &quot;SDK Image&amp;quot;.
<br />About 5 GB of free disk space is needed for these steps.
<br />'''Result:''' You should be able to:<br />* run the installed Tizen IDE by clicking &quot;Applications &gt; Tizen SDK &gt; Tizen IDE&amp;quot; in the system menu<br />* run the installed Emulator Manager by clicking &quot;Applications &gt; Tizen SDK &gt; Emulator Manager&amp;quot; in the system menu and then, create Tizen virtual machine that would be used in the development process
<br />If you want to develop for mobile profile &amp;#40;Tizen Mobile device or emulator&amp;amp;#41; 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 &quot;here&amp;quot;:https://developer.tizen.org/help/index.jsp?topic=/org.tizen.gettingstarted/html/dev_env/setting_author_certificate.htm.
<br />h2. Build Tizen plugin for Qt Creator
<br />After installing &quot;Qt SDK&amp;quot;: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.
<br />h2. Configure Qt Creator
<br />h3. Tizen Common and IVI
<br />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)
<br />h5. Prepare device
<br />By default &quot;app&amp;quot; user (used for development) doesn't have a password, so if you want to connect using ssh you need to set password:<br /><code>ssh root<code>${device_ip}<br />#password tizen<br />$&amp;gt; passwd app<br /></code><br />and (if you want to log in without password) copy you public key:<br /><code><br />#on your host<br />ssh-copy-id app</code>device_ip<br /><code><br />Also you need to install Qt libraries on device:<br /></code><br />#invoke on device from rot account<br />zypper in qt*<br /><code>
<br />h5. Connect device to Qt Creator
<br /># Go to Tools-Options<br /># In Build&amp;amp;Run section<br />## Add corresponding Qt version (like in mobile profile)<br />## Add New Kit<br />### Set previously added Qt Version<br />### As compiler set cross compilers from Tizen SDK or host compiler in case if device and host architectures are the same<br />### The same with debugger<br />### As device type set Generic Linux Device<br />### 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.<br />[[Image:https://drive.google.com/uc?id=0Bwa77UXf_zhhcEl5bjFZX2gyZ28|Qt Creator Generic Device configuration]]<br />### After adding the device Qt Creator will test if connection work.<br /># Create new test project:<br />## File</s>&gt;New File or Project-&gt;Qt Quick Application<br />## Choose name and directory, then Next, check The kit you created before and click Finish.<br />## Edit '''.pro file and add<br /></code>target.path = /home/app/temporary/deploy</code><br />before<br /><code>include(deployment.pri)<code><br />## 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.
<br />h3. Tizen Mobile
<br />All configuration steps listed below should be performed and in specified order.
<br />''' Tizen configuration:<br />'''''' Run Emulator Manager by clicking &quot;Applications &gt; Tizen SDK &gt; Emulator Manager&amp;quot; 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.'''<br />'''''' Run the installed Qt Creator<br />'''''' Click Tools -&gt; Options, and in the dialog select &quot;Tizen&amp;quot; item<br />'''''' Near &quot;Tizen SDK Path&amp;quot; click Browse button<br />'''''' 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<br />'''''' Near &quot;Author certificate&amp;quot; click Browse button<br />'''''' Select author certificate, by default a file in $HOME/tizen-sdk-data/keystore/author/<br />'''''' Fill the &quot;Author certificate password&amp;quot; field with password you have provided in the step &quot;Configure Development Tools&amp;quot; before
* Tizen emulator-related configuration:
** In the Options dialog, select &quot;Devices&amp;quot; item
** In the Device combo box select &quot;tizen (default for Tizen Device)
** Change Name to Tizen Emulator to indicate the device
** In the Options dialog, select &quot;Build &amp; Run&amp;quot; item
** Click &quot;Qt Versions&amp;quot; tab
** Click &quot;Add&amp;quot; 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 &quot;Apply&amp;quot; button on the bottom of the dialog to accept addition of the new Qt version.
** Click &quot;Kits&amp;quot; tab
** Click &quot;Add&amp;quot; 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 &quot;Unnamed&amp;quot;, change it in the &quot;Name&amp;quot; text box to &quot;Tizen Emulator&amp;quot;
** In &quot;Device type&amp;quot; combo box select &quot;Tizen Device&amp;quot;
** In &quot;Compiler&amp;quot; combo box select &quot;Tizen GCC (x86)&quot;
** In &quot;Qt Version&amp;quot; combo box select &quot;Qt 5.4.0 (Tizen emulator)&quot;
** Click &quot;Apply&amp;quot; button on the bottom of the dialog to accept addition of the new kit.

Revision as of 07:28, 24 February 2015