qgroundcontrol.pri 9.19 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

    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    LIBS += -losgViewer \
89 90
            -losgEarth \
            -losgEarthUtil
91 92 93 94 95 96 97 98 99 100
    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
101 102 103
}

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

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

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

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

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

Hugo Vincent's avatar
Hugo Vincent committed
123

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

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

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

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

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

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

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

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

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

    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
    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 \
212
        -lflite_cmu_us_kal \
213 214 215
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
Hugo Vincent's avatar
Hugo Vincent committed
216
        -lSDL \
pixhawk's avatar
pixhawk committed
217
        -lSDLmain
218

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

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

Hugo Vincent's avatar
Hugo Vincent committed
246 247
}

248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
# 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
272

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

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

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

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



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

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

    # Copy dependencies
301 302 303 304
    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
305 306
}

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

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

    # Copy dependencies
335 336 337 338
    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
339
}
340