goldendict-ng/goldendict.pro

680 lines
16 KiB
Prolog
Raw Normal View History

TEMPLATE = app
TARGET = goldendict
VERSION = 1.5.0-RC2+git
# Generate version file. We do this here and in a build rule described later.
# The build rule is required since qmake isn't run each time the project is
# rebuilt; and doing it here is required too since any other way the RCC
# compiler would complain if version.txt wouldn't exist (fresh checkouts).
system(git describe --tags --always --dirty > version.txt): hasGit=1
isEmpty( hasGit ) {
message(Failed to precisely describe the version via Git -- using the default version string)
system(echo $$VERSION > version.txt)
}
# DEPENDPATH += . generators
INCLUDEPATH += .
QT += core \
gui \
xml \
network \
svg
greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets \
webenginewidgets\
2014-07-11 14:18:37 +00:00
printsupport \
help
# QMediaPlayer is not available in Qt4.
!CONFIG( no_qtmultimedia_player ) {
QT += multimedia
DEFINES += MAKE_QTMULTIMEDIA_PLAYER
}
} else {
QT += webkit
2014-07-11 14:18:37 +00:00
CONFIG += help
}
!CONFIG( no_ffmpeg_player ) {
DEFINES += MAKE_FFMPEG_PLAYER
}
2014-06-23 15:11:15 +00:00
QT += sql
CONFIG += exceptions \
rtti \
2014-07-11 14:18:37 +00:00
stl
OBJECTS_DIR = build
UI_DIR = build
MOC_DIR = build
RCC_DIR = build
LIBS += \
-lz \
-lbz2 \
-llzo2
win32 {
TARGET = GoldenDict
win32-msvc* {
VERSION = 1.5.0 # More complicated things cause errors during compilation under MSVC++
DEFINES += __WIN32 _CRT_SECURE_NO_WARNINGS
2013-08-11 07:30:43 +00:00
contains(QMAKE_TARGET.arch, x86_64) {
DEFINES += NOMINMAX __WIN64
}
LIBS += -L$${PWD}/winlibs/lib/msvc
QMAKE_CXXFLAGS += /wd4290 # silence the warning C4290: C++ exception specification ignored
QMAKE_LFLAGS_RELEASE += /OPT:REF /OPT:ICF
DEFINES += GD_NO_MANIFEST
2013-08-11 07:30:43 +00:00
# QMAKE_CXXFLAGS_RELEASE += /GL # slows down the linking significantly
LIBS += -lshell32 -luser32 -lsapi -lole32
Debug: LIBS+= -lhunspelld
Release: LIBS+= -lhunspell
2013-08-11 07:30:43 +00:00
HUNSPELL_LIB = hunspell
} else {
2013-09-17 14:11:27 +00:00
CONFIG(gcc48) {
x64 {
LIBS += -L$${PWD}/winlibs/lib64-48
QMAKE_CXXFLAGS += -m64
QMAKE_CFLAGS += -m64
} else {
LIBS += -L$${PWD}/winlibs/lib32-48
}
2013-09-17 14:11:27 +00:00
} else {
LIBS += -L$${PWD}/winlibs/lib
}
!x64:QMAKE_LFLAGS += -Wl,--large-address-aware
2017-07-05 14:58:43 +00:00
isEmpty(HUNSPELL_LIB) {
LIBS += -lhunspell-1.6.1
} else {
LIBS += -l$$HUNSPELL_LIB
}
QMAKE_CXXFLAGS += -Wextra -Wempty-body
}
LIBS += -liconv \
-lwsock32 \
-lpsapi \
-lole32 \
-loleaut32 \
-ladvapi32 \
-lcomdlg32
LIBS += -lvorbisfile \
-lvorbis \
-logg
!CONFIG( no_ffmpeg_player ) {
LIBS += -lao \
-lswresample-gd \
-lavutil-gd \
-lavformat-gd \
-lavcodec-gd
}
RC_FILE = goldendict.rc
INCLUDEPATH += winlibs/include
# Enable console in Debug mode on Windows, with useful logging messages
Debug:CONFIG += console
Release:DEFINES += NO_CONSOLE
gcc48:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
2021-07-15 15:07:45 +00:00
CONFIG += zim_support
!CONFIG( no_chinese_conversion_support ) {
CONFIG += chinese_conversion_support
}
greaterThan(QT_MAJOR_VERSION, 4) {
LIBS += -luxtheme
}
}
unix:!mac {
2013-05-31 05:28:36 +00:00
DEFINES += HAVE_X11
# This is to keep symbols for backtraces
QMAKE_CXXFLAGS += -rdynamic
QMAKE_LFLAGS += -rdynamic
greaterThan(QT_MAJOR_VERSION, 4) {
greaterThan(QT_MINOR_VERSION, 0) {
QT += x11extras
}
}
CONFIG += link_pkgconfig
PKGCONFIG += vorbisfile \
2015-10-11 14:58:31 +00:00
vorbis \
ogg \
hunspell
!CONFIG( no_ffmpeg_player ) {
PKGCONFIG += ao \
libavutil \
libavformat \
libavcodec \
libswresample \
}
arm {
LIBS += -liconv
} else {
LIBS += -lX11 -lXtst
}
# Install prefix: first try to use qmake's PREFIX variable,
# then $PREFIX from system environment, and if both fails,
# use the hardcoded /usr/local.
PREFIX = $${PREFIX}
isEmpty( PREFIX ):PREFIX = $$(PREFIX)
isEmpty( PREFIX ):PREFIX = /usr/local
message(Install Prefix is: $$PREFIX)
DEFINES += PROGRAM_DATA_DIR=\\\"$$PREFIX/share/goldendict/\\\"
target.path = $$PREFIX/bin/
locale.path = $$PREFIX/share/goldendict/locale/
locale.files = locale/*.qm
INSTALLS += target \
locale
2009-11-10 18:52:50 +00:00
icons.path = $$PREFIX/share/pixmaps
icons.files = redist/icons/*.*
INSTALLS += icons
2009-11-10 18:52:50 +00:00
desktops.path = $$PREFIX/share/applications
desktops.files = redist/*.desktop
INSTALLS += desktops
metainfo.path = $$PREFIX/share/metainfo
metainfo.files = redist/*.metainfo.xml
INSTALLS += metainfo
2014-06-23 15:11:15 +00:00
helps.path = $$PREFIX/share/goldendict/help/
helps.files = help/*.qch
INSTALLS += helps
}
2019-04-01 21:48:46 +00:00
freebsd {
LIBS += -liconv -lexecinfo
}
mac {
TARGET = GoldenDict
2011-09-24 00:12:34 +00:00
# Uncomment this line to make a universal binary.
# You will need to use Xcode 3 and Qt Carbon SDK
# if you want the support for PowerPC and/or Mac OS X 10.4
# CONFIG += x86 x86_64 ppc
LIBS = -lz \
-lbz2 \
-liconv \
-lvorbisfile \
-lvorbis \
-logg \
-lhunspell-1.6.1 \
-llzo2
!CONFIG( no_ffmpeg_player ) {
LIBS += -lao \
-lswresample-gd \
-lavutil-gd \
-lavformat-gd \
-lavcodec-gd
}
2013-05-06 23:22:43 +00:00
INCLUDEPATH = $${PWD}/maclibs/include
LIBS += -L$${PWD}/maclibs/lib -framework AppKit -framework Carbon
OBJECTIVE_SOURCES += lionsupport.mm \
machotkeywrapper.mm \
macmouseover.mm \
speechclient_mac.mm
ICON = icons/macicon.icns
QMAKE_INFO_PLIST = myInfo.plist
QMAKE_POST_LINK = mkdir -p GoldenDict.app/Contents/Frameworks & \
2013-05-06 23:22:43 +00:00
cp -nR $${PWD}/maclibs/lib/ GoldenDict.app/Contents/Frameworks/ & \
mkdir -p GoldenDict.app/Contents/MacOS/locale & \
2014-06-23 15:11:15 +00:00
cp -R locale/*.qm GoldenDict.app/Contents/MacOS/locale/ & \
mkdir -p GoldenDict.app/Contents/MacOS/help & \
cp -R $${PWD}/help/*.qch GoldenDict.app/Contents/MacOS/help/
CONFIG += zim_support
2016-04-21 14:50:56 +00:00
!CONFIG( no_chinese_conversion_support ) {
CONFIG += chinese_conversion_support
CONFIG( x86 ) {
QMAKE_POST_LINK += & mkdir -p GoldenDict.app/Contents/MacOS/opencc & \
cp -R $${PWD}/opencc/*.json GoldenDict.app/Contents/MacOS/opencc/ & \
cp -R $${PWD}/opencc/*.ocd GoldenDict.app/Contents/MacOS/opencc/
} else {
QMAKE_POST_LINK += & mkdir -p GoldenDict.app/Contents/MacOS/opencc & \
cp -R $${PWD}/opencc/x64/*.json GoldenDict.app/Contents/MacOS/opencc/ & \
cp -R $${PWD}/opencc/x64/*.ocd GoldenDict.app/Contents/MacOS/opencc/
}
2016-04-21 14:50:56 +00:00
}
}
DEFINES += PROGRAM_VERSION=\\\"$$VERSION\\\"
# Input
HEADERS += folding.hh \
2021-08-28 02:35:23 +00:00
gico_schemahandler.h \
inc_case_folding.hh \
inc_diacritic_folding.hh \
mainwindow.hh \
sptr.hh \
dictionary.hh \
ex.hh \
config.hh \
sources.hh \
utf8.hh \
file.hh \
bgl_babylon.hh \
bgl.hh \
initializing.hh \
article_netmgr.hh \
dictzip.h \
btreeidx.hh \
stardict.hh \
chunkedstorage.hh \
xdxf2html.hh \
iconv.hh \
lsa.hh \
htmlescape.hh \
dsl.hh \
dsl_details.hh \
filetype.hh \
fsencoding.hh \
groups.hh \
groups_widgets.hh \
instances.hh \
article_maker.hh \
scanpopup.hh \
articleview.hh \
audioplayerinterface.hh \
audioplayerfactory.hh \
ffmpegaudioplayer.hh \
multimediaaudioplayer.hh \
externalaudioplayer.hh \
externalviewer.hh \
wordfinder.hh \
groupcombobox.hh \
keyboardstate.hh \
mouseover.hh \
preferences.hh \
mutex.hh \
mediawiki.hh \
sounddir.hh \
hunspell.hh \
dictdfiles.hh \
audiolink.hh \
wstring.hh \
wstring_qt.hh \
processwrapper.hh \
hotkeywrapper.hh \
searchpanewidget.hh \
hotkeyedit.hh \
langcoder.hh \
editdictionaries.hh \
loaddictionaries.hh \
transliteration.hh \
romaji.hh \
2013-01-18 19:21:56 +00:00
belarusiantranslit.hh \
russiantranslit.hh \
german.hh \
website.hh \
orderandprops.hh \
language.hh \
dictionarybar.hh \
broken_xrecord.hh \
history.hh \
atomic_rename.hh \
articlewebview.hh \
zipfile.hh \
indexedzip.hh \
termination.hh \
greektranslit.hh \
webmultimediadownload.hh \
forvo.hh \
country.hh \
about.hh \
programs.hh \
parsecmdline.hh \
dictspanewidget.hh \
maintabwidget.hh \
mainstatusbar.hh \
gdappstyle.hh \
2012-01-24 12:55:28 +00:00
ufile.hh \
2012-02-09 12:49:41 +00:00
xdxf.hh \
sdict.hh \
decompress.hh \
2012-04-02 18:41:58 +00:00
aard.hh \
mruqmenu.hh \
dictinfo.hh \
2012-12-10 14:14:13 +00:00
zipsounds.hh \
stylescombobox.hh \
extlineedit.hh \
translatebox.hh \
historypanewidget.hh \
wordlist.hh \
mdictparser.hh \
mdx.hh \
voiceengines.hh \
ffmpegaudio.hh \
delegate.hh \
zim.hh \
gddebug.hh \
utils.hh \
gestures.hh \
tiff.hh \
2014-04-16 16:18:28 +00:00
dictheadwords.hh \
fulltextsearch.hh \
2014-04-30 12:55:53 +00:00
ftshelpers.hh \
2014-06-23 15:11:15 +00:00
dictserver.hh \
2015-01-22 15:17:05 +00:00
helpwindow.hh \
2015-10-11 14:58:31 +00:00
slob.hh \
ripemd.hh \
2017-04-24 14:42:01 +00:00
gls.hh \
2017-05-05 14:39:51 +00:00
splitfile.hh \
favoritespanewidget.hh \
cpp_features.hh \
treeview.hh
FORMS += groups.ui \
dictgroupwidget.ui \
mainwindow.ui \
sources.ui \
initializing.ui \
scanpopup.ui \
articleview.ui \
preferences.ui \
about.ui \
editdictionaries.ui \
orderandprops.ui \
dictinfo.ui \
2014-04-03 14:21:02 +00:00
dictheadwords.ui \
2014-04-16 16:18:28 +00:00
authentication.ui \
fulltextsearch.ui
2015-01-22 15:17:05 +00:00
SOURCES += folding.cc \
2021-08-28 02:35:23 +00:00
gico_schemahandler.cpp \
main.cc \
dictionary.cc \
config.cc \
sources.cc \
mainwindow.cc \
utf8.cc \
file.cc \
bgl_babylon.cc \
bgl.cc \
initializing.cc \
article_netmgr.cc \
dictzip.c \
btreeidx.cc \
stardict.cc \
chunkedstorage.cc \
xdxf2html.cc \
iconv.cc \
lsa.cc \
htmlescape.cc \
dsl.cc \
dsl_details.cc \
filetype.cc \
fsencoding.cc \
groups.cc \
groups_widgets.cc \
instances.cc \
article_maker.cc \
scanpopup.cc \
articleview.cc \
audioplayerfactory.cc \
multimediaaudioplayer.cc \
externalaudioplayer.cc \
externalviewer.cc \
wordfinder.cc \
groupcombobox.cc \
keyboardstate.cc \
mouseover.cc \
preferences.cc \
mutex.cc \
mediawiki.cc \
sounddir.cc \
hunspell.cc \
dictdfiles.cc \
audiolink.cc \
wstring.cc \
wstring_qt.cc \
processwrapper.cc \
hotkeywrapper.cc \
hotkeyedit.cc \
langcoder.cc \
editdictionaries.cc \
loaddictionaries.cc \
transliteration.cc \
romaji.cc \
2013-01-18 19:21:56 +00:00
belarusiantranslit.cc \
russiantranslit.cc \
german.cc \
website.cc \
orderandprops.cc \
language.cc \
dictionarybar.cc \
broken_xrecord.cc \
history.cc \
atomic_rename.cc \
articlewebview.cc \
zipfile.cc \
indexedzip.cc \
termination.cc \
greektranslit.cc \
webmultimediadownload.cc \
forvo.cc \
country.cc \
about.cc \
programs.cc \
parsecmdline.cc \
maintabwidget.cc \
mainstatusbar.cc \
gdappstyle.cc \
2012-01-24 12:55:28 +00:00
ufile.cc \
2012-02-09 12:49:41 +00:00
xdxf.cc \
sdict.cc \
decompress.cc \
2012-04-02 18:41:58 +00:00
aard.cc \
mruqmenu.cc \
dictinfo.cc \
2012-12-10 14:14:13 +00:00
zipsounds.cc \
stylescombobox.cc \
extlineedit.cc \
translatebox.cc \
historypanewidget.cc \
wordlist.cc \
mdictparser.cc \
mdx.cc \
voiceengines.cc \
ffmpegaudio.cc \
delegate.cc \
zim.cc \
gddebug.cc \
gestures.cc \
tiff.cc \
2014-04-16 16:18:28 +00:00
dictheadwords.cc \
fulltextsearch.cc \
2014-04-30 12:55:53 +00:00
ftshelpers.cc \
2014-06-23 15:11:15 +00:00
dictserver.cc \
2015-01-22 15:17:05 +00:00
helpwindow.cc \
2015-10-11 14:58:31 +00:00
slob.cc \
ripemd.cc \
2017-04-24 14:42:01 +00:00
gls.cc \
2017-05-05 14:39:51 +00:00
splitfile.cc \
favoritespanewidget.cc \
treeview.cc
win32 {
2015-10-11 14:58:31 +00:00
FORMS += texttospeechsource.ui
SOURCES += mouseover_win32/ThTypes.c \
wordbyauto.cc \
guids.c \
x64.cc \
speechclient_win.cc \
texttospeechsource.cc \
speechhlp.cc
HEADERS += mouseover_win32/ThTypes.h \
wordbyauto.hh \
uiauto.hh \
x64.hh \
texttospeechsource.hh \
sapi.hh \
sphelper.hh \
speechclient.hh \
speechhlp.hh \
hotkeys.h
}
mac {
HEADERS += macmouseover.hh \
texttospeechsource.hh \
speechclient.hh
FORMS += texttospeechsource.ui
SOURCES += texttospeechsource.cc
}
unix:!mac {
HEADERS += scanflag.hh
FORMS += scanflag.ui
SOURCES += scanflag.cc
}
greaterThan(QT_MAJOR_VERSION, 4) {
HEADERS += wildcard.hh
SOURCES += wildcard.cc
}
CONFIG( zim_support ) {
DEFINES += MAKE_ZIM_SUPPORT
LIBS += -llzma -lzstd
}
!CONFIG( no_extra_tiff_handler ) {
DEFINES += MAKE_EXTRA_TIFF_HANDLER
LIBS += -ltiff
}
2014-05-20 13:59:56 +00:00
CONFIG( no_epwing_support ) {
DEFINES += NO_EPWING_SUPPORT
}
!CONFIG( no_epwing_support ) {
HEADERS += epwing.hh \
epwing_book.hh \
epwing_charmap.hh
2014-05-20 13:59:56 +00:00
SOURCES += epwing.cc \
epwing_book.cc \
epwing_charmap.cc
2014-05-20 13:59:56 +00:00
LIBS += -leb
}
CONFIG( chinese_conversion_support ) {
DEFINES += MAKE_CHINESE_CONVERSION_SUPPORT
FORMS += chineseconversion.ui
HEADERS += chinese.hh \
chineseconversion.hh
SOURCES += chinese.cc \
chineseconversion.cc
win32-msvc* {
Debug: LIBS += -lopenccd
Release: LIBS += -lopencc
} else {
2016-04-21 14:50:56 +00:00
mac {
LIBS += -lopencc.2
} else {
LIBS += -lopencc
}
}
}
2017-07-05 14:58:43 +00:00
CONFIG( old_hunspell ) {
DEFINES += OLD_HUNSPELL_INTERFACE
}
RESOURCES += resources.qrc \
flags.qrc
TRANSLATIONS += locale/ru_RU.ts \
locale/zh_CN.ts \
locale/cs_CZ.ts \
locale/de_DE.ts \
locale/el_GR.ts \
locale/bg_BG.ts \
locale/ar_SA.ts \
2010-06-21 21:11:37 +00:00
locale/lt_LT.ts \
locale/uk_UA.ts \
locale/vi_VN.ts \
locale/it_IT.ts \
locale/pl_PL.ts \
locale/ja_JP.ts \
locale/zh_TW.ts \
locale/sq_AL.ts \
locale/pt_BR.ts \
2011-10-16 00:06:14 +00:00
locale/es_AR.ts \
locale/es_BO.ts \
locale/es_ES.ts \
2011-11-13 08:48:47 +00:00
locale/sk_SK.ts \
locale/tr_TR.ts \
locale/qu_WI.ts \
2012-12-24 18:21:43 +00:00
locale/tg_TJ.ts \
locale/ay_WI.ts \
locale/be_BY.ts \
locale/be_BY@latin.ts \
2013-03-18 08:01:52 +00:00
locale/fr_FR.ts \
2013-04-08 21:10:39 +00:00
locale/ko_KR.ts \
locale/nl_NL.ts \
2013-09-16 13:07:20 +00:00
locale/sr_SR.ts \
2013-09-23 09:48:52 +00:00
locale/sv_SE.ts \
2014-03-18 18:54:53 +00:00
locale/tk_TM.ts \
locale/fa_IR.ts \
2016-11-24 01:46:50 +00:00
locale/mk_MK.ts \
locale/eo_EO.ts \
locale/fi_FI.ts \
locale/jb_JB.ts \
2021-03-09 14:53:48 +00:00
locale/hi_IN.ts \
locale/ie_001.ts
# Build version file
!isEmpty( hasGit ) {
QMAKE_EXTRA_TARGETS += revtarget
2012-12-03 19:11:33 +00:00
PRE_TARGETDEPS += $$PWD/version.txt
revtarget.target = $$PWD/version.txt
!win32 {
revtarget.commands = cd $$PWD; git describe --tags --always --dirty > $$revtarget.target
} else {
revtarget.commands = git --git-dir=\"$$PWD/.git\" describe --tags --always --dirty > $$revtarget.target
}
2012-12-03 19:11:33 +00:00
ALL_SOURCES = $$SOURCES $$HEADERS $$FORMS
for(src, ALL_SOURCES) {
QUALIFIED_SOURCES += $${PWD}/$${src}
}
revtarget.depends = $$QUALIFIED_SOURCES
}
# This makes qmake generate translations
2012-12-03 19:11:33 +00:00
win32:# Windows doesn't seem to have *-qt4 symlinks
isEmpty(QMAKE_LRELEASE):QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
2009-11-10 18:52:50 +00:00
isEmpty(QMAKE_LRELEASE):QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease-qt4
# The *.qm files might not exist when qmake is run for the first time,
# causing the standard install rule to be ignored, and no translations
# will be installed. With this, we create the qm files during qmake run.
!win32 {
system($${QMAKE_LRELEASE} -silent $${_PRO_FILE_} 2> /dev/null)
}
updateqm.input = TRANSLATIONS
2012-12-03 19:11:33 +00:00
updateqm.output = locale/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE \
${QMAKE_FILE_IN} \
-qm \
2012-12-03 19:11:33 +00:00
${QMAKE_FILE_OUT}
updateqm.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += updateqm
TS_OUT = $$TRANSLATIONS
TS_OUT ~= s/.ts/.qm/g
PRE_TARGETDEPS += $$TS_OUT
include( qtsingleapplication/src/qtsingleapplication.pri )