-
Notifications
You must be signed in to change notification settings - Fork 85
/
GitQlient.pro
124 lines (102 loc) · 4.21 KB
/
GitQlient.pro
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
#General stuff
CONFIG += qt warn_on c++20 c++1z
QT += widgets core network gui
DEFINES += QT_DEPRECATED_WARNINGS
if (!exists(src/git/.git) || !exists(src/AuxiliarCustomWidgets/.git) || !exists(src/QLogger/.git) || !exists(src/QPinnableTabWidget/.git)) {
message("Submodule update:")
system(git submodule update --init --recursive)
}
unix:!macos {
TARGET = gitqlient
QMAKE_LFLAGS += -no-pie
isEmpty(PREFIX) {
PREFIX = /usr/local
}
target.path = $$PREFIX/bin
application.path = $$PREFIX/share/applications
application.files = $$PWD/src/resources/gitqlient.desktop
INSTALLS += application
iconsvg.path = $$PREFIX/share/icons/hicolor/scalable/apps
iconsvg.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo.svg \$(INSTALL_ROOT)$${iconsvg.path}/$${TARGET}.svg
icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps
icon16.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo16.png \$(INSTALL_ROOT)$${icon16.path}/$${TARGET}.png
icon24.path = $$PREFIX/share/icons/hicolor/24x24/apps
icon24.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo24.png \$(INSTALL_ROOT)$${icon24.path}/$${TARGET}.png
icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps
icon32.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo32.png \$(INSTALL_ROOT)$${icon32.path}/$${TARGET}.png
icon48.path = $$PREFIX/share/icons/hicolor/48x48/apps
icon48.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo48.png \$(INSTALL_ROOT)$${icon48.path}/$${TARGET}.png
icon64.path = $$PREFIX/share/icons/hicolor/64x64/apps
icon64.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo64.png \$(INSTALL_ROOT)$${icon64.path}/$${TARGET}.png
icon96.path = $$PREFIX/share/icons/hicolor/96x96/apps
icon96.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo96.png \$(INSTALL_ROOT)$${icon96.path}/$${TARGET}.png
icon128.path = $$PREFIX/share/icons/hicolor/128x128/apps
icon128.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo128.png \$(INSTALL_ROOT)$${icon128.path}/$${TARGET}.png
icon256.path = $$PREFIX/share/icons/hicolor/256x256/apps
icon256.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo256.png \$(INSTALL_ROOT)$${icon256.path}/$${TARGET}.png
icon512.path = $$PREFIX/share/icons/hicolor/512x512/apps
icon512.extra = \$(QINSTALL) $$PWD/src/resources/icons/GitQlientLogo512.png \$(INSTALL_ROOT)$${icon512.path}/$${TARGET}.png
INSTALLS += iconsvg icon16 icon24 icon32 icon48 icon64 icon96 icon128 icon256 icon512
INSTALLS += target
} else {
TARGET = GitQlient
}
#project files
SOURCES += src/main.cpp
include(src/App.pri)
OTHER_FILES += \
$$PWD/LICENSE
isEmpty(VERSION) {
VERSION = $$system(git describe --abbrev=0)
VERSION = $$replace(VERSION, "v", "")
}
!defined(GQ_SHA, var) {
GQ_SHA = $$system(git rev-parse --short HEAD)
}
DEFINES += \
VER=\\\"$$VERSION\\\" \
SHA_VER=\\\"$$GQ_SHA\\\"
!win32-msvc* {
debug {
DEFINES += DEBUG
QMAKE_CXXFLAGS += -Wall -pedantic-errors -Werror
}
}
DEFINES += \
QT_NO_JAVA_STYLE_ITERATORS \
QT_NO_CAST_TO_ASCII \
QT_RESTRICTED_CAST_FROM_ASCII \
QT_DISABLE_DEPRECATED_BEFORE=0x050900 \
QT_USE_QSTRINGBUILDER
macos{
isEmpty(ARCH) {
ARCH = arm64
}
isEmpty(CREATEDMGPATH) {
CREATEDMGPATH = /opt/homebrew/bin
}
QMAKE_INFO_PLIST=$$PWD/src/resources/Info.plist
CONFIG+=sdk_no_version_check
ICON = $$PWD/src/resources/icon.icns
BUNDLE_FILENAME = $${TARGET}.app
DMG_FILENAME = "GitQlient-$${VERSION}-$${ARCH}.dmg"
#Target for pretty DMG generation
dmg.commands += echo "Generate DMG";
dmg.commands += rm -f *.dmg && macdeployqt $$BUNDLE_FILENAME &&
dmg.commands += $${CREATEDMGPATH}/create-dmg \
--volname $${TARGET} \
--volicon "$${PWD}/src/resources/icon.icns" \
--background "$${PWD}/src/resources/dmg_bg.png" \
--icon "$${TARGET}.app" 125 220 \
--window-size 600 450 \
--icon-size 100 \
--hdiutil-quiet \
--hide-extension $${BUNDLE_FILENAME} \
--app-drop-link 475 220 \
$${DMG_FILENAME} \
$${BUNDLE_FILENAME}
QMAKE_EXTRA_TARGETS += dmg
}
TRANSLATIONS += \
$$PWD/src/resources/translations/gitqlient_en.ts \
$$PWD/src/resources/translations/gitqlient_zh_CN.ts