common.pri 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 2010, 2011 wkhtmltopdf authors
  2. #
  3. # This file is part of wkhtmltopdf.
  4. #
  5. # wkhtmltopdf is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # wkhtmltopdf is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Lesser General Public License
  16. # along with wkhtmltopdf. If not, see <http:#www.gnu.org/licenses/>.
  17. QT4_PRL = libQtGui.prl QtGui.prl QtGui.framework/QtGui.prl
  18. QT5_PRL = libQt5Gui.prl Qt5Gui.prl
  19. for(prl, QT4_PRL):exists($$[QT_INSTALL_LIBS]/$${prl}) {
  20. include($$[QT_INSTALL_LIBS]/$${prl})
  21. CONFIG += qt_gui_prl_found
  22. }
  23. for(prl, QT5_PRL):exists($$[QT_INSTALL_LIBS]/$${prl}) {
  24. include($$[QT_INSTALL_LIBS]/$${prl})
  25. CONFIG += qt_gui_prl_found
  26. }
  27. qt_gui_prl_found {
  28. contains(QMAKE_PRL_CONFIG, static): DEFINES += QT_STATIC
  29. else: DEFINES += QT_SHARED
  30. }
  31. contains(QMAKE_PRL_CONFIG, static): QTPLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs
  32. # if we can't determine, assume that it is shared
  33. !qt_gui_prl_found: DEFINES += QT_SHARED
  34. INCLUDEPATH += ../../include
  35. RESOURCES = $$PWD/wkhtmltopdf.qrc
  36. win32: CONFIG += console
  37. win32-g++*: QMAKE_LFLAGS += -static -static-libgcc -static-libstdc++
  38. QT += webkit network xmlpatterns svg
  39. greaterThan(QT_MAJOR_VERSION, 4): QT += webkitwidgets
  40. # version related information
  41. VERSION_TEXT=$$(WKHTMLTOX_VERSION)
  42. isEmpty(VERSION_TEXT): VERSION_TEXT=$$cat($$PWD/VERSION)
  43. VERSION_LIST=$$split(VERSION_TEXT, "-")
  44. count(VERSION_LIST, 1) {
  45. VERSION=$$VERSION_TEXT
  46. FULL_VERSION=$$VERSION
  47. } else {
  48. VERSION=$$member(VERSION_LIST, 0)
  49. BUILD=$$member(VERSION_LIST, 1)
  50. FULL_VERSION=$$VERSION-$$BUILD
  51. }
  52. DEFINES += VERSION=$$VERSION FULL_VERSION=$$FULL_VERSION