qstardict.pri 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. #############################################################################
  2. # qstardict.pri - QStarDict, a StarDict clone written with using Qt #
  3. # Copyright (C) 2008 Alexander Rodin #
  4. # #
  5. # This program is free software; you can redistribute it and/or modify #
  6. # it under the terms of the GNU General Public License as published by #
  7. # the Free Software Foundation; either version 2 of the License, or #
  8. # (at your option) any later version. #
  9. # #
  10. # This program 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 General Public License along #
  16. # with this program; if not, write to the Free Software Foundation, Inc., #
  17. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #
  18. #############################################################################
  19. VERSION = 2.0
  20. QT = \
  21. core \
  22. gui \
  23. network \
  24. xml
  25. greaterThan(QT_MAJOR_VERSION, 4) {
  26. QT += widgets printsupport
  27. }
  28. CONFIG += \
  29. qt \
  30. warn_on \
  31. release
  32. unix {
  33. CONFIG += link_pkgconfig
  34. PKGCONFIG += glib-2.0
  35. LIBS += -lz -lX11
  36. }
  37. macx {
  38. # universal binaries
  39. CONFIG += x86 x86_64 # not available on Snow Leopard ppc ppc64
  40. # QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5.sdk/
  41. }
  42. win32 {
  43. CONFIG += console
  44. LIBS += -lzdll -lglib-2.0 -luser32
  45. INCLUDEPATH += $$GLIB2PATH/include/glib-2.0 \
  46. $$GLIB2PATH/lib/glib-2.0/include \
  47. $$ZLIBPATH/include
  48. QMAKE_LIBDIR += $$GLIB2PATH/lib \
  49. $$ZLIBPATH/lib
  50. }
  51. unix:DEFINES += HAVE_MMAP
  52. unix:isEmpty(NO_DBUS):!contains(QT_CONFIG, dbus): NO_DBUS = 1
  53. unix:isEmpty(NO_DBUS):QT += dbus
  54. unix:isEmpty(NO_DBUS):DEFINES += QSTARDICT_WITH_DBUS
  55. isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_WITH_TRANSLATIONS
  56. include(plugins/plugins.pri)
  57. unix {
  58. macx {
  59. isEmpty(INSTALL_PREFIX) {
  60. INSTALL_PREFIX=/opt
  61. }
  62. # helper var to save text duplicity.
  63. # NOTE: it cannot use $$TARGET because the target is
  64. # different in every directory. Obviously.
  65. MAC_BUNDLE_PATH=$$INSTALL_PREFIX/QStarDict.app/Contents
  66. # bin dir is used for qstardict dir/main application
  67. # qmake created bundle for it itself. So it *has* to be
  68. # the same as install location
  69. BIN_DIR=$$INSTALL_PREFIX
  70. DATA_DIR=$$MAC_BUNDLE_PATH/share
  71. TRANSLATIONS_DIR=$$MAC_BUNDLE_PATH/i18n
  72. PLUGINS_DIR=$$MAC_BUNDLE_PATH/lib
  73. DOCS_DIR=$$MAC_BUNDLE_PATH/share/doc
  74. DEFINES += QSTARDICT_VERSION=\\\"$$VERSION\\\"
  75. }
  76. else {
  77. isEmpty(INSTALL_PREFIX):INSTALL_PREFIX=/usr
  78. isEmpty(BIN_DIR):BIN_DIR=$$INSTALL_PREFIX/bin
  79. isEmpty(DATA_DIR):DATA_DIR=$$INSTALL_PREFIX/share/qstardict
  80. isEmpty(NO_TRANSLATIONS):isEmpty(TRANSLATIONS_DIR):TRANSLATIONS_DIR=$$DATA_DIR/translations
  81. isEmpty(LIB_DIR):LIB_DIR=$$INSTALL_PREFIX/lib/qstardict
  82. isEmpty(PLUGINS_DIR):PLUGINS_DIR=$$LIB_DIR/plugins
  83. isEmpty(DOCS_DIR):DOCS_DIR=$$INSTALL_PREFIX/share/doc/qstardict
  84. DEFINES += QSTARDICT_VERSION=\\\"$$VERSION\\\"
  85. DEFINES += QSTARDICT_INSTALL_PREFIX=\\\"$$INSTALL_PREFIX\\\"
  86. DEFINES += QSTARDICT_BIN_DIR=\\\"$$BIN_DIR\\\"
  87. DEFINES += QSTARDICT_DATA_DIR=\\\"$$DATA_DIR\\\"
  88. isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_TRANSLATIONS_DIR=\\\"$$TRANSLATIONS_DIR\\\"
  89. DEFINES += QSTARDICT_PLUGINS_DIR=\\\"$$PLUGINS_DIR\\\"
  90. }
  91. } else:win32 {
  92. isEmpty(INSTALL_PREFIX) {
  93. INSTALL_PREFIX=
  94. } else {
  95. # handle path backslashes in defines correctly
  96. INSTALL_PREFIX = $$re_escape($$INSTALL_PREFIX)
  97. }
  98. isEmpty(BIN_DIR):BIN_DIR=$$INSTALL_PREFIX/
  99. isEmpty(DATA_DIR):DATA_DIR=$$INSTALL_PREFIX/data
  100. isEmpty(NO_TRANSLATIONS):isEmpty(TRANSLATIONS_DIR):TRANSLATIONS_DIR=$$INSTALL_PREFIX/translations
  101. isEmpty(PLUGINS_DIR):PLUGINS_DIR=$$INSTALL_PREFIX/plugins
  102. isEmpty(DOCS_DIR):DOCS_DIR=$$INSTALL_PREFIX/docs
  103. DEFINES += QSTARDICT_VERSION=\\\"$$VERSION\\\"
  104. # DEFINES += QSTARDICT_INSTALL_PREFIX=\(QApplication::applicationDirPath\(\)+\\\"$$INSTALL_PREFIX\\\"\)
  105. # DEFINES += QSTARDICT_BIN_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$BIN_DIR\\\"\)
  106. # DEFINES += QSTARDICT_DATA_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$DATA_DIR\\\"\)
  107. # isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_TRANSLATIONS_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$TRANSLATIONS_DIR\\\"\)
  108. # DEFINES += QSTARDICT_PLUGINS_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$PLUGINS_DIR\\\"\)
  109. DEFINES += QSTARDICT_INSTALL_PREFIX=\\\"$$INSTALL_PREFIX\\\"
  110. DEFINES += QSTARDICT_BIN_DIR=\\\"$$BIN_DIR\\\"
  111. DEFINES += QSTARDICT_DATA_DIR=\\\"$$DATA_DIR\\\"
  112. isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_TRANSLATIONS_DIR=\\\"$$TRANSLATIONS_DIR\\\"
  113. DEFINES += QSTARDICT_PLUGINS_DIR=\\\"$$PLUGINS_DIR\\\"
  114. }