diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index b32b120c959a5ffcf87e3826802ac4a195b0e33a..24bdd3daa42ab733096ade1b78860f4796524011 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -34,19 +34,19 @@ release { # DEFINES += QT_NO_WARNING_OUTPUT } -QMAKE_PRE_LINK += echo "Copying files" - -#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. -#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. - +QMAKE_PRE_LINK += echo "Copying files" + +#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. +#QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. + # MAC OS X macx { - COMPILER_VERSION = $$system(gcc -v) - message(Using compiler $$COMPILER_VERSION) - + COMPILER_VERSION = system(gcc -v) + message(Using compiler $$COMPILER_VERSION) + 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 ) { + contains( HARDWARE_PLATFORM, 9.6.0 ) || contains( HARDWARE_PLATFORM, 9.7.0 ) || contains( HARDWARE_PLATFORM, 9.8.0 ) || contains( HARDWARE_PLATFORM, 9.9.0 ) { # 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) @@ -63,10 +63,10 @@ macx { message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later) } - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5 + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5 DESTDIR = $$BASEDIR/bin/mac - INCLUDEPATH += -framework SDL + INCLUDEPATH += -framework SDL LIBS += -framework IOKit \ -framework SDL \ @@ -79,71 +79,71 @@ macx { # Copy audio files if needed QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/qgroundcontrol.app/Contents/MacOs/. - 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") + 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") DEPENDENCIES_PRESENT += osgearth - # 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 \ - -framework osgTerrain \ - DEFINES += QGC_OSGEARTH_ENABLED + # 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 \ + -framework osgTerrain \ + DEFINES += QGC_OSGEARTH_ENABLED + } + + exists(/opt/local/include/libfreenect) { + message("Building support for libfreenect") + DEPENDENCIES_PRESENT += libfreenect + # Include libfreenect libraries + LIBS += -lfreenect + DEFINES += QGC_LIBFREENECT_ENABLED } - - exists(/opt/local/include/libfreenect) { - message("Building support for libfreenect") - DEPENDENCIES_PRESENT += libfreenect - # 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 + + # osg/osgEarth dynamic casts might fail without this compiler option. + # see http://osgearth.org/wiki/FAQ for details. + #QMAKE_CXXFLAGS += -Wl,-E } # GNU/Linux linux-g++ { - + debug { DESTDIR = $$BUILDDIR/debug - CONFIG += debug + CONFIG += debug } release { @@ -158,8 +158,8 @@ linux-g++ { # $$BASEDIR/lib/flite/lang - message(Building for GNU/Linux 32bit/i386) - + message(Building for GNU/Linux 32bit/i386) + LIBS += \ -L/usr/lib \ -lm \ @@ -170,49 +170,48 @@ linux-g++ { -lSDL \ -lSDLmain - 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) | exists(/usr/local/include/osgEarth) { - message("Building support for osgEarth") - DEPENDENCIES_PRESENT += osgearth - # Include osgEarth libraries - LIBS += -losgViewer \ - -losgEarth \ - -losgEarthUtil - DEFINES += QGC_OSGEARTH_ENABLED - } - - exists(/usr/local/include/libfreenect) { - 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 - } - - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release/. - - # osg/osgEarth dynamic casts might fail without this compiler option. - # see http://osgearth.org/wiki/FAQ for details. - QMAKE_CXXFLAGS += -Wl,-E + 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) | exists(/usr/local/include/osgEarth) { + message("Building support for osgEarth") + DEPENDENCIES_PRESENT += osgearth + # Include osgEarth libraries + LIBS += -losgViewer \ + -losgEarth \ + -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 + } + + QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. + QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. + QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/debug/. + QMAKE_PRE_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR/release/. + + # 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 { debug { DESTDIR = $$BUILDDIR/debug - CONFIG += debug + CONFIG += debug } release { @@ -220,16 +219,16 @@ linux-g++-64 { } QMAKE_PRE_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/. - + INCLUDEPATH += /usr/include \ /usr/include/qt4/phonon # $$BASEDIR/lib/flite/include \ # $$BASEDIR/lib/flite/lang - # 64-bit Linux - message(Building for GNU/Linux 64bit/x64 (g++-64)) - + # 64-bit Linux + message(Building for GNU/Linux 64bit/x64 (g++-64)) + LIBS += \ -L/usr/lib \ -lm \ @@ -240,36 +239,36 @@ linux-g++-64 { -lSDL \ -lSDLmain - 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 \ - -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 + 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 \ + -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 } # Windows (32bit) @@ -304,7 +303,6 @@ LIBS += -L$$BASEDIR/lib/osgEarth/win32/lib \ -losgEarth \ -losgEarthUtil DEFINES += QGC_OSG_ENABLED -QMAKE_CXXFLAGS += -DUSE_QT4 RC_FILE = $$BASEDIR/qgroundcontrol.rc @@ -321,13 +319,13 @@ QMAKE_CXXFLAGS += -DUSE_QT4 #QMAKE_PRE_LINK += cp -f $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/bin/OpenThreads.dll $$TARGETDIR/release/. && QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/release/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. - - # osg/osgEarth dynamic casts might fail without this compiler option. - # see http://osgearth.org/wiki/FAQ for details. - QMAKE_CXXFLAGS += /Wl /E + QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/release/. + QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. + QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. + + # osg/osgEarth dynamic casts might fail without this compiler option. + # see http://osgearth.org/wiki/FAQ for details. + } # Windows (32bit) @@ -357,51 +355,6 @@ win32-g++ { RC_FILE = $$BASEDIR/qgroundcontrol.rc - # Copy dependencies - debug { - QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/debug/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/debug/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/debug/. - } - - release { - QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/release/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/release/. - QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. - } - - # osg/osgEarth dynamic casts might fail without this compiler option. - # see http://osgearth.org/wiki/FAQ for details. - QMAKE_CXXFLAGS += -Wl,-E -} - -# Windows (64bit) -win64-g++ { - - 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 - # Copy dependencies debug { QMAKE_PRE_LINK += && cp -f $$BASEDIR/lib/sdl/win32/SDL.dll $$BUILDDIR/debug/. @@ -414,8 +367,8 @@ win64-g++ { QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/release/. QMAKE_PRE_LINK += && cp -rf $$BASEDIR/models $$TARGETDIR/release/. } - - # osg/osgEarth dynamic casts might fail without this compiler option. - # see http://osgearth.org/wiki/FAQ for details. - QMAKE_CXXFLAGS += -Wl,-E + + # osg/osgEarth dynamic casts might fail without this compiler option. + # see http://osgearth.org/wiki/FAQ for details. + QMAKE_CXXFLAGS += -Wl,-E }