QGCExternalLibs.pri 3.64 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 {
83
    INCLUDEPATH += $$BASEDIR/libs/lib/sdl2/msvc/include
Don Gagne's avatar
Don Gagne committed
84

85 86 87 88 89
    contains(QT_ARCH, i386) {
        LIBS += -L$$BASEDIR/libs/lib/sdl2/msvc/lib/x86
    } else {
        LIBS += -L$$BASEDIR/libs/lib/sdl2/msvc/lib/x64
    }
dogmaphobic's avatar
dogmaphobic committed
90
    LIBS += \
91 92
        -lSDL2main \
        -lSDL2
Don Gagne's avatar
Don Gagne committed
93 94
}

95 96 97 98 99 100 101 102 103 104 105 106 107
#
# [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
108 109
} else {
    message("Skipping support for Zeroconf (unsupported platform)")
110 111
}