2017-01-27 15:55:38 +03:00
|
|
|
TEMPLATE = app
|
|
|
|
QT += qml quick widgets
|
|
|
|
CONFIG += c++11
|
2017-08-14 13:27:04 +03:00
|
|
|
SOURCES += main.cpp \
|
|
|
|
systemtray.cpp
|
2017-01-27 15:55:38 +03:00
|
|
|
|
|
|
|
# This is the verson number for the application,
|
|
|
|
# will be in info.plist file, about page etc.
|
2017-11-27 17:52:24 +03:00
|
|
|
|
|
|
|
PYTHON3_BINARY_NAME=python3
|
|
|
|
win32|win64 {
|
|
|
|
PYTHON3_BINARY_NAME=python
|
|
|
|
}
|
|
|
|
|
|
|
|
VERSION = $$system($$PYTHON3_BINARY_NAME compute-version.py -f VERSION yubioath-desktop-)
|
2017-11-22 18:02:34 +03:00
|
|
|
|
2017-11-22 23:04:08 +03:00
|
|
|
message(Version of this build: $$VERSION)
|
2017-11-22 18:02:34 +03:00
|
|
|
|
2017-01-27 15:55:38 +03:00
|
|
|
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
|
|
|
|
2017-11-22 23:04:08 +03:00
|
|
|
win32|win64 {
|
|
|
|
# Strip suffixes from version number
|
|
|
|
# Append ".0" if "-dirty" or append ".1" if not "-dirty"
|
|
|
|
# Because rc compiler requires only numerals in the version number
|
|
|
|
VERSION ~= s/^([0-9]+\.[0-9]+\.[0-9]+).*-dirty$/\1.0
|
|
|
|
VERSION ~= s/^([0-9]+\.[0-9]+\.[0-9]+)-.*/\1.1
|
|
|
|
message(Version tweaked for Windows build: $$VERSION)
|
|
|
|
}
|
|
|
|
|
2017-01-27 15:55:38 +03:00
|
|
|
buildqrc.commands = python build_qrc.py ${QMAKE_FILE_IN}
|
|
|
|
buildqrc.input = QRC_JSON
|
|
|
|
buildqrc.output = ${QMAKE_FILE_IN_BASE}.qrc
|
|
|
|
buildqrc.variable_out = RESOURCES
|
|
|
|
|
|
|
|
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
|
|
|
|
|
|
|
|
QMAKE_EXTRA_COMPILERS += buildqrc
|
|
|
|
QRC_JSON = resources.json
|
|
|
|
|
|
|
|
# Generate first time
|
2017-03-07 11:09:13 +03:00
|
|
|
system(python build_qrc.py resources.json)
|
2017-01-27 15:55:38 +03:00
|
|
|
|
|
|
|
# Install python dependencies with pip on mac and win
|
|
|
|
win32|macx {
|
|
|
|
pip.target = pymodules
|
|
|
|
QMAKE_EXTRA_TARGETS += pip
|
|
|
|
PRE_TARGETDEPS += pymodules
|
|
|
|
QMAKE_CLEAN += -r pymodules
|
|
|
|
}
|
2017-03-06 11:32:52 +03:00
|
|
|
macx {
|
2017-06-29 12:34:40 +03:00
|
|
|
pip.commands = python3 -m venv pymodules && source pymodules/bin/activate && pip3 install -r requirements.txt && deactivate
|
2017-03-06 11:32:52 +03:00
|
|
|
}
|
|
|
|
win32 {
|
|
|
|
pip.commands = pip3 install -r requirements-win.txt --target pymodules
|
|
|
|
}
|
2017-01-27 15:55:38 +03:00
|
|
|
|
|
|
|
# Default rules for deployment.
|
|
|
|
include(deployment.pri)
|
|
|
|
|
|
|
|
# Mac doesn't use qSingleApplication
|
|
|
|
!macx {
|
|
|
|
include(vendor/qt-solutions/qtsingleapplication/src/qtsingleapplication.pri)
|
|
|
|
}
|
|
|
|
|
|
|
|
# Icon file
|
2017-03-02 11:06:03 +03:00
|
|
|
RC_ICONS = resources/icons/yubioath.ico
|
2017-01-27 15:55:38 +03:00
|
|
|
|
|
|
|
# Mac specific configuration
|
|
|
|
macx {
|
2017-03-03 12:12:34 +03:00
|
|
|
ICON = resources/icons/yubioath.icns
|
2017-01-27 15:55:38 +03:00
|
|
|
QMAKE_INFO_PLIST = resources/mac/Info.plist.in
|
|
|
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9 # Mavericks
|
2017-06-29 15:00:33 +03:00
|
|
|
QMAKE_POST_LINK += cp -rnf pymodules/lib/python3*/site-packages/ yubioath-desktop.app/Contents/MacOS/pymodules/
|
2017-01-27 15:55:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# For generating a XML file with all strings.
|
|
|
|
lupdate_only {
|
|
|
|
SOURCES = qml/*.qml \
|
|
|
|
qml/slot/*.qml
|
|
|
|
}
|
|
|
|
|
2017-08-14 13:27:04 +03:00
|
|
|
HEADERS += screenshot.h \
|
|
|
|
systemtray.h
|
2017-02-14 15:12:24 +03:00
|
|
|
|
2017-01-27 15:55:38 +03:00
|
|
|
DISTFILES += \
|
2017-02-14 15:12:24 +03:00
|
|
|
py/* \
|
|
|
|
py/qr/* \
|
2017-03-18 19:38:21 +03:00
|
|
|
qml/*
|