c++qtqmake

Make a String define in QT pro File with QMAKE_HOST.version_string


I want something like:

DEFINES += makeOs=$$QMAKE_HOST.version_string

So I can use it in my code. Do you have any Ideas how to realize something like this. My Problem is, that I need to check which Linux-Distribution my project is built on.

Thank you for your help!


Solution

  • With contains, something like this is possible:

    contains(QMAKE_HOST.version_string, .*Debian.*){
        DEFINES += DEBIAN=1
    }