qstardict.pri 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 = 1.0
  20. QT = \
  21. core \
  22. gui \
  23. network \
  24. xml
  25. CONFIG += \
  26. qt \
  27. warn_on \
  28. release
  29. unix {
  30. CONFIG += link_pkgconfig
  31. PKGCONFIG += glib-2.0
  32. LIBS += -lz -lX11
  33. }
  34. macx {
  35. # universal binaries
  36. CONFIG += x86 x86_64 # not available on Snow Leopard ppc ppc64
  37. # QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5.sdk/
  38. }
  39. win32 {
  40. CONFIG += console
  41. LIBS += -lzdll -lglib-2.0 -luser32
  42. INCLUDEPATH += $$GLIB2PATH/include/glib-2.0 \
  43. $$GLIB2PATH/lib/glib-2.0/include \
  44. $$ZLIBPATH/include
  45. QMAKE_LIBDIR += $$GLIB2PATH/lib \
  46. $$ZLIBPATH/lib
  47. }
  48. unix:DEFINES += HAVE_MMAP
  49. unix:isEmpty(NO_DBUS):!contains(QT_CONFIG, dbus): NO_DBUS = 1
  50. unix:isEmpty(NO_DBUS):CONFIG += qdbus
  51. unix:isEmpty(NO_DBUS):DEFINES += QSTARDICT_WITH_DBUS
  52. isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_WITH_TRANSLATIONS
  53. isEmpty(ENABLED_PLUGINS):ENABLED_PLUGINS="stardict web"
  54. unix {
  55. macx {
  56. isEmpty(INSTALL_PREFIX) {
  57. INSTALL_PREFIX=/opt
  58. }
  59. # helper var to save text duplicity.
  60. # NOTE: it cannot use $$TARGET because the target is
  61. # different in every directory. Obviously.
  62. MAC_BUNDLE_PATH=$$INSTALL_PREFIX/QStarDict.app/Contents
  63. # bin dir is used for qstardict dir/main application
  64. # qmake created bundle for it itself. So it *has* to be
  65. # the same as install location
  66. BIN_DIR=$$INSTALL_PREFIX
  67. DATA_DIR=$$MAC_BUNDLE_PATH/share
  68. TRANSLATIONS_DIR=$$MAC_BUNDLE_PATH/i18n
  69. PLUGINS_DIR=$$MAC_BUNDLE_PATH/lib
  70. DOCS_DIR=$$MAC_BUNDLE_PATH/share/doc
  71. DEFINES += QSTARDICT_VERSION=\\\"$$VERSION\\\"
  72. }
  73. else {
  74. isEmpty(INSTALL_PREFIX):INSTALL_PREFIX=/usr
  75. isEmpty(BIN_DIR):BIN_DIR=$$INSTALL_PREFIX/bin
  76. isEmpty(DATA_DIR):DATA_DIR=$$INSTALL_PREFIX/share/qstardict
  77. isEmpty(NO_TRANSLATIONS):isEmpty(TRANSLATIONS_DIR):TRANSLATIONS_DIR=$$DATA_DIR/translations
  78. isEmpty(LIB_DIR):LIB_DIR=$$INSTALL_PREFIX/lib/qstardict
  79. isEmpty(PLUGINS_DIR):PLUGINS_DIR=$$LIB_DIR/plugins
  80. isEmpty(DOCS_DIR):DOCS_DIR=$$INSTALL_PREFIX/share/doc/qstardict
  81. DEFINES += QSTARDICT_VERSION=\\\"$$VERSION\\\"
  82. DEFINES += QSTARDICT_INSTALL_PREFIX=\\\"$$INSTALL_PREFIX\\\"
  83. DEFINES += QSTARDICT_BIN_DIR=\\\"$$BIN_DIR\\\"
  84. DEFINES += QSTARDICT_DATA_DIR=\\\"$$DATA_DIR\\\"
  85. isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_TRANSLATIONS_DIR=\\\"$$TRANSLATIONS_DIR\\\"
  86. DEFINES += QSTARDICT_PLUGINS_DIR=\\\"$$PLUGINS_DIR\\\"
  87. }
  88. } else:win32 {
  89. isEmpty(INSTALL_PREFIX) {
  90. INSTALL_PREFIX=
  91. } else {
  92. # handle path backslashes in defines correctly
  93. INSTALL_PREFIX = $$re_escape($$INSTALL_PREFIX)
  94. }
  95. isEmpty(BIN_DIR):BIN_DIR=$$INSTALL_PREFIX/
  96. isEmpty(DATA_DIR):DATA_DIR=$$INSTALL_PREFIX/data
  97. isEmpty(NO_TRANSLATIONS):isEmpty(TRANSLATIONS_DIR):TRANSLATIONS_DIR=$$INSTALL_PREFIX/translations
  98. isEmpty(PLUGINS_DIR):PLUGINS_DIR=$$INSTALL_PREFIX/plugins
  99. isEmpty(DOCS_DIR):DOCS_DIR=$$INSTALL_PREFIX/docs
  100. DEFINES += QSTARDICT_VERSION=\\\"$$VERSION\\\"
  101. # DEFINES += QSTARDICT_INSTALL_PREFIX=\(QApplication::applicationDirPath\(\)+\\\"$$INSTALL_PREFIX\\\"\)
  102. # DEFINES += QSTARDICT_BIN_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$BIN_DIR\\\"\)
  103. # DEFINES += QSTARDICT_DATA_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$DATA_DIR\\\"\)
  104. # isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_TRANSLATIONS_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$TRANSLATIONS_DIR\\\"\)
  105. # DEFINES += QSTARDICT_PLUGINS_DIR=\(QApplication::applicationDirPath\(\)+\\\"$$PLUGINS_DIR\\\"\)
  106. DEFINES += QSTARDICT_INSTALL_PREFIX=\\\"$$INSTALL_PREFIX\\\"
  107. DEFINES += QSTARDICT_BIN_DIR=\\\"$$BIN_DIR\\\"
  108. DEFINES += QSTARDICT_DATA_DIR=\\\"$$DATA_DIR\\\"
  109. isEmpty(NO_TRANSLATIONS):DEFINES += QSTARDICT_TRANSLATIONS_DIR=\\\"$$TRANSLATIONS_DIR\\\"
  110. DEFINES += QSTARDICT_PLUGINS_DIR=\\\"$$PLUGINS_DIR\\\"
  111. }
  112. system(echo "ENABLED_PLUGINS = $$ENABLED_PLUGINS" >plugins/plugins.pri)