QGCExternalLibs.pri 5.03 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
# Mavlink dialect is hardwired to arudpilotmega for now. The reason being
# the current codebase supports both PX4 and APM flight stack. PX4 flight stack
Ricardo de Almeida Gonzaga's avatar
Ricardo de Almeida Gonzaga committed
12
# only usese common mavlink specifications, whereas APM flight stack uses custom
13 14
# mavlink specifications which add to common. So by using the adupilotmega dialect
# QGC can support both in the same codebase.
15
#
16 17 18 19
# Once the mavlink helper routines include support for multiple dialects within
# a single compiled codebase this hardwiring of dialect can go away. But until then
# this "workaround" is needed.

Don Gagne's avatar
Don Gagne committed
20
MAVLINKPATH_REL = libs/mavlink/include/mavlink/v2.0
21
MAVLINKPATH = $$BASEDIR/$$MAVLINKPATH_REL
22
MAVLINK_CONF = ardupilotmega
Don Gagne's avatar
Don Gagne committed
23 24
DEFINES += MAVLINK_NO_DATA

25 26 27
# 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) {
28
    message($$sprintf("Using MAVLink dialect '%1'.", $$MAVLINK_CONF))
Don Gagne's avatar
Don Gagne committed
29
}
30 31

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

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))
            }
43
        } else {
Lorenz Meier's avatar
Lorenz Meier committed
44
            error(Only a single mavlink dialect can be specified in MAVLINK_CONF)
45 46
        }
    } else {
Lorenz Meier's avatar
Lorenz Meier committed
47
        INCLUDEPATH += $$MAVLINKPATH/common
48
    }
Don Gagne's avatar
Don Gagne committed
49
} else {
Lorenz Meier's avatar
Lorenz Meier committed
50
    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
51 52 53
}

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

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

#
69 70 71
# [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
72 73 74
#
MacBuild {
    INCLUDEPATH += \
75
        $$BASEDIR/libs/lib/Frameworks/SDL2.framework/Headers
Don Gagne's avatar
Don Gagne committed
76 77 78

    LIBS += \
        -F$$BASEDIR/libs/lib/Frameworks \
79
        -framework SDL2
80
} else:LinuxBuild {
81
    PKGCONFIG = sdl2
82
} else:WindowsBuild {
dogmaphobic's avatar
dogmaphobic committed
83
    INCLUDEPATH += \
84
        $$BASEDIR/libs/lib/sdl2/msvc/include \
Don Gagne's avatar
Don Gagne committed
85

dogmaphobic's avatar
dogmaphobic committed
86
    LIBS += \
87
        -L$$BASEDIR/libs/lib/sdl2/msvc/lib/x86 \
88 89
        -lSDL2main \
        -lSDL2
Don Gagne's avatar
Don Gagne committed
90 91
}

92
##
93
# [OPTIONAL] Speech synthesis library support.
94
# Can be forcibly disabled by adding a `DEFINES+=DISABLE_SPEECH` argument to qmake.
95
# Linux support requires the eSpeak speech synthesizer (espeak).
96 97
# 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
98
#
99
contains (DEFINES, DISABLE_SPEECH) {
dogmaphobic's avatar
dogmaphobic committed
100 101
    message("Skipping support for speech output (manual override from command line)")
    DEFINES -= DISABLE_SPEECH
102
# Otherwise the user can still disable this feature in the user_config.pri file.
103
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_SPEECH) {
104
    message("Skipping support for speech output (manual override from user_config.pri)")
105
} else:LinuxBuild {
dogmaphobic's avatar
dogmaphobic committed
106 107 108 109 110 111 112 113
    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)")
    }
114
}
115
# Mac support is built into OS 10.6+.
dogmaphobic's avatar
dogmaphobic committed
116
else:MacBuild|iOSBuild {
117 118
    message("Including support for speech output")
    DEFINES += QGC_SPEECH_ENABLED
119
}
120 121
# Windows supports speech through native API.
else:WindowsBuild {
122 123 124
    message("Including support for speech output")
    DEFINES += QGC_SPEECH_ENABLED
    LIBS    += -lOle32
Don Gagne's avatar
Don Gagne committed
125
}
dogmaphobic's avatar
dogmaphobic committed
126 127 128 129 130
# Android supports speech through native (Java) API.
else:AndroidBuild {
    message("Including support for speech output")
    DEFINES += QGC_SPEECH_ENABLED
}
131 132 133 134 135 136 137 138 139 140 141 142 143 144

#
# [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
145 146
} else {
    message("Skipping support for Zeroconf (unsupported platform)")
147 148
}