qgroundcontrol.pri 14.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#-------------------------------------------------
#
# QGroundControl - Micro Air Vehicle Groundstation
#
# Please see our website at <http://qgroundcontrol.org>
#
# Author:
# Lorenz Meier <mavteam@student.ethz.ch>
#
# (c) 2009-2010 PIXHAWK Team
#
# This file is part of the mav groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# 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.
# QGroundControl is distributed in the hope that it will be useful,
# 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
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------

pixhawk's avatar
pixhawk committed
26

27 28 29 30 31
#$$BASEDIR/lib/qextserialport/include
#               $$BASEDIR/lib/openjaus/libjaus/include \
#               $$BASEDIR/lib/openjaus/libopenJaus/include

message(Qt version $$[QT_VERSION])
32
message(Using Qt from $$[QTDIR])
33 34 35 36 37 38 39 40

release {
#    DEFINES += QT_NO_DEBUG_OUTPUT
#    DEFINES += QT_NO_WARNING_OUTPUT
}

QMAKE_POST_LINK += echo "Copying files"

41 42 43
# Turn off serial port warnings
DEFINES += _TTY_NOWARN_

44 45 46 47
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.

# MAC OS X
pixhawk's avatar
pixhawk committed
48
macx {
49

50
   # COMPILER_VERSION = $$system(gcc -v)
lm's avatar
lm committed
51
    #message(Using compiler $$COMPILER_VERSION)
52

53 54 55
        CONFIG += x86 cocoa phonon
        CONFIG -= x86_64

56 57
    #HARDWARE_PLATFORM = $$system(uname -a)
    #contains( $$HARDWARE_PLATFORM, "9.6.0" ) || contains( $$HARDWARE_PLATFORM, "9.7.0" ) || contains( $$HARDWARE_PLATFORM, "9.8.0" ) || contains( $$HARDWARE_PLATFORM, "9.9.0" ) {
58
        # x86 Mac OS X Leopard 10.5 and earlier
59

lm's avatar
lm committed
60
        #message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
61 62

                # Enable function-profiling with the OS X saturn tool
63
                #debug {
64 65
                        #QMAKE_CXXFLAGS += -finstrument-functions
                        #LIBS += -lSaturn
66 67 68
                       # CONFIG += console
                #}
    #} else {
69
        # x64 Mac OS X Snow Leopard 10.6 and later
70
     #   CONFIG += x86_64 x86 cocoa phonon
lm's avatar
lm committed
71 72
        #CONFIG -= x86 # phonon
        #message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
73
      #          debug {
74 75 76
                        #QMAKE_CXXFLAGS += -finstrument-functions
                        #LIBS += -lSaturn
                        CONFIG += console
77 78
      #          }
    #}
79 80 81 82 83 84 85 86 87 88 89

    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5

    #DESTDIR = $$BASEDIR/bin/mac
    INCLUDEPATH += -framework SDL

    LIBS += -framework IOKit \
        -framework SDL \
        -framework CoreFoundation \
        -framework ApplicationServices \
        -lm
pixhawk's avatar
pixhawk committed
90

91 92 93
    ICON = $$BASEDIR/images/icons/macx.icns

    # Copy audio files if needed
94
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
95
    # Copy google earth starter file
96
    QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
97
    # Copy CSS stylesheets
98 99
    QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-mission.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/style-indoor.css
    QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-outdoor.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
100
    # Copy model files
101
    #QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 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

    exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
    # No check for GLUT.framework since it's a MAC default
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    DEFINES += QGC_OSG_ENABLED
    # Include OpenSceneGraph libraries
    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
    }

    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    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
    DEFINES += QGC_OSGEARTH_ENABLED
    }


    exists(/opt/local/include/libfreenect) {
    message("Building support for libfreenect")
    DEPENDENCIES_PRESENT += libfreenect
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    #QMAKE_CXXFLAGS += -Wl,-E
}

# GNU/Linux
linux-g++ {

    debug {
167
        DESTDIR = $$TARGETDIR/debug
168
        CONFIG += debug console
169 170 171
    }

    release {
172
        DESTDIR = $$TARGETDIR/release
173
        DEFINES += QT_NO_DEBUG
174
        CONFIG -= console
175 176 177 178
    }

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

INIDETAM's avatar
INIDETAM committed
179 180
message("Compiling for linux 32")

181
    INCLUDEPATH += /usr/include \
INIDETAM's avatar
INIDETAM committed
182
                   /usr/local/include \
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
                   /usr/include/qt4/phonon
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang


    message(Building for GNU/Linux 32bit/i386)

    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg \
James Goppert's avatar
James Goppert committed
205 206 207 208 209 210
            -losgViewer \
            -losgGA \
            -losgDB \
            -losgText \
            -lOpenThreads

211 212 213
    DEFINES += QGC_OSG_ENABLED
    }

214
    exists(/usr/include/osgEarth):exists(/usr/include/osg) | exists(/usr/local/include/osgEarth):exists(/usr/include/osg) {
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    LIBS += -losgEarth \
            -losgEarthUtil
    DEFINES += QGC_OSGEARTH_ENABLED
    }

    exists(/usr/local/include/libfreenect/libfreenect.h) {
    message("Building support for libfreenect")
    DEPENDENCIES_PRESENT += libfreenect
    INCLUDEPATH += /usr/include/libusb-1.0
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }

232 233 234 235
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
    QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
236 237 238 239 240 241 242 243 244

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += -Wl,-E
}

linux-g++-64 {

    debug {
245
        DESTDIR = $$TARGETDIR/debug
246
        CONFIG += debug console
247 248 249
    }

    release {
250
        DESTDIR = $$TARGETDIR/release
251
        DEFINES += QT_NO_DEBUG
252
        CONFIG -= console
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
    }

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

    INCLUDEPATH += /usr/include \
                   /usr/include/qt4/phonon
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang


    # 64-bit Linux
    message(Building for GNU/Linux 64bit/x64 (g++-64))

    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg \
James Goppert's avatar
James Goppert committed
281 282 283 284 285 286
            -losgViewer \
            -losgGA \
            -losgDB \
            -losgText \
            -lOpenThreads

287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
    DEFINES += QGC_OSG_ENABLED
    }

    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    LIBS += -losgEarth \
            -losgEarthUtil
    DEFINES += QGC_OSGEARTH_ENABLED
    }

    exists(/usr/local/include/libfreenect) {
    message("Building support for libfreenect")
    DEPENDENCIES_PRESENT += libfreenect
    INCLUDEPATH += /usr/include/libusb-1.0
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }

308 309 310 311 312
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
    QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf

313 314 315 316 317 318 319 320 321 322
    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += -Wl,-E
}

# Windows (32bit)
win32-msvc2008 {

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

323 324
    # QAxContainer support is needed for the Internet Control
    # element showing the Google Earth window
325 326
    CONFIG += qaxcontainer

327 328 329 330
    # The EIGEN library needs this define
    # to make the internal min/max functions work
    DEFINES += NOMINMAX

lm's avatar
lm committed
331 332 333
    # QWebkit is not needed on MS-Windows compilation environment
    CONFIG -= webkit

334 335
    release {
        CONFIG -= console
336
        DEFINES += QT_NO_DEBUG
337 338
    }

339 340 341
    debug {
		CONFIG += console
	}
342 343 344 345 346 347 348

    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 \
349 350
             -lSDLmain -lSDL \
			 -lsetupapi
351 352 353 354 355 356 357 358 359 360 361

exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg

# Include OpenSceneGraph and osgEarth libraries
INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \
    $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include
LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \
    -losg \
    -losgViewer \
James Goppert's avatar
James Goppert committed
362 363 364 365
    -losgGA \
    -losgDB \
    -losgText \
    -lOpenThreads
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
DEFINES += QGC_OSG_ENABLED
exists($$BASEDIR/lib/osgEarth123) {
    DEPENDENCIES_PRESENT += osgearth
    message("Building support for osgEarth")
    DEFINES += QGC_OSGEARTH_ENABLED
    LIBS += -L$$BASEDIR/lib/osgEarth/win32/lib \
        -losgEarth \
        -losgEarthUtil
}
}

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

383 384 385 386 387
    exists($$TARGETDIR/debug) {
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\debug\\audio\\\" /S /E /Y
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\\\" /S /E /Y
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\debug\\earth.html\"
388 389
    }

390
    exists($$TARGETDIR/release) {
391
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\release\\SDL.dll\"
392 393 394
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\release\\audio\\\" /S /E /Y
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\release\\models\\\" /S /E /Y
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\release\\earth.html\"
395 396 397 398 399 400 401 402
    }

}

# Windows (32bit)
win32-g++ {

    message(Building for Windows Platform (32bit))
pixhawk's avatar
pixhawk committed
403

404
    # Special settings for debug
405 406
    CONFIG += CONSOLE
    OUTPUT += CONSOLE
407

LM's avatar
LM committed
408 409 410 411
    # The EIGEN library needs this define
    # to make the internal min/max functions work
    DEFINES += NOMINMAX

412 413 414 415 416
    INCLUDEPATH += $$BASEDIR/lib/sdl/include \
                   $$BASEDIR/lib/opal/include #\ #\
                   #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"

    LIBS += -L$$BASEDIR/lib/sdl/win32 \
417 418
             -lmingw32 -lSDLmain -lSDL -mwindows \
			 -lsetupapi
419

420 421
    CONFIG += windows

422 423 424 425


    debug {
        #DESTDIR = $$BUILDDIR/debug
James Goppert's avatar
James Goppert committed
426
    CONFIG += console
427 428 429
    }

    release {
430
        CONFIG -= console
431
        DEFINES += QT_NO_DEBUG
432 433
        #DESTDIR = $$BUILDDIR/release
    }
pixhawk's avatar
pixhawk committed
434

435 436 437 438
    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies

439 440 441
    system(cp): {
    # CP command is available, use it instead of copy / xcopy
    message("Using cp to copy image and audio files to executable")
442 443 444 445 446 447 448 449 450 451 452 453
    debug {
        QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
        QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/debug/audio
        QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/debug/models
    }

    release {
        QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/SDL.dll
        QMAKE_POST_LINK += && cp -r $$BASEDIR/audio $$TARGETDIR/release/audio
        QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
    }

454 455 456 457 458 459
    } else {
    # No cp command available, go for copy / xcopy
    # Copy dependencies
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

460
    exists($$TARGETDIR/debug) {
461
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
462 463 464
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\debug\\audio\\\" /S /E /Y
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\\\" /S /E /Y
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\debug\\earth.html\"
465 466
    }

467
    exists($$TARGETDIR/release) {
468
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\release\\SDL.dll\"
469 470 471
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\audio\" \"$$TARGETDIR_WIN\\release\\audio\\\" /S /E /Y
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\release\\models\\\" /S /E /Y
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\release\\earth.html\"
472 473 474 475
    }

}

476 477 478 479
    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += -Wl,-E
}
James Goppert's avatar
James Goppert committed
480
# vim:ts=4:sw=4:expandtab