3

I'm trying to build a MultiArch Application for Ubuntu. I have to compile it separately on different Architectures. However I have to do a lot of manual changes Each time the Architecture changes. For Instance-

#linux-g++:LIBS += $$DESTDIR/lib32/libusb-1.0.so #arch-specific changes

linux-g++:LIBS += $$DESTDIR/lib64/libusb-1.0.so

Here I have to comment and uncomment a line every time I'm compiling for a different Architecture. I have to do this on a number of places.

However if there is a way to specify the Linux Architecture in the .pro file itself then my task will become much easier. I know that we can use win32 and macx scope variables and linux-g++ for Ubuntu. But I want to distinguish between ubuntu 32 bit and 64 bit Architectures. Is there any way this might be achieved a little more elegently?

I have already seen qmake platform scopes and I just want to specify that I'm looking to distinguish between linux32bit and linux64bit .

Community
  • 1
  • 1
zeerak
  • 388
  • 2
  • 11
  • 3
    Maybe this can help: http://stackoverflow.com/questions/356666/identifier-for-win64-configuration-in-qmake – vahancho Oct 14 '15 at 06:16

1 Answers1

4

SOLVED IT:

linux-g++{
   !contains(QT_ARCH, x86_64){
       LIB=lib32
       message("Compiling for 32bit system")
    } else {
       LIB=lib64
       message("Compiling for 64bit system")
   }
}
zeerak
  • 388
  • 2
  • 11