1QT += core qml
2QT -= gui
3TARGET = ykman
4CONFIG += c++11 console
5CONFIG -= app_bundle
6TEMPLATE = app
7SOURCES += main.cpp
8
9buildqrc.commands = python ../build_qrc.py ${QMAKE_FILE_IN}
10buildqrc.input = QRC_JSON
11buildqrc.output = ${QMAKE_FILE_IN_BASE}.qrc
12buildqrc.variable_out = RESOURCES
13QMAKE_STRIPFLAGS_LIB  += --strip-unneeded
14QMAKE_EXTRA_COMPILERS += buildqrc
15QRC_JSON = resources.json
16# Generate first time
17system(/usr/local/bin/python3.8 ../build_qrc.py resources.json)
18
19# Install python dependencies with pip for win and mac
20mac|win32 {
21    pip.target = pymodules
22    QMAKE_EXTRA_TARGETS += pip
23    PRE_TARGETDEPS += pymodules
24    QMAKE_CLEAN += -r pymodules
25}
26
27macx {
28    pip.commands = python3 -m venv pymodules && source pymodules/bin/activate && pip3 install -r ../requirements.txt && deactivate
29}
30!macx {
31    pip.commands = pip3 install -r ../requirements.txt --target pymodules
32}
33
34# On mac, embedd a Info.plist file in the binary, needed for codesign
35macx{
36    QMAKE_LFLAGS += -sectcreate __TEXT __info_plist $$shell_quote(../resources/mac/Info.plist.cli)
37}
38