[SOLVED] How to check the compiler version in Qt .pro file?

Issue

I want to build a Qt project using either GCC or an ARM compiler. In either environment I have to link different libraries.

How I can check if the current compiler is Linux’s g++ and CROSS_COMPILE is 'arm-cortexa9neont-linux-gnueabi-'?

Solution

You can use the Platform Scope built in to QMake to set up the build differently depending on platform.

It’s based on the mkspec’s shipped with Qt and can be found in

[Where Qt’s installed]/mkspecs

So in your case I guess it’ll look something like this:

linux-arm-gnueabi {
    //ARM stuff here
}

Please note that I have not tested this. I’ve only read what’s in the documentation I have linked to.

Answered By – xarxer

Answer Checked By – Jay B. (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *