Mquinteiro Mquinteiro - 4 months ago 18x
Linux Question

qmake conditional for raspberry pi

I'm trying to make a qmake .pro file to compile in raspberry-pi (not for cross compile) y can use conditionals definitions depending of the platform:

linux-g++-64: {
message(We are in Linux 64 bits)
macx: {
message(we are in mac osX)
win32: ....

But I can't find a way to detect when I'm in a raspberry with raspbian, the platforms looks like linux-g++

I have try some ones like linux-arm: arm-linux: linux-arm-gnueabi-g++: but not luck.

Some one know the correct way to make this conditional definitions or how to detect if we are compiling in a raspberry PI arm architecture?


Ok, It's look like no one has an answer, so I did a workaround that works for me and I will happy if it works for you.

at the time to execute qmake I aggregate one flag, for example

qmake CONFIG+=MQ_ARM -r

It will execute qmake recursive and pass the flag to each .pro file.

In the .pro file you can add this:

    LIBS +=bla bla
    message(USING ARM LIBRARY)
} else:MQ_i686 {
    LIBS +=bla bla
    message(USING 32bits LIBRARY)
else {
    LIBS +=bla bla bla
    message(qmake configurated as x86_64 if you want another conf use qmake CONFIG+=MQ_ARM -

You can separate into another file project.pri and include in all subproject .pro files with include(project.pri)

Hope it helps!