src.pri: allow using installed libcommuni instead of the submodule

######################################################################
# Communi: src.pri
######################################################################

DEPENDPATH += $$PWD
INCLUDEPATH += $$PWD
QMAKE_CLEAN += $$PWD/*~

HEADERS += $$PWD/addviewdialog.h
HEADERS += $$PWD/application.h
HEADERS += $$PWD/homepage.h
HEADERS += $$PWD/mainwindow.h
HEADERS += $$PWD/overlay.h
HEADERS += $$PWD/searchpopup.h
HEADERS += $$PWD/soundnotification.h
HEADERS += $$PWD/toolbar.h
HEADERS += $$PWD/trayicon.h

SOURCES += $$PWD/addviewdialog.cpp
SOURCES += $$PWD/application.cpp
SOURCES += $$PWD/homepage.cpp
SOURCES += $$PWD/main.cpp
SOURCES += $$PWD/mainwindow.cpp
SOURCES += $$PWD/overlay.cpp
SOURCES += $$PWD/searchpopup.cpp
SOURCES += $$PWD/soundnotification.cpp
SOURCES += $$PWD/toolbar.cpp
SOURCES += $$PWD/trayicon.cpp

exists(3rdparty/communi/src/src.pri) {
    include(3rdparty/communi/src/src.pri)
} else:load(communi-config, true) {
    # bool load(feature, ignore_error)
    CONFIG += communi
} else {
    error(Cannot detect libcommuni. Either install it or run \'git submodule update --init\' in $${_PRO_FILE_PWD_}.)
}

!exists(3rdparty/qtsystemnotifier/systemnotifier.pri) {
    error(3rdparty/qtsystemnotifier submodule is missing. Run \'git submodule update --init\' in $${_PRO_FILE_PWD_}.)
}

!exists(3rdparty/qtdocktile/qtdocktile.pri) {
    error(3rdparty/qtdocktile submodule is missing. Run \'git submodule update --init\' in $${_PRO_FILE_PWD_}.)
}

include(gui/gui.pri)
include(shared/shared.pri)
include(wizard/wizard.pri)
include(3rdparty/qtdocktile/qtdocktile.pri)
include(3rdparty/qtsystemnotifier/systemnotifier.pri)

######################################################################
# Communi: src.pri
######################################################################

DEPENDPATH += $$PWD
INCLUDEPATH += $$PWD
QMAKE_CLEAN += $$PWD/*~

HEADERS += $$PWD/addviewdialog.h
HEADERS += $$PWD/application.h
HEADERS += $$PWD/homepage.h
HEADERS += $$PWD/mainwindow.h
HEADERS += $$PWD/overlay.h
HEADERS += $$PWD/searchpopup.h
HEADERS += $$PWD/soundnotification.h
HEADERS += $$PWD/toolbar.h
HEADERS += $$PWD/trayicon.h

SOURCES += $$PWD/addviewdialog.cpp
SOURCES += $$PWD/application.cpp
SOURCES += $$PWD/homepage.cpp
SOURCES += $$PWD/main.cpp
SOURCES += $$PWD/mainwindow.cpp
SOURCES += $$PWD/overlay.cpp
SOURCES += $$PWD/searchpopup.cpp
SOURCES += $$PWD/soundnotification.cpp
SOURCES += $$PWD/toolbar.cpp
SOURCES += $$PWD/trayicon.cpp

!exists(3rdparty/communi/src/src.pri)|!exists(3rdparty/qtsystemnotifier/systemnotifier.pri) {
    error(Git submodules are missing. Run \'git submodule update --init\' in $${_PRO_FILE_PWD_}.)
}

include(gui/gui.pri)
include(shared/shared.pri)
include(wizard/wizard.pri)
include(3rdparty/communi/src/src.pri)
include(3rdparty/qtdocktile/qtdocktile.pri)
include(3rdparty/qtsystemnotifier/systemnotifier.pri)


Make the multimedi optional

Make the multimedi optional

CONFIG += c++11
QT += sql

contains(CONFIG, QUTILS_NO_MULTIMEDIA) {
    message("[qutils] Multimedia is disabled in qutils")
    QUTILS_NO_MULTIMEDIA=false
}
else {
    QUTILS_NO_MULTIMEDIA=true
    QT += multimedia
}

android {
    QT += androidextras
    OTHER_FILES += \
        $$PWD/android/src/org/zmc/qutils/notification/NotificationClient.java \
        $$PWD/android/src/org/zmc/qutils/notification/NotificationReceiver.java \
        $$PWD/android/src/org/zmc/qutils/notification/CppCallbacks.java \
        $$PWD/android/src/org/zmc/qutils/QutilsActivity.java \
        $$PWD/android/src/org/zmc/qutils/AndroidUtils.java \
        $$PWD/android/src/org/zmc/qutils/DatePickerFragment.java \
        $$PWD/android/src/org/zmc/qutils/TimePickerFragment.java

    HEADERS += \
        $$PWD/include/qutils/android/Notification_Android.h \
        $$PWD/include/qutils/android/NotificationClient_Android.h \
        $$PWD/include/qutils/android/AndroidUtils.h

    SOURCES += \
        $$PWD/src/android/Notification_Android.cpp \
        $$PWD/src/android/NotificationClient_Android.cpp \
        $$PWD/src/android/AndroidUtils.cpp

    INCLUDEPATH += $$PWD/include/android
}

HEADERS += \
    $$PWD/include/qutils/ScreenHelper.h \
    $$PWD/include/qutils/QMLRefresh.h \
    $$PWD/include/qutils/NotificationClient.h \
    $$PWD/include/qutils/Notification.h \
    $$PWD/include/qutils/Macros.h \
    $$PWD/include/qutils/TranslationHelper.h \
    $$PWD/include/qutils/NativeUtils.h \
    $$PWD/include/qutils/SqliteManager.h \
    $$PWD/include/qutils/SettingsManager.h \
    $$PWD/include/qutils/CacheManager.h \
    $$PWD/include/qutils/Network/NetworkManager.h \
    $$PWD/include/qutils/Network/DownloadManager.h \
    $$PWD/include/qutils/Network/HttpCodes.h \
    $$PWD/include/qutils/JsonUtils.h

SOURCES += \
    $$PWD/src/ScreenHelper.cpp \
    $$PWD/src/TranslationHelper.cpp \
    $$PWD/src/NativeUtils.cpp \
    $$PWD/src/SqliteManager.cpp \
    $$PWD/src/SettingsManager.cpp \
    $$PWD/src/CacheManager.cpp \
    $$PWD/src/Network/NetworkManager.cpp \
    $$PWD/src/Network/DownloadManager.cpp \
    $$PWD/src/JsonUtils.cpp

if (!QUTILS_NO_MULTIMEDIA) {
    HEADERS += \
        $$PWD/include/qutils/AudioRecorder.h

    SOURCES += \
        $$PWD/src/AudioRecorder.cpp
}

INCLUDEPATH += $$PWD/include

CONFIG += c++11
QT += sql

android {
    QT += androidextras
    OTHER_FILES += \
        $$PWD/android/src/org/zmc/qutils/notification/NotificationClient.java \
        $$PWD/android/src/org/zmc/qutils/notification/NotificationReceiver.java \
        $$PWD/android/src/org/zmc/qutils/notification/CppCallbacks.java \
        $$PWD/android/src/org/zmc/qutils/QutilsActivity.java \
        $$PWD/android/src/org/zmc/qutils/AndroidUtils.java \
        $$PWD/android/src/org/zmc/qutils/DatePickerFragment.java \
        $$PWD/android/src/org/zmc/qutils/TimePickerFragment.java

    HEADERS += \
        $$PWD/include/qutils/android/Notification_Android.h \
        $$PWD/include/qutils/android/NotificationClient_Android.h \
        $$PWD/include/qutils/android/AndroidUtils.h

    SOURCES += \
        $$PWD/src/android/Notification_Android.cpp \
        $$PWD/src/android/NotificationClient_Android.cpp \
        $$PWD/src/android/AndroidUtils.cpp

    INCLUDEPATH += $$PWD/include/android
}

HEADERS += \
    $$PWD/include/qutils/ScreenHelper.h \
    $$PWD/include/qutils/QMLRefresh.h \
    $$PWD/include/qutils/NotificationClient.h \
    $$PWD/include/qutils/Notification.h \
    $$PWD/include/qutils/Macros.h \
    $$PWD/include/qutils/TranslationHelper.h \
    $$PWD/include/qutils/NativeUtils.h \
    $$PWD/include/qutils/SqliteManager.h \
    $$PWD/include/qutils/SettingsManager.h \
    $$PWD/include/qutils/CacheManager.h \
    $$PWD/include/qutils/Network/NetworkManager.h \
    $$PWD/include/qutils/Network/DownloadManager.h \
    $$PWD/include/qutils/Network/HttpCodes.h \
    $$PWD/include/qutils/JsonUtils.h

SOURCES += \
    $$PWD/src/ScreenHelper.cpp \
    $$PWD/src/TranslationHelper.cpp \
    $$PWD/src/NativeUtils.cpp \
    $$PWD/src/SqliteManager.cpp \
    $$PWD/src/SettingsManager.cpp \
    $$PWD/src/CacheManager.cpp \
    $$PWD/src/Network/NetworkManager.cpp \
    $$PWD/src/Network/DownloadManager.cpp \
    $$PWD/src/JsonUtils.cpp

INCLUDEPATH += $$PWD/include


Support for building against Cocoa Qt4 in compiler.pri (CONFIG+=cocoa)

git-svn-id: 1bc0666016e746585a50f826fc9dc079e42ee77e@1256 05730e5d-ab1b-0410-a4ac-84af385074fa

CONFIG *= warn_on

win32 {
	INCLUDEPATH *= /dev/WinSDK/include /dev/dxsdk/Include /dev/Boost/include/boost-1_36
	CONFIG(intelcpp) {
		DEFINES *= RESTRICT=restrict
		DEFINES *= VAR_ARRAYS
		QMAKE_CC = icl
		QMAKE_CXX = icl
		QMAKE_LIB = xilib /nologo
		QMAKE_LINK = xilink
		QMAKE_CFLAGS *= -Qstd=c99 -Qrestrict -Qvc9
		QMAKE_CXXFLAGS *= -Qstd=c++0x -Qrestrict -Qvc9
		QMAKE_CFLAGS_RELEASE *= -O3 -QxK -Ob0 -Qipo
		QMAKE_CXXFLAGS_RELEASE *= -O3 -QxK -Ob0 -Qipo
		QMAKE_CFLAGS_DEBUG *= -O2 -QxK -Ob0
		#-RTCs -RTCu -RTCc
		QMAKE_CXXFLAGS_DEBUG *= -O2 -QxK -Ob0
		#-RTCs -RTCu -RTCc

		CONFIG(optgen) {
			QMAKE_CFLAGS *= -Qprof-gen
			QMAKE_CXXFLAGS *= -Qprof-gen
		}

		CONFIG(optimize) {
			QMAKE_CFLAGS *= -Qprof-use
			QMAKE_CXXFLAGS *= -Qprof-use
		}
	} else {
		DEFINES *= RESTRICT=
	}

	CONFIG(symbols) {
		QMAKE_CFLAGS_RELEASE *= -GR -Zi -Oy-
		QMAKE_CXXFLAGS_RELEASE *= -GR -Zi -Oy-
		QMAKE_LFLAGS *= -fixed:no -debug
	}

} else {
	DEFINES *= RESTRICT=__restrict__
	CONFIG(opt-gcc) {
		QMAKE_CC = /opt/gcc/bin/gcc
		QMAKE_CXX = /opt/gcc/bin/g++
		QMAKE_LINK = /opt/gcc/bin/g++
	}

	QMAKE_CFLAGS *= -Wshadow -Woverloaded-virtual -Wold-style-cast -Wconversion -Wsign-compare -fvisibility=hidden
	QMAKE_CXXFLAGS *= -Wshadow -Woverloaded-virtual -Wold-style-cast -Wconversion -Wsign-compare -fvisibility=hidden
	!macx {
		QMAKE_LFLAGS *= -Wl,--as-needed
	}

	CONFIG(optgen) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_LFLAGS *= -fprofile-generate
	}

	CONFIG(optimize) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
	}

	CONFIG(symbols) {
		QMAKE_CFLAGS *= -g
		QMAKE_CXXFLAGS *= -g
	}
}

macx {
	# Common include paths for boost 1.34
	INCLUDEPATH *= /usr/local/include/boost-1_34_1/
	INCLUDEPATH *= /opt/local/include/boost-1_34_1/

	CONFIG(cocoa) {
		QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
		QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.5.sdk

		CONFIG += x86_64
		QMAKE_CFLAGS += -mmmx -msse
		QMAKE_CXXFLAGS += -mmmx -msse
	} else {
		QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
		QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk

		CONFIG(debug, debug|release) {
			CONFIG += no-universal
		}

		CONFIG(no-universal) {
			ARCH=$$system(uname -m)
			contains(ARCH, 'i386') {
				QMAKE_CFLAGS += -mmmx -msse
				QMAKE_CXXFLAGS += -mmmx -msse
			}
		} else {
			CONFIG += x86 ppc

			# Precompiled headers are broken when using Makefiles.
			!macx-xcode {
				CONFIG += no-pch
			}
		}
	}
}

CONFIG(no-pch) {
	CONFIG -= precompile_header
} else {
 	CONFIG *= precompile_header
}

CONFIG *= warn_on

win32 {
	INCLUDEPATH *= /dev/WinSDK/include /dev/dxsdk/Include /dev/Boost/include/boost-1_36
	CONFIG(intelcpp) {
		DEFINES *= RESTRICT=restrict
		DEFINES *= VAR_ARRAYS
		QMAKE_CC = icl
		QMAKE_CXX = icl
		QMAKE_LIB = xilib /nologo
		QMAKE_LINK = xilink
		QMAKE_CFLAGS *= -Qstd=c99 -Qrestrict -Qvc9
		QMAKE_CXXFLAGS *= -Qstd=c++0x -Qrestrict -Qvc9
		QMAKE_CFLAGS_RELEASE *= -O3 -QxK -Ob0 -Qipo
		QMAKE_CXXFLAGS_RELEASE *= -O3 -QxK -Ob0 -Qipo
		QMAKE_CFLAGS_DEBUG *= -O2 -QxK -Ob0
		#-RTCs -RTCu -RTCc
		QMAKE_CXXFLAGS_DEBUG *= -O2 -QxK -Ob0
		#-RTCs -RTCu -RTCc

		CONFIG(optgen) {
			QMAKE_CFLAGS *= -Qprof-gen
			QMAKE_CXXFLAGS *= -Qprof-gen
		}

		CONFIG(optimize) {
			QMAKE_CFLAGS *= -Qprof-use
			QMAKE_CXXFLAGS *= -Qprof-use
		}
	} else {
		DEFINES *= RESTRICT=
	}

	CONFIG(symbols) {
		QMAKE_CFLAGS_RELEASE *= -GR -Zi -Oy-
		QMAKE_CXXFLAGS_RELEASE *= -GR -Zi -Oy-
		QMAKE_LFLAGS *= -fixed:no -debug
	}

} else {
	DEFINES *= RESTRICT=__restrict__
	CONFIG(opt-gcc) {
		QMAKE_CC = /opt/gcc/bin/gcc
		QMAKE_CXX = /opt/gcc/bin/g++
		QMAKE_LINK = /opt/gcc/bin/g++
	}

	QMAKE_CFLAGS *= -Wshadow -Woverloaded-virtual -Wold-style-cast -Wconversion -Wsign-compare -fvisibility=hidden
	QMAKE_CXXFLAGS *= -Wshadow -Woverloaded-virtual -Wold-style-cast -Wconversion -Wsign-compare -fvisibility=hidden
	!macx {
		QMAKE_LFLAGS *= -Wl,--as-needed
	}

	CONFIG(optgen) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_LFLAGS *= -fprofile-generate
	}

	CONFIG(optimize) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
	}

	CONFIG(symbols) {
		QMAKE_CFLAGS *= -g
		QMAKE_CXXFLAGS *= -g
	}
}

macx {
	# Common include paths for boost 1.34
	INCLUDEPATH *= /usr/local/include/boost-1_34_1/
	INCLUDEPATH *= /opt/local/include/boost-1_34_1/

	ARCH=$$system(uname -m)
	X86ARCH=$$find(ARCH, i[3456]86) $$find(ARCH, x86_64)

	QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
	QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk

	CONFIG(debug, debug|release) {
		CONFIG += no-universal
	}

	CONFIG(no-universal) {
		!isEmpty(X86ARCH) {
			QMAKE_CFLAGS += -mmmx -msse
			QMAKE_CXXFLAGS += -mmmx -msse
		}
	} else {
		CONFIG += x86 ppc

		# Precompiled headers are broken when using Makefiles.
		!macx-xcode {
			CONFIG += no-pch
		}
	}
}

CONFIG(no-pch) {
	CONFIG -= precompile_header
} else {
 	CONFIG *= precompile_header
}


Clean up Unix section of compiler.pri. Keep platform specific flags in their own sections.

CONFIG *= warn_on

win32 {
	INCLUDEPATH *= /dev/Boost/include/boost-1_40
	CONFIG(intelcpp) {
		DEFINES *= USE_INTEL_IPP
		DEFINES *= RESTRICT=restrict
		DEFINES *= VAR_ARRAYS
		QMAKE_CC = icl
		QMAKE_CXX = icl
		QMAKE_LIB = xilib /nologo
		QMAKE_LINK = xilink
		QMAKE_CFLAGS *= -Qstd=c99 -Qrestrict -Qvc9
		QMAKE_CXXFLAGS *= -Qstd=c++0x -Qrestrict -Qvc9

		QMAKE_CFLAGS_LTCG =
		QMAKE_CXXFLAGS_LTCG =
		QMAKE_LFLAGS_LTCG =

		QMAKE_CFLAGS_RELEASE *= -O3 -Ot -QxSSE2 -Qprec-div-
		QMAKE_CFLAGS_RELEASE -=-arch:SSE
		QMAKE_CFLAGS_RELEASE -= -GL

		QMAKE_CXXFLAGS_RELEASE *= -O3 -Ot -QxSSE2 -Qprec-div-
		QMAKE_CXXFLAGS_RELEASE -=-arch:SSE
		QMAKE_CXXFLAGS_RELEASE -= -GL

		QMAKE_CFLAGS_DEBUG *= -O2 -Ob0
		QMAKE_CXXFLAGS_DEBUG *= -O2 -Ob0

		CONFIG(optgen) {
			QMAKE_CFLAGS *= -Qprof-gen
			QMAKE_CXXFLAGS *= -Qprof-gen
		}

		CONFIG(optimize) {
			QMAKE_CFLAGS *= -Qprof-use
			QMAKE_CXXFLAGS *= -Qprof-use
		}
	} else {
		QMAKE_CFLAGS_RELEASE *= -Ox -Ot /fp:fast /Qfast_transcendentals -Ob2
		QMAKE_CXXFLAGS_RELEASE *= -Ox -Ot /fp:fast /Qfast_transcendentals -Ob2
		DEFINES *= RESTRICT=
	}

	CONFIG(symbols) {
		QMAKE_CFLAGS_RELEASE *= -GR -Zi -Oy-
		QMAKE_CXXFLAGS_RELEASE *= -GR -Zi -Oy-

		QMAKE_CFLAGS_RELEASE -= -Oy
		QMAKE_CXXFLAGS_RELEASE -= -Oy

		QMAKE_LFLAGS *= /debug
		QMAKE_LFLAGS *= /OPT:REF /OPT:ICF
	}

	CONFIG(debug, debug|release) {
		exists($$(VLD_DIR)) {
			VLD_DIR = $$(VLD_DIR)
		}
		else {
			VLD_DIR = /dev/vld
		}
		INCLUDEPATH *= "$$VLD_DIR/include"
		LIBPATH *= "$$VLD_DIR/lib"
	}
}

unix {
	DEFINES *= RESTRICT=__restrict__
	QMAKE_CFLAGS *= -Wfatal-errors -Wshadow -Wconversion -Wsign-compare -fvisibility=hidden
	QMAKE_CXXFLAGS *= -Wfatal-errors -Wshadow -Woverloaded-virtual -Wold-style-cast -Wconversion -Wsign-compare -fvisibility=hidden

	CONFIG(opt-gcc) {
		QMAKE_CC = /opt/gcc/bin/gcc
		QMAKE_CXX = /opt/gcc/bin/g++
		QMAKE_LINK = /opt/gcc/bin/g++
	}

	CONFIG(optgen) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_LFLAGS *= -fprofile-generate
	}

	CONFIG(optimize) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
	}
}

unix:!macx {
	CONFIG(debug, debug|release) {
		QMAKE_CFLAGS *= -fstack-protector -fPIE -pie
		QMAKE_CXXFLAGS *= -fstack-protector -fPIE -pie
		QMAKE_LFLAGS = -Wl,--no-add-needed
	}

	DEFINES *= _FORTIFY_SOURCE=2
	QMAKE_LFLAGS *= -Wl,-z,relro -Wl,-z,now

	CONFIG(symbols) {
		QMAKE_CFLAGS *= -g
		QMAKE_CXXFLAGS *= -g
	}
}

macx {
	CONFIG(debug, debug|release) {
		CONFIG += no-universal
	}

	!CONFIG(no-universal) {
		CONFIG += x86 ppc
	}

	INCLUDEPATH *= /opt/mumble-1.2/boost-1_40_0/include
	INCLUDEPATH *= /opt/mumble-1.2/include
	LIBPATH *= /opt/mumble-1.2/lib

	QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
	XCODE_PATH=$$system(xcode-select -print-path)
	QMAKE_MAC_SDK = $${XCODE_PATH}/SDKs/MacOSX10.5.sdk

	QMAKE_CC = $${XCODE_PATH}/usr/bin/gcc-4.2
	QMAKE_CXX = $${XCODE_PATH}/usr/bin/g++-4.2
	QMAKE_LINK = $${XCODE_PATH}/usr/bin/g++-4.2

	QMAKE_CFLAGS += -mmacosx-version-min=10.5 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
	QMAKE_CXXFLAGS += -mmacosx-version-min=10.5 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2

	CONFIG(symbols) {
		QMAKE_CFLAGS *= -gfull -gdwarf-2
		QMAKE_CXXFLAGS *= -gfull -gdwarf-2
	}
}

CONFIG(no-pch) {
	CONFIG -= precompile_header
} else {
 	CONFIG *= precompile_header
}

CONFIG *= warn_on

win32 {
	INCLUDEPATH *= /dev/Boost/include/boost-1_40
	CONFIG(intelcpp) {
		DEFINES *= USE_INTEL_IPP
		DEFINES *= RESTRICT=restrict
		DEFINES *= VAR_ARRAYS
		QMAKE_CC = icl
		QMAKE_CXX = icl
		QMAKE_LIB = xilib /nologo
		QMAKE_LINK = xilink
		QMAKE_CFLAGS *= -Qstd=c99 -Qrestrict -Qvc9
		QMAKE_CXXFLAGS *= -Qstd=c++0x -Qrestrict -Qvc9

		QMAKE_CFLAGS_LTCG =
		QMAKE_CXXFLAGS_LTCG =
		QMAKE_LFLAGS_LTCG =

		QMAKE_CFLAGS_RELEASE *= -O3 -Ot -QxSSE2 -Qprec-div-
		QMAKE_CFLAGS_RELEASE -=-arch:SSE
		QMAKE_CFLAGS_RELEASE -= -GL

		QMAKE_CXXFLAGS_RELEASE *= -O3 -Ot -QxSSE2 -Qprec-div-
		QMAKE_CXXFLAGS_RELEASE -=-arch:SSE
		QMAKE_CXXFLAGS_RELEASE -= -GL

		QMAKE_CFLAGS_DEBUG *= -O2 -Ob0
		QMAKE_CXXFLAGS_DEBUG *= -O2 -Ob0

		CONFIG(optgen) {
			QMAKE_CFLAGS *= -Qprof-gen
			QMAKE_CXXFLAGS *= -Qprof-gen
		}

		CONFIG(optimize) {
			QMAKE_CFLAGS *= -Qprof-use
			QMAKE_CXXFLAGS *= -Qprof-use
		}
	} else {
		QMAKE_CFLAGS_RELEASE *= -Ox -Ot /fp:fast /Qfast_transcendentals -Ob2
		QMAKE_CXXFLAGS_RELEASE *= -Ox -Ot /fp:fast /Qfast_transcendentals -Ob2
		DEFINES *= RESTRICT=
	}

	CONFIG(symbols) {
		QMAKE_CFLAGS_RELEASE *= -GR -Zi -Oy-
		QMAKE_CXXFLAGS_RELEASE *= -GR -Zi -Oy-

		QMAKE_CFLAGS_RELEASE -= -Oy
		QMAKE_CXXFLAGS_RELEASE -= -Oy

		QMAKE_LFLAGS *= /debug
		QMAKE_LFLAGS *= /OPT:REF /OPT:ICF
	}

	CONFIG(debug, debug|release) {
		exists($$(VLD_DIR)) {
			VLD_DIR = $$(VLD_DIR)
		}
		else {
			VLD_DIR = /dev/vld
		}
		INCLUDEPATH *= "$$VLD_DIR/include"
		LIBPATH *= "$$VLD_DIR/lib"
	}
} else {
	DEFINES *= RESTRICT=__restrict__
	CONFIG(opt-gcc) {
		QMAKE_CC = /opt/gcc/bin/gcc
		QMAKE_CXX = /opt/gcc/bin/g++
		QMAKE_LINK = /opt/gcc/bin/g++
	}

	CONFIG(debug, debug|release) {
		QMAKE_CFLAGS *= -fstack-protector -fPIE -pie
		QMAKE_CXXFLAGS *= -fstack-protector -fPIE -pie
		QMAKE_LFLAGS = -Wl,--no-add-needed
	}

	QMAKE_CFLAGS *= -Wfatal-errors -Wshadow -Wconversion -Wsign-compare -fvisibility=hidden
	QMAKE_CXXFLAGS *= -Wfatal-errors -Wshadow -Woverloaded-virtual -Wold-style-cast -Wconversion -Wsign-compare -fvisibility=hidden

	DEFINES *= _FORTIFY_SOURCE=2

	!macx {
		QMAKE_LFLAGS *= -Wl,-z,relro -Wl,-z,now
	}

	CONFIG(optgen) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-generate
		QMAKE_LFLAGS *= -fprofile-generate
	}

	CONFIG(optimize) {
		QMAKE_CFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
		QMAKE_CXXFLAGS *= -O3 -march=native -ffast-math -ftree-vectorize -fprofile-use
	}

	CONFIG(symbols) {
		QMAKE_CFLAGS *= -g
		QMAKE_CXXFLAGS *= -g
	}
}

macx {
	CONFIG(debug, debug|release) {
		CONFIG += no-universal
	}

	!CONFIG(no-universal) {
		CONFIG += x86 ppc
	}

	INCLUDEPATH *= /opt/mumble-1.2/boost-1_40_0/include
	INCLUDEPATH *= /opt/mumble-1.2/include
	LIBPATH *= /opt/mumble-1.2/lib

	QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
	XCODE_PATH=$$system(xcode-select -print-path)
	QMAKE_MAC_SDK = $${XCODE_PATH}/SDKs/MacOSX10.5.sdk

	QMAKE_CC = $${XCODE_PATH}/usr/bin/gcc-4.2
	QMAKE_CXX = $${XCODE_PATH}/usr/bin/g++-4.2
	QMAKE_LINK = $${XCODE_PATH}/usr/bin/g++-4.2

	QMAKE_CFLAGS += -mmacosx-version-min=10.5 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
	QMAKE_CXXFLAGS += -mmacosx-version-min=10.5 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
}

CONFIG(no-pch) {
	CONFIG -= precompile_header
} else {
 	CONFIG *= precompile_header
}


Unnecessary change

Unnecessary change

IRIS_BASE = $PWD/../..
include(../libbase.pri)
include($$PWD/modules.pri)

QT *= xml network

INCLUDEPATH += $$PWD/../irisnet/corelib $$PWD/../irisnet/noncore $$PWD/../irisnet/noncore/legacy $$PWD/../irisnet/noncore/cutestuff
iris_bundle:{
	include(../irisnet/noncore/noncore.pri)
}
else {
	LIBS += -L$$IRIS_BASE/lib -lirisnet
}

include($$IRIS_XMPP_BASE_MODULE)
include($$IRIS_XMPP_BASE64_MODULE)
include($$IRIS_XMPP_ZLIB_MODULE)
include($$IRIS_XMPP_JID_MODULE)
include($$IRIS_XMPP_SASL_MODULE)

DEFINES += XMPP_TEST

INCLUDEPATH += \
	$$PWD/ \
	$$PWD/.. \
	$$PWD/xmpp-core \
	$$PWD/xmpp-im

HEADERS += \
	$$PWD/xmpp-core/securestream.h \
	$$PWD/xmpp-core/parser.h \
	$$PWD/xmpp-core/xmlprotocol.h \
	$$PWD/xmpp-core/protocol.h \
	$$PWD/xmpp-core/compressionhandler.h \
	$$PWD/xmpp-core/td.h \
	$$PWD/xmpp-im/xmpp_tasks.h \
	$$PWD/xmpp-im/xmpp_discoinfotask.h \
	$$PWD/xmpp-im/xmpp_xmlcommon.h \
	$$PWD/xmpp-im/xmpp_vcard.h \
	$$PWD/xmpp-im/xmpp_bytestream.h \
	$$PWD/xmpp-im/s5b.h \
	$$PWD/xmpp-im/xmpp_ibb.h \
	$$PWD/xmpp-im/filetransfer.h \
	$$PWD/xmpp-core/xmpp.h \
	$$PWD/xmpp-im/xmpp_url.h \
	$$PWD/xmpp-im/xmpp_chatstate.h \
	$$PWD/xmpp-im/xmpp_receipts.h \
	$$PWD/xmpp-im/xmpp_client.h \
	$$PWD/xmpp-core/xmpp_clientstream.h \
	$$PWD/xmpp-core/xmpp_stanza.h \
	$$PWD/xmpp-core/xmpp_stream.h \
	$$PWD/xmpp-im/xmpp_address.h \
	$$PWD/xmpp-im/xmpp_htmlelement.h \
	$$PWD/xmpp-im/xmpp_muc.h \
	$$PWD/xmpp-im/xmpp_message.h \
	$$PWD/xmpp-im/xmpp_pubsubitem.h \
	$$PWD/xmpp-im/xmpp_resource.h \
	$$PWD/xmpp-im/xmpp_roster.h \
	$$PWD/xmpp-im/xmpp_rosterx.h \
	$$PWD/xmpp-im/xmpp_xdata.h \
	$$PWD/xmpp-im/xmpp_rosteritem.h \
	$$PWD/xmpp-im/xmpp_liveroster.h \
	$$PWD/xmpp-im/xmpp_liverosteritem.h \
	$$PWD/xmpp-im/xmpp_resourcelist.h \
	$$PWD/xmpp-im/xmpp_task.h \
	$$PWD/xmpp-im/xmpp_httpauthrequest.h \
	$$PWD/xmpp-im/xmpp_status.h \
	$$PWD/xmpp-im/xmpp_features.h \
	$$PWD/xmpp-im/xmpp_agentitem.h \
	$$PWD/xmpp-im/xmpp_discoitem.h \
	$$PWD/xmpp-im/xmpp_bitsofbinary.h \
	$$PWD/xmpp-im/im.h

SOURCES += \
	$$PWD/xmpp-core/connector.cpp \
	$$PWD/xmpp-core/tlshandler.cpp \
	$$PWD/xmpp-core/securestream.cpp \
	$$PWD/xmpp-core/parser.cpp \
	$$PWD/xmpp-core/xmlprotocol.cpp \
	$$PWD/xmpp-core/protocol.cpp \
	$$PWD/xmpp-core/compressionhandler.cpp \
	$$PWD/xmpp-core/stream.cpp \
	$$PWD/xmpp-core/simplesasl.cpp \
	$$PWD/xmpp-core/xmpp_stanza.cpp \
	$$PWD/xmpp-im/types.cpp \
	$$PWD/xmpp-im/client.cpp \
	$$PWD/xmpp-im/xmpp_features.cpp \
	$$PWD/xmpp-im/xmpp_discoitem.cpp \
	$$PWD/xmpp-im/xmpp_discoinfotask.cpp \
	$$PWD/xmpp-im/xmpp_xdata.cpp \
	$$PWD/xmpp-im/xmpp_task.cpp \
	$$PWD/xmpp-im/xmpp_tasks.cpp \
	$$PWD/xmpp-im/xmpp_xmlcommon.cpp \
	$$PWD/xmpp-im/xmpp_vcard.cpp \
	$$PWD/xmpp-im/xmpp_bytestream.cpp \
	$$PWD/xmpp-im/s5b.cpp \
	$$PWD/xmpp-im/xmpp_ibb.cpp \
	$$PWD/xmpp-im/filetransfer.cpp \
	$$PWD/xmpp-im/xmpp_bitsofbinary.cpp

IRIS_BASE = $PWD/../..
include(../libbase.pri)
include($$PWD/modules.pri)

QT *= xml network

INCLUDEPATH += $$PWD/../irisnet/corelib $$PWD/../irisnet/noncore $$PWD/../irisnet/noncore/legacy $$PWD/../irisnet/noncore/cutestuff
iris_bundle:{
	include(../irisnet/noncore/noncore.pri)
}
else {
        LIBS = -L$$IRIS_BASE/lib -lirisnet $$LIBS
}

include($$IRIS_XMPP_BASE_MODULE)
include($$IRIS_XMPP_BASE64_MODULE)
include($$IRIS_XMPP_ZLIB_MODULE)
include($$IRIS_XMPP_JID_MODULE)
include($$IRIS_XMPP_SASL_MODULE)

DEFINES += XMPP_TEST

INCLUDEPATH += \
	$$PWD/ \
	$$PWD/.. \
	$$PWD/xmpp-core \
	$$PWD/xmpp-im

HEADERS += \
	$$PWD/xmpp-core/securestream.h \
	$$PWD/xmpp-core/parser.h \
	$$PWD/xmpp-core/xmlprotocol.h \
	$$PWD/xmpp-core/protocol.h \
	$$PWD/xmpp-core/compressionhandler.h \
	$$PWD/xmpp-core/td.h \
	$$PWD/xmpp-im/xmpp_tasks.h \
	$$PWD/xmpp-im/xmpp_discoinfotask.h \
	$$PWD/xmpp-im/xmpp_xmlcommon.h \
	$$PWD/xmpp-im/xmpp_vcard.h \
	$$PWD/xmpp-im/xmpp_bytestream.h \
	$$PWD/xmpp-im/s5b.h \
	$$PWD/xmpp-im/xmpp_ibb.h \
	$$PWD/xmpp-im/filetransfer.h \
	$$PWD/xmpp-core/xmpp.h \
	$$PWD/xmpp-im/xmpp_url.h \
	$$PWD/xmpp-im/xmpp_chatstate.h \
	$$PWD/xmpp-im/xmpp_receipts.h \
	$$PWD/xmpp-im/xmpp_client.h \
	$$PWD/xmpp-core/xmpp_clientstream.h \
	$$PWD/xmpp-core/xmpp_stanza.h \
	$$PWD/xmpp-core/xmpp_stream.h \
	$$PWD/xmpp-im/xmpp_address.h \
	$$PWD/xmpp-im/xmpp_htmlelement.h \
	$$PWD/xmpp-im/xmpp_muc.h \
	$$PWD/xmpp-im/xmpp_message.h \
	$$PWD/xmpp-im/xmpp_pubsubitem.h \
	$$PWD/xmpp-im/xmpp_resource.h \
	$$PWD/xmpp-im/xmpp_roster.h \
	$$PWD/xmpp-im/xmpp_rosterx.h \
	$$PWD/xmpp-im/xmpp_xdata.h \
	$$PWD/xmpp-im/xmpp_rosteritem.h \
	$$PWD/xmpp-im/xmpp_liveroster.h \
	$$PWD/xmpp-im/xmpp_liverosteritem.h \
	$$PWD/xmpp-im/xmpp_resourcelist.h \
	$$PWD/xmpp-im/xmpp_task.h \
	$$PWD/xmpp-im/xmpp_httpauthrequest.h \
	$$PWD/xmpp-im/xmpp_status.h \
	$$PWD/xmpp-im/xmpp_features.h \
	$$PWD/xmpp-im/xmpp_agentitem.h \
	$$PWD/xmpp-im/xmpp_discoitem.h \
	$$PWD/xmpp-im/xmpp_bitsofbinary.h \
	$$PWD/xmpp-im/im.h

SOURCES += \
	$$PWD/xmpp-core/connector.cpp \
	$$PWD/xmpp-core/tlshandler.cpp \
	$$PWD/xmpp-core/securestream.cpp \
	$$PWD/xmpp-core/parser.cpp \
	$$PWD/xmpp-core/xmlprotocol.cpp \
	$$PWD/xmpp-core/protocol.cpp \
	$$PWD/xmpp-core/compressionhandler.cpp \
	$$PWD/xmpp-core/stream.cpp \
	$$PWD/xmpp-core/simplesasl.cpp \
	$$PWD/xmpp-core/xmpp_stanza.cpp \
	$$PWD/xmpp-im/types.cpp \
	$$PWD/xmpp-im/client.cpp \
	$$PWD/xmpp-im/xmpp_features.cpp \
	$$PWD/xmpp-im/xmpp_discoitem.cpp \
	$$PWD/xmpp-im/xmpp_discoinfotask.cpp \
	$$PWD/xmpp-im/xmpp_xdata.cpp \
	$$PWD/xmpp-im/xmpp_task.cpp \
	$$PWD/xmpp-im/xmpp_tasks.cpp \
	$$PWD/xmpp-im/xmpp_xmlcommon.cpp \
	$$PWD/xmpp-im/xmpp_vcard.cpp \
	$$PWD/xmpp-im/xmpp_bytestream.cpp \
	$$PWD/xmpp-im/s5b.cpp \
	$$PWD/xmpp-im/xmpp_ibb.cpp \
	$$PWD/xmpp-im/filetransfer.cpp \
	$$PWD/xmpp-im/xmpp_bitsofbinary.cpp


Separate header files.

Separate header files.

# This file sets qmake variables for linkage against cutehmi_base library.
# Note: common.pri must be included before this file.

include(cutehmi_utils.pri)

DEFINES += CUTEHMI_BASE_DYNAMIC
INCLUDEPATH += $$PWD/LibBase/include
DEPENDPATH += $$PWD/LibBase/include
win32:LIBS += -L$$PWD/../bin -l$$qtLibraryTarget(cutehmi_base)$$CUTEHMI_BASE_MAJOR
unix:LIBS += -L$$PWD/../bin -l$$qtLibraryTarget(cutehmi_base)

# This file sets qmake variables for linkage against cutehmi_base library.
# Note: common.pri must be included before this file.

include(cutehmi_utils.pri)

DEFINES += CUTEHMI_BASE_DYNAMIC
INCLUDEPATH += $$PWD/LibBase/src
DEPENDPATH += $$PWD/LibBase/src
win32:LIBS += -L$$PWD/../bin -l$$qtLibraryTarget(cutehmi_base)$$CUTEHMI_BASE_MAJOR
unix:LIBS += -L$$PWD/../bin -l$$qtLibraryTarget(cutehmi_base)


Silence makefile override warnings

Silence makefile override warnings

qserialport and qextserialport use the pattern of += into
PUBLIC_HEADERS and PRIVATE_HEADERS. This leads to the same header being
included twice. Which in turn causes the rule for moc in the makefile
to be added twice, hence the warning. Using *= instead of += removes
the duplication.

INCLUDEPATH += $$PWD

unix {
    CONFIG += link_pkgconfig

    packagesExist(libudev) {
        DEFINES += HAVE_LIBUDEV
        PKGCONFIG += libudev
    }
}

PUBLIC_HEADERS += \
    $$PWD/qserialportglobal.h \
    $$PWD/qserialport.h \
    $$PWD/qserialportinfo.h

PRIVATE_HEADERS += \
    $$PWD/qserialport_p.h \
    $$PWD/qserialportinfo_p.h

SOURCES += \
    $$PWD/qserialport.cpp \
    $$PWD/qserialportinfo.cpp

win32 {
    PRIVATE_HEADERS += \
        $$PWD/qserialport_win_p.h

    SOURCES += \
        $$PWD/qserialport_win.cpp \
        $$PWD/qserialportinfo_win.cpp

    LIBS += -lsetupapi -ladvapi32

}

unix:!symbian {
    PRIVATE_HEADERS += \
        $$PWD/qttylocker_unix_p.h \
        $$PWD/qserialport_unix_p.h

    SOURCES += \
        $$PWD/qttylocker_unix.cpp \
        $$PWD/qserialport_unix.cpp \
        $$PWD/qserialportinfo_unix.cpp

    macx {
        SOURCES += $$PWD/qserialportinfo_mac.cpp

        LIBS += -framework IOKit -framework CoreFoundation
    } else {
        linux*:contains( DEFINES, HAVE_LIBUDEV ) {
            LIBS += -ludev
        }
    }
}

HEADERS *= $$PUBLIC_HEADERS $$PRIVATE_HEADERS

INCLUDEPATH += $$PWD

unix {
    CONFIG += link_pkgconfig

    packagesExist(libudev) {
        DEFINES += HAVE_LIBUDEV
        PKGCONFIG += libudev
    }
}

PUBLIC_HEADERS += \
    $$PWD/qserialportglobal.h \
    $$PWD/qserialport.h \
    $$PWD/qserialportinfo.h

PRIVATE_HEADERS += \
    $$PWD/qserialport_p.h \
    $$PWD/qserialportinfo_p.h

SOURCES += \
    $$PWD/qserialport.cpp \
    $$PWD/qserialportinfo.cpp

win32 {
    PRIVATE_HEADERS += \
        $$PWD/qserialport_win_p.h

    SOURCES += \
        $$PWD/qserialport_win.cpp \
        $$PWD/qserialportinfo_win.cpp

    LIBS += -lsetupapi -ladvapi32

}

unix:!symbian {
    PRIVATE_HEADERS += \
        $$PWD/qttylocker_unix_p.h \
        $$PWD/qserialport_unix_p.h

    SOURCES += \
        $$PWD/qttylocker_unix.cpp \
        $$PWD/qserialport_unix.cpp \
        $$PWD/qserialportinfo_unix.cpp

    macx {
        SOURCES += $$PWD/qserialportinfo_mac.cpp

        LIBS += -framework IOKit -framework CoreFoundation
    } else {
        linux*:contains( DEFINES, HAVE_LIBUDEV ) {
            LIBS += -ludev
        }
    }
}

HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS


Update the kirigami.pri file

Update the kirigami.pri file

Match the actual file names in libkirigami.

Signed-off-by: Dirk Hohndel <a00b27378a09822d5638cdfb8c2e7ccc36d74c56@hohndel.org>

QT          += qml quick gui svg quickcontrols2
HEADERS     += $$PWD/src/kirigamiplugin.h \
               $$PWD/src/enums.h \
               $$PWD/src/settings.h \
               $$PWD/src/libkirigami/basictheme_p.h \
               $$PWD/src/libkirigami/platformtheme.h \
               $$PWD/src/libkirigami/kirigamipluginfactory.h
SOURCES     += $$PWD/src/kirigamiplugin.cpp \
               $$PWD/src/enums.cpp \
               $$PWD/src/settings.cpp \
               $$PWD/src/libkirigami/basictheme.cpp \
               $$PWD/src/libkirigami/platformtheme.cpp \
               $$PWD/src/libkirigami/kirigamipluginfactory.cpp
INCLUDEPATH += $$PWD/src
DEFINES     += KIRIGAMI_BUILD_TYPE_STATIC

!ios:!android {
    message( "compiling for desktop" )
    HEADERS += $$PWD/src/desktopicon.h
    SOURCES += $$PWD/src/desktopicon.cpp
}

API_VER=1.0

RESOURCES += $$PWD/kirigami.qrc

exists($$_PRO_FILE_PWD_/kirigami-icons.qrc) {
    message("Using icons QRC file shipped by the project")
    RESOURCES += $$_PRO_FILE_PWD_/kirigami-icons.qrc
} else {
    message("Using icons QRCfile shipped in kirigami")
    RESOURCES += $$PWD/kirigami-icons.qrc
}

QT          += qml quick gui svg quickcontrols2
HEADERS     += $$PWD/src/kirigamiplugin.h \
               $$PWD/src/enums.h \
               $$PWD/src/settings.h \
               $$PWD/src/libkirigami/basictheme_p.h \
               $$PWD/src/libkirigami/platformtheme.h \
               $$PWD/src/libkirigami/platformthemefactory.h
SOURCES     += $$PWD/src/kirigamiplugin.cpp \
               $$PWD/src/enums.cpp \
               $$PWD/src/settings.cpp \
               $$PWD/src/libkirigami/basictheme.cpp \
               $$PWD/src/libkirigami/platformtheme.cpp \
               $$PWD/src/libkirigami/platformthemefactory.cpp
INCLUDEPATH += $$PWD/src
DEFINES     += KIRIGAMI_BUILD_TYPE_STATIC

!ios:!android {
    message( "compiling for desktop" )
    HEADERS += $$PWD/src/desktopicon.h
    SOURCES += $$PWD/src/desktopicon.cpp
}

API_VER=1.0

RESOURCES += $$PWD/kirigami.qrc

exists($$_PRO_FILE_PWD_/kirigami-icons.qrc) {
    message("Using icons QRC file shipped by the project")
    RESOURCES += $$_PRO_FILE_PWD_/kirigami-icons.qrc
} else {
    message("Using icons QRCfile shipped in kirigami")
    RESOURCES += $$PWD/kirigami-icons.qrc
}


QmlJsDebug: Don't append 'd' to library name on Unix

# This file is part of Qt Creator
# It enables debugging of Qt Quick applications

QT += declarative script
INCLUDEPATH += $$PWD/include

symbian {
    LIBNAME = QmLJSDebugger.lib
} else {
    windows:CONFIG(debug, debug|release) {
        LIBNAME = QmlJSDebuggerd
    } else {
        LIBNAME = QmlJSDebugger
    }
}
LIBS += -L$$PWD -l$$LIBNAME

DEFINES += QMLJSDEBUGGER

# This file is part of Qt Creator
# It enables debugging of Qt Quick applications

QT += declarative script
INCLUDEPATH += $$PWD/include

symbian {
    LIBNAME = QmLJSDebugger.lib
} else {
    CONFIG(debug, debug|release) {
        LIBNAME = QmlJSDebuggerd
    } else {
        LIBNAME = QmlJSDebugger
    }
}
LIBS += -L$$PWD -l$$LIBNAME

DEFINES += QMLJSDEBUGGER


Fixed incorrect osg flags.

Fixed incorrect osg flags.

#-------------------------------------------------
#
# QGroundControl - Micro Air Vehicle Groundstation
#
# Please see our website at <http://qgroundcontrol.org>
#
# Author:
# Lorenz Meier <mavteam@student.ethz.ch>
#
# (c) 2009-2010 PIXHAWK Team
#
# This file is part of the mav groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# 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.
# QGroundControl is distributed in the hope that it will be useful,
# 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
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------

#$$BASEDIR/lib/qextserialport/include
#               $$BASEDIR/lib/openjaus/libjaus/include \
#               $$BASEDIR/lib/openjaus/libopenJaus/include

message(Qt version $$[QT_VERSION])

release {
#    DEFINES += QT_NO_DEBUG_OUTPUT
#    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/.

# MAC OS X
macx {

    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 ) {
        # 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)

                # Enable function-profiling with the OS X saturn tool
                debug {
                        #QMAKE_CXXFLAGS += -finstrument-functions
                        #LIBS += -lSaturn
                }
    } else {
        # x64 Mac OS X Snow Leopard 10.6 and later
        CONFIG += x86_64 cocoa
        CONFIG -= x86 phonon
        message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
    }

    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5

    #DESTDIR = $$BASEDIR/bin/mac
    INCLUDEPATH += -framework SDL

    LIBS += -framework IOKit \
        -framework SDL \
        -framework CoreFoundation \
        -framework ApplicationServices \
        -lm

    ICON = $$BASEDIR/images/icons/macx.icns

    # Copy audio files if needed
    QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/.
    # Copy google earth starter file
    QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/.
    # Copy model files
    #QMAKE_PRE_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
    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
    }

    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
}

# GNU/Linux
linux-g++ {

    debug {
        #DESTDIR = $$BUILDDIR/debug
        CONFIG += debug
    }

    release {
        #DESTDIR = $$BUILDDIR/release
    }

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

    INCLUDEPATH += /usr/include \
                   /usr/include/qt4/phonon
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang

    message(Building for GNU/Linux 32bit/i386)

    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg \
            -losgViewer
    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 += -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
    }

    release {
        #DESTDIR = $$BUILDDIR/release
    }

    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))

    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -lSDL \
        -lSDLmain

    exists(/usr/include/osg) {
    message("Building support for OpenSceneGraph")
    DEPENDENCIES_PRESENT += osg
    # Include OpenSceneGraph libraries
    LIBS += -losg \
            -losgViewer
    DEFINES += QGC_OSG_ENABLED
    }

    exists(/usr/include/osgEarth) {
    message("Building support for osgEarth")
    DEPENDENCIES_PRESENT += osgearth
    # Include osgEarth libraries
    LIBS += -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)
win32-msvc2008 {

    message(Building for Windows Visual Studio 2008 (32bit))

    CONFIG += qaxcontainer

    # 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

exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg

# Include OpenSceneGraph and osgEarth libraries
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 \
    -losg \
    -losgViewer \
	-losgGA \
	-losgDB \
	-losgText \
        -lOpenThreads
DEFINES += QGC_OSG_ENABLED
exists($$BASEDIR/lib/osgEarth123) {
    DEPENDENCIES_PRESENT += osgearth
    message("Building support for osgEarth")
    DEFINES += QGC_OSGEARTH_ENABLED
    LIBS += -L$$BASEDIR/lib/osgEarth/win32/lib \
        -losgEarth \
        -losgEarthUtil
}
}

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\"
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y

    # Copy google earth starter file
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\"
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\"

}

# Windows (32bit)
win32-g++ {

    message(Building for Windows Platform (32bit))

    # 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 = $$BUILDDIR/debug
    }

    release {
        #DESTDIR = $$BUILDDIR/release
    }

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\"
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += -Wl,-E
}

#-------------------------------------------------
#
# QGroundControl - Micro Air Vehicle Groundstation
#
# Please see our website at <http://qgroundcontrol.org>
#
# Author:
# Lorenz Meier <mavteam@student.ethz.ch>
#
# (c) 2009-2010 PIXHAWK Team
#
# This file is part of the mav groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# 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.
# QGroundControl is distributed in the hope that it will be useful,
# 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
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------

#$$BASEDIR/lib/qextserialport/include
#               $$BASEDIR/lib/openjaus/libjaus/include \
#               $$BASEDIR/lib/openjaus/libopenJaus/include

message(Qt version $$[QT_VERSION])

release {
#    DEFINES += QT_NO_DEBUG_OUTPUT
#    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/.

# MAC OS X
macx {

    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 ) {
        # 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)

                # Enable function-profiling with the OS X saturn tool
                debug {
                        #QMAKE_CXXFLAGS += -finstrument-functions
                        #LIBS += -lSaturn
                }
    } else {
        # x64 Mac OS X Snow Leopard 10.6 and later
        CONFIG += x86_64 cocoa
        CONFIG -= x86 phonon
        message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later)
    }

    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5

    #DESTDIR = $$BASEDIR/bin/mac
    INCLUDEPATH += -framework SDL

    LIBS += -framework IOKit \
        -framework SDL \
        -framework CoreFoundation \
        -framework ApplicationServices \
        -lm

    ICON = $$BASEDIR/images/icons/macx.icns

    # Copy audio files if needed
    QMAKE_PRE_LINK += && cp -rf $$BASEDIR/audio $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/.
    # Copy google earth starter file
    QMAKE_PRE_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOs/.
    # Copy model files
    #QMAKE_PRE_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
    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
    }

    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
}

# GNU/Linux
linux-g++ {

    debug {
        #DESTDIR = $$BUILDDIR/debug
        CONFIG += debug
    }

    release {
        #DESTDIR = $$BUILDDIR/release
    }

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

    INCLUDEPATH += /usr/include \
                   /usr/include/qt4/phonon
              # $$BASEDIR/lib/flite/include \
              # $$BASEDIR/lib/flite/lang

    message(Building for GNU/Linux 32bit/i386)

    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -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/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
    }

    release {
        #DESTDIR = $$BUILDDIR/release
    }

    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))

    LIBS += \
        -L/usr/lib \
        -lm \
        -lflite_cmu_us_kal \
        -lflite_usenglish \
        -lflite_cmulex \
        -lflite \
        -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
}

# Windows (32bit)
win32-msvc2008 {

    message(Building for Windows Visual Studio 2008 (32bit))

    CONFIG += qaxcontainer

    # 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

exists($$BASEDIR/lib/osg123) {
message("Building support for OSG")
DEPENDENCIES_PRESENT += osg

# Include OpenSceneGraph and osgEarth libraries
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 \
    -losg \
    -losgViewer \
	-losgGA \
	-losgDB \
	-losgText \
        -lOpenThreads
DEFINES += QGC_OSG_ENABLED
exists($$BASEDIR/lib/osgEarth123) {
    DEPENDENCIES_PRESENT += osgearth
    message("Building support for osgEarth")
    DEFINES += QGC_OSGEARTH_ENABLED
    LIBS += -L$$BASEDIR/lib/osgEarth/win32/lib \
        -losgEarth \
        -losgEarthUtil
}
}

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\"
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y

    # Copy google earth starter file
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\release\"
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR/images/earth.html $$TARGETDIR_WIN\debug\"

}

# Windows (32bit)
win32-g++ {

    message(Building for Windows Platform (32bit))

    # 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 = $$BUILDDIR/debug
    }

    release {
        #DESTDIR = $$BUILDDIR/release
    }

    RC_FILE = $$BASEDIR/qgroundcontrol.rc

    # Copy dependencies
    BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
    TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")

    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\debug\SDL.dll\"
    QMAKE_PRE_LINK += && copy /Y \"$$BASEDIR_WIN\lib\sdl\win32\SDL.dll\" \"$$TARGETDIR_WIN\release\SDL.dll\"
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\debug\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\audio\" \"$$TARGETDIR_WIN\release\audio\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\debug\models\" /S /E /Y
    QMAKE_PRE_LINK += && xcopy \"$$BASEDIR_WIN\models\" \"$$TARGETDIR_WIN\release\models\" /S /E /Y

    # osg/osgEarth dynamic casts might fail without this compiler option.
    # see http://osgearth.org/wiki/FAQ for details.
    QMAKE_CXXFLAGS += -Wl,-E
}


Update qmlglsink build settings

Update qmlglsink build settings

LinuxBuild {
    DEFINES += HAVE_QT_X11 HAVE_QT_EGLFS HAVE_QT_WAYLAND
} else:MacBuild {
    DEFINES += HAVE_QT_MAC
} else:iOSBuild {
    DEFINES += HAVE_QT_IOS
} else:WindowsBuild {
    DEFINES += HAVE_QT_WIN32
    LIBS += opengl32.lib user32.lib
} else:AndroidBuild {
    DEFINES += HAVE_QT_ANDROID
}

SOURCES += \
    libs/gst-plugins-good/ext/qt/gstplugin.cc \
    libs/gst-plugins-good/ext/qt/gstqtglutility.cc \
    libs/gst-plugins-good/ext/qt/gstqsgtexture.cc \
    libs/gst-plugins-good/ext/qt/gstqtsink.cc \
    libs/gst-plugins-good/ext/qt/gstqtsrc.cc \
    libs/gst-plugins-good/ext/qt/qtwindow.cc \
    libs/gst-plugins-good/ext/qt/qtitem.cc

HEADERS += \
    libs/gst-plugins-good/ext/qt/gstqsgtexture.h \
    libs/gst-plugins-good/ext/qt/gstqtgl.h \
    libs/gst-plugins-good/ext/qt/gstqtglutility.h \
    libs/gst-plugins-good/ext/qt/gstqtsink.h \
    libs/gst-plugins-good/ext/qt/gstqtsrc.h \
    libs/gst-plugins-good/ext/qt/qtwindow.h \
    libs/gst-plugins-good/ext/qt/qtitem.h

LinuxBuild {
    DEFINES += HAVE_QT_X11 HAVE_QT_EGLFS HAVE_QT_WAYLAND
} else:MacBuild {
    DEFINES += HAVE_QT_MAC
} else:iOSBuild {
    DEFINES += HAVE_QT_IOS
} else:WindowsBuild {
    DEFINES += HAVE_QT_WIN32
    LIBS += opengl32.lib
} else:AndroidBuild {
    DEFINES += HAVE_QT_ANDROID
}

SOURCES += \
    libs/gst-plugins-good/ext/qt/gstplugin.cc \
    libs/gst-plugins-good/ext/qt/gstqtglutility.cc \
    libs/gst-plugins-good/ext/qt/gstqsgtexture.cc \
    libs/gst-plugins-good/ext/qt/gstqtsink.cc \
    libs/gst-plugins-good/ext/qt/gstqtsrc.cc \
    libs/gst-plugins-good/ext/qt/qtwindow.cc \
    libs/gst-plugins-good/ext/qt/qtitem.cc

HEADERS += \
    libs/gst-plugins-good/ext/qt/gstqsgtexture.h \
    libs/gst-plugins-good/ext/qt/gstqtgl.h \
    libs/gst-plugins-good/ext/qt/gstqtglutility.h \
    libs/gst-plugins-good/ext/qt/gstqtsink.h \
    libs/gst-plugins-good/ext/qt/gstqtsrc.h \
    libs/gst-plugins-good/ext/qt/qtwindow.h \
    libs/gst-plugins-good/ext/qt/qtitem.h


Increase version number for development build

QT       += core gui widgets websockets

VERSION = 2.6.3
DEFINES += MINIZINC_IDE_VERSION=\\\"$$VERSION\\\"

bundled {
    DEFINES += MINIZINC_IDE_BUNDLED
}

output_version {
    write_file($$OUT_PWD/version, VERSION)
}

CONFIG += c++11

macx {
    ICON = $$PWD/mznide.icns
    OBJECTIVE_SOURCES += \
        $$PWD/darkmodenotifier_macos.mm
    LIBS += -framework Cocoa
    macx-xcode {
      QMAKE_INFO_PLIST = $$PWD/mznide-xcode.plist
    } else {
      QMAKE_INFO_PLIST = $$PWD/mznide-makefile.plist
    }
}

win32 {
    LIBS += -ladvapi32
}

RC_ICONS = $$PWD/mznide.ico

CONFIG += embed_manifest_exe

SOURCES += \
    $$PWD/codechecker.cpp \
    $$PWD/configwindow.cpp \
    $$PWD/darkmodenotifier.cpp \
    $$PWD/elapsedtimer.cpp \
    $$PWD/extraparamdialog.cpp \
    $$PWD/ide.cpp \
    $$PWD/ideutils.cpp \
    $$PWD/mainwindow.cpp \
    $$PWD/codeeditor.cpp \
    $$PWD/highlighter.cpp \
    $$PWD/fzndoc.cpp \
    $$PWD/outputwidget.cpp \
    $$PWD/preferencesdialog.cpp \
    $$PWD/process.cpp \
    $$PWD/profilecompilation.cpp \
    $$PWD/projectbrowser.cpp \
    $$PWD/server.cpp \
    $$PWD/gotolinedialog.cpp \
    $$PWD/paramdialog.cpp \
    $$PWD/outputdockwidget.cpp \
    $$PWD/checkupdatedialog.cpp \
    $$PWD/project.cpp \
    $$PWD/moocsubmission.cpp \
    $$PWD/esclineedit.cpp \
    $$PWD/solver.cpp

HEADERS += \
    $$PWD/mainwindow.h \
    $$PWD/codechecker.h \
    $$PWD/codeeditor.h \
    $$PWD/configwindow.h \
    $$PWD/darkmodenotifier.h \
    $$PWD/elapsedtimer.h \
    $$PWD/exception.h \
    $$PWD/extraparamdialog.h \
    $$PWD/highlighter.h \
    $$PWD/fzndoc.h \
    $$PWD/ide.h \
    $$PWD/ideutils.h \
    $$PWD/outputwidget.h \
    $$PWD/preferencesdialog.h \
    $$PWD/process.h \
    $$PWD/profilecompilation.h \
    $$PWD/projectbrowser.h \
    $$PWD/server.h \
    $$PWD/gotolinedialog.h \
    $$PWD/paramdialog.h \
    $$PWD/outputdockwidget.h \
    $$PWD/checkupdatedialog.h \
    $$PWD/project.h \
    $$PWD/moocsubmission.h \
    $$PWD/esclineedit.h \
    $$PWD/solver.h

FORMS += \
    $$PWD/configwindow.ui \
    $$PWD/extraparamdialog.ui \
    $$PWD/mainwindow.ui \
    $$PWD/outputwidget.ui \
    $$PWD/preferencesdialog.ui \
    $$PWD/projectbrowser.ui \
    $$PWD/gotolinedialog.ui \
    $$PWD/paramdialog.ui \
    $$PWD/checkupdatedialog.ui \
    $$PWD/moocsubmission.ui

RESOURCES += \
    $$PWD/minizincide.qrc

include($$PWD/../cp-profiler/cp-profiler.pri)
QT += network sql

QT       += core gui widgets websockets

VERSION = 2.6.2
DEFINES += MINIZINC_IDE_VERSION=\\\"$$VERSION\\\"

bundled {
    DEFINES += MINIZINC_IDE_BUNDLED
}

output_version {
    write_file($$OUT_PWD/version, VERSION)
}

CONFIG += c++11

macx {
    ICON = $$PWD/mznide.icns
    OBJECTIVE_SOURCES += \
        $$PWD/darkmodenotifier_macos.mm
    LIBS += -framework Cocoa
    macx-xcode {
      QMAKE_INFO_PLIST = $$PWD/mznide-xcode.plist
    } else {
      QMAKE_INFO_PLIST = $$PWD/mznide-makefile.plist
    }
}

win32 {
    LIBS += -ladvapi32
}

RC_ICONS = $$PWD/mznide.ico

CONFIG += embed_manifest_exe

SOURCES += \
    $$PWD/codechecker.cpp \
    $$PWD/configwindow.cpp \
    $$PWD/darkmodenotifier.cpp \
    $$PWD/elapsedtimer.cpp \
    $$PWD/extraparamdialog.cpp \
    $$PWD/ide.cpp \
    $$PWD/ideutils.cpp \
    $$PWD/mainwindow.cpp \
    $$PWD/codeeditor.cpp \
    $$PWD/highlighter.cpp \
    $$PWD/fzndoc.cpp \
    $$PWD/outputwidget.cpp \
    $$PWD/preferencesdialog.cpp \
    $$PWD/process.cpp \
    $$PWD/profilecompilation.cpp \
    $$PWD/projectbrowser.cpp \
    $$PWD/server.cpp \
    $$PWD/gotolinedialog.cpp \
    $$PWD/paramdialog.cpp \
    $$PWD/outputdockwidget.cpp \
    $$PWD/checkupdatedialog.cpp \
    $$PWD/project.cpp \
    $$PWD/moocsubmission.cpp \
    $$PWD/esclineedit.cpp \
    $$PWD/solver.cpp

HEADERS += \
    $$PWD/mainwindow.h \
    $$PWD/codechecker.h \
    $$PWD/codeeditor.h \
    $$PWD/configwindow.h \
    $$PWD/darkmodenotifier.h \
    $$PWD/elapsedtimer.h \
    $$PWD/exception.h \
    $$PWD/extraparamdialog.h \
    $$PWD/highlighter.h \
    $$PWD/fzndoc.h \
    $$PWD/ide.h \
    $$PWD/ideutils.h \
    $$PWD/outputwidget.h \
    $$PWD/preferencesdialog.h \
    $$PWD/process.h \
    $$PWD/profilecompilation.h \
    $$PWD/projectbrowser.h \
    $$PWD/server.h \
    $$PWD/gotolinedialog.h \
    $$PWD/paramdialog.h \
    $$PWD/outputdockwidget.h \
    $$PWD/checkupdatedialog.h \
    $$PWD/project.h \
    $$PWD/moocsubmission.h \
    $$PWD/esclineedit.h \
    $$PWD/solver.h

FORMS += \
    $$PWD/configwindow.ui \
    $$PWD/extraparamdialog.ui \
    $$PWD/mainwindow.ui \
    $$PWD/outputwidget.ui \
    $$PWD/preferencesdialog.ui \
    $$PWD/projectbrowser.ui \
    $$PWD/gotolinedialog.ui \
    $$PWD/paramdialog.ui \
    $$PWD/checkupdatedialog.ui \
    $$PWD/moocsubmission.ui

RESOURCES += \
    $$PWD/minizincide.qrc

include($$PWD/../cp-profiler/cp-profiler.pri)
QT += network sql