qgroundcontrol.pri 12 KB
Newer Older
pixhawk's avatar
pixhawk committed
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 26 27 28 29 30 31 32 33 34 35 36
#-------------------------------------------------
#
# 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/>.
#
#-------------------------------------------------

#$$BASEDIR/lib/qextserialport/include
#               $$BASEDIR/lib/openjaus/libjaus/include \
#               $$BASEDIR/lib/openjaus/libopenJaus/include

message(Qt version $$[QT_VERSION])

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

37
QMAKE_POST_LINK += echo "Copying files"
pixhawk's avatar
pixhawk committed
38

39 40
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/.
#QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/.
pixhawk's avatar
pixhawk committed
41

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

pixhawk's avatar
pixhawk committed
45 46 47
    COMPILER_VERSION = system(gcc -v)
    message(Using compiler $$COMPILER_VERSION)

pixhawk's avatar
pixhawk committed
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 53 54 55 56 57 58 59 60 61 62 63 64 65
        # 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)

                # Enable function-profiling with the OS X saturn tool
                debug {
                        #QMAKE_CXXFLAGS += -finstrument-functions
                        #LIBS += -lSaturn
                }
    } else {
        # x64 Mac OS X Snow Leopard 10.6 and later
        CONFIG += x86_64 cocoa
        CONFIG -= x86 phonon
        message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
    }

pixhawk's avatar
pixhawk committed
66
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
pixhawk's avatar
pixhawk committed
67

68
    #DESTDIR = $$BASEDIR/bin/mac
pixhawk's avatar
pixhawk committed
69
    INCLUDEPATH += -framework SDL
pixhawk's avatar
pixhawk committed
70 71 72 73 74 75 76 77 78 79

    LIBS += -framework IOKit \
        -framework SDL \
        -framework CoreFoundation \
        -framework ApplicationServices \
        -lm
    
    ICON = $$BASEDIR/images/icons/macx.icns

    # Copy audio files if needed
lm's avatar
lm committed
80
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
pixhawk's avatar
pixhawk committed
81
    # Copy google earth starter file
lm's avatar
lm committed
82
    QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
83
    # Copy model files
lm's avatar
lm committed
84
    #QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
pixhawk's avatar
pixhawk committed
85

pixhawk's avatar
pixhawk committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
    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")
pixhawk's avatar
pixhawk committed
115
    DEPENDENCIES_PRESENT += osgearth
pixhawk's avatar
pixhawk committed
116 117 118 119 120 121 122 123 124 125 126 127
    # 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 \
128
            -framework osgTerrain
pixhawk's avatar
pixhawk committed
129 130 131
    DEFINES += QGC_OSGEARTH_ENABLED
    }

132

pixhawk's avatar
pixhawk committed
133 134 135 136 137 138
    exists(/opt/local/include/libfreenect) {
    message("Building support for libfreenect")
    DEPENDENCIES_PRESENT += libfreenect
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
pixhawk's avatar
pixhawk committed
139
    }
pixhawk's avatar
pixhawk committed
140 141 142 143

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

# GNU/Linux
linux-g++ {
pixhawk's avatar
pixhawk committed
148

pixhawk's avatar
pixhawk committed
149
    debug {
150
        #DESTDIR = $$BUILDDIR/debug
pixhawk's avatar
pixhawk committed
151
        CONFIG += debug
pixhawk's avatar
pixhawk committed
152 153 154
    }

    release {
155
        #DESTDIR = $$BUILDDIR/release
pixhawk's avatar
pixhawk committed
156 157
    }

158
    QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
pixhawk's avatar
pixhawk committed
159 160 161 162 163 164 165

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


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

pixhawk's avatar
pixhawk committed
168 169 170 171 172 173 174 175 176 177
    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

pixhawk's avatar
pixhawk committed
178 179 180 181
    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
Lionel Heng's avatar
Lionel Heng committed
182 183
    LIBS += -losg \
            -losgViewer
pixhawk's avatar
pixhawk committed
184 185 186 187 188 189 190
    DEFINES += QGC_OSG_ENABLED
    }

    exists(/usr/include/osgEarth) | exists(/usr/local/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
Lionel Heng's avatar
Lionel Heng committed
191
    LIBS += -losgEarth \
pixhawk's avatar
pixhawk committed
192 193 194 195 196 197 198 199 200 201 202 203 204
            -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
    }

205
    debug {
lm's avatar
lm committed
206 207
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug
208 209 210
    }

    release {
lm's avatar
lm committed
211 212
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release
213
    }
pixhawk's avatar
pixhawk committed
214 215 216 217

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += -Wl,-E
pixhawk's avatar
pixhawk committed
218 219 220 221 222
}

linux-g++-64 {

    debug {
223
        #DESTDIR = $$BUILDDIR/debug
pixhawk's avatar
pixhawk committed
224
        CONFIG += debug
pixhawk's avatar
pixhawk committed
225 226 227
    }

    release {
228
        #DESTDIR = $$BUILDDIR/release
pixhawk's avatar
pixhawk committed
229 230
    }

231
    QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
pixhawk's avatar
pixhawk committed
232

pixhawk's avatar
pixhawk committed
233 234 235 236 237 238
    INCLUDEPATH += /usr/include \
                   /usr/include/qt4/phonon
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang


pixhawk's avatar
pixhawk committed
239 240 241
    # 64-bit Linux
    message(Building for GNU/Linux 64bit/x64 (g++-64))

pixhawk's avatar
pixhawk committed
242 243 244 245 246 247 248 249 250 251
    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

pixhawk's avatar
pixhawk committed
252 253 254 255
    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
Lionel Heng's avatar
Lionel Heng committed
256 257
    LIBS += -losg \
            -losgViewer
pixhawk's avatar
pixhawk committed
258 259 260 261 262 263 264
    DEFINES += QGC_OSG_ENABLED
    }

    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
Lionel Heng's avatar
Lionel Heng committed
265
    LIBS += -losgEarth \
pixhawk's avatar
pixhawk committed
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
            -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
    }

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += -Wl,-E
pixhawk's avatar
pixhawk committed
282 283 284 285 286 287 288
}

# Windows (32bit)
win32-msvc2008 {

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

289 290
    CONFIG += qaxcontainer

pixhawk's avatar
pixhawk committed
291 292 293 294 295 296 297 298 299 300 301
    # 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

pixhawk's avatar
pixhawk committed
302 303 304 305
exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg

pixhawk's avatar
pixhawk committed
306 307 308
# Include OpenSceneGraph and osgEarth libraries
INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \
    $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include
pixhawk's avatar
pixhawk committed
309
LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \
pixhawk's avatar
pixhawk committed
310 311 312 313 314
    -losg \
    -losgViewer \
	-losgGA \
	-losgDB \
	-losgText \
pixhawk's avatar
pixhawk committed
315
        -lOpenThreads
pixhawk's avatar
pixhawk committed
316
DEFINES += QGC_OSG_ENABLED
pixhawk's avatar
pixhawk committed
317 318 319 320 321 322 323 324 325
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
}
}
pixhawk's avatar
pixhawk committed
326 327 328 329

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
330 331
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
pixhawk's avatar
pixhawk committed
332

333 334 335 336 337 338
    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/images/earth.html $$TARGETDIR_WIN\debug\"
    }
pixhawk's avatar
pixhawk committed
339

340 341 342 343 344 345
    release {
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
        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/images/earth.html $$TARGETDIR_WIN\release\"
    }
pixhawk's avatar
pixhawk committed
346

pixhawk's avatar
pixhawk committed
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366
}

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

    message(Building for Windows Platform (32bit))
    
    # 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 {
367
        #DESTDIR = $$BUILDDIR/debug
pixhawk's avatar
pixhawk committed
368 369 370
    }

    release {
371
        #DESTDIR = $$BUILDDIR/release
pixhawk's avatar
pixhawk committed
372 373 374 375 376
    }
        
    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
377

378 379 380 381 382 383 384 385 386 387 388
    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
    }
pixhawk's avatar
pixhawk committed
389 390 391 392

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