Präprozessor-defines in *.pro-files?

Alles zu Entwicklungsumgebungen und Editoren für Qt
Antworten
ichbinsisyphos
Beiträge: 24
Registriert: 4. Mai 2010 16:00

Präprozessor-defines in *.pro-files?

Beitrag von ichbinsisyphos »

Code: Alles auswählen

CONFIG += static

static  {
            DEPENDPATH += ./libzip
            INCLUDEPATH += ./libzip
            LIBS += -lqsvg -L./libzip -lzip
            CONFIG += static
            QTPLUGIN += qsvg
            DEFINES += STATIC
            message("Static build.")
        }
else    {
            LIBS += -lzip
        }
Im Moment kommentiere ich CONFIG += ... aus, je nachdem ob ich auf Windows (static build) oder auf Linux (normal dynamisch) bin. Ich hab kürzlich rausgefunden, dass ich im Quellcode sowas wie

Code: Alles auswählen

#ifdef WIN32
       do stuff
#endif
verwenden kann. Jetzt frag ich mich ob ich das kombinieren und im .pro-file einsetzten kann?
ichbinsisyphos
Beiträge: 24
Registriert: 4. Mai 2010 16:00

Re: Präprozessor-defines in *.pro-files?

Beitrag von ichbinsisyphos »

Ich hab in dem check "static" durch "win32" ersetzt und das tut was ich will. Fragts sich noch, wo das herkommt.
solarix
Beiträge: 1133
Registriert: 7. Juni 2007 19:25

Re: Präprozessor-defines in *.pro-files?

Beitrag von solarix »

ichbinsisyphos hat geschrieben: Fragts sich noch, wo das herkommt.
"win32" ist IMHO "built-in" (also vermutlich hartcodiert in qmake)
http://doc.qt.nokia.com/stable/qmake-ad ... ope-values

hth!
Antworten