-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
qt-openzwave.pri
121 lines (120 loc) · 4.6 KB
/
qt-openzwave.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
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
top_srcdir=$$PWD
top_builddir=$$shadowed($$PWD)
unix {
macx {
ICON = res/ozw_logo.icns
QMAKE_POST_LINK=$$top_srcdir/tools/updaterpath.sh $(TARGET)
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
}
!macx: QMAKE_CXXFLAGS += -Wno-deprecated-copy
}
unix {
CONFIG-= no-pkg-config
CONFIG+= link_pkgconfig
!isEmpty(OZW_LIB_PATH) {
!exists($$OZW_LIB_PATH/libopenzwave.so): error("Can't find libopenzwave.so")
!exists($$OZW_INCLUDE_PATH/Manager.h) {
!exists($$OZW_LIB_PATH/cpp/src/Manager.h) {
error("Can't find Manager.h")
} else {
OZW_INCLUDE_PATH=$$OZW_LIB_PATH/cpp/src/
}
}
!exists($$OZW_DATABASE_PATH/manufacturer_specific.xml) {
!exists($$OZW_LIB_PATH/config/manufacturer_specific.xml) {
error("Can't find manufacturer_specific.xml")
} else {
OZW_DATABASE_PATH=$$absolute_path($$OZW_LIB_PATH/config/)
}
}
OZW_LIB_PATH=$$absolute_path($$OZW_LIB_PATH)
OZW_INCLUDE_PATH=$$absolute_path($$OZW_INCLUDE_PATH)
OZW_LIBS="-L$$OZW_LIB_PATH"
OZW_LIBS+="-lopenzwave"
OZW_DATABASE_PATH=$$absolute_path($$OZW_DATABASE_PATH)
message(" ")
message("OpenZWave Summary:")
message(" OpenZWave Library Path: $$OZW_LIB_PATH")
message(" OpenZWave Include Path: $$OZW_INCLUDE_PATH")
message(" OpenZWave Libs Command: $$OZW_LIBS")
message(" OpenZWave Database Path: $$OZW_DATABASE_PATH")
message(" ")
INCLUDEPATH+=$$OZW_INCLUDE_PATH
!emscripten {
LIBS+=$$OZW_LIBS
} else {
message(" Not Adding OpenZWave to Libs")
}
} else {
exists( $$top_srcdir/../open-zwave/cpp/src/) {
message("Found OZW in $$absolute_path($$top_srcdir/../open-zwave/)")
OZW_LIB_PATH = "$$absolute_path($$top_srcdir/../open-zwave/)"
OZW_INCLUDE_PATH = $$absolute_path($$top_srcdir/../open-zwave/cpp/src/)
OZW_LIBS="-L$$OZW_LIB_PATH"
OZW_LIBS+="-lopenzwave"
OZW_DATABASE_PATH = $$absolute_path($$top_srcdir/../open-zwave/config/)
message(" ")
message("OpenZWave Summary:")
message(" OpenZWave Library Path: $$OZW_LIB_PATH")
message(" OpenZWave Include Path: $$OZW_INCLUDE_PATH")
message(" OpenZWave Libs Command: $$OZW_LIBS")
message(" OpenZWave Database Path: $$OZW_DATABASE_PATH")
message(" ")
INCLUDEPATH+=$$OZW_INCLUDE_PATH
!emscripten {
LIBS+=$$OZW_LIBS
} else {
message(" Not Adding OpenZWave to Libs")
}
} else {
packagesExist("libopenzwave") {
PKGCONFIG += libopenzwave
OZW_DATABASE_PATH=$$system($$PKG_CONFIG --variable=sysconfdir libopenzwave)
message(" ")
message("OpenZWave Summary:")
message(" Using OpenZWave from pkg-config:")
message(" CXXFLAGS: $$system($$PKG_CONFIG --cflags libopenzwave)")
message(" LDFLAGS: $$system($$PKG_CONFIG --libs libopenzwave)")
message(" DATABASE: $$system($$PKG_CONFIG --variable=sysconfdir libopenzwave)")
message(" ")
} else {
error("Can't find OpenZWave Library and Headers");
}
}
}
}
win32 {
CONFIG(debug, debug|release) {
BUILDTYPE = debug
} else {
BUILDTYPE = release
}
message(Checking for $$BUILDTYPE build of OZW)
exists( $$top_srcdir/../open-zwave/cpp/src/) {
message("Found OZW in $$absolute_path($$top_srcdir/../open-zwave/cpp/src)")
INCLUDEPATH += $$absolute_path($$top_srcdir/../open-zwave/cpp/src/)/
OZW_DATABASE_PATH = $$absolute_path($$top_srcdir/../open-zwave/config/)
equals(BUILDTYPE, "release") {
exists( $$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/ReleaseDLL/OpenZWave.dll ) ) {
LIBS += -L$$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/ReleaseDLL) -lopenzwave
OZW_LIB_PATH = $$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/ReleaseDLL)
} else {
error("Can't find a copy of OpenZWave.dll in the ReleaseDLL Directory");
}
} else {
equals(BUILDTYPE, "debug") {
exists ( $$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/DebugDLL/OpenZWaved.dll )) {
LIBS += -L$$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/DebugDLL) -lOpenZWaved
OZW_LIB_PATH = $$absolute_path($$top_srcdir/../open-zwave/cpp/build/windows/vs2010/ReleaseDLL)
} else {
error("Can't find a copy of OpenZWaved.dll in the DebugDLL Directory");
}
}
}
isEmpty(OZW_LIB_PATH) {
error("Can't find a copy of OpenZWave with the right builds");
}
} else {
error("Can't Find a copy of OpenZwave")
}
}