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

    exists(/opt/local/lib/osg):exists("/opt/local/lib/osgEarth") {
    message("Building support for OSGEARTH")
79
    DEPENDENCIES_PRESENT += osgearth
80 81 82 83 84
    LIBS += -L/opt/local/lib/
    INCLUDEPATH += /opt/local/include
    # Include OpenSceneGraph and osgEarth libraries
    LIBS += -losg \
        -losgViewer \
85 86
        -losgEarth \
        -losgEarthUtil
87 88
    DEFINES += QGC_OSG_ENABLED
    }
Hugo Vincent's avatar
Hugo Vincent committed
89 90 91
}

# GNU/Linux
92
linux-g++ {
93 94

    CONFIG += debug
Hugo Vincent's avatar
Hugo Vincent committed
95 96
    
    debug {
97
        DESTDIR = $$BUILDDIR/debug
Hugo Vincent's avatar
Hugo Vincent committed
98 99 100
    }

    release {
101
        DESTDIR = $$BUILDDIR/release
Hugo Vincent's avatar
Hugo Vincent committed
102
    }
103 104 105

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

106
    INCLUDEPATH += /usr/include \
pixhawk's avatar
pixhawk committed
107
                   /usr/include/qt4/phonon
lm's avatar
lm committed
108 109
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang
110

Hugo Vincent's avatar
Hugo Vincent committed
111

112
    HARDWARE_PLATFORM = $$system(uname -a)
Hugo Vincent's avatar
Hugo Vincent committed
113 114
    contains( HARDWARE_PLATFORM, x86_64 ) {
        # 64-bit Linux
lm's avatar
lm committed
115 116
        #LIBS += \
            #-L$$BASEDIR/lib/flite/linux64
117
        message(Building for GNU/Linux 64bit/x64)
Hugo Vincent's avatar
Hugo Vincent committed
118 119
    } else {
        # 32-bit Linux
lm's avatar
lm committed
120 121
        #LIBS += \
           #-L$$BASEDIR/lib/flite/linux32
122
        message(Building for GNU/Linux 32bit/i386)
123
    }
124 125 126
    LIBS += \
        -L/usr/lib \
        -lm \
127
        -lflite_cmu_us_kal \
128 129 130 131
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
pixhawk's avatar
pixhawk committed
132
        -lSDLmain
133

134
exists(/usr/include/osgEarth) | exists(/usr/local/include/osgEarth) {
135
message("Building support for OSGEARTH")
136
DEPENDENCIES_PRESENT += osgearth
137 138 139
# Include OpenSceneGraph and osgEarth libraries
LIBS += -losg \
    -losgViewer \
140 141
    -losgEarth \
    -losgEarthUtil
142 143 144
DEFINES += QGC_OSG_ENABLED
}

145
QMAKE_CXXFLAGS += -Wl,-E, -DUSE_QT4
pixhawk's avatar
pixhawk committed
146

lm's avatar
lm committed
147 148
        #-lflite_cmu_us_rms \
        #-lflite_cmu_us_slt \
149 150 151 152 153 154
}

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

    debug {
155
        DESTDIR = $$BUILDDIR/debug
156 157 158
    }

    release {
159
        DESTDIR = $$BUILDDIR/release
160
    }
161 162

    QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
    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 \
184
        -lflite_cmu_us_kal \
185 186 187
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
Hugo Vincent's avatar
Hugo Vincent committed
188
        -lSDL \
pixhawk's avatar
pixhawk committed
189
        -lSDLmain
190 191 192

exists(/usr/lib/osg):exists(/usr/lib/osgEarth) {
message("Building support for OSGEARTH")
193
DEPENDENCIES_PRESENT += osgearth
194 195 196 197 198 199
# Include OpenSceneGraph and osgEarth libraries
LIBS += -losg \
    -losgViewer \
    -losgEarth
DEFINES += QGC_OSG_ENABLED
}
Hugo Vincent's avatar
Hugo Vincent committed
200 201 202
}


pixhawk's avatar
pixhawk committed
203
# Windows (32bit)
204
win32-g++ {
Hugo Vincent's avatar
Hugo Vincent committed
205

pixhawk's avatar
pixhawk committed
206
    message(Building for Windows Platform (32bit))
Hugo Vincent's avatar
Hugo Vincent committed
207 208
    
    # Special settings for debug
Hugo Vincent's avatar
Hugo Vincent committed
209
    #CONFIG += CONSOLE
unknown's avatar
unknown committed
210

211 212
    INCLUDEPATH += $$BASEDIR/lib/sdl/include \
                   $$BASEDIR/lib/opal/include #\ #\
pixhawk's avatar
pixhawk committed
213
                   #"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
Hugo Vincent's avatar
Hugo Vincent committed
214

215
    LIBS += -L$$BASEDIR/lib/sdl/win32 \
unknown's avatar
unknown committed
216 217 218 219
             -lmingw32 -lSDLmain -lSDL -mwindows



Hugo Vincent's avatar
Hugo Vincent committed
220
    debug {
221
        DESTDIR = $$BUILDDIR/debug
Hugo Vincent's avatar
Hugo Vincent committed
222 223 224
    }

    release {
225
        DESTDIR = $$BUILDDIR/release
Hugo Vincent's avatar
Hugo Vincent committed
226 227
    }
        
228
    RC_FILE = $$BASEDIR/qgroundcontrol.rc
229 230

    # Copy dependencies
231 232 233 234
    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
235 236
}

pixhawk's avatar
pixhawk committed
237
# Windows (64bit)
238
win64-g++ {
239

pixhawk's avatar
pixhawk committed
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
    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
263 264

    # Copy dependencies
265 266 267 268
    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
269
}
270