One thing I’ve been using a lot lately is Madde’s mad-admin to add development packages to the build tree that QtSDK uses to build armel applications and I pretty much figured that out alone – well, not completely alone but after seeing a how-to related to qtmobility installation for Maemo that used this without really explaining what was what).
Preamble:
QtSdk comes with a full build environment (analogue to what one`s got on scratchbox) for armel applications. This is used every time you build a Qt project selecting a device (N9(|(0|5)0)). This whole mechanism stays quite hidden inside the sdk’s files.
Problem:
Your application may have dependencies (headers, shared libs) on packages that are not provided with QtSDK. Without proper installation of this dependencies on QtSDK’s environment, you’ll never get code-completion, compiling or linking using the default SDK.
In a normal desktop-only world, you’d normally install development packages for a given library to then be able to compile/build applications that use such library. Only after installing those packages you’ll have the proper headers, shared libraries, etc needed to build your, “higher level”, application.
Debian packages tagged by the -dev suffix usually carry what is needed (e.g. headers) for a developer to “develop” something that uses the homonimous library. While the package without the -dev suffix carry what is needed to RUN (e.g. shared library) an application that uses such package. (worth nothing that a foo-dev package will normally depend on the foo pkg).
The question is: How to do this inside QtSDK’s own world.
The secret (for Harmattan) is inside
[sourcecode language=”shell”]
/QtSDK/Madde/bin/
[/sourcecode]
PS: for maemo it’s inside
[sourcecode language=”shell”]
~/QtSDK/Maemo/4.6.2/bin
[/sourcecode]
but works pretty much the same way.
There you’ll find to binaries that make handling this libraries/dependencies business as easy as on a normal debian system.
Say you have a library called libfoo and that you already have it built and packaged for harmattan/armel (well, that’s what I use Scratchbox for…but that stays for another post). You’ll probably have files like
[sourcecode language=”shell”]
libfoo_1.0_armel.deb
libfoo-dev_1.0_armel.deb
[/sourcecode]
Well, just do:
[sourcecode language=”shell”]
you@box:~/QtSDK/Madde/bin$ ./mad set harmattan-platform-api
you@box:~/QtSDK/Madde/bin$ ./mad-admin xdpkg -i ../path-to-that-deb/libfoo_1.0_armel.deb
Package ‘libfoo’ installed.
you@box:~/QtSDK/Madde/bin$ ./mad-admin xdpkg -i ../path-to-that-deb/libfoo-dev_1.0_armel.deb
Package ‘libfoo-dev’ installed.
[/sourcecode]
In line 1 you-re setting which target you are referring (you can select which target you are using in QtCreator’s project management window.
After that, on line 2 and 4 it’s pretty much the same thing as using dpkg -i. Voila! Now your QtCreator will recognize your new lib and all’s good.
Remember that you’ll need that foo_1.0_armel.deb package installed on the device but that should be automatic if you reference to it on your debian/control file and if that package is in the same
repository as your application.
Well, gotta go back to something useful.
Hope this helps someone.