summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-08-23 08:45:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-23 10:37:46 +0200
commit3ce7f4bd74ab46d1c01f15ce037af2b69058f881 (patch)
tree631f32678b34c75527335a486eaf5594e3716e06
parentd8dc10efb1714dcfafa6a08e107fd31fc1e3ce0e (diff)
downloadqtserialport-3ce7f4bd74ab46d1c01f15ce037af2b69058f881.tar.gz
Qt 4: Refactor the shell handling for header generation
It does not make much sense to use branches for only a minor difference, hence there is now a precheck for the host os and the quote variable is set accordingly. This is a slightly modified version of what QtCreator's qtcreator.pro is using. Basically, single quote is used here for the quote variable rather than double quote as double quote is causing issues at least on my machine. Task-number: QTBUG-33125 Change-Id: I9eb0a0a62e1404a095cfc3b1bd68c519552d23b8 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--src/serialport/qt4support/install-helper.pri10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/serialport/qt4support/install-helper.pri b/src/serialport/qt4support/install-helper.pri
index 1046f8b..9ec2e6b 100644
--- a/src/serialport/qt4support/install-helper.pri
+++ b/src/serialport/qt4support/install-helper.pri
@@ -10,13 +10,9 @@ for(header_file, PUBLIC_HEADERS) {
# This is a quick workaround for generating forward header with Qt4.
-unix {
- system("echo \'$${LITERAL_HASH}include \"qserialport.h\"\' > \"$$QTSERIALPORT_PROJECT_INCLUDEDIR/QSerialPort\"")
- system("echo \'$${LITERAL_HASH}include \"qserialportinfo.h\"\' > \"$$QTSERIALPORT_PROJECT_INCLUDEDIR/QSerialPortInfo\"")
-} win32 {
- system("echo $${LITERAL_HASH}include \"qserialport.h\" > \"$$QTSERIALPORT_PROJECT_INCLUDEDIR/QSerialPort\"")
- system("echo $${LITERAL_HASH}include \"qserialportinfo.h\" > \"$$QTSERIALPORT_PROJECT_INCLUDEDIR/QSerialPortInfo\"")
-}
+!equals(QMAKE_HOST.os, Windows): maybe_quote = "\'"
+system("echo $${maybe_quote}$${LITERAL_HASH}include \"qserialport.h\"$${maybe_quote} > \"$$QTSERIALPORT_PROJECT_INCLUDEDIR/QSerialPort\"")
+system("echo $${maybe_quote}$${LITERAL_HASH}include \"qserialportinfo.h\"$${maybe_quote} > \"$$QTSERIALPORT_PROJECT_INCLUDEDIR/QSerialPortInfo\"")
PUBLIC_HEADERS += \
$$PUBLIC_HEADERS \