The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


User:Tswindell/Qt Creator And Mer Integration

From Mer Wiki
< User:Tswindell(Difference between revisions)
Jump to: navigation, search
(/opt/sdks/mer/scripts/qmake)
 
(2 intermediate revisions by 2 users not shown)
Line 12: Line 12:
 
In order for Qt Creator to recognised the build environment provided by scratcbox2 inside the Mer SDK, we must create the below hook scripts for Qt Creator, which execute qmake and make inside the sbox2 environment.
 
In order for Qt Creator to recognised the build environment provided by scratcbox2 inside the Mer SDK, we must create the below hook scripts for Qt Creator, which execute qmake and make inside the sbox2 environment.
  
=== /opt/sdks/mer/scripts/qmake ===
+
=== /srv/mer/scripts/qmake ===
 
  #! /bin/sh
 
  #! /bin/sh
  sdkroot="/opt/sdks/mer"
+
  sdkroot="/srv/mer/sdks/sdk"
 
  sdkscript="${sdkroot}/mer-sdk-chroot"
 
  sdkscript="${sdkroot}/mer-sdk-chroot"
 
   
 
   
Line 23: Line 23:
 
Qt Creator uses the 'qmake' command to find out information about your target environments Qt versions and configuration. The above script when called acts as though it's being run directly in our sbox2 build environment, it uses the current sbox2 target and remaps the directory information to point to the correct place on the filesystem so QtCreator can find the proper include files and resources.
 
Qt Creator uses the 'qmake' command to find out information about your target environments Qt versions and configuration. The above script when called acts as though it's being run directly in our sbox2 build environment, it uses the current sbox2 target and remaps the directory information to point to the correct place on the filesystem so QtCreator can find the proper include files and resources.
  
To make Qt Creator recognise our target development environment, goto: "Tools > Options > Build & Run > Qt Versions" click on "Add", use the file picker to select the above created "qmake" script from "/opt/sdks/mer/scripts". If everything went well, Qt Creator should recognise the Qt version. Now set the version name to something like "Mer SDK (SB2)".
+
To make Qt Creator recognise our target development environment, goto: "Tools > Options > Build & Run > Qt Versions" click on "Add", use the file picker to select the above created "qmake" script from "/srv/mer/scripts". If everything went well, Qt Creator should recognise the Qt version. Now set the version name to something like "Mer SDK (SB2)".
  
=== /opt/sdks/mer/scripts/make ===
+
=== /srv/mer/scripts/make ===
 
  #! /bin/sh
 
  #! /bin/sh
  sdkroot="/opt/sdks/mer"
+
  sdkroot="/srv/mer/sdks/sdk"
 
  sdkscript="${sdkroot}/mer-sdk-chroot"
 
  sdkscript="${sdkroot}/mer-sdk-chroot"
 
   
 
   
  target=$($sdkscript exec sb2 sb2-show which /bin | sed 's/\/bin$//')
+
  target=$($sdkscript exec sb2 sb2-show which /bin | sed 's/\/bin$//' | sed 's/^\/parentroot//')
 
   
 
   
 
  $sdkscript exec sb2 sh -c "'cd $PWD; make $@'"
 
  $sdkscript exec sb2 sh -c "'cd $PWD; make $@'"
Line 39: Line 39:
  
 
Finally we need to tell Qt Creator to use our special "make" script instead of the system make command. To acheive this find the "Make" build step under the "Build Steps" section of the projects build configuration. Click Details, select our script as the "Override make" field value. Do the same for the "Clean" build step as well. Now our project is ready to build for your Mer target. :)
 
Finally we need to tell Qt Creator to use our special "make" script instead of the system make command. To acheive this find the "Make" build step under the "Build Steps" section of the projects build configuration. Click Details, select our script as the "Override make" field value. Do the same for the "Clean" build step as well. Now our project is ready to build for your Mer target. :)
 +
 +
== Mer SDK Virtual Machine ==
 +
  
 
== Deployment & Running on Device ==
 
== Deployment & Running on Device ==

Latest revision as of 23:00, 8 October 2012

Contents

[edit] Introduction

The purpose of this article is to explain how to integrate Qt Creator from the Nokia Qt SDK with the Mer SDK, allowing you to create/build/deploy & run projects through Qt Creator. The methods documented here are currently a Work in Progress.

[edit] Requirements

  1. Installed Nokia Qt SDK (for recent Qt Creator with Maemo/MeeGo/Harmattan support)
  2. Installed Mer Platform SDK Platform_SDK
  3. Setup SB2 & Targets Platform_SDK_and_SB2
  4. Setup default SB2 target with: sb2-config -d <target-name>
  5. Have device running a Mer based product (can be an emulated device).

[edit] Qt Creator Hook Scripts

In order for Qt Creator to recognised the build environment provided by scratcbox2 inside the Mer SDK, we must create the below hook scripts for Qt Creator, which execute qmake and make inside the sbox2 environment.

[edit] /srv/mer/scripts/qmake

#! /bin/sh
sdkroot="/srv/mer/sdks/sdk"
sdkscript="${sdkroot}/mer-sdk-chroot"

target=$($sdkscript exec sb2 sb2-show which /bin | sed 's/\/bin$//' | sed 's/^\/parentroot//')

$sdkscript exec sb2 sh -c "'cd $PWD; qmake $@'" | sed "s/:\//:$(echo $target | sed 's/\//\\\//g')\//g"

Qt Creator uses the 'qmake' command to find out information about your target environments Qt versions and configuration. The above script when called acts as though it's being run directly in our sbox2 build environment, it uses the current sbox2 target and remaps the directory information to point to the correct place on the filesystem so QtCreator can find the proper include files and resources.

To make Qt Creator recognise our target development environment, goto: "Tools > Options > Build & Run > Qt Versions" click on "Add", use the file picker to select the above created "qmake" script from "/srv/mer/scripts". If everything went well, Qt Creator should recognise the Qt version. Now set the version name to something like "Mer SDK (SB2)".

[edit] /srv/mer/scripts/make

#! /bin/sh
sdkroot="/srv/mer/sdks/sdk"
sdkscript="${sdkroot}/mer-sdk-chroot"

target=$($sdkscript exec sb2 sb2-show which /bin | sed 's/\/bin$//' | sed 's/^\/parentroot//')

$sdkscript exec sb2 sh -c "'cd $PWD; make $@'"

Next we need to use the above script in our Projects' build configuration to replace the use of our systems' make command. This step has to be done on all projects that you want to build with your Mer SDK targets in Qt Creator. You'll have to do this step for all your new projects as well.

Load or create a new project in Qt Creator, click on "Projects" on the right hand vertical panel. Edit the build configuration to use our "Mer SDK (SB2)" target. If it's not in the drop down you may have to click the Add button and select it from there. Next, in the "General" section select the "Mer SDK (SB2)" target for the "Qt version" field.

Finally we need to tell Qt Creator to use our special "make" script instead of the system make command. To acheive this find the "Make" build step under the "Build Steps" section of the projects build configuration. Click Details, select our script as the "Override make" field value. Do the same for the "Clean" build step as well. Now our project is ready to build for your Mer target. :)

[edit] Mer SDK Virtual Machine

[edit] Deployment & Running on Device

TBD

[edit] References

Personal tools