QGCExternalLibs.pri 18.3 KB
Newer Older
Don Gagne's avatar
Don Gagne committed
1
#
2
# [REQUIRED] Tell the Linux build to look in a few additional places for libs
Don Gagne's avatar
Don Gagne committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#
LinuxBuild {
	INCLUDEPATH += \
        /usr/include \
        /usr/local/include

	LIBS += \
		-L/usr/lib

    linux-g++-64 {
        LIBS += \
            -L/usr/local/lib64 \
            -L/usr/lib64
	}
}

#
20
# [REQUIRED] Add support for <inttypes.h> to Windows.
Don Gagne's avatar
Don Gagne committed
21 22 23 24 25 26
#
WindowsBuild {
    INCLUDEPATH += libs/lib/msinttypes
}

#
27
# [OPTIONAL] QUpgrade support.
Don Gagne's avatar
Don Gagne committed
28
#
29 30 31
# Allow the user to override QUpgrade compilation through a DISABLE_QUPGRADE
# define like: `qmake DEFINES=DISABLE_QUPGRADE`
contains(DEFINES, DISABLE_QUPGRADE) {
32
    message("Skipping support for QUpgrade (manual override from command line)")
33
    DEFINES -= DISABLE_QUPGRADE
34
}
35 36 37 38
# Otherwise the user can still disable this feature in the user_config.pri file.
else:infile(user_config.pri, DEFINES, DISABLE_QUPGRADE) {
    message("Skipping support for QUpgrade (manual override from user_config.pri)")
}
39 40 41
# If the QUpgrade submodule has been initialized, build in support by default.
else:exists(qupgrade/.git) {
    message("Including support for QUpgrade")
Don Gagne's avatar
Don Gagne committed
42

43
    DEFINES += QGC_QUPGRADE_ENABLED
Don Gagne's avatar
Don Gagne committed
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

    INCLUDEPATH += qupgrade/src/apps/qupgrade

    FORMS += \
        qupgrade/src/apps/qupgrade/dialog_bare.ui \
        qupgrade/src/apps/qupgrade/boardwidget.ui

    HEADERS += \
        qupgrade/src/apps/qupgrade/qgcfirmwareupgradeworker.h \
        qupgrade/src/apps/qupgrade/uploader.h \
        qupgrade/src/apps/qupgrade/dialog_bare.h \
        qupgrade/src/apps/qupgrade/boardwidget.h

    SOURCES += \
        qupgrade/src/apps/qupgrade/qgcfirmwareupgradeworker.cpp \
        qupgrade/src/apps/qupgrade/uploader.cpp \
        qupgrade/src/apps/qupgrade/dialog_bare.cpp \
        qupgrade/src/apps/qupgrade/boardwidget.cpp

    RESOURCES += \
        qupgrade/qupgrade.qrc

    LinuxBuild:CONFIG += qesp_linux_udev

    include(qupgrade/libs/qextserialport/src/qextserialport.pri)
69 70 71
}
# Otherwise notify the user and don't compile it.
else {
72
    warning("Skipping support for QUpgrade (missing submodule, see README)")
Don Gagne's avatar
Don Gagne committed
73 74 75
}

#
76
# [REQUIRED] Add support for the MAVLink communications protocol.
77 78
# Some logic is involved here in selecting the proper dialect for
# the selected autopilot system.
Don Gagne's avatar
Don Gagne committed
79
#
80
# If the user config file exists, it will be included. If this file
81 82 83
# specifies the MAVLINK_CONF variable with a MAVLink dialect, support 
# for it will be compiled in to QGC. It will also create a 
# QGC_USE_{AUTOPILOT_NAME}_MESSAGES macro for use within the actual code.
84 85 86
#
MAVLINKPATH_REL = libs/mavlink/include/mavlink/v1.0
MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL
Don Gagne's avatar
Don Gagne committed
87 88
DEFINES += MAVLINK_NO_DATA

89 90 91
# 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) {
92
    message($$sprintf("Using MAVLink dialect '%1' specified at the command line.", $$MAVLINK_CONF))
93
}
94 95
else:infile(user_config.pri, MAVLINK_CONF) {
    MAVLINK_CONF = $$fromfile(user_config.pri, MAVLINK_CONF)
96
    !isEmpty(MAVLINK_CONF) {
97
        message($$sprintf("Using MAVLink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF))
98
    }
Don Gagne's avatar
Don Gagne committed
99
}
100 101 102
# If no valid user selection is found, default to the ardupilotmega if it's available.
# Note: This can be a list of several dialects.
else {
103 104
    MAVLINK_CONF=ardupilotmega
    message($$sprintf("Using default MAVLink dialect '%1'.", $$MAVLINK_CONF))
105
}
106 107

# Then we add the proper include paths dependent on the dialect.
Don Gagne's avatar
Don Gagne committed
108
INCLUDEPATH += $$MAVLINKPATH
109 110 111 112 113 114 115 116 117 118
!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))
        }
    } else {
        error(Only a single mavlink dialect can be specified in MAVLINK_CONF)
119
    }
Don Gagne's avatar
Don Gagne committed
120
} else {
121
    warning("No MAVLink dialect specified, only common messages supported.")
122
    INCLUDEPATH += $$MAVLINKPATH/common
Don Gagne's avatar
Don Gagne committed
123 124 125
}

#
126 127
# [DEPRECATED] MAVLink generator UI. Provides a GUI interface for generating MAVLink dialects.
# Replaced by mavgenerator.py within the MAVLink project.
Don Gagne's avatar
Don Gagne committed
128
#
129
contains(DEFINES, ENABLE_MAVGEN) {
130 131 132 133 134 135 136
	warning("Including support for MAVLink generator GUI (manual override from command line, CAUTION: deprecated)")
} else:infile(user_config.pri, DEFINES, ENABLE_MAVGEN) {
	DEFINES += ENABLE_MAVGEN # infile doesn't automatically include everything in the specified file
	warning("Including support for MAVLink generator GUI (manual override from user_config.pri, CAUTION: deprecated)")
}

contains(DEFINES, ENABLE_MAVGEN) {
137 138 139
	# Rename the macro to be consistent with other QGC feature existance macros.
	DEFINES -= ENABLE_MAVGEN
	DEFINES += QGC_MAVGEN_ENABLED
140 141
	DEPENDPATH += \
		src/apps/mavlinkgen
Don Gagne's avatar
Don Gagne committed
142

143 144 145 146
	INCLUDEPATH += \
		src/apps/mavlinkgen \
		src/apps/mavlinkgen/ui \
		src/apps/mavlinkgen/generator
Don Gagne's avatar
Don Gagne committed
147

148 149 150 151
	include(src/apps/mavlinkgen/mavlinkgen.pri)
} else {
	message("Skipping support for MAVLink generator GUI (deprecated, see README)")
}
Don Gagne's avatar
Don Gagne committed
152 153

#
154
# [OPTIONAL] OpenSceneGraph
155 156 157 158 159 160 161 162 163 164 165
# Allow the user to override OpenSceneGraph compilation through a DISABLE_OPEN_SCENE_GRAPH
# define like: `qmake DEFINES=DISABLE_OPEN_SCENE_GRAPH`
contains(DEFINES, DISABLE_OPEN_SCENE_GRAPH) {
    message("Skipping support for OpenSceneGraph (manual override from command line)")
    DEFINES -= DISABLE_OPEN_SCENE_GRAPH
}
# Otherwise the user can still disable this feature in the user_config.pri file.
else:infile(user_config.pri, DEFINES, DISABLE_OPEN_SCENE_GRAPH) {
    message("Skipping support for OpenSceneGraph (manual override from user_config.pri)")
}
else:MacBuild {
Don Gagne's avatar
Don Gagne committed
166
    # GLUT and OpenSceneGraph are part of standard install on Mac
167
	message("Including support for OpenSceneGraph")
Don Gagne's avatar
Don Gagne committed
168 169 170 171 172 173 174 175
	CONFIG += OSGDependency

    INCLUDEPATH += \
        $$BASEDIR/libs/lib/mac64/include

	LIBS += \
        -L$$BASEDIR/libs/lib/mac64/lib \
        -losgWidget
176
} else:LinuxBuild {
Don Gagne's avatar
Don Gagne committed
177
	exists(/usr/include/osg) | exists(/usr/local/include/osg) {
178
		message("Including support for OpenSceneGraph")
Don Gagne's avatar
Don Gagne committed
179 180 181 182 183 184
        CONFIG += OSGDependency
        exists(/usr/include/osg/osgQt) | exists(/usr/include/osgQt) | exists(/usr/local/include/osg/osgQt) | exists(/usr/local/include/osgQt) {
            message("Including support for Linux OpenSceneGraph Qt")
            LIBS += -losgQt
            DEFINES += QGC_OSG_QT_ENABLED
        } else {
185
            warning("Skipping support for Linux OpenSceneGraph Qt (missing libraries, see README)")
Don Gagne's avatar
Don Gagne committed
186
        }
187 188
	} else {
		warning("Skipping support for OpenSceneGraph (missing libraries, see README)")
Don Gagne's avatar
Don Gagne committed
189
	}
190
} else:WindowsBuild {
Don Gagne's avatar
Don Gagne committed
191
	exists($$BASEDIR/libs/lib/osg123) {
192
		message("Including support for OpenSceneGraph")
Don Gagne's avatar
Don Gagne committed
193 194 195 196 197 198 199
        CONFIG += OSGDependency

		INCLUDEPATH += \
            $$BASEDIR/libs/lib/osgEarth/win32/include \
			$$BASEDIR/libs/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include

		LIBS += -L$$BASEDIR/libs/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib
200 201
	} else {
		warning("Skipping support for OpenSceneGraph (missing libraries, see README)")
Don Gagne's avatar
Don Gagne committed
202
	}
203 204
} else {
    message("Skipping support for OpenSceneGraph (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
}

OSGDependency {
	DEFINES += QGC_OSG_ENABLED
    
    LIBS += \
        -losg \
        -losgViewer \
        -losgGA \
        -losgDB \
        -losgText \
        -lOpenThreads

    HEADERS += \
        src/ui/map3D/gpl.h \
        src/ui/map3D/CameraParams.h \
        src/ui/map3D/ViewParamWidget.h \
        src/ui/map3D/SystemContainer.h \
        src/ui/map3D/SystemViewParams.h \
        src/ui/map3D/GlobalViewParams.h \
        src/ui/map3D/SystemGroupNode.h \
        src/ui/map3D/Q3DWidget.h \
        src/ui/map3D/GCManipulator.h \
        src/ui/map3D/ImageWindowGeode.h \
        src/ui/map3D/PixhawkCheetahNode.h \
        src/ui/map3D/Pixhawk3DWidget.h \
        src/ui/map3D/Q3DWidgetFactory.h \
        src/ui/map3D/WebImageCache.h \
        src/ui/map3D/WebImage.h \
        src/ui/map3D/TextureCache.h \
        src/ui/map3D/Texture.h \
        src/ui/map3D/Imagery.h \
        src/ui/map3D/HUDScaleGeode.h \
        src/ui/map3D/WaypointGroupNode.h \
        src/ui/map3D/TerrainParamDialog.h \
        src/ui/map3D/ImageryParamDialog.h
        
    SOURCES += \
        src/ui/map3D/gpl.cc \
        src/ui/map3D/CameraParams.cc \
        src/ui/map3D/ViewParamWidget.cc \
        src/ui/map3D/SystemContainer.cc \
        src/ui/map3D/SystemViewParams.cc \
        src/ui/map3D/GlobalViewParams.cc \
        src/ui/map3D/SystemGroupNode.cc \
        src/ui/map3D/Q3DWidget.cc \
        src/ui/map3D/ImageWindowGeode.cc \
        src/ui/map3D/GCManipulator.cc \
        src/ui/map3D/PixhawkCheetahNode.cc \
        src/ui/map3D/Pixhawk3DWidget.cc \
        src/ui/map3D/Q3DWidgetFactory.cc \
        src/ui/map3D/WebImageCache.cc \
        src/ui/map3D/WebImage.cc \
        src/ui/map3D/TextureCache.cc \
        src/ui/map3D/Texture.cc \
        src/ui/map3D/Imagery.cc \
        src/ui/map3D/HUDScaleGeode.cc \
        src/ui/map3D/WaypointGroupNode.cc \
        src/ui/map3D/TerrainParamDialog.cc \
        src/ui/map3D/ImageryParamDialog.cc
}

#
268 269
# [OPTIONAL] Google Earth dependency. Provides Google Earth view to supplement 2D map view.
# Only supported on Mac and Windows where Google Earth can be installed.
Don Gagne's avatar
Don Gagne committed
270
#
271
contains(DEFINES, DISABLE_GOOGLE_EARTH) {
272
    message("Skipping support for Google Earth view (manual override from command line)")
273
    DEFINES -= DISABLE_GOOGLE_EARTH
274 275 276 277
}
# Otherwise the user can still disable this feature in the user_config.pri file.
else:infile(user_config.pri, DEFINES, DISABLE_GOOGLE_EARTH) {
    message("Skipping support for Google Earth view (manual override from user_config.pri)")
278 279
} else:MacBuild {
    message("Including support for Google Earth view")
280
    DEFINES += QGC_GOOGLE_EARTH_ENABLED
281 282 283 284
    HEADERS += src/ui/map3D/QGCGoogleEarthView.h
    SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
} else:WindowsBuild {
    message("Including support for Google Earth view")
285
    DEFINES += QGC_GOOGLE_EARTH_ENABLED
Don Gagne's avatar
Don Gagne committed
286 287
    HEADERS += src/ui/map3D/QGCGoogleEarthView.h
    SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
288
    CONFIG += qaxcontainer
Don Gagne's avatar
Don Gagne committed
289
} else {
290
    message("Skipping support for Google Earth view (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
291 292 293
}

#
294
# [OPTIONAL] Protcol Buffers for PixHawk
Don Gagne's avatar
Don Gagne committed
295
#
296
LinuxBuild : contains(MAVLINK_DIALECT, pixhawk) {
Don Gagne's avatar
Don Gagne committed
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
    exists(/usr/local/include/google/protobuf) | exists(/usr/include/google/protobuf) {
        message("Including support for Protocol Buffers")

        DEFINES += QGC_PROTOBUF_ENABLED

        LIBS += \
            -lprotobuf \
            -lprotobuf-lite \
            -lprotoc

        HEADERS += \
            libs/mavlink/include/mavlink/v1.0/pixhawk/pixhawk.pb.h \
            src/ui/map3D/ObstacleGroupNode.h \
            src/ui/map3D/GLOverlayGeode.h

        SOURCES += \
            libs/mavlink/share/mavlink/src/v1.0/pixhawk/pixhawk.pb.cc \
            src/ui/map3D/ObstacleGroupNode.cc \
            src/ui/map3D/GLOverlayGeode.cc
    } else {
317
        warning("Skipping support for Protocol Buffers (missing libraries, see README)")
Don Gagne's avatar
Don Gagne committed
318 319
    }
} else {
320
    message("Skipping support for Protocol Buffers (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
321 322 323
}

#
324 325
# [REQUIRED] EIGEN matrix library
# NOMINMAX constant required to make internal min/max work.
Don Gagne's avatar
Don Gagne committed
326 327 328 329
INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX

#
330
# [REQUIRED] OPMapControl library from OpenPilot. Provides 2D mapping functionality.
Don Gagne's avatar
Don Gagne committed
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
#
include(libs/utils/utils_external.pri)
include(libs/opmapcontrol/opmapcontrol_external.pri)

DEPENDPATH += \
    libs/utils \
    libs/utils/src \
    libs/opmapcontrol \
    libs/opmapcontrol/src \
    libs/opmapcontrol/src/mapwidget

INCLUDEPATH += \
    libs/utils \
    libs \
    libs/opmapcontrol

#
348
# [REQUIRED] QWT plotting library dependency. Provides plotting capabilities.
Don Gagne's avatar
Don Gagne committed
349 350 351 352
#
include(libs/qwt/qwt.pri)

#
353
# [REQUIRED] QSerialPort library. Provides serial port wrapper library.
Don Gagne's avatar
Don Gagne committed
354 355 356 357
#
include(libs/serialport/qserialport.pri)

#
358
# [OPTIONAL] XBee wireless support. This is not necessary for basic serial/UART communications.
359 360 361 362 363
# 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
364
#
365 366 367 368 369 370 371 372 373 374
XBEE_DEPENDENT_HEADERS += \
	src/comm/XbeeLinkInterface.h \
	src/comm/XbeeLink.h \
	src/comm/HexSpinBox.h \
	src/ui/XbeeConfigurationWindow.h \
	src/comm/CallConv.h
XBEE_DEPENDENT_SOURCES += \
	src/comm/XbeeLink.cpp \
	src/comm/HexSpinBox.cpp \
	src/ui/XbeeConfigurationWindow.cpp
375
XBEE_DEFINES = QGC_XBEE_ENABLED
376 377

contains(DEFINES, DISABLE_XBEE) {
378
	message("Skipping support for native XBee API (manual override from command line)")
379
	DEFINES -= DISABLE_XBEE
380 381 382
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_XBEE) {
    message("Skipping support for native XBee API (manual override from user_config.pri)")
383 384 385 386 387 388 389 390 391
} else:LinuxBuild {
	exists(/usr/include/xbee.h) {
		message("Including support for XBee API")

		HEADERS += $$XBEE_DEPENDENT_HEADERS
		SOURCES += $$XBEE_DEPENDENT_SOURCES
		DEFINES += $$XBEE_DEFINES
		LIBS += -lxbee
	} else {
392
		warning("Skipping support for XBee API (missing libraries, see README)")
393 394 395 396 397 398 399
	}
} else:WindowsBuild {
	message("Including support for XBee API")
	HEADERS += $$XBEE_DEPENDENT_HEADERS
	SOURCES += $$XBEE_DEPENDENT_SOURCES
	DEFINES += $$XBEE_DEFINES
	INCLUDEPATH += libs/thirdParty/libxbee
400
        LIBS += -l$$BASEDIR/libs/thirdParty/libxbee/lib/libxbee
Don Gagne's avatar
Don Gagne committed
401
} else {
402
	message("Skipping support for XBee API (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
403 404 405
}

#
406
# [OPTIONAL] Magellan 3DxWare library. Provides support for 3DConnexion's 3D mice.
Don Gagne's avatar
Don Gagne committed
407
#
408
contains(DEFINES, DISABLE_3DMOUSE) {
409
	message("Skipping support for 3DConnexion mice (manual override from command line)")
410
	DEFINES -= DISABLE_3DMOUSE
411 412 413
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_3DMOUSE) {
    message("Skipping support for 3DConnexion mice (manual override from user_config.pri)")
414 415 416
} else:LinuxBuild {
	exists(/usr/local/lib/libxdrvlib.so) {
		message("Including support for 3DConnexion mice")
Don Gagne's avatar
Don Gagne committed
417

418
		DEFINES +=
419
		QGC_MOUSE_ENABLED_LINUX \
420
		ParameterCheck                      # Hack: Has to be defined for magellan usage
Don Gagne's avatar
Don Gagne committed
421

422 423 424 425 426 427 428 429
		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)")
	}
} else:WindowsBuild {
    message("Including support for 3DConnexion mice")
Don Gagne's avatar
Don Gagne committed
430

431
    DEFINES += QGC_MOUSE_ENABLED_WIN
Don Gagne's avatar
Don Gagne committed
432 433 434 435 436 437 438 439 440 441 442 443 444

    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
445 446
} else {
	message("Skipping support for 3DConnexion mice (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
447 448 449
}

#
450
# [OPTIONAL] Opal RT-LAB Library. Provides integration with Opal-RT's RT-LAB simulator.
Don Gagne's avatar
Don Gagne committed
451
#
452
contains(DEFINES, DISABLE_RTLAB) {
453
	message("Skipping support for RT-LAB (manual override from command line)")
454
	DEFINES -= DISABLE_RTLAB
455 456 457
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_RTLAB) {
    message("Skipping support for RT-LAB (manual override from user_config.pri)")
458 459
} else:WindowsBuild {
	exists(src/lib/opalrt/OpalApi.h) : exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) {
460
		message("Including support for RT-LAB")
461

462
		DEFINES += QGC_RTLAB_ENABLED
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491

		INCLUDEPATH +=
			src/lib/opalrt
			libs/lib/opal/include \

		FORMS += src/ui/OpalLinkSettings.ui

		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

		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

		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
492
} else {
493
    message("Skipping support for RT-LAB (unsupported platform)")
Don Gagne's avatar
Don Gagne committed
494 495 496
}

#
497 498 499
# [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
500 501 502 503 504 505 506 507
#
MacBuild {
    INCLUDEPATH += \
        $$BASEDIR/libs/lib/Frameworks/SDL.framework/Headers

    LIBS += \
        -F$$BASEDIR/libs/lib/Frameworks \
        -framework SDL
508
} else:LinuxBuild {
Don Gagne's avatar
Don Gagne committed
509 510 511
	LIBS += \
		-lSDL \
		-lSDLmain
512
} else:WindowsBuild {
Don Gagne's avatar
Don Gagne committed
513 514 515 516 517 518 519 520 521
	INCLUDEPATH += \
        $$BASEDIR/libs/lib/sdl/msvc/include \

	LIBS += \
        -L$$BASEDIR/libs/lib/sdl/msvc/lib \
        -lSDLmain \
        -lSDL
}

522
##
523
# [OPTIONAL] Speech synthesis library support.
524
# Can be forcibly disabled by adding a `DEFINES+=DISABLE_SPEECH` argument to qmake.
525 526 527
# Linux support requires the Festival Lite speech synthesis engine (flite).
# 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
528
#
529
contains (DEFINES, DISABLE_SPEECH) {
530
	message("Skipping support for speech output (manual override from command line)")
531
	DEFINES -= DISABLE_SPEECH
532 533 534
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:infile(user_config.pri, DEFINES, DISABLE_SPEECH) {
    message("Skipping support for speech output (manual override from user_config.pri)")
535 536 537
} else:LinuxBuild {
	exists(/usr/include/flite) | exists(/usr/local/include/flite) {
		message("Including support for speech output")
538
		DEFINES += QGC_SPEECH_ENABLED
539
		LIBS += \
540 541 542 543
		-lflite_cmu_us_kal \
		-lflite_usenglish \
		-lflite_cmulex \
		-lflite
544 545 546 547

		# We need to add the alsa asound library as well for some Linux platforms
		# (like Arch)
		LIBS += -lasound
548
	} else {
549
		warning("Skipping support for speech output (missing libraries, see README)")
550 551
	}
}
552 553 554
# Mac support is built into OS 10.6+.
else:MacBuild {
	message("Including support for speech output")
555
	DEFINES += QGC_SPEECH_ENABLED
556
}
557 558 559
# Windows supports speech through native API.
else:WindowsBuild {
	message("Including support for speech output")
560
	DEFINES += QGC_SPEECH_ENABLED
Don Gagne's avatar
Don Gagne committed
561
}