qgroundcontrol.pri 11.1 KB
Newer Older
Hugo Vincent's avatar
Hugo Vincent committed
1 2
#-------------------------------------------------
#
3 4
# QGroundControl - Micro Air Vehicle Groundstation
#
5
# Please see our website at <http://qgroundcontrol.org>
Hugo Vincent's avatar
Hugo Vincent committed
6
#
7
# Author:
Hugo Vincent's avatar
Hugo Vincent committed
8 9
# Lorenz Meier <mavteam@student.ethz.ch>
#
10
# (c) 2009-2010 PIXHAWK Team
Hugo Vincent's avatar
Hugo Vincent committed
11 12
#
# This file is part of the mav groundstation project
13
# QGroundControl is free software: you can redistribute it and/or modify
Hugo Vincent's avatar
Hugo Vincent committed
14 15 16
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
17
# QGroundControl is distributed in the hope that it will be useful,
Hugo Vincent's avatar
Hugo Vincent committed
18 19 20 21
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
22
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
Hugo Vincent's avatar
Hugo Vincent committed
23 24 25
#
#-------------------------------------------------

pixhawk's avatar
pixhawk committed
26 27 28 29
#$$BASEDIR/lib/qextserialport/include
#               $$BASEDIR/lib/openjaus/libjaus/include \
#               $$BASEDIR/lib/openjaus/libopenJaus/include

Hugo Vincent's avatar
Hugo Vincent committed
30 31
message(Qt version $$[QT_VERSION])

32 33 34 35
release {
#    DEFINES += QT_NO_DEBUG_OUTPUT
#    DEFINES += QT_NO_WARNING_OUTPUT
}
Hugo Vincent's avatar
Hugo Vincent committed
36

lm's avatar
lm committed
37 38 39 40 41
QMAKE_PRE_LINK += echo "Copying files"

#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.

Hugo Vincent's avatar
Hugo Vincent committed
42 43
# MAC OS X
macx { 
44

45 46 47
    COMPILER_VERSION = $$system(gcc -v)
    message(Using compiler $$COMPILER_VERSION)

48
    HARDWARE_PLATFORM = $$system(uname -a)
pixhawk's avatar
pixhawk committed
49
    contains( HARDWARE_PLATFORM, 9.6.0 ) || contains( HARDWARE_PLATFORM, 9.7.0 ) || contains( HARDWARE_PLATFORM, 9.8.0 ) || contains( HARDWARE_PLATFORM, 9.9.0 ) {
pixhawk's avatar
pixhawk committed
50 51 52
        # x86 Mac OS X Leopard 10.5 and earlier
        CONFIG += x86 cocoa phonon
        message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
53

54 55
                # Enable function-profiling with the OS X saturn tool
                debug {
56 57
                        #QMAKE_CXXFLAGS += -finstrument-functions
                        #LIBS += -lSaturn
58
                }
pixhawk's avatar
pixhawk committed
59
    } else {
60 61
        # x64 Mac OS X Snow Leopard 10.6 and later
        CONFIG += x86_64 cocoa
pixhawk's avatar
pixhawk committed
62
        CONFIG -= x86 phonon
63
        message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
64
    }
Hugo Vincent's avatar
Hugo Vincent committed
65

66
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
Hugo Vincent's avatar
Hugo Vincent committed
67 68

    DESTDIR = $$BASEDIR/bin/mac
69
    INCLUDEPATH += -framework SDL
Hugo Vincent's avatar
Hugo Vincent committed
70 71

    LIBS += -framework IOKit \
Hugo Vincent's avatar
Hugo Vincent committed
72 73 74
        -framework SDL \
        -framework CoreFoundation \
        -framework ApplicationServices \
Hugo Vincent's avatar
Hugo Vincent committed
75 76 77
        -lm
    
    ICON = $$BASEDIR/images/icons/macx.icns
78 79

    # Copy audio files if needed
80
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/qgroundcontrol.app/Contents/MacOs/.
81

82 83
    exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
    # No check for GLUT.framework since it's a MAC default
84 85
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
86
    DEFINES += QGC_OSG_ENABLED
87
    # Include OpenSceneGraph libraries
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
    INCLUDEPATH += -framework GLUT \
            -framework Carbon \
            -framework OpenThreads \
            -framework osg \
            -framework osgViewer \
            -framework osgGA \
            -framework osgDB \
            -framework osgText \
            -framework osgWidget

    LIBS += -framework GLUT \
            -framework Carbon \
            -framework OpenThreads \
            -framework osg \
            -framework osgViewer \
            -framework osgGA \
            -framework osgDB \
            -framework osgText \
            -framework osgWidget
107
    }
108 109 110 111 112

    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
113 114 115 116 117 118 119 120 121 122 123 124
    INCLUDEPATH += -framework GDAL \
            $$IN_PWD/lib/mac32-gcc/include \
            -framework GEOS \
            -framework SQLite3 \
            -framework osgFX \
            -framework osgTerrain

    LIBS += -framework GDAL \
            -framework GEOS \
            -framework SQLite3 \
            -framework osgFX \
            -framework osgTerrain \
125 126 127
    DEFINES += QGC_OSGEARTH_ENABLED
    }

128
    exists(/opt/local/include/libfreenect) {
129 130 131 132 133 134
    message("Building support for libfreenect")
    DEPENDENCIES_PRESENT += libfreenect
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }
135 136 137

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
138
    #QMAKE_CXXFLAGS += -Wl,-E
Hugo Vincent's avatar
Hugo Vincent committed
139 140 141
}

# GNU/Linux
142
linux-g++ {
143

Hugo Vincent's avatar
Hugo Vincent committed
144
    debug {
145
        DESTDIR = $$BUILDDIR/debug
pixhawk's avatar
pixhawk committed
146
        CONFIG += debug
Hugo Vincent's avatar
Hugo Vincent committed
147 148 149
    }

    release {
150
        DESTDIR = $$BUILDDIR/release
Hugo Vincent's avatar
Hugo Vincent committed
151
    }
152 153 154

    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.

155
    INCLUDEPATH += /usr/include \
pixhawk's avatar
pixhawk committed
156
                   /usr/include/qt4/phonon
lm's avatar
lm committed
157 158
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang
159

Hugo Vincent's avatar
Hugo Vincent committed
160

pixhawk's avatar
pixhawk committed
161 162
    message(Building for GNU/Linux 32bit/i386)

163 164 165
    LIBS += \
        -L/usr/lib \
        -lm \
166
        -lflite_cmu_us_kal \
167 168 169 170
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
pixhawk's avatar
pixhawk committed
171
        -lSDLmain
172

173 174 175 176 177 178 179
    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg
    DEFINES += QGC_OSG_ENABLED
    }
180

181
    exists(/usr/include/osgEarth) | exists(/usr/local/include/osgEarth) {
182 183 184 185
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    LIBS += -losgViewer \
186 187
            -losgEarth \
            -losgEarthUtil
188 189
    DEFINES += QGC_OSGEARTH_ENABLED
    }
190

191
    exists(/usr/local/include/libfreenect) {
192
    message("Building support for libfreenect")
193
    DEPENDENCIES_PRESENT += libfreenect
194
    INCLUDEPATH += /usr/include/libusb-1.0
195 196 197 198 199
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }

200 201 202 203 204
    QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
    QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
    QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug/.
    QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release/.

205 206
    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
207
    QMAKE_CXXFLAGS += -Wl,-E
208 209 210 211 212
}

linux-g++-64 {

    debug {
213
        DESTDIR = $$BUILDDIR/debug
pixhawk's avatar
pixhawk committed
214
        CONFIG += debug
215 216 217
    }

    release {
218
        DESTDIR = $$BUILDDIR/release
219
    }
220 221

    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
pixhawk's avatar
pixhawk committed
222

223 224 225 226 227 228
    INCLUDEPATH += /usr/include \
                   /usr/include/qt4/phonon
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang


pixhawk's avatar
pixhawk committed
229 230 231
    # 64-bit Linux
    message(Building for GNU/Linux 64bit/x64 (g++-64))

232 233 234
    LIBS += \
        -L/usr/lib \
        -lm \
235
        -lflite_cmu_us_kal \
236 237 238
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
Hugo Vincent's avatar
Hugo Vincent committed
239
        -lSDL \
pixhawk's avatar
pixhawk committed
240
        -lSDLmain
241

242 243 244 245 246 247 248 249 250 251 252 253 254
    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg
    DEFINES += QGC_OSG_ENABLED
    }

    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    LIBS += -losgViewer \
255 256
            -losgEarth \
            -losgEarthUtil
257 258 259 260 261 262
    DEFINES += QGC_OSGEARTH_ENABLED
    }

    exists(/usr/local/include/libfreenect) {
    message("Building support for libfreenect")
    DEPENDENCIES_PRESENT += libfreenect
263
    INCLUDEPATH += /usr/include/libusb-1.0
264 265 266 267
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }
pixhawk's avatar
pixhawk committed
268

269 270
    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
271
    QMAKE_CXXFLAGS += -Wl,-E
Hugo Vincent's avatar
Hugo Vincent committed
272 273
}

274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
# Windows (32bit)
win32-msvc2008 {

    message(Building for Windows Visual Studio 2008 (32bit))

    # Special settings for debug
    #CONFIG += CONSOLE

    INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \
                   $$BASEDIR/lib/opal/include \
                   $$BASEDIR/lib/msinttypes
                   #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"

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

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
    QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/. &&
    QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$TARGETDIR/debug/. &&
lm's avatar
lm committed
296 297 298
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$TARGETDIR/release/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/models $$TARGETDIR/debug/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/models $$TARGETDIR/release/.
299 300 301 302

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += /Wl /E
303
}
Hugo Vincent's avatar
Hugo Vincent committed
304

pixhawk's avatar
pixhawk committed
305
# Windows (32bit)
306
win32-g++ {
Hugo Vincent's avatar
Hugo Vincent committed
307

pixhawk's avatar
pixhawk committed
308
    message(Building for Windows Platform (32bit))
Hugo Vincent's avatar
Hugo Vincent committed
309 310
    
    # Special settings for debug
Hugo Vincent's avatar
Hugo Vincent committed
311
    #CONFIG += CONSOLE
unknown's avatar
unknown committed
312

313 314
    INCLUDEPATH += $$BASEDIR/lib/sdl/include \
                   $$BASEDIR/lib/opal/include #\ #\
pixhawk's avatar
pixhawk committed
315
                   #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
Hugo Vincent's avatar
Hugo Vincent committed
316

317
    LIBS += -L$$BASEDIR/lib/sdl/win32 \
unknown's avatar
unknown committed
318 319 320 321
             -lmingw32 -lSDLmain -lSDL -mwindows



Hugo Vincent's avatar
Hugo Vincent committed
322
    debug {
323
        DESTDIR = $$BUILDDIR/debug
Hugo Vincent's avatar
Hugo Vincent committed
324 325 326
    }

    release {
327
        DESTDIR = $$BUILDDIR/release
Hugo Vincent's avatar
Hugo Vincent committed
328 329
    }
        
330
    RC_FILE = $$BASEDIR/qgroundcontrol.rc
331 332

    # Copy dependencies
333 334
    QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/debug/. &&
    QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/release/. &&
lm's avatar
lm committed
335 336 337 338
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$TARGETDIR/debug/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$TARGETDIR/release/.
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/models $$TARGETDIR/debug/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/models $$TARGETDIR/release/.
339 340 341

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
342
    QMAKE_CXXFLAGS += -Wl,-E
Hugo Vincent's avatar
Hugo Vincent committed
343 344
}

pixhawk's avatar
pixhawk committed
345
# Windows (64bit)
346
win64-g++ {
347

pixhawk's avatar
pixhawk committed
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
    message(Building for Windows Platform (64bit))

    # Special settings for debug
    #CONFIG += CONSOLE

    INCLUDEPATH += $$BASEDIR\lib\sdl\include \
                   $$BASEDIR\lib\opal\include #\ #\
                   #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"

    LIBS += -L$$BASEDIR\lib\sdl\win32 \
             -lmingw32 -lSDLmain -lSDL -mwindows



    debug {
        DESTDIR = $$BASEDIR/bin
    }

    release {
        DESTDIR = $$BASEDIR/bin
    }

    RC_FILE = $$BASEDIR/qgroundcontrol.rc
371 372

    # Copy dependencies
373 374 375 376
    QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/debug/. &&
    QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/release/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$BUILDDIR/debug/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$BUILDDIR/release/.
377

378 379
    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
380
    QMAKE_CXXFLAGS += -Wl,-E
pixhawk's avatar
pixhawk committed
381
}