MAINT: update year in mne-cpp.pri

MAINT: update year in mne-cpp.pri

############################################## GLOBAL FUNCTIONS ###############################################
#Define minQtVersion Test
defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

defineReplace(macDeployArgs) {
    target = $$1
    target_ext = $$2
    mne_binary_dir = $$3
    mne_library_dir = $$4
    extra_args = $$5

    isEmpty(target_ext) {
        target_ext = .app
    }

    deploy_cmd = macdeployqt

    deploy_target = $$shell_quote($$shell_path($${mne_binary_dir}/$${target}$${target_ext}))

    deploy_libs_to_copy = -libpath=$${mne_library_dir}
    !isEmpty(extra_args) {
        deploy_libs_to_copy += $${extra_args}
    }
    return($$deploy_cmd $$deploy_target $$deploy_libs_to_copy)
}

defineReplace(winDeployLibArgs) {
    # Copy library to bin folder
    target = $$1
    target_ext = $$2
    mne_binary_dir = $$3
    mne_library_dir = $$4
    extra_args = $$5

    isEmpty(target_ext) {
        target_ext = .dll
    }

    file = $$shell_quote($$shell_path($${mne_library_dir}/$${target}$${target_ext}))
    final_deploy_command += $${QMAKE_COPY} $${file} $$shell_quote($${mne_binary_dir}) $$escape_expand(\\n\\t)

    # Deploy qt dependecies for the library
    deploy_target = $$shell_quote($$shell_path($${mne_binary_dir}/$${target}$${target_ext}))
    deploy_cmd = windeployqt

    final_deploy_command += $$deploy_cmd $$deploy_target $$extra_args $$escape_expand(\\n\\t)

    return($${final_deploy_command})
}

defineReplace(winDeployAppArgs) {
    target = $$1
    target_ext = $$2
    mne_binary_dir = $$3
    extra_args = $$5

    # Deploy qt dependecies for the application
    isEmpty(target_ext) {
        target_ext = .exe
    }

    deploy_target = $$shell_quote($$shell_path($${mne_binary_dir}/$${target}$${target_ext}))
    deploy_cmd = windeployqt

    final_deploy_command += $$deploy_cmd $$deploy_target $$extra_args $$escape_expand(\\n\\t)

    return($${final_deploy_command})
}

defineReplace(copyResources) {
    resource_files = $$1

    for(FILE, resource_files) {
        FILEDIR = $$dirname(FILE)
        FILEDIR ~= s,/resources,/bin/resources,g
        FILEDIR = $$shell_path($${FILEDIR})
        TRGTDIR = $${FILEDIR}

        final_copy_command += $$sprintf($${QMAKE_MKDIR_CMD}, "$${TRGTDIR}") $$escape_expand(\n\t)

        FILE = $$shell_path($${FILE})
        final_copy_command += $${QMAKE_COPY} $$quote($${FILE}) $$quote($${TRGTDIR}) $$escape_expand(\\n\\t)
    }

    return($${final_copy_command})
}

############################################### GLOBAL DEFINES ################################################

MNE_CPP_VERSION = 1.0.0
MNE_LIB_VERSION = 1

QMAKE_TARGET_PRODUCT = mne-cpp
QMAKE_TARGET_DESCRIPTION = MNE Qt 5 based C++ library.
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2020 Authors of mne-cpp. All rights reserved.

########################################### PROJECT CONFIGURATION #############################################

## To build only the minimal version, i.e, for mne_rt_server run: qmake MNECPP_CONFIG+=minimalVersion
## To set CodeCov coverage compiler flag run: qmake MNECPP_CONFIG+=withCodeCov
## To disable tests run: qmake MNECPP_CONFIG+=noTests
## To disable examples run: qmake MNECPP_CONFIG+=noExamples
## To disable applications run: qmake MNECPP_CONFIG+=noApplications
## To build MNE-CPP libraries as static libs: qmake MNECPP_CONFIG+=static
## To build MNE-CPP with FFTW support in Eigen (make sure to specify FFTW_DIRs below): qmake MNECPP_CONFIG+=useFFTW
## To build MNE-CPP Disp library without OpenGL support (default is with OpenGL support): qmake MNECPP_CONFIG+=noOpenGL
## To build MNE-CPP against wasm: qmake MNECPP_CONFIG+=wasm
## To build MNE Scan with BrainFlow support: qmake MNECPP_CONFIG+=withBrainFlow
## To build MNE Scan with LSL support: qmake MNECPP_CONFIG+=withLsl
## To build MNE Scan with BrainAMP support: qmake MNECPP_CONFIG+=withBrainAmp
## To build MNE Scan with EegoSports support: qmake MNECPP_CONFIG+=withEego
## To build MNE Scan with GUSBAmp support: qmake MNECPP_CONFIG+=withGUSBAmp
## To build MNE Scan with TMSI support: qmake MNECPP_CONFIG+=withTmsi

# Default flags
MNECPP_CONFIG +=

# Minimal version needs at least qt version 5.2.1
!minQtVersion(5, 2, 1) {
    message("Cannot build MNE-CPP with Qt version $${QT_VERSION}.")
    error("Use at least Qt 5.2.1. Please note that you may only be able to build the minimal MNE-CPP version.")
}

# Build minimalVersion for qt versions < 5.10.0
!minQtVersion(5, 10, 0) {
    message("Building minimal version of MNE-CPP due to Qt version $${QT_VERSION}.")
    MNECPP_CONFIG += minimalVersion
}

# Build static version if wasm flag was defined
contains(MNECPP_CONFIG, wasm) {
    message("The wasm flag was detected. Building static version of MNE-CPP. Disable OpenGL support for Disp library.")
    MNECPP_CONFIG += static noOpenGL
}

contains(MNECPP_CONFIG, static) {
    message("The static flag was detected. Building static version of MNE-CPP.")
}

########################################### DIRECTORY DEFINITIONS #############################################

# Eigen
EIGEN_INCLUDE_DIR = $$EIGEN_INCLUDE_DIR
isEmpty(EIGEN_INCLUDE_DIR) {
    EIGEN_INCLUDE_DIR = $$shell_path($${PWD}/include/3rdParty/eigen3)
}

# include
MNE_INCLUDE_DIR = $$MNE_INCLUDE_DIR
isEmpty( MNE_INCLUDE_DIR ) {
    MNE_INCLUDE_DIR = $$shell_path($${PWD}/libraries)
}
MNE_SCAN_INCLUDE_DIR = $$MNE_SCAN_INCLUDE_DIR
isEmpty( MNE_SCAN_INCLUDE_DIR ) {
    MNE_SCAN_INCLUDE_DIR = $$shell_path($${PWD}/applications/mne_scan/libs)
}
MNE_ANALYZE_INCLUDE_DIR = $$MNE_ANALYZE_INCLUDE_DIR
isEmpty( MNE_ANALYZE_INCLUDE_DIR ) {
    MNE_ANALYZE_INCLUDE_DIR = $$shell_path($${PWD}/applications/mne_analyze/libs)
}
MNE_ANALYZE_EXTENSIONS_DIR = $$MNE_ANALYZE_EXTENSIONS_DIR
isEmpty( MNE_ANALYZE_EXTENSIONS_DIR ) {
    MNE_ANALYZE_EXTENSIONS_DIR = $$shell_path($${PWD}/applications/mne_analyze/extensions)
}

# lib
MNE_LIBRARY_DIR = $$MNE_LIBRARY_DIR
isEmpty( MNE_LIBRARY_DIR ) {
    MNE_LIBRARY_DIR = $$shell_path($${PWD}/lib)
}

# bin
MNE_BINARY_DIR = $$MNE_BINARY_DIR
isEmpty( MNE_BINARY_DIR ) {
    MNE_BINARY_DIR = $$shell_path($${PWD}/bin)
}

# repository dir
ROOT_DIR = $${PWD}

# install
MNE_INSTALL_INCLUDE_DIR = $$MNE_INSTALL_INCLUDE_DIR
isEmpty( MNE_INSTALL_INCLUDE_DIR ) {
    MNE_INSTALL_INCLUDE_DIR = $$shell_path($${PWD}/include)
}

# FFTW dir
FFTW_DIR_LIBS = $$shell_path(C:\fftw-3.3.5-dll64)
FFTW_DIR_INCLUDE = $$shell_path(C:\fftw-3.3.5-dll64)

############################################## GLOBAL FUNCTIONS ###############################################
#Define minQtVersion Test
defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

defineReplace(macDeployArgs) {
    target = $$1
    target_ext = $$2
    mne_binary_dir = $$3
    mne_library_dir = $$4
    extra_args = $$5

    isEmpty(target_ext) {
        target_ext = .app
    }

    deploy_cmd = macdeployqt

    deploy_target = $$shell_quote($$shell_path($${mne_binary_dir}/$${target}$${target_ext}))

    deploy_libs_to_copy = -libpath=$${mne_library_dir}
    !isEmpty(extra_args) {
        deploy_libs_to_copy += $${extra_args}
    }
    return($$deploy_cmd $$deploy_target $$deploy_libs_to_copy)
}

defineReplace(winDeployLibArgs) {
    # Copy library to bin folder
    target = $$1
    target_ext = $$2
    mne_binary_dir = $$3
    mne_library_dir = $$4
    extra_args = $$5

    isEmpty(target_ext) {
        target_ext = .dll
    }

    file = $$shell_quote($$shell_path($${mne_library_dir}/$${target}$${target_ext}))
    final_deploy_command += $${QMAKE_COPY} $${file} $$shell_quote($${mne_binary_dir}) $$escape_expand(\\n\\t)

    # Deploy qt dependecies for the library
    deploy_target = $$shell_quote($$shell_path($${mne_binary_dir}/$${target}$${target_ext}))
    deploy_cmd = windeployqt

    final_deploy_command += $$deploy_cmd $$deploy_target $$extra_args $$escape_expand(\\n\\t)

    return($${final_deploy_command})
}

defineReplace(winDeployAppArgs) {
    target = $$1
    target_ext = $$2
    mne_binary_dir = $$3
    extra_args = $$5

    # Deploy qt dependecies for the application
    isEmpty(target_ext) {
        target_ext = .exe
    }

    deploy_target = $$shell_quote($$shell_path($${mne_binary_dir}/$${target}$${target_ext}))
    deploy_cmd = windeployqt

    final_deploy_command += $$deploy_cmd $$deploy_target $$extra_args $$escape_expand(\\n\\t)

    return($${final_deploy_command})
}

defineReplace(copyResources) {
    resource_files = $$1

    for(FILE, resource_files) {
        FILEDIR = $$dirname(FILE)
        FILEDIR ~= s,/resources,/bin/resources,g
        FILEDIR = $$shell_path($${FILEDIR})
        TRGTDIR = $${FILEDIR}

        final_copy_command += $$sprintf($${QMAKE_MKDIR_CMD}, "$${TRGTDIR}") $$escape_expand(\n\t)

        FILE = $$shell_path($${FILE})
        final_copy_command += $${QMAKE_COPY} $$quote($${FILE}) $$quote($${TRGTDIR}) $$escape_expand(\\n\\t)
    }

    return($${final_copy_command})
}

############################################### GLOBAL DEFINES ################################################

MNE_CPP_VERSION = 1.0.0
MNE_LIB_VERSION = 1

QMAKE_TARGET_PRODUCT = mne-cpp
QMAKE_TARGET_DESCRIPTION = MNE Qt 5 based C++ library.
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2019 Authors of mne-cpp. All rights reserved.

########################################### PROJECT CONFIGURATION #############################################

## To build only the minimal version, i.e, for mne_rt_server run: qmake MNECPP_CONFIG+=minimalVersion
## To set CodeCov coverage compiler flag run: qmake MNECPP_CONFIG+=withCodeCov
## To disable tests run: qmake MNECPP_CONFIG+=noTests
## To disable examples run: qmake MNECPP_CONFIG+=noExamples
## To disable applications run: qmake MNECPP_CONFIG+=noApplications
## To build MNE-CPP libraries as static libs: qmake MNECPP_CONFIG+=static
## To build MNE-CPP with FFTW support in Eigen (make sure to specify FFTW_DIRs below): qmake MNECPP_CONFIG+=useFFTW
## To build MNE-CPP Disp library without OpenGL support (default is with OpenGL support): qmake MNECPP_CONFIG+=noOpenGL
## To build MNE-CPP against wasm: qmake MNECPP_CONFIG+=wasm
## To build MNE Scan with BrainFlow support: qmake MNECPP_CONFIG+=withBrainFlow
## To build MNE Scan with LSL support: qmake MNECPP_CONFIG+=withLsl
## To build MNE Scan with BrainAMP support: qmake MNECPP_CONFIG+=withBrainAmp
## To build MNE Scan with EegoSports support: qmake MNECPP_CONFIG+=withEego
## To build MNE Scan with GUSBAmp support: qmake MNECPP_CONFIG+=withGUSBAmp
## To build MNE Scan with TMSI support: qmake MNECPP_CONFIG+=withTmsi

# Default flags
MNECPP_CONFIG +=

# Minimal version needs at least qt version 5.2.1
!minQtVersion(5, 2, 1) {
    message("Cannot build MNE-CPP with Qt version $${QT_VERSION}.")
    error("Use at least Qt 5.2.1. Please note that you may only be able to build the minimal MNE-CPP version.")
}

# Build minimalVersion for qt versions < 5.10.0
!minQtVersion(5, 10, 0) {
    message("Building minimal version of MNE-CPP due to Qt version $${QT_VERSION}.")
    MNECPP_CONFIG += minimalVersion
}

# Build static version if wasm flag was defined
contains(MNECPP_CONFIG, wasm) {
    message("The wasm flag was detected. Building static version of MNE-CPP. Disable OpenGL support for Disp library.")
    MNECPP_CONFIG += static noOpenGL
}

contains(MNECPP_CONFIG, static) {
    message("The static flag was detected. Building static version of MNE-CPP.")
}

########################################### DIRECTORY DEFINITIONS #############################################

# Eigen
EIGEN_INCLUDE_DIR = $$EIGEN_INCLUDE_DIR
isEmpty(EIGEN_INCLUDE_DIR) {
    EIGEN_INCLUDE_DIR = $$shell_path($${PWD}/include/3rdParty/eigen3)
}

# include
MNE_INCLUDE_DIR = $$MNE_INCLUDE_DIR
isEmpty( MNE_INCLUDE_DIR ) {
    MNE_INCLUDE_DIR = $$shell_path($${PWD}/libraries)
}
MNE_SCAN_INCLUDE_DIR = $$MNE_SCAN_INCLUDE_DIR
isEmpty( MNE_SCAN_INCLUDE_DIR ) {
    MNE_SCAN_INCLUDE_DIR = $$shell_path($${PWD}/applications/mne_scan/libs)
}
MNE_ANALYZE_INCLUDE_DIR = $$MNE_ANALYZE_INCLUDE_DIR
isEmpty( MNE_ANALYZE_INCLUDE_DIR ) {
    MNE_ANALYZE_INCLUDE_DIR = $$shell_path($${PWD}/applications/mne_analyze/libs)
}
MNE_ANALYZE_EXTENSIONS_DIR = $$MNE_ANALYZE_EXTENSIONS_DIR
isEmpty( MNE_ANALYZE_EXTENSIONS_DIR ) {
    MNE_ANALYZE_EXTENSIONS_DIR = $$shell_path($${PWD}/applications/mne_analyze/extensions)
}

# lib
MNE_LIBRARY_DIR = $$MNE_LIBRARY_DIR
isEmpty( MNE_LIBRARY_DIR ) {
    MNE_LIBRARY_DIR = $$shell_path($${PWD}/lib)
}

# bin
MNE_BINARY_DIR = $$MNE_BINARY_DIR
isEmpty( MNE_BINARY_DIR ) {
    MNE_BINARY_DIR = $$shell_path($${PWD}/bin)
}

# repository dir
ROOT_DIR = $${PWD}

# install
MNE_INSTALL_INCLUDE_DIR = $$MNE_INSTALL_INCLUDE_DIR
isEmpty( MNE_INSTALL_INCLUDE_DIR ) {
    MNE_INSTALL_INCLUDE_DIR = $$shell_path($${PWD}/include)
}

# FFTW dir
FFTW_DIR_LIBS = $$shell_path(C:\fftw-3.3.5-dll64)
FFTW_DIR_INCLUDE = $$shell_path(C:\fftw-3.3.5-dll64)


Removed unused 'DISTFILES +=' entry

Removed unused 'DISTFILES +=' entry

message("QtFirebase: configuring build for supported Firebase target platform...")

isEmpty(QTFIREBASE_SDK_PATH){
    QTFIREBASE_SDK_PATH = $$PWD/firebase_cpp_sdk
    message("No QTFIREBASE_SDK_PATH path sat. Using default (firebase_cpp_sdk) $$QTFIREBASE_SDK_PATH")
} else {
    message("Using QTFIREBASE_SDK_PATH ($$QTFIREBASE_SDK_PATH)")
}

QML_IMPORT_PATH += $$PWD

INCLUDEPATH += $$PWD

INCLUDEPATH += \
    $$QTFIREBASE_SDK_PATH/include \
    \

HEADERS += \
    $$PWD/src/platformutils.h \
    $$PWD/src/qtfirebase.h  \
    \

SOURCES += \
    $$PWD/src/qtfirebase.cpp \
    \

contains(QTPLUGIN,qtfirebase) {
    HEADERS += $$PWD/src/qtfirebase_plugin.h
    SOURCES += $$PWD/src/qtfirebase_plugin.cpp
}

!ios: {
    SOURCES += \
        $$PWD/src/platformutils.cpp
}

RESOURCES += \
    $$PWD/qtfirebase.qrc

android: {

    # Setup tips
    #
    # Add services to xml file
    # https://github.com/firebase/quickstart-cpp/blob/e8c20f678a06a28ebb73132abcd79d93b27622d9/messaging/testapp/AndroidManifest.xml
    #
    # Add the 'onNewIntent' function to your Qt Activity
    # https://github.com/firebase/quickstart-cpp/blob/e8c20f678a06a28ebb73132abcd79d93b27622d9/messaging/testapp/src/android/java/com/google/firebase/example/TestappNativeActivity.java

    message("QtFirebase Android base")
    QT += androidextras gui-private

    QTFIREBASE_SDK_LIBS_PATH = $$QTFIREBASE_SDK_PATH/libs/android/$$ANDROID_TARGET_ARCH/gnustl

    DEPENDPATH += $$QTFIREBASE_SDK_LIBS_PATH
}

ios: {

    # Setup tips
    #
    # Download the Google Firebase Framework link for Ios
    # and extract the files to this folder $$PWD/src/ios/Firebase/
    # or use your own folder QTFIREBASE_FRAMEWORKS_ROOT = YOUR/PWD
    # https://firebase.google.com/docs/ios/setup#frameworks

    message("QtFirebase iOS base")
    QT += gui_private

    QTFIREBASE_SDK_LIBS_PATH = $$QTFIREBASE_SDK_PATH/libs/ios/universal/

    QTFIREBASE_FRAMEWORKS_ROOT = $$PWD/src/ios/Firebase/

    QMAKE_LFLAGS += -ObjC

    HEADERS += \
        $$PWD/src/ios/AppDelegate.h \
        \

    OBJECTIVE_SOURCES += \
        $$PWD/src/ios/platformutils.mm \
        $$PWD/src/ios/AppDelegate.mm \
        \

    LIBS += \
        -ObjC \
        -lsqlite3 \
        -lz \
        -L$$QTFIREBASE_SDK_LIBS_PATH \
        -framework MediaPlayer \
        -framework CoreMotion \
        -framework CoreTelephony \
        -framework MessageUI \
        -framework GLKit \
        -framework AddressBook \
        -framework UIKit \
        \

    INCLUDEPATH += \
        $$QTFIREBASE_SDK_PATH/include \
        $$PWD/src \
        $$PWD/src/ios \
        \
}

# NOTE the order of linking is important!

PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libapp.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lapp

# AdMob
contains(DEFINES,QTFIREBASE_BUILD_ADMOB) {
    message( "QtFirebase including AdMob" )

    ios: {
        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/AdMob \
            -framework GoogleMobileAds \
            -framework AdSupport \
            -framework StoreKit \
            \
    }

    HEADERS += $$PWD/src/qtfirebaseadmob.h
    SOURCES += $$PWD/src/qtfirebaseadmob.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libadmob.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -ladmob
}

# RemoteConfig
contains(DEFINES,QTFIREBASE_BUILD_REMOTE_CONFIG) {
    message( "QtFirebase including RemoteConfig" )

    ios: {
        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/RemoteConfig \
            -framework FirebaseRemoteConfig \
            -framework Protobuf \
            \
    }

    HEADERS += $$PWD/src/qtfirebaseremoteconfig.h
    SOURCES += $$PWD/src/qtfirebaseremoteconfig.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libremote_config.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lremote_config
}

# Messaging
contains(DEFINES,QTFIREBASE_BUILD_MESSAGING) {
    message( "QtFirebase including Messaging" )

    ios: {
        message( "QtFirebase Messaging requires iOS v10.x to build. Setting QMAKE_IOS_DEPLOYMENT_TARGET = 10.0" )
        QMAKE_IOS_DEPLOYMENT_TARGET = 10.0

        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/Messaging \
            -framework FirebaseMessaging \
            -framework Protobuf \
            -framework UserNotifications \
            \
    }

    HEADERS += $$PWD/src/qtfirebasemessaging.h
    SOURCES += $$PWD/src/qtfirebasemessaging.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libmessaging.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lmessaging
}

# Analytics
contains(DEFINES,QTFIREBASE_BUILD_ANALYTICS) {
    message( "QtFirebase including Analytics" )

    ios: {
        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/Analytics \
            -framework FirebaseAnalytics \
            -framework FirebaseCore \
            -framework FirebaseCoreDiagnostics \
            -framework FirebaseInstanceID \
            -framework FirebaseNanoPB \
            -framework GoogleToolboxForMac \
            -framework nanopb \
            \
    }

    HEADERS += $$PWD/src/qtfirebaseanalytics.h
    SOURCES += $$PWD/src/qtfirebaseanalytics.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libanalytics.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lanalytics
}

message("QtFirebase: configuring build for supported Firebase target platform...")

isEmpty(QTFIREBASE_SDK_PATH){
    QTFIREBASE_SDK_PATH = $$PWD/firebase_cpp_sdk
    message("No QTFIREBASE_SDK_PATH path sat. Using default (firebase_cpp_sdk) $$QTFIREBASE_SDK_PATH")
} else {
    message("Using QTFIREBASE_SDK_PATH ($$QTFIREBASE_SDK_PATH)")
}

QML_IMPORT_PATH += $$PWD

INCLUDEPATH += $$PWD

INCLUDEPATH += \
    $$QTFIREBASE_SDK_PATH/include \
    \

HEADERS += \
    $$PWD/src/platformutils.h \
    $$PWD/src/qtfirebase.h  \
    \

SOURCES += \
    $$PWD/src/qtfirebase.cpp \
    \

contains(QTPLUGIN,qtfirebase) {
    HEADERS += $$PWD/src/qtfirebase_plugin.h
    SOURCES += $$PWD/src/qtfirebase_plugin.cpp
}

!ios: {
    SOURCES += \
        $$PWD/src/platformutils.cpp
}

RESOURCES += \
    $$PWD/qtfirebase.qrc

android: {

    # Setup tips
    #
    # Add services to xml file
    # https://github.com/firebase/quickstart-cpp/blob/e8c20f678a06a28ebb73132abcd79d93b27622d9/messaging/testapp/AndroidManifest.xml
    #
    # Add the 'onNewIntent' function to your Qt Activity
    # https://github.com/firebase/quickstart-cpp/blob/e8c20f678a06a28ebb73132abcd79d93b27622d9/messaging/testapp/src/android/java/com/google/firebase/example/TestappNativeActivity.java

    message("QtFirebase Android base")
    QT += androidextras gui-private

    QTFIREBASE_SDK_LIBS_PATH = $$QTFIREBASE_SDK_PATH/libs/android/$$ANDROID_TARGET_ARCH/gnustl

    DEPENDPATH += $$QTFIREBASE_SDK_LIBS_PATH
}

ios: {

    # Setup tips
    #
    # Download the Google Firebase Framework link for Ios
    # and extract the files to this folder $$PWD/src/ios/Firebase/
    # or use your own folder QTFIREBASE_FRAMEWORKS_ROOT = YOUR/PWD
    # https://firebase.google.com/docs/ios/setup#frameworks

    message("QtFirebase iOS base")
    QT += gui_private

    QTFIREBASE_SDK_LIBS_PATH = $$QTFIREBASE_SDK_PATH/libs/ios/universal/

    QTFIREBASE_FRAMEWORKS_ROOT = $$PWD/src/ios/Firebase/

    QMAKE_LFLAGS += -ObjC

    HEADERS += \
        $$PWD/src/ios/AppDelegate.h \
        \

    OBJECTIVE_SOURCES += \
        $$PWD/src/ios/platformutils.mm \
        $$PWD/src/ios/AppDelegate.mm \
        \

    LIBS += \
        -ObjC \
        -lsqlite3 \
        -lz \
        -L$$QTFIREBASE_SDK_LIBS_PATH \
        -framework MediaPlayer \
        -framework CoreMotion \
        -framework CoreTelephony \
        -framework MessageUI \
        -framework GLKit \
        -framework AddressBook \
        -framework UIKit \
        \

    DISTFILES += \
        $$PWD/src/ios/CocoaPods/Podfile \
        \

    INCLUDEPATH += \
        $$QTFIREBASE_SDK_PATH/include \
        $$PWD/src \
        $$PWD/src/ios \
        \
}

# NOTE the order of linking is important!

PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libapp.a
LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lapp

# AdMob
contains(DEFINES,QTFIREBASE_BUILD_ADMOB) {
    message( "QtFirebase including AdMob" )

    ios: {
        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/AdMob \
            -framework GoogleMobileAds \
            -framework AdSupport \
            -framework StoreKit \
            \
    }

    HEADERS += $$PWD/src/qtfirebaseadmob.h
    SOURCES += $$PWD/src/qtfirebaseadmob.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libadmob.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -ladmob
}

# RemoteConfig
contains(DEFINES,QTFIREBASE_BUILD_REMOTE_CONFIG) {
    message( "QtFirebase including RemoteConfig" )

    ios: {
        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/RemoteConfig \
            -framework FirebaseRemoteConfig \
            -framework Protobuf \
            \
    }

    HEADERS += $$PWD/src/qtfirebaseremoteconfig.h
    SOURCES += $$PWD/src/qtfirebaseremoteconfig.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libremote_config.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lremote_config
}

# Messaging
contains(DEFINES,QTFIREBASE_BUILD_MESSAGING) {
    message( "QtFirebase including Messaging" )

    ios: {
        message( "QtFirebase Messaging requires iOS v10.x to build. Setting QMAKE_IOS_DEPLOYMENT_TARGET = 10.0" )
        QMAKE_IOS_DEPLOYMENT_TARGET = 10.0

        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/Messaging \
            -framework FirebaseMessaging \
            -framework Protobuf \
            -framework UserNotifications \
            \
    }

    HEADERS += $$PWD/src/qtfirebasemessaging.h
    SOURCES += $$PWD/src/qtfirebasemessaging.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libmessaging.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lmessaging
}

# Analytics
contains(DEFINES,QTFIREBASE_BUILD_ANALYTICS) {
    message( "QtFirebase including Analytics" )

    ios: {
        LIBS += \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/Analytics \
            -framework FirebaseAnalytics \
            -framework FirebaseCore \
            -framework FirebaseCoreDiagnostics \
            -framework FirebaseInstanceID \
            -framework FirebaseNanoPB \
            -framework GoogleToolboxForMac \
            -framework nanopb \
            \
    }

    HEADERS += $$PWD/src/qtfirebaseanalytics.h
    SOURCES += $$PWD/src/qtfirebaseanalytics.cpp

    PRE_TARGETDEPS += $$QTFIREBASE_SDK_LIBS_PATH/libanalytics.a
    LIBS += -L$$QTFIREBASE_SDK_LIBS_PATH -lanalytics
}


Fix typo

Fix typo

HEADERS += \
    bluetooth/qbluetoothaddress.h\
    bluetooth/qbluetoothuuid.h\
    bluetooth/qbluetoothdeviceinfo.h\
    bluetooth/qbluetoothserviceinfo.h\
    bluetooth/qbluetoothdevicediscoveryagent.h\
    bluetooth/qbluetoothservicediscoveryagent.h\
    bluetooth/qbluetoothsocket.h\
    bluetooth/qrfcommserver.h \
    bluetooth/ql2capserver.h \
    bluetooth/qbluetooth.h \
    bluetooth/qbluetoothlocaldevice.h \
    bluetooth/ql2capsocket.h \
    bluetooth/qrfcommsocket.h \
    bluetooth/qbluetoothtransfermanager.h \
    bluetooth/qbluetoothtransferrequest.h \
    bluetooth/qbluetoothtransferreply.h

PRIVATE_HEADERS += \
    bluetooth/qbluetoothuuid_p.h\
    bluetooth/qbluetoothdeviceinfo_p.h\
    bluetooth/qbluetoothserviceinfo_p.h\
    bluetooth/qbluetoothdevicediscoveryagent_p.h\
    bluetooth/qbluetoothservicediscoveryagent_p.h\
    bluetooth/qbluetoothsocket_p.h\
    bluetooth/qrfcommserver_p.h \
    bluetooth/ql2capserver_p.h \
    bluetooth/qbluetoothtransferrequest_p.h

SOURCES += \
    bluetooth/qbluetoothaddress.cpp\
    bluetooth/qbluetoothuuid.cpp\
    bluetooth/qbluetoothdeviceinfo.cpp\
    bluetooth/qbluetoothserviceinfo.cpp\
    bluetooth/qbluetoothdevicediscoveryagent.cpp\
    bluetooth/qbluetoothservicediscoveryagent.cpp\
    bluetooth/qbluetoothsocket.cpp\
    bluetooth/qrfcommserver.cpp \
    bluetooth/ql2capserver.cpp \
    bluetooth/qbluetoothlocaldevice.cpp \
    bluetooth/qbluetooth.cpp \
    bluetooth/ql2capsocket.cpp \
    bluetooth/qrfcommsocket.cpp \
    bluetooth/qbluetoothtransfermanager.cpp \
    bluetooth/qbluetoothtransferrequest.cpp \
    bluetooth/qbluetoothtransferreply.cpp

symbian {
    contains(S60_VERSION, 3.1) | contains(S60_VERSION, 3.2) {
        DEFINES += DO_NOT_BUILD_BLUETOOTH_SYMBIAN_BACKEND
        message("S60 3.1 or 3.2 sdk not supported by bluetooth")
        SOURCES += \
            bluetooth/qbluetoothdevicediscoveryagent_p.cpp \
            bluetooth/qbluetoothlocaldevice_p.cpp \
            bluetooth/qbluetoothserviceinfo_p.cpp \
            bluetooth/qbluetoothservicediscoveryagent_p.cpp \
            bluetooth/qbluetoothsocket_p.cpp \
            bluetooth/ql2capserver_p.cpp \
            bluetooth/qrfcommserver_p.cpp \
            bluetooth/qbluetoothtransfermanager_p.cpp
    }
}

symbian {
    !contains(DEFINES, DO_NOT_BUILD_BLUETOOTH_SYMBIAN_BACKEND) {
        DEFINES += QTM_SYMBIAN_BLUETOOTH
        INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
        include(symbian/symbian.pri)

        PRIVATE_HEADERS += \
                        bluetooth/qbluetoothtransferreply_symbian_p.h

        SOURCES += \
                        bluetooth/qbluetoothserviceinfo_symbian.cpp\
                        bluetooth/qbluetoothdevicediscoveryagent_symbian.cpp\
            bluetooth/qbluetoothservicediscoveryagent_symbian.cpp\
            bluetooth/qbluetoothsocket_symbian.cpp\
            bluetooth/qrfcommserver_symbian.cpp \
            bluetooth/qbluetoothlocaldevice_symbian.cpp \
                        bluetooth/qbluetoothtransfermanager_symbian.cpp \
            bluetooth/qbluetoothtransferreply_symbian.cpp \
                bluetooth/ql2capserver_symbian.cpp

        contains(S60_VERSION, 5.0) {
            message("NOTICE - START")
            message("Bluetooth backend needs SDK plugin from Forum Nokia for 5.0 SDK")
            message("NOTICE - END")
            LIBS *= -lesock -lbluetooth -lsdpagent -lsdpdatabase -lestlib -lirobex -lbtengsettings
        } else {
            LIBS *= -lesock -lbluetooth -lsdpagent -lsdpdatabase -lestlib -lobex -lbtengsettings
        }
    }
} else:contains(bluez_enabled, yes):contains(QT_CONFIG, dbus) {
    QT *= dbus

    include(bluez/bluez.pri)

    PRIVATE_HEADERS += \
        bluetooth/qbluetoothtransferreply_bluez_p.h

    SOURCES += \
        bluetooth/qbluetoothserviceinfo_bluez.cpp \
        bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp\
        bluetooth/qbluetoothservicediscoveryagent_bluez.cpp \
        bluetooth/qbluetoothsocket_bluez.cpp \
        bluetooth/qrfcommserver_bluez.cpp \
        bluetooth/qbluetoothlocaldevice_bluez.cpp \
        bluetooth/qbluetoothtransferreply_bluez.cpp \
        bluetooth/qbluetoothtransfermanager_bluez.cpp \
        bluetooth/ql2capserver_bluez.cpp
} else {
    message("Unsupported bluetooth platform, will not build a working QBluetooth library")
    message("Either no Qt dBus found, no bluez headers, or not symbian")
    SOURCES += \
        bluetooth/qbluetoothdevicediscoveryagent_p.cpp \
        bluetooth/qbluetoothlocaldevice_p.cpp \
        bluetooth/qbluetoothserviceinfo_p.cpp \
        bluetooth/qbluetoothservicediscoveryagent_p.cpp \
        bluetooth/qbluetoothsocket_p.cpp \
        bluetooth/ql2capserver_p.cpp \
        bluetooth/qrfcommserver_p.cpp \
        bluetooth/qbluetoothtransfermanager_p.cpp

}

INCLUDEPATH += $$PWD
INCLUDEPATH += ..
INCLUDEPATH += $${QMAKE_INCDIR_QT}/QtNetwork

OTHER_FILES +=

HEADERS += \
    bluetooth/qbluetoothaddress.h\
    bluetooth/qbluetoothuuid.h\
    bluetooth/qbluetoothdeviceinfo.h\
    bluetooth/qbluetoothserviceinfo.h\
    bluetooth/qbluetoothdevicediscoveryagent.h\
    bluetooth/qbluetoothservicediscoveryagent.h\
    bluetooth/qbluetoothsocket.h\
    bluetooth/qrfcommserver.h \
    bluetooth/ql2capserver.h \
    bluetooth/qbluetooth.h \
    bluetooth/qbluetoothlocaldevice.h \
    bluetooth/ql2capsocket.h \
    bluetooth/qrfcommsocket.h \
    bluetooth/qbluetoothtransfermanager.h \
    bluetooth/qbluetoothtransferrequest.h \
    bluetooth/qbluetoothtransferreply.h

PRIVATE_HEADERS += \
    bluetooth/qbluetoothuuid_p.h\
    bluetooth/qbluetoothdeviceinfo_p.h\
    bluetooth/qbluetoothserviceinfo_p.h\
    bluetooth/qbluetoothdevicediscoveryagent_p.h\
    bluetooth/qbluetoothservicediscoveryagent_p.h\
    bluetooth/qbluetoothsocket_p.h\
    bluetooth/qrfcommserver_p.h \
    bluetooth/ql2capserver_p.h \
    bluetooth/qbluetoothtransferrequest_p.h

SOURCES += \
    bluetooth/qbluetoothaddress.cpp\
    bluetooth/qbluetoothuuid.cpp\
    bluetooth/qbluetoothdeviceinfo.cpp\
    bluetooth/qbluetoothserviceinfo.cpp\
    bluetooth/qbluetoothdevicediscoveryagent.cpp\
    bluetooth/qbluetoothservicediscoveryagent.cpp\
    bluetooth/qbluetoothsocket.cpp\
    bluetooth/qrfcommserver.cpp \
    bluetooth/ql2capserver.cpp \
    bluetooth/qbluetoothlocaldevice.cpp \
    bluetooth/qbluetooth.cpp \
    bluetooth/ql2capsocket.cpp \
    bluetooth/qrfcommsocket.cpp \
    bluetooth/qbluetoothtransfermanager.cpp \
    bluetooth/qbluetoothtransferrequest.cpp \
    bluetooth/qbluetoothtransferreply.cpp

symbian {
    contains(S60_VERSION, 3.1) | contains(S60_VERSION, 3.2) {
        DEFINES += DO_NOT_BUILD_BLUETOOTH_SYMBIAN_BACKEND
        message("S60 3.1 or 3.2 sdk not supported by bluetooth")
        SOURCES += \
            bluetooth/qbluetoothdevicediscoveryagent_p.cpp \
            bluetooth/qbluetoothlocaldevice_p.cpp \
            bluetooth/qbluetoothserviceinfo_p.cpp \
            bluetooth/qbluetoothservicediscoveryagent_p.cpp \
            bluetooth/qbluetoothsocket_p.cpp \
            bluetooth/ql2capserver_p.cpp \
            bluetooth/qrfcommserver_p.cpp \
            bluetooth/qbluetoothtransfermanage_p.cpp
    }
}

symbian {
    !contains(DEFINES, DO_NOT_BUILD_BLUETOOTH_SYMBIAN_BACKEND) {
        DEFINES += QTM_SYMBIAN_BLUETOOTH
        INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
        include(symbian/symbian.pri)

        PRIVATE_HEADERS += \
                        bluetooth/qbluetoothtransferreply_symbian_p.h

        SOURCES += \
                        bluetooth/qbluetoothserviceinfo_symbian.cpp\
                        bluetooth/qbluetoothdevicediscoveryagent_symbian.cpp\
            bluetooth/qbluetoothservicediscoveryagent_symbian.cpp\
            bluetooth/qbluetoothsocket_symbian.cpp\
            bluetooth/qrfcommserver_symbian.cpp \
            bluetooth/qbluetoothlocaldevice_symbian.cpp \
                        bluetooth/qbluetoothtransfermanager_symbian.cpp \
            bluetooth/qbluetoothtransferreply_symbian.cpp \
                bluetooth/ql2capserver_symbian.cpp

        contains(S60_VERSION, 5.0) {
            message("NOTICE - START")
            message("Bluetooth backend needs SDK plugin from Forum Nokia for 5.0 SDK")
            message("NOTICE - END")
            LIBS *= -lesock -lbluetooth -lsdpagent -lsdpdatabase -lestlib -lirobex -lbtengsettings
        } else {
            LIBS *= -lesock -lbluetooth -lsdpagent -lsdpdatabase -lestlib -lobex -lbtengsettings
        }
    }
} else:contains(bluez_enabled, yes):contains(QT_CONFIG, dbus) {
    QT *= dbus

    include(bluez/bluez.pri)

    PRIVATE_HEADERS += \
        bluetooth/qbluetoothtransferreply_bluez_p.h

    SOURCES += \
        bluetooth/qbluetoothserviceinfo_bluez.cpp \
        bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp\
        bluetooth/qbluetoothservicediscoveryagent_bluez.cpp \
        bluetooth/qbluetoothsocket_bluez.cpp \
        bluetooth/qrfcommserver_bluez.cpp \
        bluetooth/qbluetoothlocaldevice_bluez.cpp \
        bluetooth/qbluetoothtransferreply_bluez.cpp \
        bluetooth/qbluetoothtransfermanager_bluez.cpp \
        bluetooth/ql2capserver_bluez.cpp
} else {
    message("Unsupported bluetooth platform, will not build a working QBluetooth library")
    message("Either no Qt dBus found, no bluez headers, or not symbian")
    SOURCES += \
        bluetooth/qbluetoothdevicediscoveryagent_p.cpp \
        bluetooth/qbluetoothlocaldevice_p.cpp \
        bluetooth/qbluetoothserviceinfo_p.cpp \
        bluetooth/qbluetoothservicediscoveryagent_p.cpp \
        bluetooth/qbluetoothsocket_p.cpp \
        bluetooth/ql2capserver_p.cpp \
        bluetooth/qrfcommserver_p.cpp \
        bluetooth/qbluetoothtransfermanager_p.cpp

}

INCLUDEPATH += $$PWD
INCLUDEPATH += ..
INCLUDEPATH += $${QMAKE_INCDIR_QT}/QtNetwork

OTHER_FILES +=


build: attempt to resolve Fedora's 64bit builds

#############################################################################
# Application name & version
#############################################################################

APPNAME    = Q Light Controller Plus
FXEDNAME   = Fixture Definition Editor
APPVERSION = 4.10.3

# Disable these if you don't want to see GIT short hash in the About Box
#unix:REVISION = $$system(git log --pretty=format:'%h' -n 1)
#unix:APPVERSION = $$APPVERSION-r$$REVISION

#############################################################################
# Compiler & linker configuration
#############################################################################

# Treat all compiler warnings as errors
QMAKE_CXXFLAGS += -Werror

CONFIG         += warn_on

# Build everything in the order specified in .pro files
CONFIG         += ordered

# Enable the following 2 lines when making a release
CONFIG         += release
DEFINES        += QT_NO_DEBUG_OUTPUT

# Disable this when making a release
CONFIG         -= debug

!macx:!ios: {
 system( g++ --version | grep -e "4.6.[0-9]" ) {
   #message("g++ version 4.6 found")
   QMAKE_CXXFLAGS += -Wno-error=strict-overflow
 }
 else {
   QMAKE_CXXFLAGS += -Wno-unused-local-typedefs # Fix to build with GCC 4.8
 }
}

unix:OLA_GIT    = /usr/src/ola    # OLA directories

#macx:CONFIG   += x86 ppc  # Build universal binaries (Leopard only)
macx:CONFIG    -= app_bundle # Let QLC+ construct the .app bundle
# Qt 5.5 and above
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
  macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}

# Produce build targets to the source directory
win32:DESTDIR  = ./

# Don't whine about some imports
win32:QMAKE_LFLAGS += -Wl,--enable-auto-import

# Enable unit test coverage measurement ('qmake CONFIG+=coverage' works, too)
#CONFIG        += coverage

#############################################################################
# Installation paths
#############################################################################

# Install root
win32:INSTALLROOT       = $$(SystemDrive)/qlcplus
macx:INSTALLROOT        = ~/QLC+.app/Contents
unix:!macx:INSTALLROOT += /usr
android:INSTALLROOT     = /
ios:INSTALLROOT         = /

# Binaries
win32:BINDIR      =
unix:!macx:BINDIR = bin
macx:BINDIR       = MacOS
android:BINDIR    = bin
ios:BINDIR        =

# Libraries
win32:LIBSDIR      =
unix:!macx:LIBSDIR = lib
macx:LIBSDIR       = Frameworks
android:LIBSDIR    = /libs/armeabi-v7a
ios:LIBSDIR        = lib

# Data
win32:DATADIR      =
unix:!macx:DATADIR = share/qlcplus
macx:DATADIR       = Resources
android:DATADIR    = /assets
ios:DATADIR        =

# User Data
win32:USERDATADIR      = QLC+
unix:!macx:USERDATADIR = .qlcplus
macx:USERDATADIR       = "Library/Application Support/QLC+"
android:USERDATADIR    = .qlcplus
ios:USERDATADIR        = .qlcplus

# Documentation
win32:DOCSDIR      = Documents
unix:!macx:DOCSDIR = $$DATADIR/documents
macx:DOCSDIR       = $$DATADIR/Documents
android:DOCSDIR    = $$DATADIR/documents
ios:DOCSDIR        = Documents

# Input profiles
win32:INPUTPROFILEDIR      = InputProfiles
unix:!macx:INPUTPROFILEDIR = $$DATADIR/inputprofiles
macx:INPUTPROFILEDIR       = $$DATADIR/InputProfiles
android:INPUTPROFILEDIR    = $$DATADIR/inputprofiles
ios:INPUTPROFILEDIR        = InputProfiles

# User input profiles
win32:USERINPUTPROFILEDIR      = $$USERDATADIR/InputProfiles
unix:!macx:USERINPUTPROFILEDIR = $$USERDATADIR/inputprofiles
macx:USERINPUTPROFILEDIR       = $$USERDATADIR/InputProfiles
android:USERINPUTPROFILEDIR    = $$USERDATADIR/inputprofiles
ios:USERINPUTPROFILEDIR        = $$USERDATADIR/InputProfiles

# Midi templates
win32:MIDITEMPLATEDIR      = MidiTemplates
unix:!macx:MIDITEMPLATEDIR = $$DATADIR/miditemplates
macx:MIDITEMPLATEDIR       = $$DATADIR/MidiTemplates
android:MIDITEMPLATEDIR    = $$DATADIR/miditemplates
ios:MIDITEMPLATEDIR        = MidiTemplates

# User midi templates
win32:USERMIDITEMPLATEDIR      = $$USERDATADIR/MidiTemplates
unix:!macx:USERMIDITEMPLATEDIR = $$USERDATADIR/miditemplates
macx:USERMIDITEMPLATEDIR       = $$USERDATADIR/MidiTemplates
android:USERMIDITEMPLATEDIR    = $$USERDATADIR/miditemplates
ios:USERMIDITEMPLATEDIR        = $$USERDATADIR/MidiTemplates

# Channel modifiers templates
win32:MODIFIERSTEMPLATEDIR      = ModifiersTemplates
unix:!macx:MODIFIERSTEMPLATEDIR = $$DATADIR/modifierstemplates
macx:MODIFIERSTEMPLATEDIR       = $$DATADIR/ModifiersTemplates
android:MODIFIERSTEMPLATEDIR    = $$DATADIR/modifierstemplates
ios:MODIFIERSTEMPLATEDIR        = ModifiersTemplates

# User midi templates
win32:USERMODIFIERSTEMPLATEDIR      = $$USERDATADIR/ModifiersTemplates
unix:!macx:USERMODIFIERSTEMPLATEDIR = $$USERDATADIR/modifierstemplates
macx:USERMODIFIERSTEMPLATEDIR       = $$USERDATADIR/ModifiersTemplates
android:USERMODIFIERSTEMPLATEDIR    = $$USERDATADIR/modifierstemplates
ios:USERMODIFIERSTEMPLATEDIR        = $$USERDATADIR/ModifiersTemplates

# Fixtures
win32:FIXTUREDIR      = Fixtures
unix:!macx:FIXTUREDIR = $$DATADIR/fixtures
macx:FIXTUREDIR       = $$DATADIR/Fixtures
android:FIXTUREDIR    = $$DATADIR/fixtures
ios:FIXTUREDIR        = Fixtures

# Gobos
win32:GOBODIR      = Gobos
unix:!macx:GOBODIR = $$DATADIR/gobos
macx:GOBODIR       = $$DATADIR/Gobos
android:GOBODIR    = $$DATADIR/gobos
ios:GOBODIR        = Gobos

# User fixtures
win32:USERFIXTUREDIR      = $$USERDATADIR/Fixtures
unix:!macx:USERFIXTUREDIR = $$USERDATADIR/fixtures
macx:USERFIXTUREDIR       = $$USERDATADIR/Fixtures
android:USERFIXTUREDIR    = $$USERDATADIR/fixtures
ios:USERFIXTUREDIR        = $$USERDATADIR/Fixtures

# Plugins
win32:PLUGINDIR      = Plugins
unix:!macx:PLUGINDIR = $$LIBSDIR/qt4/plugins/qlcplus
macx:PLUGINDIR       = PlugIns
android:PLUGINDIR    = Plugins
ios:PLUGINDIR        = Plugins

# Translations
win32:TRANSLATIONDIR      =
unix:!macx:TRANSLATIONDIR = $$DATADIR/translations
macx:TRANSLATIONDIR       = $$DATADIR/Translations
android:TRANSLATIONDIR    = $$DATADIR/translations
ios:TRANSLATIONDIR        =

# RGB Scripts
win32:RGBSCRIPTDIR      = RGBScripts
unix:!macx:RGBSCRIPTDIR = $$DATADIR/rgbscripts
macx:RGBSCRIPTDIR       = $$DATADIR/RGBScripts
android:RGBSCRIPTDIR    = $$DATADIR/rgbscripts
ios:RGBSCRIPTDIR        = RGBScripts

# User RGB Scripts
win32:USERRGBSCRIPTDIR      = $$USERDATADIR/RGBScripts
unix:!macx:USERRGBSCRIPTDIR = $$USERDATADIR/rgbscripts
macx:USERRGBSCRIPTDIR       = $$USERDATADIR/RGBScripts
android:USERRGBSCRIPTDIR    = $$USERDATADIR/rgbscripts
ios:USERRGBSCRIPTDIR        = $$USERDATADIR/RGBScripts

# RGB Scripts
win32:WEBFILESDIR      = Web
unix:!macx:WEBFILESDIR = $$DATADIR/web
macx:WEBFILESDIR       = $$DATADIR/Web
android:WEBFILESDIR    = $$DATADIR/web
ios:WEBFILESDIR        = Web

unix:!macx: {
  QTPREFIX = $$[QT_INSTALL_PREFIX]
  contains(QTPREFIX, "/usr") {
    QTLIBSDIR = $$[QT_INSTALL_LIBS]
    QTPLUGINSDIR = $$[QT_INSTALL_PLUGINS]
    LIBSDIR = $$replace(QTLIBSDIR, "/usr/", "")
    PLUGINDIR = $$replace(QTPLUGINSDIR, "/usr/", "")/qlcplus
  }
  message("Qt install prefix: "$$[QT_INSTALL_PREFIX])
  message("Qt install libs: "$$[QT_INSTALL_LIBS])
  message("Linux libs dir: " $$INSTALLROOT/$$LIBSDIR)
  message("Linux plugins dir: " $$INSTALLROOT/$$PLUGINDIR)
}

#############################################################################
# Application name & version
#############################################################################

APPNAME    = Q Light Controller Plus
FXEDNAME   = Fixture Definition Editor
APPVERSION = 4.10.3

# Disable these if you don't want to see GIT short hash in the About Box
#unix:REVISION = $$system(git log --pretty=format:'%h' -n 1)
#unix:APPVERSION = $$APPVERSION-r$$REVISION

#############################################################################
# Compiler & linker configuration
#############################################################################

# Treat all compiler warnings as errors
QMAKE_CXXFLAGS += -Werror

CONFIG         += warn_on

# Build everything in the order specified in .pro files
CONFIG         += ordered

# Enable the following 2 lines when making a release
CONFIG         += release
DEFINES        += QT_NO_DEBUG_OUTPUT

# Disable this when making a release
CONFIG         -= debug

!macx:!ios: {
 system( g++ --version | grep -e "4.6.[0-9]" ) {
   #message("g++ version 4.6 found")
   QMAKE_CXXFLAGS += -Wno-error=strict-overflow
 }
 else {
   QMAKE_CXXFLAGS += -Wno-unused-local-typedefs # Fix to build with GCC 4.8
 }
}

unix:OLA_GIT    = /usr/src/ola    # OLA directories

#macx:CONFIG   += x86 ppc  # Build universal binaries (Leopard only)
macx:CONFIG    -= app_bundle # Let QLC+ construct the .app bundle
# Qt 5.5 and above
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
  macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}

# Produce build targets to the source directory
win32:DESTDIR  = ./

# Don't whine about some imports
win32:QMAKE_LFLAGS += -Wl,--enable-auto-import

# Enable unit test coverage measurement ('qmake CONFIG+=coverage' works, too)
#CONFIG        += coverage

#############################################################################
# Installation paths
#############################################################################

# Install root
win32:INSTALLROOT       = $$(SystemDrive)/qlcplus
macx:INSTALLROOT        = ~/QLC+.app/Contents
unix:!macx:INSTALLROOT += /usr
android:INSTALLROOT     = /
ios:INSTALLROOT         = /

# Binaries
win32:BINDIR      =
unix:!macx:BINDIR = bin
macx:BINDIR       = MacOS
android:BINDIR    = bin
ios:BINDIR        =

# Libraries
win32:LIBSDIR      =
unix:!macx:LIBSDIR = lib
macx:LIBSDIR       = Frameworks
android:LIBSDIR    = /libs/armeabi-v7a
ios:LIBSDIR        = lib

# Data
win32:DATADIR      =
unix:!macx:DATADIR = share/qlcplus
macx:DATADIR       = Resources
android:DATADIR    = /assets
ios:DATADIR        =

# User Data
win32:USERDATADIR      = QLC+
unix:!macx:USERDATADIR = .qlcplus
macx:USERDATADIR       = "Library/Application Support/QLC+"
android:USERDATADIR    = .qlcplus
ios:USERDATADIR        = .qlcplus

# Documentation
win32:DOCSDIR      = Documents
unix:!macx:DOCSDIR = $$DATADIR/documents
macx:DOCSDIR       = $$DATADIR/Documents
android:DOCSDIR    = $$DATADIR/documents
ios:DOCSDIR        = Documents

# Input profiles
win32:INPUTPROFILEDIR      = InputProfiles
unix:!macx:INPUTPROFILEDIR = $$DATADIR/inputprofiles
macx:INPUTPROFILEDIR       = $$DATADIR/InputProfiles
android:INPUTPROFILEDIR    = $$DATADIR/inputprofiles
ios:INPUTPROFILEDIR        = InputProfiles

# User input profiles
win32:USERINPUTPROFILEDIR      = $$USERDATADIR/InputProfiles
unix:!macx:USERINPUTPROFILEDIR = $$USERDATADIR/inputprofiles
macx:USERINPUTPROFILEDIR       = $$USERDATADIR/InputProfiles
android:USERINPUTPROFILEDIR    = $$USERDATADIR/inputprofiles
ios:USERINPUTPROFILEDIR        = $$USERDATADIR/InputProfiles

# Midi templates
win32:MIDITEMPLATEDIR      = MidiTemplates
unix:!macx:MIDITEMPLATEDIR = $$DATADIR/miditemplates
macx:MIDITEMPLATEDIR       = $$DATADIR/MidiTemplates
android:MIDITEMPLATEDIR    = $$DATADIR/miditemplates
ios:MIDITEMPLATEDIR        = MidiTemplates

# User midi templates
win32:USERMIDITEMPLATEDIR      = $$USERDATADIR/MidiTemplates
unix:!macx:USERMIDITEMPLATEDIR = $$USERDATADIR/miditemplates
macx:USERMIDITEMPLATEDIR       = $$USERDATADIR/MidiTemplates
android:USERMIDITEMPLATEDIR    = $$USERDATADIR/miditemplates
ios:USERMIDITEMPLATEDIR        = $$USERDATADIR/MidiTemplates

# Channel modifiers templates
win32:MODIFIERSTEMPLATEDIR      = ModifiersTemplates
unix:!macx:MODIFIERSTEMPLATEDIR = $$DATADIR/modifierstemplates
macx:MODIFIERSTEMPLATEDIR       = $$DATADIR/ModifiersTemplates
android:MODIFIERSTEMPLATEDIR    = $$DATADIR/modifierstemplates
ios:MODIFIERSTEMPLATEDIR        = ModifiersTemplates

# User midi templates
win32:USERMODIFIERSTEMPLATEDIR      = $$USERDATADIR/ModifiersTemplates
unix:!macx:USERMODIFIERSTEMPLATEDIR = $$USERDATADIR/modifierstemplates
macx:USERMODIFIERSTEMPLATEDIR       = $$USERDATADIR/ModifiersTemplates
android:USERMODIFIERSTEMPLATEDIR    = $$USERDATADIR/modifierstemplates
ios:USERMODIFIERSTEMPLATEDIR        = $$USERDATADIR/ModifiersTemplates

# Fixtures
win32:FIXTUREDIR      = Fixtures
unix:!macx:FIXTUREDIR = $$DATADIR/fixtures
macx:FIXTUREDIR       = $$DATADIR/Fixtures
android:FIXTUREDIR    = $$DATADIR/fixtures
ios:FIXTUREDIR        = Fixtures

# Gobos
win32:GOBODIR      = Gobos
unix:!macx:GOBODIR = $$DATADIR/gobos
macx:GOBODIR       = $$DATADIR/Gobos
android:GOBODIR    = $$DATADIR/gobos
ios:GOBODIR        = Gobos

# User fixtures
win32:USERFIXTUREDIR      = $$USERDATADIR/Fixtures
unix:!macx:USERFIXTUREDIR = $$USERDATADIR/fixtures
macx:USERFIXTUREDIR       = $$USERDATADIR/Fixtures
android:USERFIXTUREDIR    = $$USERDATADIR/fixtures
ios:USERFIXTUREDIR        = $$USERDATADIR/Fixtures

# Plugins
win32:PLUGINDIR      = Plugins
unix:!macx:PLUGINDIR = $$LIBSDIR/qt4/plugins/qlcplus
macx:PLUGINDIR       = PlugIns
android:PLUGINDIR    = Plugins
ios:PLUGINDIR        = Plugins

# Translations
win32:TRANSLATIONDIR      =
unix:!macx:TRANSLATIONDIR = $$DATADIR/translations
macx:TRANSLATIONDIR       = $$DATADIR/Translations
android:TRANSLATIONDIR    = $$DATADIR/translations
ios:TRANSLATIONDIR        =

# RGB Scripts
win32:RGBSCRIPTDIR      = RGBScripts
unix:!macx:RGBSCRIPTDIR = $$DATADIR/rgbscripts
macx:RGBSCRIPTDIR       = $$DATADIR/RGBScripts
android:RGBSCRIPTDIR    = $$DATADIR/rgbscripts
ios:RGBSCRIPTDIR        = RGBScripts

# User RGB Scripts
win32:USERRGBSCRIPTDIR      = $$USERDATADIR/RGBScripts
unix:!macx:USERRGBSCRIPTDIR = $$USERDATADIR/rgbscripts
macx:USERRGBSCRIPTDIR       = $$USERDATADIR/RGBScripts
android:USERRGBSCRIPTDIR    = $$USERDATADIR/rgbscripts
ios:USERRGBSCRIPTDIR        = $$USERDATADIR/RGBScripts

# RGB Scripts
win32:WEBFILESDIR      = Web
unix:!macx:WEBFILESDIR = $$DATADIR/web
macx:WEBFILESDIR       = $$DATADIR/Web
android:WEBFILESDIR    = $$DATADIR/web
ios:WEBFILESDIR        = Web

unix:!macx: {
  QTPREFIX = $$[QT_INSTALL_PREFIX]
  equals(QTPREFIX, "/usr") {
    QTLIBSDIR = $$[QT_INSTALL_LIBS]
    QTPLUGINSDIR = $$[QT_INSTALL_PLUGINS]
    LIBSDIR = $$replace(QTLIBSDIR, "/usr/", "")
    PLUGINDIR = $$replace(QTPLUGINSDIR, "/usr/", "")/qlcplus
  }
  message("Qt install prefix: "$$[QT_INSTALL_PREFIX])
  message("Qt install libs: "$$[QT_INSTALL_LIBS])
  message("Linux libs dir: " $$INSTALLROOT/$$LIBSDIR)
  message("Linux plugins dir: " $$INSTALLROOT/$$PLUGINDIR)
}


Fixed build for mac

Fixed build for mac

INCLUDEPATH *= $$PWD/../include
DEPENDPATH  *= $$PWD

QT       -= gui

DEFINES += QT_NO_CAST_FROM_ASCII

SOURCES += qmimedatabase.cpp \
    qmimetype.cpp \
    magicmatcher.cpp \
    mimetypeparser.cpp \
    qmimemagicrule.cpp

HEADERS += qmime_global.h \
    qmimedatabase.h \
    qmimetype.h \
    magicmatcher.h \
    qmimetype_p.h \
    magicmatcher_p.h \
    mimetypeparser_p.h \
    qmimedatabase_p.h \
    qmimemagicrule.h

INCLUDEPATH *= $$PWD/../include
DEPENDPATH  *= $$PWD

DEFINES += QT_NO_CAST_FROM_ASCII

SOURCES += qmimedatabase.cpp \
    qmimetype.cpp \
    magicmatcher.cpp \
    mimetypeparser.cpp \
    qmimemagicrule.cpp

HEADERS += qmime_global.h \
    qmimedatabase.h \
    qmimetype.h \
    magicmatcher.h \
    qmimetype_p.h \
    magicmatcher_p.h \
    mimetypeparser_p.h \
    qmimedatabase_p.h \
    qmimemagicrule.h


Disable the udis86 disassembler by default

It's only required for debugging the JIT, and thus
shouldn't be included in a regular build. Enable it
with CONFIG+=disassembler

Change-Id: I71264da0be00e8618f120ac9d3d06e6cb4b6dfae
Reviewed-by: Simon Hausmann <a975102812d593b3191088e3d0aeaeb6f11dbcf5@digia.com>

!ios:!if(win*:isEqual(QT_ARCH, "x86_64")): DEFINES += V4_ENABLE_JIT

# On Qt/Android/ARM release builds are thumb and debug builds arm,
# but we'll force the JIT to always generate thumb2
android:isEqual(QT_ARCH, "arm") {
    DEFINES += WTF_CPU_ARM_THUMB2
}

DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

win*: DEFINES += NOMINMAX

DEFINES += ENABLE_LLINT=0
DEFINES += ENABLE_DFG_JIT=0
DEFINES += ENABLE_JIT_CONSTANT_BLINDING=0
DEFINES += ENABLE_ASSEMBLER=1
DEFINES += BUILDING_QT__
DEFINES += ENABLE_YARR_JIT=1
DEFINES += ENABLE_JIT=1

INCLUDEPATH += $$PWD/jit
INCLUDEPATH += $$PWD/assembler
INCLUDEPATH += $$PWD/runtime
INCLUDEPATH += $$PWD/wtf
INCLUDEPATH += $$PWD/stubs
INCLUDEPATH += $$PWD/stubs/wtf
INCLUDEPATH += $$PWD

disassembler:if(isEqual(QT_ARCH, "i386")|isEqual(QT_ARCH, "x86_64")):!win*: DEFINES += WTF_USE_UDIS86=1
else: DEFINES += WTF_USE_UDIS86=0

INCLUDEPATH += $$PWD/disassembler
INCLUDEPATH += $$PWD/disassembler/udis86
INCLUDEPATH += $$_OUT_PWD

!ios:!if(win*:isEqual(QT_ARCH, "x86_64")): DEFINES += V4_ENABLE_JIT

# On Qt/Android/ARM release builds are thumb and debug builds arm,
# but we'll force the JIT to always generate thumb2
android:isEqual(QT_ARCH, "arm") {
    DEFINES += WTF_CPU_ARM_THUMB2
}

DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

win*: DEFINES += NOMINMAX

DEFINES += ENABLE_LLINT=0
DEFINES += ENABLE_DFG_JIT=0
DEFINES += ENABLE_JIT_CONSTANT_BLINDING=0
DEFINES += ENABLE_ASSEMBLER=1
DEFINES += BUILDING_QT__
DEFINES += ENABLE_YARR_JIT=1
DEFINES += ENABLE_JIT=1

INCLUDEPATH += $$PWD/jit
INCLUDEPATH += $$PWD/assembler
INCLUDEPATH += $$PWD/runtime
INCLUDEPATH += $$PWD/wtf
INCLUDEPATH += $$PWD/stubs
INCLUDEPATH += $$PWD/stubs/wtf
INCLUDEPATH += $$PWD

if(isEqual(QT_ARCH, "i386")|isEqual(QT_ARCH, "x86_64")):!win*: DEFINES += WTF_USE_UDIS86=1
else: DEFINES += WTF_USE_UDIS86=0

INCLUDEPATH += $$PWD/disassembler
INCLUDEPATH += $$PWD/disassembler/udis86
INCLUDEPATH += $$_OUT_PWD


Build: Removed unneccesary build options, fix #497

#
# Tell the Linux build to look in a few additional places for libs
#

LinuxBuild {
	LIBS += \
		-L/usr/lib

    linux-g++-64 {
        LIBS += \
            -L/usr/local/lib64 \
            -L/usr/lib64
	}
}

#
# Add in a few missing headers to windows
#

WindowsBuild {
    INCLUDEPATH += libs/lib/msinttypes
}

#
# QUpgrade
#

exists(qupgrade) {
    message(Including support for QUpgrade)

    DEFINES += QUPGRADE_SUPPORT

    INCLUDEPATH += qupgrade/src/apps/qupgrade

    FORMS += \
        qupgrade/src/apps/qupgrade/dialog_bare.ui \
        qupgrade/src/apps/qupgrade/boardwidget.ui

    HEADERS += \
        qupgrade/src/apps/qupgrade/qgcfirmwareupgradeworker.h \
        qupgrade/src/apps/qupgrade/uploader.h \
        qupgrade/src/apps/qupgrade/dialog_bare.h \
        qupgrade/src/apps/qupgrade/boardwidget.h

    SOURCES += \
        qupgrade/src/apps/qupgrade/qgcfirmwareupgradeworker.cpp \
        qupgrade/src/apps/qupgrade/uploader.cpp \
        qupgrade/src/apps/qupgrade/dialog_bare.cpp \
        qupgrade/src/apps/qupgrade/boardwidget.cpp

    RESOURCES += \
        qupgrade/qupgrade.qrc

    LinuxBuild:CONFIG += qesp_linux_udev

    include(qupgrade/libs/qextserialport/src/qextserialport.pri)
} else {
    message(Skipping support for QUpgrade)
}

#
# MAVLink
#

MAVLINK_CONF = ""
MAVLINKPATH = $$BASEDIR/libs/mavlink/include/mavlink/v1.0
DEFINES += MAVLINK_NO_DATA

# If the user config file exists, it will be included.
# if the variable MAVLINK_CONF contains the name of an
# additional project, QGroundControl includes the support
# of custom MAVLink messages of this project. It will also
# create a QGC_USE_{AUTOPILOT_NAME}_MESSAGES macro for use
# within the actual code.
exists(user_config.pri) {
    include(user_config.pri)
    message("----- USING CUSTOM USER QGROUNDCONTROL CONFIG FROM user_config.pri -----")
    message("Adding support for additional MAVLink messages for: " $$MAVLINK_CONF)
    message("------------------------------------------------------------------------")
} else {
    MAVLINK_CONF += ardupilotmega
}
INCLUDEPATH += $$MAVLINKPATH
isEmpty(MAVLINK_CONF) {
    INCLUDEPATH += $$MAVLINKPATH/common
message("Using mavlink common")
} else {
    INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
message("Using mavlink " + $$MAVLINK_CONF)
    DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
}

#
# MAVLink generator (deprecated)
#

DEPENDPATH += \
    src/apps/mavlinkgen

INCLUDEPATH += \
    src/apps/mavlinkgen \
    src/apps/mavlinkgen/ui \
    src/apps/mavlinkgen/generator

#include(src/apps/mavlinkgen/mavlinkgen.pri)

#
# OpenSceneGraph
#

#Remove OSG support, as it's only valid for Qt4, not Qt5
#MacBuild {
#    # GLUT and OpenSceneGraph are part of standard install on Mac
#	CONFIG += OSGDependency

#    INCLUDEPATH += \
#        $$BASEDIR/libs/lib/mac64/include

#	LIBS += \
#        -L$$BASEDIR/libs/lib/mac64/lib \
#        -losgWidget
#}

#Remove OSG support, as it's only valid for Qt4, not Qt5
#LinuxBuild {
#	exists(/usr/include/osg) | exists(/usr/local/include/osg) {
#        CONFIG += OSGDependency
#        exists(/usr/include/osg/osgQt) | exists(/usr/include/osgQt) | exists(/usr/local/include/osg/osgQt) | exists(/usr/local/include/osgQt) {
#            message("Including support for Linux OpenSceneGraph Qt")
#            LIBS += -losgQt
#            DEFINES += QGC_OSG_QT_ENABLED
#        } else {
#            message("Skipping support for Linux OpenSceneGraph Qt")
#        }
#	}
#}

WindowsBuild {
	exists($$BASEDIR/libs/lib/osg123) {
        CONFIG += OSGDependency

		INCLUDEPATH += \
            $$BASEDIR/libs/lib/osgEarth/win32/include \
			$$BASEDIR/libs/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include

		LIBS += -L$$BASEDIR/libs/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib
	}
}

OSGDependency {
    message("Including support for OpenSceneGraph")

	DEFINES += QGC_OSG_ENABLED

    LIBS += \
        -losg \
        -losgViewer \
        -losgGA \
        -losgDB \
        -losgText \
        -lOpenThreads

    HEADERS += \
        src/ui/map3D/gpl.h \
        src/ui/map3D/CameraParams.h \
        src/ui/map3D/ViewParamWidget.h \
        src/ui/map3D/SystemContainer.h \
        src/ui/map3D/SystemViewParams.h \
        src/ui/map3D/GlobalViewParams.h \
        src/ui/map3D/SystemGroupNode.h \
        src/ui/map3D/Q3DWidget.h \
        src/ui/map3D/GCManipulator.h \
        src/ui/map3D/ImageWindowGeode.h \
        src/ui/map3D/PixhawkCheetahNode.h \
        src/ui/map3D/Pixhawk3DWidget.h \
        src/ui/map3D/Q3DWidgetFactory.h \
        src/ui/map3D/WebImageCache.h \
        src/ui/map3D/WebImage.h \
        src/ui/map3D/TextureCache.h \
        src/ui/map3D/Texture.h \
        src/ui/map3D/Imagery.h \
        src/ui/map3D/HUDScaleGeode.h \
        src/ui/map3D/WaypointGroupNode.h \
        src/ui/map3D/TerrainParamDialog.h \
        src/ui/map3D/ImageryParamDialog.h

    SOURCES += \
        src/ui/map3D/gpl.cc \
        src/ui/map3D/CameraParams.cc \
        src/ui/map3D/ViewParamWidget.cc \
        src/ui/map3D/SystemContainer.cc \
        src/ui/map3D/SystemViewParams.cc \
        src/ui/map3D/GlobalViewParams.cc \
        src/ui/map3D/SystemGroupNode.cc \
        src/ui/map3D/Q3DWidget.cc \
        src/ui/map3D/ImageWindowGeode.cc \
        src/ui/map3D/GCManipulator.cc \
        src/ui/map3D/PixhawkCheetahNode.cc \
        src/ui/map3D/Pixhawk3DWidget.cc \
        src/ui/map3D/Q3DWidgetFactory.cc \
        src/ui/map3D/WebImageCache.cc \
        src/ui/map3D/WebImage.cc \
        src/ui/map3D/TextureCache.cc \
        src/ui/map3D/Texture.cc \
        src/ui/map3D/Imagery.cc \
        src/ui/map3D/HUDScaleGeode.cc \
        src/ui/map3D/WaypointGroupNode.cc \
        src/ui/map3D/TerrainParamDialog.cc \
        src/ui/map3D/ImageryParamDialog.cc
} else {
    message("Skipping support for OpenSceneGraph")
}

#
# Google Earth
#

MacBuild | WindowsBuild : contains(GOOGLEEARTH, enable) { #fix this to make sense ;)
    message(Including support for Google Earth)

    HEADERS += src/ui/map3D/QGCGoogleEarthView.h
    SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
    WindowsBuild {
        CONFIG += qaxcontainer
    }
} else {
    message(Skipping support for Google Earth)
}

#
# Protcol Buffers for PixHawk
#

LinuxBuild : contains(MAVLINK_CONF, pixhawk) {
    exists(/usr/local/include/google/protobuf) | exists(/usr/include/google/protobuf) {
        message("Including support for Protocol Buffers")

        DEFINES += QGC_PROTOBUF_ENABLED

        LIBS += \
            -lprotobuf \
            -lprotobuf-lite \
            -lprotoc

        HEADERS += \
            libs/mavlink/include/mavlink/v1.0/pixhawk/pixhawk.pb.h \
            src/ui/map3D/ObstacleGroupNode.h \
            src/ui/map3D/GLOverlayGeode.h

        SOURCES += \
            libs/mavlink/share/mavlink/src/v1.0/pixhawk/pixhawk.pb.cc \
            src/ui/map3D/ObstacleGroupNode.cc \
            src/ui/map3D/GLOverlayGeode.cc
    } else {
        message("Skipping support for Protocol Buffers")
    }
} else {
    message("Skipping support for Protocol Buffers")
}

#
# libfreenect Kinect support
#

MacBuild | LinuxBuild {
    exists(/opt/local/include/libfreenect) | exists(/usr/local/include/libfreenect) {
        message("Including support for libfreenect")

        #INCLUDEPATH += /usr/include/libusb-1.0
        DEFINES += QGC_LIBFREENECT_ENABLED
        LIBS += -lfreenect
        HEADERS += src/input/Freenect.h
        SOURCES += src/input/Freenect.cc
    } else {
        message("Skipping support for libfreenect")
    }
} else {
    message("Skipping support for libfreenect")
}

#
# EIGEN matrix library (NOMINMAX needed to make internal min/max work)
#

INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX

#
# AGLLIB math library
#
include(libs/alglib/alglib.pri)

#
# OPMapControl library (from OpenPilot)
#

#include(libs/utils/utils_external.pri)
include(libs/opmapcontrol/opmapcontrol_external.pri)

DEPENDPATH += \
    libs/utils \
    libs/utils/src \
    libs/opmapcontrol \
    libs/opmapcontrol/src \
    libs/opmapcontrol/src/mapwidget

INCLUDEPATH += \
    libs/utils \
    libs \
    libs/opmapcontrol

WindowsBuild {
    # Used to enumerate serial ports by QSerialPort
	LIBS += -lsetupapi
}

#
# Zip Access Tool (http://quazip.sourceforge.net)
#
include (libs/thirdParty/quazip/quazip.pri)

#
# XBee wireless
#

WindowsBuild {
    #message(Including support for XBee)

    #DEFINES += XBEELINK

    #INCLUDEPATH += libs/thirdParty/libxbee

    #HEADERS += \
    #    src/comm/XbeeLinkInterface.h \
    #    src/comm/XbeeLink.h \
    #    src/comm/HexSpinBox.h \
    #    src/ui/XbeeConfigurationWindow.h \
    #    src/comm/CallConv.h

    #SOURCES += \
    #    src/comm/XbeeLink.cpp \
    #    src/comm/HexSpinBox.cpp \
    #    src/ui/XbeeConfigurationWindow.cpp

    #WindowsBuild {
    #    LIBS += -llibs/thirdParty/libxbee/lib/libxbee
    #}

    #LinuxBuild {
    #    LIBS += -lxbee
    #}
} else:WindowsCrossBuild {
    #LIBS += -llibs/thirdParty/libxbee/lib/libxbee
    message(Skipping support for XBee)
} else {
    message(Skipping support for XBee)
}

#
# 3DConnexion 3d Mice support
#

LinuxBuild : exists(/usr/local/lib/libxdrvlib.so) {
    message("Including support for Magellan 3DxWare")

    DEFINES += MOUSE_ENABLED_LINUX
    DEFINES += ParameterCheck
# Hack: Has to be defined for magellan usage

    INCLUDEPATH *= /usr/local/include
    HEADERS += src/input/Mouse6dofInput.h
    SOURCES += src/input/Mouse6dofInput.cpp
    LIBS += -L/usr/local/lib/ -lxdrvlib
}

WindowsBuild {
    message("Including support for Magellan 3DxWare")

    DEFINES += MOUSE_ENABLED_WIN

    INCLUDEPATH += libs/thirdParty/3DMouse/win

    HEADERS += \
        libs/thirdParty/3DMouse/win/I3dMouseParams.h \
        libs/thirdParty/3DMouse/win/MouseParameters.h \
        libs/thirdParty/3DMouse/win/Mouse3DInput.h \
        src/input/Mouse6dofInput.h

    SOURCES += \
        libs/thirdParty/3DMouse/win/MouseParameters.cpp \
        libs/thirdParty/3DMouse/win/Mouse3DInput.cpp \
        src/input/Mouse6dofInput.cpp
}

#
# Opal RT-LAB Library
#

WindowsBuild : win32 : exists(src/lib/opalrt/OpalApi.h) : exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) {
    message("Including support for Opal-RT")

    DEFINES += OPAL_RT

    INCLUDEPATH +=
        src/lib/opalrt
        libs/lib/opal/include \

    FORMS += src/ui/OpalLinkSettings.ui

    HEADERS += \
        src/comm/OpalRT.h \
        src/comm/OpalLink.h \
        src/comm/Parameter.h \
        src/comm/QGCParamID.h \
        src/comm/ParameterList.h \
        src/ui/OpalLinkConfigurationWindow.h

    SOURCES += \
        src/comm/OpalRT.cc \
        src/comm/OpalLink.cc \
        src/comm/Parameter.cc \
        src/comm/QGCParamID.cc \
        src/comm/ParameterList.cc \
        src/ui/OpalLinkConfigurationWindow.cc

    LIBS += \
        -LC:/OPAL-RT/RT-LAB7.2.4/Common/bin \
        -lOpalApi
} else {
    message("Skipping support for Opal-RT")
}

#
# SDL
#

MacBuild {
    INCLUDEPATH += \
        $$BASEDIR/libs/lib/Frameworks/SDL2.framework/Headers

    LIBS += \
        -F$$BASEDIR/libs/lib/Frameworks \
        -framework SDL2
}

LinuxBuild {
	LIBS += \
        -lSDL2
}

WindowsBuild {
	INCLUDEPATH += \
        $$BASEDIR/libs/lib/sdl/msvc/include \

	LIBS += \
        -L$$BASEDIR/libs/lib/sdl/msvc/lib \
        -lSDL2main \
        -lSDL2
}

WindowsCrossBuild {
        INCLUDEPATH += \
        $$BASEDIR/libs/lib/sdl/include \

        LIBS += \
        -Llibs/lib/sdl/win32 \
        -lSDL2.dll
}

#
# Festival Lite speech synthesis engine
#

LinuxBuild {
	LIBS += \
		-lflite_cmu_us_kal \
		-lflite_usenglish \
		-lflite_cmulex \
		-lflite
}

#
# Tell the Linux build to look in a few additional places for libs
#

LinuxBuild {
	INCLUDEPATH += \
        /usr/include \
        /usr/local/include

	LIBS += \
		-L/usr/lib

    linux-g++-64 {
        LIBS += \
            -L/usr/local/lib64 \
            -L/usr/lib64
	}
}

#
# Add in a few missing headers to windows
#

WindowsBuild {
    INCLUDEPATH += libs/lib/msinttypes
}

#
# QUpgrade
#

exists(qupgrade) {
    message(Including support for QUpgrade)

    DEFINES += QUPGRADE_SUPPORT

    INCLUDEPATH += qupgrade/src/apps/qupgrade

    FORMS += \
        qupgrade/src/apps/qupgrade/dialog_bare.ui \
        qupgrade/src/apps/qupgrade/boardwidget.ui

    HEADERS += \
        qupgrade/src/apps/qupgrade/qgcfirmwareupgradeworker.h \
        qupgrade/src/apps/qupgrade/uploader.h \
        qupgrade/src/apps/qupgrade/dialog_bare.h \
        qupgrade/src/apps/qupgrade/boardwidget.h

    SOURCES += \
        qupgrade/src/apps/qupgrade/qgcfirmwareupgradeworker.cpp \
        qupgrade/src/apps/qupgrade/uploader.cpp \
        qupgrade/src/apps/qupgrade/dialog_bare.cpp \
        qupgrade/src/apps/qupgrade/boardwidget.cpp

    RESOURCES += \
        qupgrade/qupgrade.qrc

    LinuxBuild:CONFIG += qesp_linux_udev

    include(qupgrade/libs/qextserialport/src/qextserialport.pri)
} else {
    message(Skipping support for QUpgrade)
}

#
# MAVLink
#

MAVLINK_CONF = ""
MAVLINKPATH = $$BASEDIR/libs/mavlink/include/mavlink/v1.0
DEFINES += MAVLINK_NO_DATA

# If the user config file exists, it will be included.
# if the variable MAVLINK_CONF contains the name of an
# additional project, QGroundControl includes the support
# of custom MAVLink messages of this project. It will also
# create a QGC_USE_{AUTOPILOT_NAME}_MESSAGES macro for use
# within the actual code.
exists(user_config.pri) {
    include(user_config.pri)
    message("----- USING CUSTOM USER QGROUNDCONTROL CONFIG FROM user_config.pri -----")
    message("Adding support for additional MAVLink messages for: " $$MAVLINK_CONF)
    message("------------------------------------------------------------------------")
} else {
    MAVLINK_CONF += ardupilotmega
}
INCLUDEPATH += $$MAVLINKPATH
isEmpty(MAVLINK_CONF) {
    INCLUDEPATH += $$MAVLINKPATH/common
message("Using mavlink common")
} else {
    INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
message("Using mavlink " + $$MAVLINK_CONF)
    DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
}

#
# MAVLink generator (deprecated)
#

DEPENDPATH += \
    src/apps/mavlinkgen

INCLUDEPATH += \
    src/apps/mavlinkgen \
    src/apps/mavlinkgen/ui \
    src/apps/mavlinkgen/generator

#include(src/apps/mavlinkgen/mavlinkgen.pri)

#
# OpenSceneGraph
#

#Remove OSG support, as it's only valid for Qt4, not Qt5
#MacBuild {
#    # GLUT and OpenSceneGraph are part of standard install on Mac
#	CONFIG += OSGDependency

#    INCLUDEPATH += \
#        $$BASEDIR/libs/lib/mac64/include

#	LIBS += \
#        -L$$BASEDIR/libs/lib/mac64/lib \
#        -losgWidget
#}

#Remove OSG support, as it's only valid for Qt4, not Qt5
#LinuxBuild {
#	exists(/usr/include/osg) | exists(/usr/local/include/osg) {
#        CONFIG += OSGDependency
#        exists(/usr/include/osg/osgQt) | exists(/usr/include/osgQt) | exists(/usr/local/include/osg/osgQt) | exists(/usr/local/include/osgQt) {
#            message("Including support for Linux OpenSceneGraph Qt")
#            LIBS += -losgQt
#            DEFINES += QGC_OSG_QT_ENABLED
#        } else {
#            message("Skipping support for Linux OpenSceneGraph Qt")
#        }
#	}
#}

WindowsBuild {
	exists($$BASEDIR/libs/lib/osg123) {
        CONFIG += OSGDependency

		INCLUDEPATH += \
            $$BASEDIR/libs/lib/osgEarth/win32/include \
			$$BASEDIR/libs/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include

		LIBS += -L$$BASEDIR/libs/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib
	}
}

OSGDependency {
    message("Including support for OpenSceneGraph")

	DEFINES += QGC_OSG_ENABLED

    LIBS += \
        -losg \
        -losgViewer \
        -losgGA \
        -losgDB \
        -losgText \
        -lOpenThreads

    HEADERS += \
        src/ui/map3D/gpl.h \
        src/ui/map3D/CameraParams.h \
        src/ui/map3D/ViewParamWidget.h \
        src/ui/map3D/SystemContainer.h \
        src/ui/map3D/SystemViewParams.h \
        src/ui/map3D/GlobalViewParams.h \
        src/ui/map3D/SystemGroupNode.h \
        src/ui/map3D/Q3DWidget.h \
        src/ui/map3D/GCManipulator.h \
        src/ui/map3D/ImageWindowGeode.h \
        src/ui/map3D/PixhawkCheetahNode.h \
        src/ui/map3D/Pixhawk3DWidget.h \
        src/ui/map3D/Q3DWidgetFactory.h \
        src/ui/map3D/WebImageCache.h \
        src/ui/map3D/WebImage.h \
        src/ui/map3D/TextureCache.h \
        src/ui/map3D/Texture.h \
        src/ui/map3D/Imagery.h \
        src/ui/map3D/HUDScaleGeode.h \
        src/ui/map3D/WaypointGroupNode.h \
        src/ui/map3D/TerrainParamDialog.h \
        src/ui/map3D/ImageryParamDialog.h

    SOURCES += \
        src/ui/map3D/gpl.cc \
        src/ui/map3D/CameraParams.cc \
        src/ui/map3D/ViewParamWidget.cc \
        src/ui/map3D/SystemContainer.cc \
        src/ui/map3D/SystemViewParams.cc \
        src/ui/map3D/GlobalViewParams.cc \
        src/ui/map3D/SystemGroupNode.cc \
        src/ui/map3D/Q3DWidget.cc \
        src/ui/map3D/ImageWindowGeode.cc \
        src/ui/map3D/GCManipulator.cc \
        src/ui/map3D/PixhawkCheetahNode.cc \
        src/ui/map3D/Pixhawk3DWidget.cc \
        src/ui/map3D/Q3DWidgetFactory.cc \
        src/ui/map3D/WebImageCache.cc \
        src/ui/map3D/WebImage.cc \
        src/ui/map3D/TextureCache.cc \
        src/ui/map3D/Texture.cc \
        src/ui/map3D/Imagery.cc \
        src/ui/map3D/HUDScaleGeode.cc \
        src/ui/map3D/WaypointGroupNode.cc \
        src/ui/map3D/TerrainParamDialog.cc \
        src/ui/map3D/ImageryParamDialog.cc
} else {
    message("Skipping support for OpenSceneGraph")
}

#
# Google Earth
#

MacBuild | WindowsBuild : contains(GOOGLEEARTH, enable) { #fix this to make sense ;)
    message(Including support for Google Earth)

    HEADERS += src/ui/map3D/QGCGoogleEarthView.h
    SOURCES += src/ui/map3D/QGCGoogleEarthView.cc
    WindowsBuild {
        CONFIG += qaxcontainer
    }
} else {
    message(Skipping support for Google Earth)
}

#
# Protcol Buffers for PixHawk
#

LinuxBuild : contains(MAVLINK_CONF, pixhawk) {
    exists(/usr/local/include/google/protobuf) | exists(/usr/include/google/protobuf) {
        message("Including support for Protocol Buffers")

        DEFINES += QGC_PROTOBUF_ENABLED

        LIBS += \
            -lprotobuf \
            -lprotobuf-lite \
            -lprotoc

        HEADERS += \
            libs/mavlink/include/mavlink/v1.0/pixhawk/pixhawk.pb.h \
            src/ui/map3D/ObstacleGroupNode.h \
            src/ui/map3D/GLOverlayGeode.h

        SOURCES += \
            libs/mavlink/share/mavlink/src/v1.0/pixhawk/pixhawk.pb.cc \
            src/ui/map3D/ObstacleGroupNode.cc \
            src/ui/map3D/GLOverlayGeode.cc
    } else {
        message("Skipping support for Protocol Buffers")
    }
} else {
    message("Skipping support for Protocol Buffers")
}

#
# libfreenect Kinect support
#

MacBuild | LinuxBuild {
    exists(/opt/local/include/libfreenect) | exists(/usr/local/include/libfreenect) {
        message("Including support for libfreenect")

        #INCLUDEPATH += /usr/include/libusb-1.0
        DEFINES += QGC_LIBFREENECT_ENABLED
        LIBS += -lfreenect
        HEADERS += src/input/Freenect.h
        SOURCES += src/input/Freenect.cc
    } else {
        message("Skipping support for libfreenect")
    }
} else {
    message("Skipping support for libfreenect")
}

#
# EIGEN matrix library (NOMINMAX needed to make internal min/max work)
#

INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX

#
# AGLLIB math library
#
include(libs/alglib/alglib.pri)

#
# OPMapControl library (from OpenPilot)
#

#include(libs/utils/utils_external.pri)
include(libs/opmapcontrol/opmapcontrol_external.pri)

DEPENDPATH += \
    libs/utils \
    libs/utils/src \
    libs/opmapcontrol \
    libs/opmapcontrol/src \
    libs/opmapcontrol/src/mapwidget

INCLUDEPATH += \
    libs/utils \
    libs \
    libs/opmapcontrol

WindowsBuild {
    # Used to enumerate serial ports by QSerialPort
	LIBS += -lsetupapi
}

#
# Zip Access Tool (http://quazip.sourceforge.net)
#
include (libs/thirdParty/quazip/quazip.pri)

#
# XBee wireless
#

WindowsBuild {
    #message(Including support for XBee)

    #DEFINES += XBEELINK

    #INCLUDEPATH += libs/thirdParty/libxbee

    #HEADERS += \
    #    src/comm/XbeeLinkInterface.h \
    #    src/comm/XbeeLink.h \
    #    src/comm/HexSpinBox.h \
    #    src/ui/XbeeConfigurationWindow.h \
    #    src/comm/CallConv.h

    #SOURCES += \
    #    src/comm/XbeeLink.cpp \
    #    src/comm/HexSpinBox.cpp \
    #    src/ui/XbeeConfigurationWindow.cpp

    #WindowsBuild {
    #    LIBS += -llibs/thirdParty/libxbee/lib/libxbee
    #}

    #LinuxBuild {
    #    LIBS += -lxbee
    #}
} else:WindowsCrossBuild {
    #LIBS += -llibs/thirdParty/libxbee/lib/libxbee
    message(Skipping support for XBee)
} else {
    message(Skipping support for XBee)
}

#
# 3DConnexion 3d Mice support
#

LinuxBuild : exists(/usr/local/lib/libxdrvlib.so) {
    message("Including support for Magellan 3DxWare")

    DEFINES += MOUSE_ENABLED_LINUX
    DEFINES += ParameterCheck
# Hack: Has to be defined for magellan usage

    INCLUDEPATH *= /usr/local/include
    HEADERS += src/input/Mouse6dofInput.h
    SOURCES += src/input/Mouse6dofInput.cpp
    LIBS += -L/usr/local/lib/ -lxdrvlib
}

WindowsBuild {
    message("Including support for Magellan 3DxWare")

    DEFINES += MOUSE_ENABLED_WIN

    INCLUDEPATH += libs/thirdParty/3DMouse/win

    HEADERS += \
        libs/thirdParty/3DMouse/win/I3dMouseParams.h \
        libs/thirdParty/3DMouse/win/MouseParameters.h \
        libs/thirdParty/3DMouse/win/Mouse3DInput.h \
        src/input/Mouse6dofInput.h

    SOURCES += \
        libs/thirdParty/3DMouse/win/MouseParameters.cpp \
        libs/thirdParty/3DMouse/win/Mouse3DInput.cpp \
        src/input/Mouse6dofInput.cpp
}

#
# Opal RT-LAB Library
#

WindowsBuild : win32 : exists(src/lib/opalrt/OpalApi.h) : exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) {
    message("Including support for Opal-RT")

    DEFINES += OPAL_RT

    INCLUDEPATH +=
        src/lib/opalrt
        libs/lib/opal/include \

    FORMS += src/ui/OpalLinkSettings.ui

    HEADERS += \
        src/comm/OpalRT.h \
        src/comm/OpalLink.h \
        src/comm/Parameter.h \
        src/comm/QGCParamID.h \
        src/comm/ParameterList.h \
        src/ui/OpalLinkConfigurationWindow.h

    SOURCES += \
        src/comm/OpalRT.cc \
        src/comm/OpalLink.cc \
        src/comm/Parameter.cc \
        src/comm/QGCParamID.cc \
        src/comm/ParameterList.cc \
        src/ui/OpalLinkConfigurationWindow.cc

    LIBS += \
        -LC:/OPAL-RT/RT-LAB7.2.4/Common/bin \
        -lOpalApi
} else {
    message("Skipping support for Opal-RT")
}

#
# SDL
#

MacBuild {
    INCLUDEPATH += \
        $$BASEDIR/libs/lib/Frameworks/SDL2.framework/Headers

    LIBS += \
        -F$$BASEDIR/libs/lib/Frameworks \
        -framework SDL2
}

LinuxBuild {
	LIBS += \
        -lSDL2
}

WindowsBuild {
	INCLUDEPATH += \
        $$BASEDIR/libs/lib/sdl/msvc/include \

	LIBS += \
        -L$$BASEDIR/libs/lib/sdl/msvc/lib \
        -lSDL2main \
        -lSDL2
}

WindowsCrossBuild {
        INCLUDEPATH += \
        $$BASEDIR/libs/lib/sdl/include \

        LIBS += \
        -Llibs/lib/sdl/win32 \
        -lSDL2.dll
}

#
# Festival Lite speech synthesis engine
#

LinuxBuild {
	LIBS += \
		-lflite_cmu_us_kal \
		-lflite_usenglish \
		-lflite_cmulex \
		-lflite
}