QGCExternalLibs.pri 8.73 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
# Android supports speech through native (Java) API.
else:AndroidBuild {
    message("Including support for speech output")
    DEFINES += QGC_SPEECH_ENABLED
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
    QMAKE_CXXFLAGS += -g
    INCLUDEPATH += \
        libs/breakpad/src \
        libs/breakpad/src/common/android/include
    HEADERS += \
        libs/breakpad/src/client/linux/crash_generation/crash_generation_client.h \
        libs/breakpad/src/client/linux/handler/exception_handler.h \
        libs/breakpad/src/client/linux/handler/minidump_descriptor.h \
        libs/breakpad/src/client/linux/log/log.h \
        libs/breakpad/src/client/linux/dump_writer_common/thread_info.h \
        libs/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h \
        libs/breakpad/src/client/linux/microdump_writer/microdump_writer.h \
        libs/breakpad/src/client/linux/minidump_writer/cpu_set.h \
        libs/breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h \
        libs/breakpad/src/client/linux/minidump_writer/minidump_writer.h \
        libs/breakpad/src/client/linux/minidump_writer/line_reader.h \
        libs/breakpad/src/client/linux/minidump_writer/linux_dumper.h \
        libs/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.h \
        libs/breakpad/src/client/linux/minidump_writer/directory_reader.h \
        libs/breakpad/src/client/minidump_file_writer-inl.h \
        libs/breakpad/src/client/minidump_file_writer.h \
        libs/breakpad/src/common/scoped_ptr.h \
        libs/breakpad/src/common/linux/linux_libc_support.h \
        libs/breakpad/src/common/linux/eintr_wrapper.h \
        libs/breakpad/src/common/linux/ignore_ret.h \
        libs/breakpad/src/common/linux/file_id.h \
        libs/breakpad/src/common/linux/memory_mapped_file.h \
        libs/breakpad/src/common/linux/safe_readlink.h \
        libs/breakpad/src/common/linux/guid_creator.h \
        libs/breakpad/src/common/linux/elfutils.h \
        libs/breakpad/src/common/linux/elfutils-inl.h \
        libs/breakpad/src/common/linux/elf_gnu_compat.h \
        libs/breakpad/src/common/using_std_string.h \
        libs/breakpad/src/common/memory.h \
        libs/breakpad/src/common/basictypes.h \
        libs/breakpad/src/common/memory_range.h \
        libs/breakpad/src/common/string_conversion.h \
        libs/breakpad/src/common/convert_UTF.h \
        libs/breakpad/src/google_breakpad/common/minidump_format.h \
        libs/breakpad/src/google_breakpad/common/minidump_size.h \
        libs/breakpad/src/google_breakpad/common/breakpad_types.h \
        libs/breakpad/src/third_party/lss/linux_syscall_support.h
    SOURCES += \
        libs/breakpad/src/client/linux/crash_generation/crash_generation_client.cc \
        libs/breakpad/src/client/linux/handler/exception_handler.cc \
        libs/breakpad/src/client/linux/handler/minidump_descriptor.cc \
        libs/breakpad/src/client/linux/dump_writer_common/thread_info.cc \
        libs/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc \
        libs/breakpad/src/client/linux/log/log.cc \
        libs/breakpad/src/client/linux/microdump_writer/microdump_writer.cc \
        libs/breakpad/src/client/linux/minidump_writer/minidump_writer.cc \
        libs/breakpad/src/client/linux/minidump_writer/linux_dumper.cc \
        libs/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
        libs/breakpad/src/client/minidump_file_writer.cc \
        libs/breakpad/src/common/linux/linux_libc_support.cc \
        libs/breakpad/src/common/linux/file_id.cc \
        libs/breakpad/src/common/linux/memory_mapped_file.cc \
        libs/breakpad/src/common/linux/safe_readlink.cc \
        libs/breakpad/src/common/linux/guid_creator.cc \
        libs/breakpad/src/common/linux/elfutils.cc \
        libs/breakpad/src/common/string_conversion.cc \
        libs/breakpad/src/common/convert_UTF.c \
        libs/breakpad/src/common/android/breakpad_getcontext.S
dogmaphobic's avatar
dogmaphobic committed
193
}
194 195 196 197 198 199 200 201 202 203 204 205 206 207

#
# [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
208 209
} else {
    message("Skipping support for Zeroconf (unsupported platform)")
210 211
}