Commit 6df76bb1 authored by Bryant Mairs's avatar Bryant Mairs

Corrected the Windows Visual Studio compilation so that release builds no...

Corrected the Windows Visual Studio compilation so that release builds no longer have a console or debugging macros while the debug builds have both.
Fixed indentation across all build scripts (.pro/.pri) to be 4-spaces and consistent.
Updated the README with proper Visual Studio compilation instructions for both VS2010 and VS2008.
parent 3027f1ae
......@@ -78,52 +78,25 @@ Done.
Windows
=======
DETAILED STEPS BELOW THE VISUAL STUDIO 2010 NOTES.
GNU GCC / MINGW IS UNTESTED, COULD WORK
VISUAL STUDIO 2008 / 2010 EXPRESS EDITION IS FREE!
-------------------------------------------------------------------------------------
VISUAL STUDIO 2010 NOTES (VS 2008 runs out-of-the-box, just follow the steps below):
For use of Qt 4x with Visual Studio 2010 Add-in.
Visual studio adds automatically certain defines that are wrong and cause errors.
To resolve this, execute these steps:
In the projects properties -> C/C++ ->preprocessor change:
in DEBUG:
delete QT_NO_DEBUG
in both (DEBUG / RELEASE):
delete QT_NO_DYNAMIC_CAST
-------------------------------------------------------------------------------------
Steps for Visual Studio 2008 / 2010. (VS 2008 is easier, VS 2010 only recommended for
expert developers)
Steps for Visual Studio 2008 / 2010:
Windows XP/7:
1) Download and install the Qt SDK for Windows from http://qt.nokia.com/downloads/ (Visual Studio 2008 version) OR download Qt source and compile with VS 2010
2) Download and install Visual Studio 2008 Express Edition (free) OR VS 2010 Express Edition
3) Go to the QGroundControl folder and then to thirdParty -> libxbee
1) Download and install the Qt libraries for Windows from https://qt.nokia.com/downloads/ (the Visual Studio 2008 or 2010 version as appropriate)
4) Build the library. See win32.README
2) Download and install Visual Studio 2008 or 2010 Express Edition (free) from https://www.microsoft.com/visualstudio
5) Go to the source folder of QGroundControl with the Qt 4.7.x Command Prompt tool (from the applications menu)
3) Go to the QGroundControl folder and then to thirdParty/libxbee and build it following the instructions in win32.README
6) Create the Visual Studio project by typing:
4) Open the Qt Command Prompt program (should be in the Start Menu), navigate to the source folder of QGroundControl and create the Visual Studio project by typing:
qmake -tp vc qgroundcontrol.pro
`qmake -tp vc qgroundcontrol.pro`
7) Now start Visual Studio and load the qgroundcontrol.vcproj file
5) Now start Visual Studio and load the qgroundcontrol.vcproj if using Visual Studio 2008 or qgroundcontrol.vcxproj if using Visual Studio 2010
8) Compile and edit in Visual Studio. If you need to add new files, add them to qgroundcontrol.pro and re-run "quake -tp vc qgroundcontrol.pro"
6) Compile and edit in Visual Studio. If you need to add new files, add them to qgroundcontrol.pro and re-run `qmake -tp vc qgroundcontrol.pro`
For use of qt 4x and visual studio2010 and add in.
The Visual studio adds automatically certain defines
In the projects properties -> C/C++ ->preprocessor change:
in DEBUG:
delete QT_NO_DEBUG
Both:
delete QT_NO_DYNAMIC_CAST
......@@ -141,7 +141,4 @@ HEADERS += src/uas/UASInterface.h \
src/uas/QGCMAVLinkUASFactory.h
DEFINES += SRCDIR=\\\"$$PWD/\\\"
......@@ -20,13 +20,6 @@
message(Qt version $$[QT_VERSION])
message(Using Qt from $$(QTDIR))
release {
# DEFINES += QT_NO_DEBUG_OUTPUT
# DEFINES += QT_NO_WARNING_OUTPUT
}
win32-msvc2008|win32-msvc2010 {
QMAKE_POST_LINK += $$quote(echo "Copying files"$$escape_expand(\\n))
} else {
......@@ -39,38 +32,11 @@ DEFINES += _TTY_NOWARN_
# MAC OS X
macx|macx-g++42|macx-g++: {
# COMPILER_VERSION = $$system(gcc -v)
#message(Using compiler $$COMPILER_VERSION)
CONFIG += x86_64 cocoa phonon
CONFIG -= x86
#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" ) {
# x86 Mac OS X Leopard 10.5 and earlier
#message(Building for Mac OS X 32bit/Leopard 10.5 and earlier)
# Enable function-profiling with the OS X saturn tool
#debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
# CONFIG += console
#}
#} else {
# x64 Mac OS X Snow Leopard 10.6 and later
# CONFIG += x86_64 x86 cocoa phonon
#CONFIG -= x86 # phonon
#message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
# debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
# }
#}
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
#DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL
LIBS += -framework IOKit \
......@@ -150,11 +116,6 @@ macx|macx-g++42|macx-g++: {
# CORE OSG LIBRARY
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosg.dylib
# Copy model files
#QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/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
......@@ -174,7 +135,6 @@ macx|macx-g++42|macx-g++: {
-losgDB \
-losgText \
-losgWidget
#}
exists(/usr/local/include/google/protobuf) {
message("Building support for Protocol Buffers")
......@@ -202,17 +162,10 @@ linux-g++|linux-g++-64{
CONFIG -= console
debug {
#CONFIG += debug console
}
release {
DEFINES += QT_NO_DEBUG
#CONFIG -= console
}
#QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/.
INCLUDEPATH += /usr/include \
/usr/local/include \
/usr/include/qt4/phonon
......@@ -295,7 +248,7 @@ linux-g++-64 {
}
}
# Windows (32bit)
# Windows (32bit), Visual Studio
win32-msvc2008|win32-msvc2010 {
win32-msvc2008 {
......@@ -316,40 +269,40 @@ win32-msvc2008|win32-msvc2010 {
# QWebkit is not needed on MS-Windows compilation environment
CONFIG -= webkit
release {
CONFIG -= console
# For release builds remove support for various Qt debugging macros.
CONFIG(release, debug|release) {
DEFINES += QT_NO_DEBUG
}
debug {
# For debug releases we just want the debugging console.
CONFIG(debug, debug|release) {
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 \
-lsetupapi
exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg
exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph
INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \
# Include OpenSceneGraph
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 \
LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \
-losg \
-losgViewer \
-losgGA \
-losgDB \
-losgText \
-lOpenThreads
DEFINES += QGC_OSG_ENABLED
}
DEFINES += QGC_OSG_ENABLED
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
......@@ -357,7 +310,6 @@ DEFINES += QGC_OSG_ENABLED
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
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))
......@@ -415,8 +367,7 @@ win32-g++ {
DEFINES += NOMINMAX
INCLUDEPATH += $$BASEDIR/lib/sdl/include \
$$BASEDIR/lib/opal/include #\ #\
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
$$BASEDIR/lib/opal/include
LIBS += -L$$BASEDIR/lib/sdl/win32 \
-lmingw32 -lSDLmain -lSDL -mwindows \
......@@ -427,14 +378,12 @@ win32-g++ {
debug {
#DESTDIR = $$BUILDDIR/debug
CONFIG += console
}
release {
CONFIG -= console
DEFINES += QT_NO_DEBUG
#DESTDIR = $$BUILDDIR/release
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
......@@ -476,10 +425,9 @@ win32-g++ {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\release\\earth.html\"
}
}
}
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E
}
# vim:ts=4:sw=4:expandtab
......@@ -33,14 +33,14 @@ TEMPLATE = app
TARGET = qgroundcontrol
BASEDIR = $${IN_PWD}
linux-g++|linux-g++-64{
debug {
debug {
TARGETDIR = $${OUT_PWD}/debug
BUILDDIR = $${OUT_PWD}/build-debug
}
release {
}
release {
TARGETDIR = $${OUT_PWD}/release
BUILDDIR = $${OUT_PWD}/build-release
}
}
} else {
TARGETDIR = $${OUT_PWD}
BUILDDIR = $${OUT_PWD}/build
......@@ -55,12 +55,12 @@ MAVLINKPATH = $$BASEDIR/thirdParty/mavlink/include
DEFINES += MAVLINK_NO_DATA
win32 {
QMAKE_INCDIR_QT = $$(QTDIR)/include
QMAKE_LIBDIR_QT = $$(QTDIR)/lib
QMAKE_UIC = "$$(QTDIR)/bin/uic.exe"
QMAKE_MOC = "$$(QTDIR)/bin/moc.exe"
QMAKE_RCC = "$$(QTDIR)/bin/rcc.exe"
QMAKE_QMAKE = "$$(QTDIR)/bin/qmake.exe"
QMAKE_INCDIR_QT = $$(QTDIR)/include
QMAKE_LIBDIR_QT = $$(QTDIR)/lib
QMAKE_UIC = "$$(QTDIR)/bin/uic.exe"
QMAKE_MOC = "$$(QTDIR)/bin/moc.exe"
QMAKE_RCC = "$$(QTDIR)/bin/rcc.exe"
QMAKE_QMAKE = "$$(QTDIR)/bin/qmake.exe"
}
......@@ -588,7 +588,7 @@ TRANSLATIONS += es-MX.ts \
# xbee support
# libxbee only supported by linux and windows systems
win32-msvc2008|win32-msvc2010|linux{
win32-msvc2008|win32-msvc2010|linux {
HEADERS += src/comm/XbeeLinkInterface.h \
src/comm/XbeeLink.h \
src/comm/HexSpinBox.h \
......@@ -599,8 +599,7 @@ win32-msvc2008|win32-msvc2010|linux{
src/ui/XbeeConfigurationWindow.cpp
DEFINES += XBEELINK
INCLUDEPATH += thirdParty/libxbee
# TO DO: build library when it does not exists already
# TO DO: build library when it does not exist already
LIBS += -LthirdParty/libxbee/lib \
-llibxbee
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment