[SailfishDevel] SailfishOS as an OS/platform in Qt

Luciano Montanaro mikelima at gmail.com
Mon Dec 8 00:29:28 UTC 2014

On Sun, Dec 7, 2014 at 10:29 PM, Alejandro Exojo <suy at badopi.org> wrote:
> El Sunday 07 December 2014, Luciano Montanaro escribió:
>> On Sun, Dec 7, 2014 at 10:33 AM, Alejandro Exojo <suy at badopi.org> wrote:
>> > That's the opposite of what most people are trying to do.
>> >
>> > If the overhead is negligible, you may not care much of shipping all the
>> > assets in one binary package, of which the user will only see a part, but
>> > other applications might prefer to save some space if they contain many
>> > assets.
>> The problem is that this model does not scale. Now there is one device
>> using SailfishOS, next June there will be two...
>> Hopefully there will be more in one year.
>> So you want to make one build for each model that will use SailfishOS
>> in the future?
> I did nowhere say that. I say that MAYBE you want to trim some assets if you
> have OS specific assets (and you have a non-negligible gain). And for that you
> need to know the OS you are building for. As I explained, other systems have
> built in support in Qt for knowing the OS.

Well, os specific, all right. But I understood you wanted a different
configuration on tablet vs phone, and to that I would object.
But you do not need a Qt .config file for that -- and when you build
Qt, Sailfish is just a Linux target.

>> I think Jolla hopes to license the OS to other vendors. If they
>> succeed, optimization s targeted to single devices will not be
>> practical.
>> The best option is to build the asset in a scalable format (or ship it
>> at high res) and then render it at install time...
>> Like what has been proposed for the icon scaling.
> Exactly what I said: "Other features like screen size, language, etc. Of
> course you want to do it at runtime."
>> > However, the main thing that motivated me to dig into the issue and send
>> > the mail was libsailfishapp. That library is, AFAIK, only relevant on
>> > Sailfish, and also requires one to add special code in main(). That
>> > can't be done at runtime (well, you could do it I think, but you really
>> > don't want to, given that you already have to set a special binary name,
>> > for example, and it complicates things for no reason).
>> Well, I think the easiest thing to do is do out-of source builds, and
>> since the target configuration
>> qmake -config sailfishos
>> qmake -config blackberry
> I don't follow you here. What's that qmake flag?

I think it is not documented, but it allows you to pass a custom
configuration to the qmake.
You could also use

qmake CONFIG+=sailfishos, for example.
Then in the .pro file you put specific files and rules in specific sections

sailfishos {
ubuntu {
linux {
blackberry {

sections. Note that the linux rule is predefined, and would apply in
both sailfishos and uuntu build.

If you use Qtcreator, You can modify the target build configuration so
that the qmake step includes the -config for architecture you want to
build for.

>> Then if you want to have different assets, you can do this as well...
>> But it makes no sense to ask for a generic way to do that.
>> In the end, the Qt platform for sailfish os is indeed simply Linux, or
>> if you want Linux+Wayland.
>> The rest of the dependencies should be checked package for package:
>> So on linux, check if there is libsailfishapp, and build the sailfish
>> version. Check for... Mir, and build for Ubuntu.
>> Or build for a desktop Linux if you do not find mobile specific libraries.
> I also explained the problem with the tooling that a library check has. And
> that is not only about the library.

All right, but then the proper solution would bet to fix the check,
not shipping more qt .config files.

> But well, if so many people disagree, I'll just give up. Only one more thing
> so I don't need to add more traffic to the mailing list:
> El Sunday 07 December 2014, Attila Csipa escribió:
>> On 12/7/2014 11:33 AM, Alejandro Exojo wrote:
>> > However, the main thing that motivated me to dig into the issue and
>> > send the mail was libsailfishapp. That library is, AFAIK, only
>> > relevant on Sailfish, and also requires one to add special code in
>> > main(). That can't be done at
>> There, you said it yourself - if what you want is to detect a library,
>> then that's what
>> you should be doing.
> I did not say that. You even quoted what I said. Read it again please. :)

Well, even in this case, the trick above would work.

I just wish there were CMake templates available - qmake is badly
documented, and it quickly get messy if the project grows.

> --
> Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
> http://barnacity.net/ | http://disperso.net
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org

Luciano Montanaro

Anyone who is capable of getting themselves made President should on
no account be allowed to do the job. -- Douglas Adams

More information about the Devel mailing list