Merge branch 'master' of ssh://pumpa.branchable.com
[larjonas-pumpa.git] / pumpa.pro
blobf7f1b5346da71f6fd2735a01047cfc547325be34
1 # -*- mode: makefile -*-
2 ######################################################################
3 # Copyright 2015 Mats Sjöberg
4 #
5 # This file is part of the Pumpa programme.
7 # Pumpa is free software: you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # Pumpa is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Pumpa. If not, see <http://www.gnu.org/licenses/>.
19 ######################################################################
21 TEMPLATE = app
22 TARGET = pumpa
23 RESOURCES += pumpa.qrc
24 OBJECTS_DIR = obj
26 QT += core gui network
28 # To enable debug mode, run as:
29 # qmake CONFIG+=debug
30 # or uncomment this:
31 # CONFIG+=debug
33 # To disable libtidy (not recommended), run as:
34 # qmake CONFIG+=notidy
35 # or uncomment this line:
36 # CONFIG += notidy
38 CONFIG(release, debug|release) {
39 message("Release mode on")
40 } else {
41 message("Debug mode on")
42 CONFIG -= release
43 # Enable debugging output for different things
44 # DEFINES += DEBUG_QAS
45 DEFINES += DEBUG_NET
46 # DEFINES += DEBUG_NET_MOAR
47 # DEFINES += DEBUG_NET_EVEN_MOAR
48 DEFINES += DEBUG_MEMORY
49 DEFINES += DEBUG_MARKUP
50 # DEFINES += DEBUG_WIDGETS
51 DEFINES += DEBUG_BUTTONS
54 unix:!macx {
55 message("Enabling dbus")
56 QT += dbus
57 DEFINES += USE_DBUS
60 win32 {
61 RC_FILE = win32/pumpa.rc
64 macx {
65 ICON = $${PWD}/icons/pumpa.icns
67 # Additions for Qt 4
68 lessThan(QT_MAJOR_VERSION, 5) {
69 message("Configuring for Qt 4")
70 LIBS += -lqjson
73 # Additions for Qt 5
74 greaterThan(QT_MAJOR_VERSION, 4) {
75 message("Configuring for Qt 5")
76 QT += widgets
77 DEFINES += QT5
80 notidy {
81 message("Disabling libtidy")
82 DEFINES += NO_TIDY
83 } else {
84 message("Using libtidy")
85 LIBS += -ltidy
86 exists( /usr/include/tidy/tidy.h ) {
87 DEFINES += USE_TIDY_TIDY
88 } else:exists( /usr/include/tidy.h ) {
89 DEFINES += USE_TIDY
90 } else:exists( /usr/local/include/tidy.h ) {
91 DEFINES += USE_TIDY
92 } else:exists( /usr/local/include/tidy/tidy.h ) {
93 DEFINES += USE_TIDY_TIDY
94 } else {
95 error("Unable to find libtidy header files for compiling! Install libtidy-dev (Debian, Ubuntu) or libtidy-devel (Fedora).")
99 # Optional spell checking support with libaspell
100 exists( /usr/include/aspell.h )|exists( /usr/local/include/aspell.h ) {
101 message("Using aspell")
102 LIBS += -laspell
103 DEFINES += USE_ASPELL
104 } else {
105 warning("Unable to find libaspell header files for compiling. Install libaspell-dev (Debian, Ubuntu) if you want to enable spell-checking.")
108 # Optionally use etags
109 exists( /usr/bin/etags ) {
110 message("Using etags")
111 PRE_TARGETDEPS += etags
115 ######################################################################
116 # Main sources
117 ######################################################################
119 INCLUDEPATH += src
120 VPATH += src
122 OBJECT_HEADERS = pumpapp.h qactivitystreams.h aswidget.h \
123 collectionwidget.h contextwidget.h json.h messagewindow.h \
124 messageedit.h messagerecipients.h fancyhighlighter.h \
125 qaspell.h actorwidget.h filedownloader.h richtextlabel.h \
126 oauthwizard.h tabwidget.h util.h pumpasettingsdialog.h \
127 pumpasettings.h activitywidget.h objectwidget.h \
128 shortobjectwidget.h fullobjectwidget.h imagelabel.h \
129 texttoolbutton.h objectwidgetwithsignals.h objectlistwidget.h \
130 qasabstractobject.h qasobject.h qasactor.h qasactivity.h \
131 qasobjectlist.h qasactorlist.h qascollection.h \
132 qasabstractobjectlist.h editprofiledialog.h
134 OBJECT_SOURCES = $$replace(OBJECT_HEADERS, \\.h, .cpp)
135 OBJECT_ALL = $$OBJECT_HEADERS $$OBJECT_SOURCES
137 SUNDOWN_HEADERS = sundown/markdown.h sundown/html.h sundown/buffer.h
139 SUNDOWN_SOURCES = sundown/autolink.c sundown/buffer.c \
140 sundown/houdini_href_e.c sundown/houdini_html_e.c \
141 sundown/html.c sundown/markdown.c sundown/stack.c
143 HEADERS += $$OBJECT_HEADERS $$SUNDOWN_HEADERS pumpa_defines.h
144 SOURCES += main.cpp
145 SOURCES += $$OBJECT_SOURCES $$SUNDOWN_SOURCES
147 ######################################################################
148 # Translation files
149 ######################################################################
151 TRANSLATIONS = \
152 translations/pumpa_es.ts \
153 translations/pumpa_fr.ts \
154 translations/pumpa_nvi.ts \
155 translations/pumpa_en.ts \
156 translations/pumpa_it.ts \
157 translations/pumpa_de.ts \
158 translations/pumpa_ru.ts \
159 translations/pumpa_fi.ts
161 ######################################################################
162 # kQOAuth sources
163 ######################################################################
165 INCLUDEPATH += src/kQOAuth
166 VPATH += src/kQOAuth
168 PUBLIC_HEADERS += kqoauthmanager.h \
169 kqoauthrequest.h \
170 kqoauthrequest_1.h \
171 kqoauthrequest_xauth.h \
172 kqoauthglobals.h
174 PRIVATE_HEADERS += kqoauthrequest_p.h \
175 kqoauthmanager_p.h \
176 kqoauthauthreplyserver.h \
177 kqoauthauthreplyserver_p.h \
178 kqoauthutils.h \
179 kqoauthrequest_xauth_p.h
181 HEADERS += \
182 $$PUBLIC_HEADERS \
183 $$PRIVATE_HEADERS
185 SOURCES += \
186 kqoauthmanager.cpp \
187 kqoauthrequest.cpp \
188 kqoauthutils.cpp \
189 kqoauthauthreplyserver.cpp \
190 kqoauthrequest_1.cpp \
191 kqoauthrequest_xauth.cpp
193 ######################################################################
194 # Install target
195 ######################################################################
197 unix {
198 isEmpty(PREFIX) {
199 PREFIX = /usr/local
201 BINDIR = $$PREFIX/bin
202 DATADIR =$$PREFIX/share
204 INSTALLS += target desktop icon16 icon24 icon32 icon64 icon96 \
205 icon128 icon256 icon512
207 target.path =$$BINDIR
209 desktop.path = $$DATADIR/applications
210 desktop.files += $${TARGET}.desktop
212 icon16.path = $$DATADIR/icons/hicolor/16x16/apps
213 icon16.files += icons/16x16/$${TARGET}.png
215 icon24.path = $$DATADIR/icons/hicolor/24x24/apps
216 icon24.files += icons/24x24/$${TARGET}.png
218 icon32.path = $$DATADIR/icons/hicolor/32x32/apps
219 icon32.files += icons/32x32/$${TARGET}.png
221 icon64.path = $$DATADIR/icons/hicolor/64x64/apps
222 icon64.files += icons/64x64/$${TARGET}.png
224 icon96.path = $$DATADIR/icons/hicolor/96x96/apps
225 icon96.files += icons/96x96/$${TARGET}.png
227 icon128.path = $$DATADIR/icons/hicolor/128x128/apps
228 icon128.files += icons/128x128/$${TARGET}.png
230 icon256.path = $$DATADIR/icons/hicolor/256x256/apps
231 icon256.files += icons/256x256/$${TARGET}.png
233 icon512.path = $$DATADIR/icons/hicolor/512x512/apps
234 icon512.files += icons/512x512/$${TARGET}.png
238 # target.path = /usr/bin
239 # INSTALLS += target
241 ######################################################################
242 # Generate documentation
243 ######################################################################
245 doc.depends = README
246 doc.commands = markdown README > pumpa.html; cp README ~/dev/web/_includes/README.pumpa
247 QMAKE_EXTRA_TARGETS += doc
250 ######################################################################
251 # Generate TAGS for GNU Emacs and others
252 ######################################################################
254 ETAGS_INPUTS = $$join(OBJECT_ALL, " src/", "src/")
255 etags.depends = $$split($$ETAGS_INPUTS)
256 etags.commands = etags -o src/TAGS $$ETAGS_INPUTS
257 QMAKE_EXTRA_TARGETS += etags
259 ######################################################################
260 # Extra stuff to clean up
261 ######################################################################
263 QMAKE_CLEAN += $DOC_TARGETS src/TAGS