qgroundcontrol.pri 9.13 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 37 38

# MAC OS X
macx { 
39

40
    HARDWARE_PLATFORM = $$system(uname -a)
41
    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
42 43 44
        # 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)
45

46 47
                # Enable function-profiling with the OS X saturn tool
                debug {
48 49
                        #QMAKE_CXXFLAGS += -finstrument-functions
                        #LIBS += -lSaturn
50
                }
pixhawk's avatar
pixhawk committed
51
    } else {
52 53
        # x64 Mac OS X Snow Leopard 10.6 and later
        CONFIG += x86_64 cocoa
pixhawk's avatar
pixhawk committed
54
        CONFIG -= x86 phonon
55
        message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
56
    }
Hugo Vincent's avatar
Hugo Vincent committed
57

58
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
Hugo Vincent's avatar
Hugo Vincent committed
59 60 61

    DESTDIR = $$BASEDIR/bin/mac
    INCLUDEPATH += -framework SDL \
62
        $$BASEDIR/../mavlink/contrib/slugs/include \
lm's avatar
lm committed
63
        $$BASEDIR/../mavlink/include
Hugo Vincent's avatar
Hugo Vincent committed
64 65

    LIBS += -framework IOKit \
Hugo Vincent's avatar
Hugo Vincent committed
66 67 68
        -framework SDL \
        -framework CoreFoundation \
        -framework ApplicationServices \
pixhawk's avatar
pixhawk committed
69
 #       -framework GLUT \
Hugo Vincent's avatar
Hugo Vincent committed
70 71 72
        -lm
    
    ICON = $$BASEDIR/images/icons/macx.icns
73 74

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

77 78 79 80 81
    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg
82
    }
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

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

    exists(/usr/local/include/libfreenect) {
    message("Building support for libfreenect")
    DEPENDENCIES_PRESENT += libfreenect
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }
Hugo Vincent's avatar
Hugo Vincent committed
100 101 102
}

# GNU/Linux
103
linux-g++ {
104 105

    CONFIG += debug
Hugo Vincent's avatar
Hugo Vincent committed
106 107
    
    debug {
108
        DESTDIR = $$BUILDDIR/debug
Hugo Vincent's avatar
Hugo Vincent committed
109 110 111
    }

    release {
112
        DESTDIR = $$BUILDDIR/release
Hugo Vincent's avatar
Hugo Vincent committed
113
    }
114 115 116

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

117
    INCLUDEPATH += /usr/include \
pixhawk's avatar
pixhawk committed
118
                   /usr/include/qt4/phonon
lm's avatar
lm committed
119 120
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang
121

Hugo Vincent's avatar
Hugo Vincent committed
122

123
    HARDWARE_PLATFORM = $$system(uname -a)
Hugo Vincent's avatar
Hugo Vincent committed
124 125
    contains( HARDWARE_PLATFORM, x86_64 ) {
        # 64-bit Linux
lm's avatar
lm committed
126 127
        #LIBS += \
            #-L$$BASEDIR/lib/flite/linux64
128
        message(Building for GNU/Linux 64bit/x64)
Hugo Vincent's avatar
Hugo Vincent committed
129 130
    } else {
        # 32-bit Linux
lm's avatar
lm committed
131 132
        #LIBS += \
           #-L$$BASEDIR/lib/flite/linux32
133
        message(Building for GNU/Linux 32bit/i386)
134
    }
135 136 137
    LIBS += \
        -L/usr/lib \
        -lm \
138
        -lflite_cmu_us_kal \
139 140 141 142
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
pixhawk's avatar
pixhawk committed
143
        -lSDLmain
144

145 146 147 148 149 150 151
    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg
    DEFINES += QGC_OSG_ENABLED
    }
152

153 154 155 156 157
    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    LIBS += -losgViewer \
lm's avatar
lm committed
158 159
            -losgEarth \
            -losgEarthUtil
160 161
    DEFINES += QGC_OSGEARTH_ENABLED
    }
162

163
    exists(/usr/local/include/libfreenect) {
164
    message("Building suplocport for libfreenect")
165
    DEPENDENCIES_PRESENT += libfreenect
166
    INCLUDEPATH += /usr/include/libusb-1.0
167 168 169 170 171 172
    # Include libfreenect libraries
    LIBS += -lfreenect
    DEFINES += QGC_LIBFREENECT_ENABLED
    }

    QMAKE_CXXFLAGS += -Wl,-E
pixhawk's avatar
pixhawk committed
173

lm's avatar
lm committed
174 175
        #-lflite_cmu_us_rms \
        #-lflite_cmu_us_slt \
176 177 178 179 180 181
}

linux-g++-64 {
    CONFIG += debug

    debug {
182
        DESTDIR = $$BUILDDIR/debug
183 184 185
    }

    release {
186
        DESTDIR = $$BUILDDIR/release
187
    }
188 189

    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
    INCLUDEPATH += /usr/include \
                   /usr/include/qt4/phonon
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang


    HARDWARE_PLATFORM = $$system(uname -a)
    contains( HARDWARE_PLATFORM, x86_64 ) {
        # 64-bit Linux
        #LIBS += \
            #-L$$BASEDIR/lib/flite/linux64
        message(Building for GNU/Linux 64bit/x64)
    } else {
        # 32-bit Linux
        #LIBS += \
           #-L$$BASEDIR/lib/flite/linux32
        message(Building for GNU/Linux 32bit/i386)
    }
    LIBS += \
        -L/usr/lib \
        -lm \
211
        -lflite_cmu_us_kal \
212 213 214
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
Hugo Vincent's avatar
Hugo Vincent committed
215
        -lSDL \
pixhawk's avatar
pixhawk committed
216
        -lSDLmain
217

218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
    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 \
            -losgEarth
    DEFINES += QGC_OSGEARTH_ENABLED
    }

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

Hugo Vincent's avatar
Hugo Vincent committed
244 245
}

246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
# 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/. &&
    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$TARGETDIR/release/.
}
Hugo Vincent's avatar
Hugo Vincent committed
270

pixhawk's avatar
pixhawk committed
271
# Windows (32bit)
272
win32-g++ {
Hugo Vincent's avatar
Hugo Vincent committed
273

pixhawk's avatar
pixhawk committed
274
    message(Building for Windows Platform (32bit))
Hugo Vincent's avatar
Hugo Vincent committed
275 276
    
    # Special settings for debug
Hugo Vincent's avatar
Hugo Vincent committed
277
    #CONFIG += CONSOLE
unknown's avatar
unknown committed
278

279 280
    INCLUDEPATH += $$BASEDIR/lib/sdl/include \
                   $$BASEDIR/lib/opal/include #\ #\
pixhawk's avatar
pixhawk committed
281
                   #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
Hugo Vincent's avatar
Hugo Vincent committed
282

283
    LIBS += -L$$BASEDIR/lib/sdl/win32 \
unknown's avatar
unknown committed
284 285 286 287
             -lmingw32 -lSDLmain -lSDL -mwindows



Hugo Vincent's avatar
Hugo Vincent committed
288
    debug {
289
        DESTDIR = $$BUILDDIR/debug
Hugo Vincent's avatar
Hugo Vincent committed
290 291 292
    }

    release {
293
        DESTDIR = $$BUILDDIR/release
Hugo Vincent's avatar
Hugo Vincent committed
294 295
    }
        
296
    RC_FILE = $$BASEDIR/qgroundcontrol.rc
297 298

    # Copy dependencies
299 300 301 302
    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/.
Hugo Vincent's avatar
Hugo Vincent committed
303 304
}

pixhawk's avatar
pixhawk committed
305
# Windows (64bit)
306
win64-g++ {
307

pixhawk's avatar
pixhawk committed
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
    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
331 332

    # Copy dependencies
333 334 335 336
    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/.
pixhawk's avatar
pixhawk committed
337
}
338