forked from marsiliano/tino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tino.pri
executable file
·78 lines (69 loc) · 1.95 KB
/
tino.pri
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
!isEmpty(TINO_PRI_INCLUDED):error("tino.pri already included")
TINO_PRI_INCLUDED = 1
TINO_LIB_DIRS = $$PWD/src/
TINO_BUILD_DIR = $$shadowed($$PWD)
CONFIG += c++17
defineTest(minQtVersion) {
maj = $$1
min = $$2
patch = $$3
isEqual(QT_MAJOR_VERSION, $$maj) {
isEqual(QT_MINOR_VERSION, $$min) {
isEqual(QT_PATCH_VERSION, $$patch) {
return(true)
}
greaterThan(QT_PATCH_VERSION, $$patch) {
return(true)
}
}
greaterThan(QT_MINOR_VERSION, $$min) {
return(true)
}
}
greaterThan(QT_MAJOR_VERSION, $$maj) {
return(true)
}
return(false)
}
defineReplace(qtLibraryTargetName) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
CONFIG(debug, debug|release) {
mac:RET = $$member(LIBRARY_NAME, 0)_debug
else:win32:RET = $$member(LIBRARY_NAME, 0)d
}
isEmpty(RET):RET = $$LIBRARY_NAME
return($$RET)
}
defineReplace(qtLibraryName) {
RET = $$qtLibraryTargetName($$1)
win32 {
VERSION_LIST = $$split(TINO_VERSION, .)
RET = $$RET$$first(VERSION_LIST)
}
return($$RET)
}
# recursively resolve library deps
done_libs =
for(ever) {
isEmpty(TINO_LIB_DEPENDS): \
break()
done_libs += $$TINO_LIB_DEPENDS
for(dep, TINO_LIB_DEPENDS) {
dependencies_file =
for(dir, TINO_LIB_DIRS) {
exists($$dir/$$dep/$${dep}_dependencies.pri) {
dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
break()
}
}
isEmpty(dependencies_file): \
error("Library dependency $$dep not found")
include($$dependencies_file)
LIBS *= -L$$TINO_BUILD_DIR/src/$$dep -l$$qtLibraryName($$TINO_LIB_NAME)
INCLUDEPATH *= $$TINO_LIB_DIRS$$dep
DEPENDPATH *= $$TINO_LIB_DIRS$$dep
}
TINO_LIB_DEPENDS = $$unique(TINO_LIB_DEPENDS)
TINO_LIB_DEPENDS -= $$unique(done_libs)
}