qgroundcontrol.pri 25.7 KB
Newer Older
1
# -------------------------------------------------
2 3
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
4 5 6 7
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2011 QGroundControl Developers
# This file is part of the open groundstation project
8 9 10 11 12 13 14 15 16 17
# 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/>.
18
# -------------------------------------------------
19 20

message(Qt version $$[QT_VERSION])
21
message(Using Qt from $$(QTDIR))
22

23

LM's avatar
LM committed
24

25 26 27 28 29
release {
#    DEFINES += QT_NO_DEBUG_OUTPUT
#    DEFINES += QT_NO_WARNING_OUTPUT
}

30 31 32 33 34
win32-msvc2008|win32-msvc2010 {
    QMAKE_POST_LINK += $$quote(echo "Copying files"$$escape_expand(\\n))
} else {
    QMAKE_POST_LINK += $$quote(echo "Copying files")
}
35

36 37 38
# Turn off serial port warnings
DEFINES += _TTY_NOWARN_

39
# MAC OS X
40
macx|macx-g++42|macx-g++: {
41

42
   # COMPILER_VERSION = $$system(gcc -v)
lm's avatar
lm committed
43
    #message(Using compiler $$COMPILER_VERSION)
44

LM's avatar
LM committed
45 46
        CONFIG += x86_64 cocoa phonon
        CONFIG -= x86
47

48 49
    #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" ) {
50
        # x86 Mac OS X Leopard 10.5 and earlier
51

lm's avatar
lm committed
52
        #message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
53 54

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

71
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
72 73 74 75 76 77 78 79 80

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

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

82 83
    ICON = $$BASEDIR/images/icons/macx.icns

84 85
    # Copy contributed files
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
86
    # Copy google earth starter file
87
    QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
88
    # Copy CSS stylesheets
89 90
    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
lm's avatar
lm committed
91 92
    # Copy parameter tooltip files
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
93
    # Copy libraries
94
    QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/qgroundcontrol.app/Contents/libs
LM's avatar
LM committed
95
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/lib/mac64/lib/* $$TARGETDIR/qgroundcontrol.app/Contents/libs
96 97 98 99 100 101 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

    # Fix library paths inside executable
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
    QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
    QMAKE_POST_LINK += && install_name_tool -change libosgViewer.dylib "@executable_path/../libs/libosgViewer.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
    QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
    QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
    QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
    QMAKE_POST_LINK += && install_name_tool -change libosgWidget.dylib "@executable_path/../libs/libosgWidget.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol

    # Fix library paths within libraries (inter-library dependencies)

    # OSG GA LIBRARY
    QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib

    # OSG DB LIBRARY
    QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib

    # OSG TEXT LIBRARY
    QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib

    # OSG UTIL LIBRARY
    QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgUtil.dylib
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgUtil.dylib


    # OSG VIEWER LIBRARY
    QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib

    # OSG WIDGET LIBRARY
    QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
    QMAKE_POST_LINK += && install_name_tool -change libosgViewer.dylib "@executable_path/../libs/libosgViewer.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib

    # CORE OSG LIBRARY
    QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosg.dylib


154
    # Copy model files
155
    #QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
156

157
    #exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
158 159 160 161 162 163
    # 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 \
164
            -framework Cocoa \
LM's avatar
LM committed
165
            $$BASEDIR/lib/mac64/include
166 167

    LIBS += -framework GLUT \
168
            -framework Cocoa \
LM's avatar
LM committed
169
            -L$$BASEDIR/lib/mac64/lib \
170 171 172 173 174 175 176 177
            -lOpenThreads \
            -losg \
            -losgViewer \
            -losgGA \
            -losgDB \
            -losgText \
            -losgWidget
    #}
178

LM's avatar
LM committed
179 180 181 182 183 184 185 186 187 188 189 190
    exists(/usr/local/include/google/protobuf) {
    message("Building support for Protocol Buffers")
    DEPENDENCIES_PRESENT += protobuf
    # Include Protocol Buffers libraries
    LIBS += -L/usr/local/lib \
            -lprotobuf \
            -lprotobuf-lite \
            -lprotoc

    DEFINES += QGC_PROTOBUF_ENABLED
    }

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

# GNU/Linux
linux-g++ {

203 204
    CONFIG -= console

205
    debug {
206 207
        #DESTDIR = $$TARGETDIR/debug
        #CONFIG += debug console
208 209 210
    }

    release {
211
        #DESTDIR = $$TARGETDIR/release
212
        DEFINES += QT_NO_DEBUG
213
        #CONFIG -= console
214 215
    }

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

INIDETAM's avatar
INIDETAM committed
218 219
message("Compiling for linux 32")

220
    INCLUDEPATH += /usr/include \
INIDETAM's avatar
INIDETAM committed
221
                   /usr/local/include \
222 223 224 225 226 227 228
                   /usr/include/qt4/phonon


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

    LIBS += \
        -L/usr/lib \
hengli's avatar
hengli committed
229
        -L/usr/local/lib64 \
230 231 232 233 234 235 236 237
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

hengli's avatar
hengli committed
238
    exists(/usr/include/osg) | exists(/usr/local/include/osg) {
239 240 241 242
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg \
James Goppert's avatar
James Goppert committed
243 244 245 246 247 248
            -losgViewer \
            -losgGA \
            -losgDB \
            -losgText \
            -lOpenThreads

249
    DEFINES += QGC_OSG_ENABLED
Lorenz Meier's avatar
Lorenz Meier committed
250 251 252 253 254 255
    }

    exists(/usr/include/osg/osgQt) | exists(/usr/local/include/osg/osgQt) {
    message("Building support for OpenSceneGraph")
    # Include OpenSceneGraph Qt libraries
    LIBS += -losgQt
256
    DEFINES += QGC_OSG_QT_ENABLED
257 258
    }

259 260 261 262 263 264 265 266 267 268 269
    exists(/usr/local/include/google/protobuf) {
    message("Building support for Protocol Buffers")
    DEPENDENCIES_PRESENT += protobuf
    # Include Protocol Buffers libraries
    LIBS += -lprotobuf \
            -lprotobuf-lite \
            -lprotoc

    DEFINES += QGC_PROTOBUF_ENABLED
    }

270 271 272 273 274 275 276 277 278
    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
    }

279
    # Validated copy commands
pixhawk's avatar
pixhawk committed
280
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR
281

pixhawk's avatar
pixhawk committed
282 283 284
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR
    QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/images
    QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/images/Vera.ttf
285 286 287 288 289 290 291 292

    # 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 {

293 294
    CONFIG -= console

295
    debug {
296 297
        #DESTDIR = $$TARGETDIR/debug
        #CONFIG += debug console
298 299 300
    }

    release {
301
        #DESTDIR = $$TARGETDIR/release
302
        DEFINES += QT_NO_DEBUG
303
        #CONFIG -= console
304 305
    }

306
    #QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
307 308 309 310 311 312 313 314 315 316

    INCLUDEPATH += /usr/include \
                   /usr/include/qt4/phonon


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

    LIBS += \
        -L/usr/lib \
hengli's avatar
hengli committed
317
        -L/usr/local/lib64 \
318 319 320 321 322 323 324 325
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

hengli's avatar
hengli committed
326
    exists(/usr/include/osg) | exists(/usr/local/include/osg) {
327 328 329 330
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg \
James Goppert's avatar
James Goppert committed
331 332 333 334 335
            -losgViewer \
            -losgGA \
            -losgDB \
            -losgText \
            -lOpenThreads
336

337 338 339 340
    exists(/usr/local/lib64) {
    LIBS += -L/usr/local/lib64
    }

341
    DEFINES += QGC_OSG_ENABLED
Lorenz Meier's avatar
Lorenz Meier committed
342 343 344 345 346 347
    }

    exists(/usr/include/osg/osgQt) | exists(/usr/local/include/osg/osgQt) {
    message("Building support for OpenSceneGraph")
    # Include OpenSceneGraph Qt libraries
    LIBS += -losgQt
348
    DEFINES += QGC_OSG_QT_ENABLED
349 350
    }

351 352 353 354 355 356 357 358 359 360 361
    exists(/usr/local/include/google/protobuf) {
    message("Building support for Protocol Buffers")
    DEPENDENCIES_PRESENT += protobuf
    # Include Protocol Buffers libraries
    LIBS += -lprotobuf \
            -lprotobuf-lite \
            -lprotoc

    DEFINES += QGC_PROTOBUF_ENABLED
    }

362 363 364 365 366 367 368 369 370
    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
    }

371
    # Validated copy commands
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
    debug {
        !exists($$TARGETDIR/debug){
             QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/debug
        }
        DESTDIR = $$TARGETDIR/debug
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/debug
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug
        QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/debug/images
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/debug/images/Vera.ttf
    }
    release {
        !exists($$TARGETDIR/release){
             QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/release
        }
        DESTDIR = $$TARGETDIR/release
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/release
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release
        QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/release/images
        QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/release/images/Vera.ttf
    }
392

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

# Windows (32bit)
Franz's avatar
Franz committed
399
win32-msvc2008|win32-msvc2010 {
400

Franz's avatar
Franz committed
401
    win32-msvc2008 {
402
    message(Building for Windows Visual Studio 2008 (32bit))
Franz's avatar
Franz committed
403 404 405 406
    }
    win32-msvc2010 {
    message(Building for Windows Visual Studio 2010 (32bit))
    }
407

408 409
    # QAxContainer support is needed for the Internet Control
    # element showing the Google Earth window
410 411
    CONFIG += qaxcontainer

412 413 414 415
    # The EIGEN library needs this define
    # to make the internal min/max functions work
    DEFINES += NOMINMAX

lm's avatar
lm committed
416 417 418
    # QWebkit is not needed on MS-Windows compilation environment
    CONFIG -= webkit

419 420
    release {
        CONFIG -= console
421
        DEFINES += QT_NO_DEBUG
422 423
    }

424 425 426
    debug {
		CONFIG += console
	}
427 428 429 430 431 432 433

    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 \
434 435
             -lSDLmain -lSDL \
			 -lsetupapi
436 437 438 439 440

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

441
# Include OpenSceneGraph
442 443 444 445 446
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
447 448 449 450
    -losgGA \
    -losgDB \
    -losgText \
    -lOpenThreads
451 452 453 454 455 456 457 458 459 460
DEFINES += QGC_OSG_ENABLED
}

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

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


461 462 463
    CONFIG(debug, debug|release) {
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
        QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\debug\\files" /E /I $$escape_expand(\\n))
464
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\debug\\models" /E /I $$escape_expand(\\n))
465 466 467 468 469 470 471 472 473 474 475 476 477 478
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\plugins" "$$TARGETDIR_WIN\\debug" /E /I $$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\phonond4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtCored4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtGuid4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtMultimediad4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtNetworkd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtOpenGLd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtSqld4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtSvgd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtWebKitd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmld4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmlPatternsd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
479 480
    }

481 482 483
    CONFIG(release, debug|release) {
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
        QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\release\\files" /E /I $$escape_expand(\\n))
484
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\release\\models" /E /I $$escape_expand(\\n))
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\release\\earth.html" $$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\plugins" "$$TARGETDIR_WIN\\release" /E /I $$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\phonon4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtCore4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtGui4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtMultimedia4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtNetwork4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtOpenGL4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtSql4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtSvg4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtWebKit4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXml4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmlPatterns4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(del /F "$$TARGETDIR_WIN\\release\\qgroundcontrol.exp"$$escape_expand(\\n))
		QMAKE_POST_LINK += $$quote(del /F "$$TARGETDIR_WIN\\release\\qgroundcontrol.lib"$$escape_expand(\\n))
501 502 503 504 505 506 507
    }
}

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

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

509
    # Special settings for debug
510 511
    CONFIG += CONSOLE
    OUTPUT += CONSOLE
512

LM's avatar
LM committed
513 514 515 516
    # The EIGEN library needs this define
    # to make the internal min/max functions work
    DEFINES += NOMINMAX

517 518 519 520 521
    INCLUDEPATH += $$BASEDIR/lib/sdl/include \
                   $$BASEDIR/lib/opal/include #\ #\
                   #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"

    LIBS += -L$$BASEDIR/lib/sdl/win32 \
522 523
             -lmingw32 -lSDLmain -lSDL -mwindows \
			 -lsetupapi
524

525 526
    CONFIG += windows

527 528 529 530


    debug {
        #DESTDIR = $$BUILDDIR/debug
James Goppert's avatar
James Goppert committed
531
    CONFIG += console
532 533 534
    }

    release {
535
        CONFIG -= console
536
        DEFINES += QT_NO_DEBUG
537 538
        #DESTDIR = $$BUILDDIR/release
    }
pixhawk's avatar
pixhawk committed
539

540 541 542 543
    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies

544 545 546
    system(cp): {
    # CP command is available, use it instead of copy / xcopy
    message("Using cp to copy image and audio files to executable")
547 548
    debug {
        QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
LM's avatar
LM committed
549
        QMAKE_POST_LINK += && cp -r $$BASEDIR/files $$TARGETDIR/debug/files
550 551 552 553 554
        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
LM's avatar
LM committed
555
        QMAKE_POST_LINK += && cp -r $$BASEDIR/files $$TARGETDIR/release/files
556 557 558
        QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
    }

559 560 561 562 563 564
    } else {
    # No cp command available, go for copy / xcopy
    # Copy dependencies
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

565
    exists($$TARGETDIR/debug) {
566
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
LM's avatar
LM committed
567
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\files\" \"$$TARGETDIR_WIN\\debug\\files\\\" /S /E /Y
568 569
        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\"
570 571
    }

572
    exists($$TARGETDIR/release) {
573
        QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\release\\SDL.dll\"
LM's avatar
LM committed
574
        QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\files\" \"$$TARGETDIR_WIN\\release\\files\\\" /S /E /Y
575 576
        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\"
577 578 579 580
    }

}

581 582 583 584
    # 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
585
# vim:ts=4:sw=4:expandtab