summaryrefslogtreecommitdiffstats
path: root/appcontroller.pro
blob: b467652c74d26c7834c6d2e8274813bf379dbefe (plain)
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
QT-=gui
QT+=network
HEADERS=\
        process.h \
        portlist.h \

SOURCES=\
        main.cpp \
        process.cpp \
        portlist.cpp \

android {
    target.path = $$[INSTALL_ROOT]/system/bin
} else {
    target.path = $$[INSTALL_ROOT]/usr/bin
}
INSTALLS+=target

# Find out git hash
exists(.git) {
    unix:system(which git):HAS_GIT=TRUE
    win32:system(where git.exe):HAS_GIT=TRUE
    contains(HAS_GIT, TRUE) {
        GIT_HASH=$$system(git log -1 --format=%H)
        !system(git diff-index --quiet HEAD): GIT_HASH="$$GIT_HASH-dirty"
        GIT_VERSION=$$system(git describe --tags --exact-match)
        isEmpty(GIT_VERSION) : GIT_VERSION="unknown"
    }
} else {
    GIT_HASH="unknown"
    GIT_VERSION="unknown"
}

isEmpty(GIT_VERSION) : error("No suitable tag found")
isEmpty(GIT_HASH) : error("No hash available")

DEFINES+="GIT_HASH=\\\"$$GIT_HASH\\\""
DEFINES+="GIT_VERSION=\\\"$$GIT_VERSION\\\""