QGCExternalLibs.pri 10.3 KB
Newer Older
Don Gagne's avatar
Don Gagne committed
1
#
2
# [REQUIRED] Add support for <inttypes.h> to Windows.
Don Gagne's avatar
Don Gagne committed
3 4 5 6 7 8
#
WindowsBuild {
    INCLUDEPATH += libs/lib/msinttypes
}

#
9
# [REQUIRED] Add support for the MAVLink communications protocol.
10 11
# Some logic is involved here in selecting the proper dialect for
# the selected autopilot system.
Don Gagne's avatar
Don Gagne committed
12
#
13
# If the user config file exists, it will be included. If this file
dogmaphobic's avatar
dogmaphobic committed
14 15
# specifies the MAVLINK_CONF variable with a MAVLink dialect, support
# for it will be compiled in to QGC. It will also create a
16
# QGC_USE_{AUTOPILOT_NAME}_MESSAGES macro for use within the actual code.
17 18 19
#
MAVLINKPATH_REL = libs/mavlink/include/mavlink/v1.0
MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL
Don Gagne's avatar
Don Gagne committed
20 21
DEFINES += MAVLINK_NO_DATA

22 23 24
# First we select the dialect, checking for valid user selection
# Users can override all other settings by specifying MAVLINK_CONF as an argument to qmake
!isEmpty(MAVLINK_CONF) {
25
    message($$sprintf("Using MAVLink dialect '%1' specified at the command line.", $$MAVLINK_CONF))
26
}
27
# Otherwise they can specify MAVLINK_CONF within user_config.pri
28
else:exists(user_config.pri):infile(user_config.pri, MAVLINK_CONF) {
29
    MAVLINK_CONF = $$fromfile(user_config.pri, MAVLINK_CONF)
30
    !isEmpty(MAVLINK_CONF) {
31
        message($$sprintf("Using MAVLink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF))
32
    }
Don Gagne's avatar
Don Gagne committed
33
}
34 35

# Then we add the proper include paths dependent on the dialect.
Don Gagne's avatar
Don Gagne committed
36
INCLUDEPATH += $$MAVLINKPATH
Lorenz Meier's avatar
Lorenz Meier committed
37 38 39 40 41 42 43 44 45 46

exists($$MAVLINKPATH/common) {
    !isEmpty(MAVLINK_CONF) {
        count(MAVLINK_CONF, 1) {
            exists($$MAVLINKPATH/$$MAVLINK_CONF) {
                INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
                DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
            } else {
                error($$sprintf("MAVLink dialect '%1' does not exist at '%2'!", $$MAVLINK_CONF, $$MAVLINKPATH_REL))
            }
47
        } else {
Lorenz Meier's avatar
Lorenz Meier committed
48
            error(Only a single mavlink dialect can be specified in MAVLINK_CONF)
49 50
        }
    } else {
Lorenz Meier's avatar
Lorenz Meier committed
51
        INCLUDEPATH += $$MAVLINKPATH/common
52
    }
Don Gagne's avatar
Don Gagne committed
53
} else {
Lorenz Meier's avatar
Lorenz Meier committed
54
    error($$sprintf("MAVLink folder does not exist at '%1'! Run 'git submodule init && git submodule update' on the command line.",$$MAVLINKPATH_REL))
Don Gagne's avatar
Don Gagne committed
55 56 57
}

#
58 59
# [REQUIRED] EIGEN matrix library
# NOMINMAX constant required to make internal min/max work.
Don Gagne's avatar
Don Gagne committed
60 61 62 63
INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX

#
64
# [REQUIRED] QWT plotting library dependency. Provides plotting capabilities.
Don Gagne's avatar
Don Gagne committed
65
#
Don Gagne's avatar
Don Gagne committed
66
!MobileBuild {
67 68 69
include(libs/qwt.pri)
DEPENDPATH += libs/qwt
INCLUDEPATH += libs/qwt
Don Gagne's avatar
Don Gagne committed
70
}
Don Gagne's avatar
Don Gagne committed
71 72

#
73
# [OPTIONAL] XBee wireless support. This is not necessary for basic serial/UART communications.
74 75 76 77 78
# It's only required for speaking directly to the Xbee using their proprietary API.
# Unsupported on Mac.
# Installation on Windows is unnecessary, as we just link to our included .dlls directly.
# Installing on Linux involves running `make;sudo make install` in `libs/thirdParty/libxbee`
# Uninstalling from Linux can be done with `sudo make uninstall`.
Don Gagne's avatar
Don Gagne committed
79
#
80
XBEE_DEPENDENT_HEADERS += \
dogmaphobic's avatar
dogmaphobic committed
81 82 83 84 85
    src/comm/XbeeLinkInterface.h \
    src/comm/XbeeLink.h \
    src/comm/HexSpinBox.h \
    src/ui/XbeeConfigurationWindow.h \
    src/comm/CallConv.h
86
XBEE_DEPENDENT_SOURCES += \
dogmaphobic's avatar
dogmaphobic committed
87 88 89
    src/comm/XbeeLink.cpp \
    src/comm/HexSpinBox.cpp \
    src/ui/XbeeConfigurationWindow.cpp
90
XBEE_DEFINES = QGC_XBEE_ENABLED
91 92

contains(DEFINES, DISABLE_XBEE) {
dogmaphobic's avatar
dogmaphobic committed
93 94
    message("Skipping support for native XBee API (manual override from command line)")
    DEFINES -= DISABLE_XBEE
95
# Otherwise the user can still disable this feature in the user_config.pri file.
96
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_XBEE) {
97
    message("Skipping support for native XBee API (manual override from user_config.pri)")
98
} else:LinuxBuild {
99 100 101
        linux-g++-64 {
            message("Skipping support for XBee API (64-bit Linux builds not supported)")
        } else:exists(/usr/include/xbee.h) {
dogmaphobic's avatar
dogmaphobic committed
102
        message("Including support for XBee API")
103

dogmaphobic's avatar
dogmaphobic committed
104 105 106 107 108 109 110
        HEADERS += $$XBEE_DEPENDENT_HEADERS
        SOURCES += $$XBEE_DEPENDENT_SOURCES
        DEFINES += $$XBEE_DEFINES
        LIBS += -L/usr/lib -lxbee
    } else {
        warning("Skipping support for XBee API (missing libraries, see README)")
    }
111
} else:WindowsBuild {
dogmaphobic's avatar
dogmaphobic committed
112 113 114 115 116
    message("Including support for XBee API")
    HEADERS += $$XBEE_DEPENDENT_HEADERS
    SOURCES += $$XBEE_DEPENDENT_SOURCES
    DEFINES += $$XBEE_DEFINES
    INCLUDEPATH += libs/thirdParty/libxbee
117
        LIBS += -l$$BASEDIR/libs/thirdParty/libxbee/lib/libxbee
Don Gagne's avatar
Don Gagne committed
118
} else {
dogmaphobic's avatar
dogmaphobic committed
119
    message("Skipping support for XBee API (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
120 121 122
}

#
123
# [OPTIONAL] Magellan 3DxWare library. Provides support for 3DConnexion's 3D mice.
Don Gagne's avatar
Don Gagne committed
124
#
125
contains(DEFINES, DISABLE_3DMOUSE) {
dogmaphobic's avatar
dogmaphobic committed
126 127
    message("Skipping support for 3DConnexion mice (manual override from command line)")
    DEFINES -= DISABLE_3DMOUSE
128
# Otherwise the user can still disable this feature in the user_config.pri file.
129
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_3DMOUSE) {
130
    message("Skipping support for 3DConnexion mice (manual override from user_config.pri)")
131
} else:LinuxBuild {
dogmaphobic's avatar
dogmaphobic committed
132 133
    exists(/usr/local/lib/libxdrvlib.so) {
        message("Including support for 3DConnexion mice")
Don Gagne's avatar
Don Gagne committed
134

135
                DEFINES += \
dogmaphobic's avatar
dogmaphobic committed
136
        QGC_MOUSE_ENABLED_LINUX \
137 138
                ParameterCheck
                # Hack: Has to be defined for magellan usage
Don Gagne's avatar
Don Gagne committed
139

dogmaphobic's avatar
dogmaphobic committed
140 141 142 143 144 145
        HEADERS += src/input/Mouse6dofInput.h
        SOURCES += src/input/Mouse6dofInput.cpp
        LIBS += -L/usr/local/lib/ -lxdrvlib
    } else {
        warning("Skipping support for 3DConnexion mice (missing libraries, see README)")
    }
146 147
} else:WindowsBuild {
    message("Including support for 3DConnexion mice")
Don Gagne's avatar
Don Gagne committed
148

149
    DEFINES += QGC_MOUSE_ENABLED_WIN
Don Gagne's avatar
Don Gagne committed
150 151 152 153 154 155 156 157 158 159 160 161 162

    INCLUDEPATH += libs/thirdParty/3DMouse/win

    HEADERS += \
        libs/thirdParty/3DMouse/win/I3dMouseParams.h \
        libs/thirdParty/3DMouse/win/MouseParameters.h \
        libs/thirdParty/3DMouse/win/Mouse3DInput.h \
        src/input/Mouse6dofInput.h

    SOURCES += \
        libs/thirdParty/3DMouse/win/MouseParameters.cpp \
        libs/thirdParty/3DMouse/win/Mouse3DInput.cpp \
        src/input/Mouse6dofInput.cpp
163
} else {
dogmaphobic's avatar
dogmaphobic committed
164
    message("Skipping support for 3DConnexion mice (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
165 166 167
}

#
168
# [OPTIONAL] Opal RT-LAB Library. Provides integration with Opal-RT's RT-LAB simulator.
Don Gagne's avatar
Don Gagne committed
169
#
170
contains(DEFINES, DISABLE_RTLAB) {
dogmaphobic's avatar
dogmaphobic committed
171 172
    message("Skipping support for RT-LAB (manual override from command line)")
    DEFINES -= DISABLE_RTLAB
173
# Otherwise the user can still disable this feature in the user_config.pri file.
174
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_RTLAB) {
175
    message("Skipping support for RT-LAB (manual override from user_config.pri)")
176
} else:WindowsBuild {
dogmaphobic's avatar
dogmaphobic committed
177 178
    exists(src/lib/opalrt/OpalApi.h) : exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) {
        message("Including support for RT-LAB")
179

dogmaphobic's avatar
dogmaphobic committed
180
        DEFINES += QGC_RTLAB_ENABLED
181

dogmaphobic's avatar
dogmaphobic committed
182 183 184
        INCLUDEPATH +=
            src/lib/opalrt
            libs/lib/opal/include \
185

dogmaphobic's avatar
dogmaphobic committed
186
        FORMS += src/ui/OpalLinkSettings.ui
187

dogmaphobic's avatar
dogmaphobic committed
188 189 190 191 192 193 194
        HEADERS += \
            src/comm/OpalRT.h \
            src/comm/OpalLink.h \
            src/comm/Parameter.h \
            src/comm/QGCParamID.h \
            src/comm/ParameterList.h \
            src/ui/OpalLinkConfigurationWindow.h
195

dogmaphobic's avatar
dogmaphobic committed
196 197 198 199 200 201 202
        SOURCES += \
            src/comm/OpalRT.cc \
            src/comm/OpalLink.cc \
            src/comm/Parameter.cc \
            src/comm/QGCParamID.cc \
            src/comm/ParameterList.cc \
            src/ui/OpalLinkConfigurationWindow.cc
203

dogmaphobic's avatar
dogmaphobic committed
204 205 206 207 208 209
        LIBS += \
            -LC:/OPAL-RT/RT-LAB7.2.4/Common/bin \
            -lOpalApi
    } else {
        warning("Skipping support for RT-LAB (missing libraries, see README)")
    }
Don Gagne's avatar
Don Gagne committed
210
} else {
211
    message("Skipping support for RT-LAB (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
212 213 214
}

#
215 216 217
# [REQUIRED] SDL dependency. Provides joystick/gamepad support.
# The SDL is packaged with QGC for the Mac and Windows. Linux support requires installing the SDL
# library (development libraries and static binaries).
Don Gagne's avatar
Don Gagne committed
218 219 220 221 222 223 224 225
#
MacBuild {
    INCLUDEPATH += \
        $$BASEDIR/libs/lib/Frameworks/SDL.framework/Headers

    LIBS += \
        -F$$BASEDIR/libs/lib/Frameworks \
        -framework SDL
226
} else:LinuxBuild {
dogmaphobic's avatar
dogmaphobic committed
227
    PKGCONFIG = sdl
228
} else:WindowsBuild {
dogmaphobic's avatar
dogmaphobic committed
229
    INCLUDEPATH += \
Don Gagne's avatar
Don Gagne committed
230 231
        $$BASEDIR/libs/lib/sdl/msvc/include \

dogmaphobic's avatar
dogmaphobic committed
232
    LIBS += \
Don Gagne's avatar
Don Gagne committed
233 234 235 236 237
        -L$$BASEDIR/libs/lib/sdl/msvc/lib \
        -lSDLmain \
        -lSDL
}

238
##
239
# [OPTIONAL] Speech synthesis library support.
240
# Can be forcibly disabled by adding a `DEFINES+=DISABLE_SPEECH` argument to qmake.
241
# Linux support requires the eSpeak speech synthesizer (espeak).
242 243
# Mac support is provided in Snow Leopard and newer (10.6+)
# Windows is supported as of Windows 7
Don Gagne's avatar
Don Gagne committed
244
#
245
contains (DEFINES, DISABLE_SPEECH) {
dogmaphobic's avatar
dogmaphobic committed
246 247
    message("Skipping support for speech output (manual override from command line)")
    DEFINES -= DISABLE_SPEECH
248
# Otherwise the user can still disable this feature in the user_config.pri file.
249
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_SPEECH) {
250
    message("Skipping support for speech output (manual override from user_config.pri)")
251
} else:LinuxBuild {
dogmaphobic's avatar
dogmaphobic committed
252 253 254 255 256 257 258 259
    exists(/usr/include/espeak) | exists(/usr/local/include/espeak) {
        message("Including support for speech output")
        DEFINES += QGC_SPEECH_ENABLED
        LIBS += \
        -lespeak
    } else {
        warning("Skipping support for speech output (missing libraries, see README)")
    }
260
}
261
# Mac support is built into OS 10.6+.
dogmaphobic's avatar
dogmaphobic committed
262
else:MacBuild|iOSBuild {
263 264
    message("Including support for speech output")
    DEFINES += QGC_SPEECH_ENABLED
265
}
266 267
# Windows supports speech through native API.
else:WindowsBuild {
268 269 270
    message("Including support for speech output")
    DEFINES += QGC_SPEECH_ENABLED
    LIBS    += -lOle32
Don Gagne's avatar
Don Gagne committed
271
}
dogmaphobic's avatar
dogmaphobic committed
272 273 274 275 276
# Android supports speech through native (Java) API.
else:AndroidBuild {
    message("Including support for speech output")
    DEFINES += QGC_SPEECH_ENABLED
}
277 278 279 280 281 282 283 284 285 286 287 288 289 290

#
# [OPTIONAL] Zeroconf for UDP links
#
contains (DEFINES, DISABLE_ZEROCONF) {
    message("Skipping support for Zeroconf (manual override from command line)")
    DEFINES -= DISABLE_ZEROCONF
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_ZEROCONF) {
    message("Skipping support for Zeroconf (manual override from user_config.pri)")
# Mac support is built into OS
} else:MacBuild|iOSBuild {
    message("Including support for Zeroconf (Bonjour)")
    DEFINES += QGC_ZEROCONF_ENABLED
Gus Grubba's avatar
Gus Grubba committed
291 292
} else {
    message("Skipping support for Zeroconf (unsupported platform)")
293 294
}