1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
|
#########################################################################################
# pkgAtLeastVersion(widget_name, widget_version)
# Custom test that checks if widget_name is installed and at least version widget_version
#########################################################################################
defineTest(pkgAtLeastVersion) {
# We do not use "pkg-config --atleast-version ..." because there is bug in
# Ubuntu 16.04 which causes the command to fail.
MOD_LINES = $$system($$pkgConfigExecutable() "--modversion " $$1, lines, exitCode)
if (!isEqual(exitCode, 0)) {
return (false)
}
if (isEmpty(MOD_LINES)) {
return (false)
}
if (versionGreaterOrEqual($$first(MOD_LINES), $$2)) {
return (true)
} else {
return (false)
}
}
###########################################################################################
# versionGreaterOrEqual(VERSION_1, VERSION_2)
# Custom test that compares two dot-separated versions and checks if VERSION_1 >= VERSION_2
# versionAtLeast() is not supported before Qt 5.10, so we have a custom implementation of
# this function.
###########################################################################################
defineTest(versionGreaterOrEqual) {
VER_1_SEGMENTS = $$split(1, ".")
VER_2_SEGMENTS = $$split(2, ".")
INDEX = 0
for(VER_2_ITEM, VER_2_SEGMENTS) {
VER_1_ITEM = $$member(VER_1_SEGMENTS, $$INDEX)
if(isEmpty(VER_1_ITEM)) {
VER_1_ITEM = 0
}
if (lessThan(VER_1_ITEM, $$VER_2_ITEM)) {
return(false)
}
if (greaterThan(VER_1_ITEM, $$VER_2_ITEM)) {
return(true)
}
INDEX = $$num_add($$INDEX, 1)
}
return(true)
}
####################
# Start of main code
####################
TEMPLATE = app
LANGUAGE = C++
DESTDIR = ./
DISTFILES = texstudio.astylerc
win32 {
!versionGreaterOrEqual($$QT_VERSION, "5.10.0") {
error(Windows builds require Qt version 5.10.0 or newer)
}
} else {
!versionGreaterOrEqual($$QT_VERSION, "5.0.0") {
error(Non-Windows builds require Qt version 5.0.0 or newer)
}
}
message(Building with Qt $$QT_VERSION)
CONFIG += qt
CONFIG -= precompile_header
# allow loading extra config by file for automatic compilations (OBS)
exists(texstudio.pri):include(texstudio.pri)
QT += network \
xml \
svg \
script \
printsupport \
concurrent
QT += \
widgets \
uitools
!isEmpty(PHONON){
QT += phonon4qt5
LIBS += -lphonon4qt5
DEFINES += PHONON
}
isEmpty(INTERNAL_TERMINAL):pkgAtLeastVersion("qtermwidget5", "0.9.0") {
INTERNAL_TERMINAL=1
message(Use detected qterminal)
}
!isEmpty(INTERNAL_TERMINAL){
LIBS += -lqtermwidget5
DEFINES += INTERNAL_TERMINAL
message(Use qterminal)
}
!isEmpty(QJS){
DEFINES += QJS
QT += qml
QT -= script
message(Use experimental JS engine)
}
include(src/qtsingleapplication/qtsingleapplication.pri)
# ##############################
# precompile_header: PRECOMPILED_HEADER = mostQtHeaders.h
# principal sources
include(src/sources.pri)
include(src/debug/debug.pri)
RESOURCES += texstudio.qrc \
symbols.qrc \
completion.qrc \
images.qrc
TRANSLATIONS += translation/texstudio_ar.ts \
translation/texstudio_br.ts \
translation/texstudio_cs.ts \
translation/texstudio_de.ts \
translation/texstudio_el.ts \
translation/texstudio_es.ts \
translation/texstudio_fa.ts \
translation/texstudio_fr.ts \
translation/texstudio_hu.ts \
translation/texstudio_id_ID.ts \
translation/texstudio_it.ts \
translation/texstudio_ja.ts \
translation/texstudio_ko.ts \
translation/texstudio_ko_KR.ts \
translation/texstudio_nl.ts \
translation/texstudio_pl.ts \
translation/texstudio_pt.ts \
translation/texstudio_pt_BR.ts \
translation/texstudio_ru_RU.ts \
translation/texstudio_sk.ts \
translation/texstudio_sv.ts \
translation/texstudio_tr_TR.ts \
translation/texstudio_uk.ts \
translation/texstudio_vi.ts \
translation/texstudio_zh_CN.ts
# ###############################
win32:RC_FILE = win.rc
# ##############################
macx {
# make sure that the documentation is right
config += unix
# #universal tiger
CONFIG += link_prl \
x86_64
# QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
# QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
target.path = /Applications
manual.path = Contents/Resources/
utilities.path = Contents/Resources/
QMAKE_BUNDLE_DATA += utilities manual
ICON = texstudio.icns
QMAKE_INFO_PLIST = Info.plist
}
# ###############################
unix:!macx {
isEmpty( PREFIX ):PREFIX = /usr
isEmpty( DATADIR ):DATADIR = $${PREFIX}/share
DEFINES += PREFIX=\\\"$${PREFIX}\\\"
target.path = $${PREFIX}/bin
utilities.path = $${DATADIR}/texstudio
manual.path = $${DATADIR}/texstudio
utilities.files = utilities/texstudio16x16.png \
utilities/texstudio22x22.png \
utilities/texstudio32x32.png \
utilities/texstudio48x48.png \
utilities/texstudio64x64.png \
utilities/texstudio128x128.png
applicationmenu.path = $${DATADIR}/applications
applicationmenu.files = utilities/texstudio.desktop
icon.path = $${DATADIR}/icons/hicolor/scalable/apps
icon.files = utilities/texstudio.svg
isEmpty(NO_APPDATA) {
appdata.path = $${DATADIR}/metainfo
appdata.files = utilities/texstudio.appdata.xml
INSTALLS += appdata
}
INSTALLS += applicationmenu
INSTALLS += icon
include(src/xkb/xkb.pri)
}
# ##########UNIX + MACX###############
unix {
UI_DIR = .ui
MOC_DIR = .moc
OBJECTS_DIR = .obj
utilities.files += utilities/latex2e.html \
utilities/latex2e.css \
translation/texstudio_ar.qm \
translation/texstudio_br.qm \
translation/texstudio_cs.qm \
translation/texstudio_de.qm \
translation/texstudio_el.qm \
translation/texstudio_es.qm \
translation/texstudio_fa.qm \
translation/texstudio_fr.qm \
translation/texstudio_hu.qm \
translation/texstudio_id_ID.qm \
translation/texstudio_it.qm \
translation/texstudio_ja.qm \
translation/texstudio_ko.qm \
translation/texstudio_ko_KR.qm \
translation/texstudio_nl.qm \
translation/texstudio_pl.qm \
translation/texstudio_pt.qm \
translation/texstudio_pt_BR.qm \
translation/texstudio_ru_RU.qm \
translation/texstudio_sk.qm \
translation/texstudio_sv.qm \
translation/texstudio_tr_TR.qm \
translation/texstudio_uk.qm \
translation/texstudio_vi.qm \
translation/texstudio_zh_CN.qm \
templates/tabletemplate_fullyframed_firstBold.js \
templates/tabletemplate_fullyframed_firstBold.png \
templates/tabletemplate_fullyframed_longtable.js \
templates/tabletemplate_fullyframed_longtable.png \
templates/tabletemplate_plain_tabular.js \
templates/tabletemplate_plain_tabular.png \
templates/tabletemplate_plain_tabularx.js \
templates/tabletemplate_plain_tabularx.png \
templates/tabletemplate_rowcolors_tabular.js \
templates/tabletemplate_rowcolors_tabular.png \
templates/template_Article.json \
templates/template_Article.png \
templates/template_Article.tex \
templates/template_Article_French.json \
templates/template_Article_French.png \
templates/template_Article_French.tex \
templates/template_Beamer.json \
templates/template_Beamer.tex \
templates/template_Book.json \
templates/template_Book.png \
templates/template_Book.zip \
templates/template_HA-prosper.json \
templates/template_HA-prosper.tex \
templates/template_Letter.json \
templates/template_Letter.png \
templates/template_Letter.tex \
templates/template_Moderncv.json \
templates/template_Moderncv.png \
templates/template_Moderncv.tex \
templates/template_Moderncv_French.json \
templates/template_Moderncv_French.png \
templates/template_Moderncv_French.tex \
templates/template_Prosper.json \
templates/template_Prosper.tex \
templates/template_Report.json \
templates/template_Report.png \
templates/template_Report.tex \
templates/template_Scrartcl.json \
templates/template_Scrartcl.png \
templates/template_Scrartcl.tex \
templates/template_Scrbook.json \
templates/template_Scrbook.tex \
templates/template_Scrlttr2.json \
templates/template_Scrlttr2.tex \
templates/template_Scrreprt.json \
templates/template_Scrreprt.tex \
utilities/dictionaries/de_DE.badWords \
utilities/dictionaries/de_DE.stopWords \
utilities/dictionaries/de_DE.stopWords.level2 \
utilities/dictionaries/en_GB.stopWords \
utilities/dictionaries/en_US.stopWords \
utilities/dictionaries/fr_FR.stopWords \
utilities/AUTHORS \
utilities/COPYING \
utilities/manual/CHANGELOG.txt
manual.files = \
utilities/manual/usermanual_en.html \
utilities/manual/usermanual.css \
utilities/manual/doc1.png \
utilities/manual/doc10.png \
utilities/manual/doc11.png \
utilities/manual/doc12.png \
utilities/manual/doc13.png \
utilities/manual/doc14.png \
utilities/manual/doc15.png \
utilities/manual/doc16.png \
utilities/manual/doc17.png \
utilities/manual/doc18.png \
utilities/manual/doc19.png \
utilities/manual/doc2.png \
utilities/manual/doc20.png \
utilities/manual/doc21.png \
utilities/manual/doc3.png \
utilities/manual/doc5.png \
utilities/manual/doc6.png \
utilities/manual/doc7.png \
utilities/manual/doc8.png \
utilities/manual/doc9.png \
utilities/manual/configure_completion.png \
utilities/manual/configure_commands.png \
utilities/manual/configure_customizeMenu.png \
utilities/manual/configure_customToolbar.png \
utilities/manual/configure_editor.png \
utilities/manual/configure_general.png \
utilities/manual/configure_shortcuts.png \
utilities/manual/configure_svn.png \
utilities/manual/configure_build.png \
utilities/manual/compile_toolbar.png \
utilities/manual/template.png \
utilities/manual/thesaurus.png \
utilities/manual/wizard_figure.png \
utilities/manual/block_selection.png \
utilities/manual/spellcheck_menu.png \
utilities/manual/spellcheck_options.png \
utilities/manual/format_example.png
INSTALLS += target \
manual \
utilities
}
isEmpty(USE_SYSTEM_HUNSPELL){
include(src/hunspell/hunspell.pri)
}else{
message(System hunspell)
CONFIG += link_pkgconfig
PKGCONFIG += hunspell
}
include(src/qcodeedit/qcodeedit.pri)
include(src/latexparser/latexparser.pri)
include(src/symbolpanel/symbolpanel.pri)
isEmpty(USE_SYSTEM_QUAZIP) {
include(src/quazip/quazip/quazip.pri)
} else {
message(System quazip5)
isEmpty(QUAZIP_LIB): QUAZIP_LIB = -lquazip5
isEmpty(QUAZIP_INCLUDE): QUAZIP_INCLUDE = $${PREFIX}/include/quazip5
INCLUDEPATH += $${QUAZIP_INCLUDE}
LIBS += $${QUAZIP_LIB}
}
include(src/pdfviewer/pdfviewer.pri)
# ###############################
CONFIG(debug, debug|release) {
message(Creating debug version)
CONFIG -= debug_and_release release
} else {
message(Creating release version)
CONFIG -= debug_and_release debug
NO_TESTS = 1
}
macx:LIBS += -framework CoreFoundation
freebsd-* {
LIBS += -lexecinfo
}
!isEmpty(NO_CRASH_HANDLER) {
DEFINES += NO_CRASH_HANDLER
message("Internal crash handler disabled as you wish.")
}
include(src/tests/tests.pri)
!isEmpty(DEBUG_LOGGER) {
DEFINES += DEBUG_LOGGER
message("Enabling debug logger.")
}
# add git revision
exists(./.git) {
win32:isEmpty(MXE): {
message(GIT)
system(\"$${PWD}/git_revision.bat\" $${QMAKE_CXX} \"$${OUT_PWD}\" \"$${PWD}\")
SOURCES += src/git_revision.cpp
} else {
message(GIT)
QMAKE_PRE_LINK += \"$${PWD}/git_revision.sh\" $${QMAKE_CXX} \"$${OUT_PWD}\" \"$${PWD}\"
LIBS += git_revision.o
}
} else {
!exists(src/git_revision.cpp){
win32:isEmpty(MXE): system(echo const char * TEXSTUDIO_GIT_REVISION = 0; > src\git_revision.cpp)
else: system(echo \"const char * TEXSTUDIO_GIT_REVISION = 0;\" > src/git_revision.cpp)
}
SOURCES += src/git_revision.cpp
}
!win32-msvc*: {
QMAKE_CXXFLAGS_DEBUG -= -O -O1 -O2 -O3
QMAKE_CXXFLAGS_DEBUG += -Wall -Wextra -Wmissing-include-dirs -Wunknown-pragmas -Wundef -Wpointer-arith -Winline -O0
QMAKE_CXXFLAGS += -std=c++11
!isEmpty(MXE): QMAKE_CXXFLAGS += -fpermissive
!win32:!haiku: QMAKE_LFLAGS += -rdynamic # option not supported by mingw and haiku
else {
QMAKE_CXXFLAGS += -gstabs -g
QMAKE_LFLAGS -= -Wl,-s
QMAKE_LFLAGS_RELEASE -= -Wl,-s
}
} else {
DEFINES += _CRT_SECURE_NO_WARNINGS
}
*-g++:equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 13) {
QMAKE_CXXFLAGS += -Wno-deprecated-copy
}
|