I'm trying to make a qmake .pro file to compile in RaspberryPi (not for cross compile). Can I use conditionals definitions depending on 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 PaspberryPi with raspbian.
I have tried something like linux-arm
, arm-linux
, linux-arm-gnueabi-g++
but not luck.
Someone know the correct way to make this conditional definitions or how to detect if we are compiling in a RaspberryPi architecture?
This worked for me:
linux {
contains(QMAKE_HOST.arch, arm.*):{
raspberry's bla bla bla
}else{
...
}
}
I hope it works for you.
http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-host
current Raspbian OS(32bit) for RPi3 report QMAKE_HOST.arch
as armv7l
, while older board\OS can report armv6l
.
while 64bit builds, like UbuntuMate for RaspberryPi: aarch64
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With