This repository was archived by the owner on Feb 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathturnMeOn.pro
138 lines (118 loc) · 3.33 KB
/
turnMeOn.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
125
126
127
128
129
130
131
132
133
134
135
136
# Author: David Costa <david@zarel.net>
# turnMeOn project file
# Uncomment next line to build the doc
# CONFIG += documentation
# Uncomment next line to rebuild the database (if needed)
#CONFIG += rebuild_db
# Uncomment the next line to build a release version
# CONFIG -= debug
# Uncomment next line to build a self-contained setup (for Windows)
CONFIG += installer
unix{
message(Building on Linux)
INST_PREFIX=/usr/local
#
# MAC Database
# (database is already present or should be rebuilt)
# sed must be present and sqlite3 too
rebuild_db:system(which sed &> /dev/null):system(which sqlite3 &> /dev/null){
message("Database build is ON")
!exists("res/oui.txt"){
NO_OUI_TXT="Download oui.txt from http://standards.ieee.org/develop/regauth/oui/oui.txt"\
"and put it in the res/ folder"
error($$NO_OUI_TXT)
}else{
macdb.commands="rm -f res/oui.db;"
macdb.commands+="sed -f res/ouitosql.sed res/oui.txt | sqlite3 res/oui.db;"
macdb.target=res/oui.db
QMAKE_EXTRA_TARGETS+=macdb
QMAKE_CLEAN+=res/oui.db
PRE_TARGETDEPS+=res/oui.db
}
} #if rebuild_db is off then oui.db must be already present
else {
message("Database build is OFF")
!exists("res/oui.db"):error("Cannot build. Rebuild the MAC database.")
}
#
# Documentation
#
# Can be built only if doxygen is available AND
# documentation is present in CONFIG
documentation:system(which doxygen &> /dev/null){
message("Documentation build is ON")
# Makefile target
dox.commands=doxygen doc/Doxyfile;
dox.target=doc/html
QMAKE_EXTRA_TARGETS+=dox
## There is NO WAY to delete this directory
## but using this bash-only kludge.
# The result is a Makefile with a target like this:
# clean: ;rm -f `rm -Rf doc/html`
# which will do the job.
QMAKE_CLEAN+= `rm -Rf doc/html`
#autobuild with the target
PRE_TARGETDEPS+=doc/html
# Documentation install set
CONFIG+=copy_dir_files
docs.path=$${INST_PREFIX}/doc/$$TARGET
docs.files=doc/html
INSTALLS+=docs
}
#
# Database install set
#
database.path=$${INST_PREFIX}/share/$$TARGET
database.files=res/oui.db
INSTALLS+=database
# Let the application know where to find the database
# In order to obtain -DSYS_MAC_DB="\"something\""
# some strange quotes are needed
DEFINES+=SYS_MAC_DB="\"\\\"$${INST_PREFIX}/share/$$TARGET/oui.db\\\"\""
#
# turnMeOn install set
#
target.path=$${INST_PREFIX}/bin
INSTALLS+=target
} #End of linux configuration
#Windows configuration
#Typically only a release build needs to be done
#and an NSIS installer prepared.
win32{
message(Building on Windows)
CONFIG+=release
CONFIG-=debug
CONFIG(installer){
nsis_script=build\\installer\\setup.nsi
nsis_bin=$$(programFiles)\\NSIS\\makensis.exe
target.path=build\\installer
INSTALLS+=target
database.path=build\\installer
database.files=res/oui.db
INSTALLS+=database
setup.target=build\\installer
setup.commands=$${nsis_bin} $${nsis_script}
setup.path=build\\installer
INSTALLS+=setup
}
RC_FILE+=res\\icon.rc
}
exists(build\\defaults.qmake){
include(build\\defaults.qmake)
}
BUILD_DIR=build
VPATH=src
VPATH+=res
TEMPLATE = app
TARGET=turnMeOn
VERSION = 1.0.0
QT = core gui network sql
SOURCES += main.cpp magicPacket.cpp mainWnd.cpp
HEADERS += mainWnd.h magicPacket.h
FORMS += mainWnd.ui
RESOURCES += data.qrc
TRANSLATIONS +=
OBJECTS_DIR = $${BUILD_DIR}
MOC_DIR = $${BUILD_DIR}
RCC_DIR = $${BUILD_DIR}
UI_DIR = $${BUILD_DIR}