#------------------------------------------------- # # Project created by QtCreator 2015-01-28T16:21:51 # #------------------------------------------------- QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = test1 TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui ### Have qmake auto generate a Windows(R) RC-file VERSION = 1.2.3.4 ### DIFFERENT ALTERNATIVES TO HAVE A FOO defined as "BAR BAR" inside main.cpp using the Visual Studio 2010 IDE. ### call: qmake -tp vc ### Tested with Qt 4.8.6 # DEFINES += FOO=BAR BAR ### (1) compiles but delivers 1 in main.cpp instead of "BAR BAR" # DEFINES += FOO="BAR BAR" ### (2) moc does not work, CC1x Fails with undefined BAR # DEFINES += FOO='BAR BAR' ### (3) moc does not work, CC1x Fails with undefined BAR # DEFINES += 'FOO="BAR BAR"' ### (4) RC fails # DEFINES += "FOO=BAR BAR" ### (5) moc does not work, CC1x Fails with undefined FOO DEFINES += "FOO=\"BAR BAR\"" ### (6) RC fails ( FOO seems to be replaced as "BAR BAR" in main.cpp, at least intellisense says so...) ### IT SEEMS TO SUM UP, THAT RC and CC need different syntax in the under and ### If you take aternative (6) with "just" RC failing and change inside the FOO="BAR BAR" to "FOO=BAR BAR" ### then RC compiles !!! However I did not check, if using FOO inside the RC file works ok .... # Prevent Qt from setting "TARGET_VERSION_EXT" to "VER_MAJ" win32 { lessThan(QT_MAJOR_VERSION, 5) { # have some dirty hack for QT4 QMAKE_SYMBIAN_SHLIB = FOOBAR } else { # is this documented anywhere or is it a secret ... ? CONFIG += skip_target_version_ext } }