Fix writing sdk version when linking binary files (macos) (#236)

VERSION = $$cat(version.txt)

PRODUCT_VERSION = $$(PRODUCT_VERSION)
BUILD_NUMBER = $$(BUILD_NUMBER)

!isEmpty(PRODUCT_VERSION){
    !isEmpty(BUILD_NUMBER){
        VERSION = $${PRODUCT_VERSION}.$${BUILD_NUMBER}
	}
}

DEFINES += INTVER=$$VERSION

PUBLISHER_NAME = $$(PUBLISHER_NAME)
isEmpty(PUBLISHER_NAME){
    PUBLISHER_NAME = $$cat(copyright.txt)
}

win32 {
    CURRENT_YEAR = $$system(wmic PATH Win32_LocalTime GET ^Year /FORMAT:VALUE | find \"=\")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "Year=", "")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "\r", "")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "\n", "")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "\t", "")
}

!win32 {
    CURRENT_YEAR = $$system(date +%Y)
}

QMAKE_TARGET_COMPANY = $$PUBLISHER_NAME
QMAKE_TARGET_COPYRIGHT = Copyright (C) $${PUBLISHER_NAME} $${CURRENT_YEAR}. All rights reserved

# CONFIGURATION
CONFIG(debug, debug|release) {
    CONFIG += core_debug
} else {
    CONFIG += core_release
}

not_use_dynamic_libs {
shared {
    CONFIG -= shared
    CONFIG -= plugin
    CONFIG += staticlib
}
}

#PLATFORM
win32 {
    CONFIG += core_windows

    WINDOWS_VERSION_XP = $$(WINDOWS_VERSION_XP)
    !isEmpty(WINDOWS_VERSION_XP) {
        CONFIG += build_xp
        message(xp using)
    }
}

DST_ARCH=$$QMAKE_TARGET.arch
isEqual(QT_MAJOR_VERSION, 5) {
    DST_ARCH=$$QT_ARCH
    # QT_ARCH uses 'i386' instead of 'x86',
    # so map that value back to what we expect.
    equals(DST_ARCH, i386) {
        DST_ARCH=x86
    }
}

ios {
    CONFIG += core_ios
    DEFINES += _IOS IOS LINUX _LINUX MAC _MAC _XCODE
}
android {
    CONFIG += core_android
    DEFINES += __ANDROID__ LINUX _LINUX
}

win32:contains(QMAKE_TARGET.arch, x86_64): {
    CONFIG += core_win_64
}
win32:!contains(QMAKE_TARGET.arch, x86_64): {
    CONFIG += core_win_32
}

linux-g++ {
    CONFIG += core_linux
linux-g++:contains(QMAKE_HOST.arch, x86_64): {
    message("linux-64")
    CONFIG += core_linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64): {
    message("linux-32")
    CONFIG += core_linux_32
}
linux-g++:contains(DST_ARCH, arm): {
    message("arm")
    CONFIG += core_linux_arm
    DEFINES += LINUX_ARM
}
}

linux-g++-64 {
    message("linux-64")
    CONFIG += core_linux
    CONFIG += core_linux_64
}
linux-g++-32 {
    message("linux-32")
    CONFIG += core_linux
    CONFIG += core_linux_32
}

mac {
    !core_ios {
        CONFIG += core_mac
        CONFIG += core_mac_64
    }
}

# DEFINES
core_windows {
    DEFINES += WIN32 _WIN32
    DEFINES += NOMINMAX
}
core_win_64 {
    DEFINES += WIN64 _WIN64
}

core_linux {
    DEFINES += LINUX _LINUX
}

core_mac {
    DEFINES += LINUX _LINUX MAC _MAC
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
    QMAKE_LFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
}

# PREFIXES
core_windows {
    CONFIG -= debug_and_release debug_and_release_target
    QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
    QMAKE_CXXFLAGS -= -Zc:strictStrings
    QMAKE_CXXFLAGS += /MP

    equals(TEMPLATE, app) {
        console {
            core_win_64:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.02
            core_win_32:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
        } else {
            core_win_64:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWS,5.02
            core_win_32:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWS,5.01
        }
    }
}

core_linux {
    equals(TEMPLATE, app) {
        QMAKE_LFLAGS += -Wl,--rpath=./:./system
    }
}

core_win_32 {
    CORE_BUILDS_PLATFORM_PREFIX = win_32
}
core_win_64 {
    CORE_BUILDS_PLATFORM_PREFIX = win_64
}
core_linux_32 {
    CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
    CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_mac_64 {
    CORE_BUILDS_PLATFORM_PREFIX = mac_64
}
core_linux_arm {
    CORE_BUILDS_PLATFORM_PREFIX = arm
}
core_ios {
    CORE_BUILDS_PLATFORM_PREFIX = ios

    CONFIG(iphonesimulator, iphoneos|iphonesimulator): {
        message("iphonesimulator")
        CORE_BUILDS_PLATFORM_PREFIX = ios_simulator
    } else {

        QMAKE_IOS_DEPLOYMENT_TARGET = 10.0
        CONFIG += core_ios_main_arch

        QMAKE_CFLAGS += -fembed-bitcode
        QMAKE_CXXFLAGS += -fembed-bitcode
        QMAKE_LFLAGS += -fembed-bitcode

        core_ios_main_arch {
            QMAKE_APPLE_DEVICE_ARCHS = arm64
            core_ios_no_simulator_arch : QMAKE_APPLE_SIMULATOR_ARCHS=

            !core_ios_no_32 {
                QMAKE_APPLE_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS armv7
            }
        } else {
            plugin : TARGET = $$join(TARGET, TARGET, "", "_addition")
            QMAKE_APPLE_DEVICE_ARCHS=
            QMAKE_APPLE_SIMULATOR_ARCHS=
        }

        core_ios_nomain_arch {
            QMAKE_APPLE_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS arm64e
            !core_ios_no_32 {
                QMAKE_APPLE_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS armv7s
            }
        }

        !no_verify_bitcode {
            # for application: (using xcodebuild)
            #Q_ENABLE_BITCODE.name = ENABLE_BITCODE
            #Q_ENABLE_BITCODE.value = NO
            #
            #Q_BITCODE_GENERATION_MODE.name = BITCODE_GENERATION_MODE
            #Q_BITCODE_GENERATION_MODE.value = marker
            #
            #QMAKE_MAC_XCODE_SETTINGS += Q_ENABLE_BITCODE
            #QMAKE_MAC_XCODE_SETTINGS += Q_BITCODE_GENERATION_MODE

            # for libraries
            !core_debug {
                QMAKE_LFLAGS += -Xlinker -bitcode_verify
                QMAKE_LFLAGS += -Xlinker -bitcode_hide_symbols
                #QMAKE_LFLAGS += -Xlinker -bitcode_symbol_map -Xlinker $$CORE_BUILDS_LIBRARIES_PATH
            }
        }
    }

    !core_ios_no_unistd {
        DEFINES += HAVE_UNISTD_H
    }
}
core_android {
    equals(QT_ARCH, arm): CORE_BUILDS_PLATFORM_PREFIX = android_arm
    equals(QT_ARCH, i386): CORE_BUILDS_PLATFORM_PREFIX = android_x86
}

core_debug {
    CORE_BUILDS_CONFIGURATION_PREFIX    = debug
}
core_release {
    CORE_BUILDS_CONFIGURATION_PREFIX    = release
}

# MESSAGE
message($$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX)

# COMPILER
CONFIG += c++11

core_linux {
core_static_link_libstd {
    QMAKE_LFLAGS += -static-libstdc++ -static-libgcc
    message(core_static_link_libstd)
}
plugin {
    QMAKE_CXXFLAGS += -fvisibility=hidden
    QMAKE_CFLAGS += -fvisibility=hidden

    TARGET_EXT = .so
}
}

core_mac {
plugin {
    QMAKE_CXXFLAGS += -fvisibility=hidden
    QMAKE_CFLAGS += -fvisibility=hidden
}
}

core_windows {
plugin {
    TARGET_EXT = .dll
}
}

# BUILD_PATHS
# MUST BE DEFINED CORE_ROOT_DIR
!core_no_dst {
DESTDIR     = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX
OBJECTS_DIR = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/obj
MOC_DIR     = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/moc
RCC_DIR     = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/rcc
UI_DIR      = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/ui
build_xp {
    OBJECTS_DIR = $$OBJECTS_DIR/xp
    MOC_DIR     = $$MOC_DIR/xp
    RCC_DIR     = $$RCC_DIR/xp
    UI_DIR      = $$UI_DIR/xp
}
}

CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/lib/$$CORE_BUILDS_PLATFORM_PREFIX
CORE_BUILDS_BINARY_PATH = $$CORE_ROOT_DIR/build/bin/$$CORE_BUILDS_PLATFORM_PREFIX

OO_BUILD_BRANDING = $$(OO_BRANDING)
!isEmpty(OO_BUILD_BRANDING) {
    CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/$$OO_BUILD_BRANDING/lib/$$CORE_BUILDS_PLATFORM_PREFIX
    CORE_BUILDS_BINARY_PATH = $$CORE_ROOT_DIR/build/$$OO_BUILD_BRANDING/bin/$$CORE_BUILDS_PLATFORM_PREFIX
}

core_debug {
    CORE_BUILDS_LIBRARIES_PATH = $$CORE_BUILDS_LIBRARIES_PATH/debug
    CORE_BUILDS_BINARY_PATH = $$CORE_BUILDS_BINARY_PATH/debug
}

plugin {
    DESTDIR = $$CORE_BUILDS_LIBRARIES_PATH
}
staticlib {
    DESTDIR = $$CORE_BUILDS_LIBRARIES_PATH
}

core_x2t {
core_windows {
    QMAKE_CXXFLAGS += /bigobj
} else {
    QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}

DEFINES += CRYPTOPP_DISABLE_ASM
}

core_ios {
    bundle_dylibs {
        plugin {
            CONFIG -= plugin
            CONFIG += lib_bundle

            QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
            #QMAKE_LFLAGS += -Xlinker -rpath -Xlinker @executable_path/Frameworks
            #QMAKE_LFLAGS += -Xlinker -rpath -Xlinker @loader_path/Frameworks

            # correct version to < 256
            VERSIONS = $$split(VERSION, ".")
            VERSION_1 = $$member(VERSIONS, 0)
            VERSION_2 = $$member(VERSIONS, 1)
            VERSION_3 = $$member(VERSIONS, 2)
            VERSION_4 = $$member(VERSIONS, 3)

            greaterThan(VERSION_1, 255): VERSION_1 = 255
            greaterThan(VERSION_2, 255): VERSION_2 = 255
            greaterThan(VERSION_3, 255): VERSION_3 = 255
            greaterThan(VERSION_4, 255): VERSION_4 = 255

            VERSION_CORRECT = $$VERSION_1
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", ".")
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", $$VERSION_2)
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", ".")
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", $$VERSION_3)
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", ".")
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", $$VERSION_4)

            VERSION = $$VERSION_CORRECT
        }
    }
}

defineTest(ADD_DEPENDENCY) {
    libs = $$ARGS
    for(lib, libs) {
        CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH
        build_xp {
            isEqual(lib, doctrenderer):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH/xp
            isEqual(lib, ascdocumentscore):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH/xp
            isEqual(lib, videoplayer):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH/xp
        }
        !bundle_dylibs:LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH_DST -l$$lib
        bundle_dylibs:LIBS += -F$$CORE_BUILDS_LIBRARIES_PATH_DST -framework $$lib
    }
    export(LIBS)
}

VERSION = $$cat(version.txt)

PRODUCT_VERSION = $$(PRODUCT_VERSION)
BUILD_NUMBER = $$(BUILD_NUMBER)

!isEmpty(PRODUCT_VERSION){
    !isEmpty(BUILD_NUMBER){
        VERSION = $${PRODUCT_VERSION}.$${BUILD_NUMBER}
	}
}

DEFINES += INTVER=$$VERSION

PUBLISHER_NAME = $$(PUBLISHER_NAME)
isEmpty(PUBLISHER_NAME){
    PUBLISHER_NAME = $$cat(copyright.txt)
}

win32 {
    CURRENT_YEAR = $$system(wmic PATH Win32_LocalTime GET ^Year /FORMAT:VALUE | find \"=\")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "Year=", "")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "\r", "")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "\n", "")
    CURRENT_YEAR = $$replace(CURRENT_YEAR, "\t", "")
}

!win32 {
    CURRENT_YEAR = $$system(date +%Y)
}

QMAKE_TARGET_COMPANY = $$PUBLISHER_NAME
QMAKE_TARGET_COPYRIGHT = Copyright (C) $${PUBLISHER_NAME} $${CURRENT_YEAR}. All rights reserved

# CONFIGURATION
CONFIG(debug, debug|release) {
    CONFIG += core_debug
} else {
    CONFIG += core_release
}

not_use_dynamic_libs {
shared {
    CONFIG -= shared
    CONFIG -= plugin
    CONFIG += staticlib
}
}

#PLATFORM
win32 {
    CONFIG += core_windows

    WINDOWS_VERSION_XP = $$(WINDOWS_VERSION_XP)
    !isEmpty(WINDOWS_VERSION_XP) {
        CONFIG += build_xp
        message(xp using)
    }
}

DST_ARCH=$$QMAKE_TARGET.arch
isEqual(QT_MAJOR_VERSION, 5) {
    DST_ARCH=$$QT_ARCH
    # QT_ARCH uses 'i386' instead of 'x86',
    # so map that value back to what we expect.
    equals(DST_ARCH, i386) {
        DST_ARCH=x86
    }
}

ios {
    CONFIG += core_ios
    DEFINES += _IOS IOS LINUX _LINUX MAC _MAC _XCODE
}
android {
    CONFIG += core_android
    DEFINES += __ANDROID__ LINUX _LINUX
}

win32:contains(QMAKE_TARGET.arch, x86_64): {
    CONFIG += core_win_64
}
win32:!contains(QMAKE_TARGET.arch, x86_64): {
    CONFIG += core_win_32
}

linux-g++ {
    CONFIG += core_linux
linux-g++:contains(QMAKE_HOST.arch, x86_64): {
    message("linux-64")
    CONFIG += core_linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64): {
    message("linux-32")
    CONFIG += core_linux_32
}
linux-g++:contains(DST_ARCH, arm): {
    message("arm")
    CONFIG += core_linux_arm
    DEFINES += LINUX_ARM
}
}

linux-g++-64 {
    message("linux-64")
    CONFIG += core_linux
    CONFIG += core_linux_64
}
linux-g++-32 {
    message("linux-32")
    CONFIG += core_linux
    CONFIG += core_linux_32
}

mac {
    !core_ios {
        CONFIG += core_mac
        CONFIG += core_mac_64
    }
}

# DEFINES
core_windows {
    DEFINES += WIN32 _WIN32
    DEFINES += NOMINMAX
}
core_win_64 {
    DEFINES += WIN64 _WIN64
}

core_linux {
    DEFINES += LINUX _LINUX
}

core_mac {
    DEFINES += LINUX _LINUX MAC _MAC
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
}

# PREFIXES
core_windows {
    CONFIG -= debug_and_release debug_and_release_target
    QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
    QMAKE_CXXFLAGS -= -Zc:strictStrings
    QMAKE_CXXFLAGS += /MP

    equals(TEMPLATE, app) {
        console {
            core_win_64:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.02
            core_win_32:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
        } else {
            core_win_64:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWS,5.02
            core_win_32:QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWS,5.01
        }
    }
}

core_linux {
    equals(TEMPLATE, app) {
        QMAKE_LFLAGS += -Wl,--rpath=./:./system
    }
}

core_win_32 {
    CORE_BUILDS_PLATFORM_PREFIX = win_32
}
core_win_64 {
    CORE_BUILDS_PLATFORM_PREFIX = win_64
}
core_linux_32 {
    CORE_BUILDS_PLATFORM_PREFIX = linux_32
}
core_linux_64 {
    CORE_BUILDS_PLATFORM_PREFIX = linux_64
}
core_mac_64 {
    CORE_BUILDS_PLATFORM_PREFIX = mac_64
}
core_linux_arm {
    CORE_BUILDS_PLATFORM_PREFIX = arm
}
core_ios {
    CORE_BUILDS_PLATFORM_PREFIX = ios

    CONFIG(iphonesimulator, iphoneos|iphonesimulator): {
        message("iphonesimulator")
        CORE_BUILDS_PLATFORM_PREFIX = ios_simulator
    } else {

        QMAKE_IOS_DEPLOYMENT_TARGET = 10.0
        CONFIG += core_ios_main_arch

        QMAKE_CFLAGS += -fembed-bitcode
        QMAKE_CXXFLAGS += -fembed-bitcode
        QMAKE_LFLAGS += -fembed-bitcode

        core_ios_main_arch {
            QMAKE_APPLE_DEVICE_ARCHS = arm64
            core_ios_no_simulator_arch : QMAKE_APPLE_SIMULATOR_ARCHS=

            !core_ios_no_32 {
                QMAKE_APPLE_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS armv7
            }
        } else {
            plugin : TARGET = $$join(TARGET, TARGET, "", "_addition")
            QMAKE_APPLE_DEVICE_ARCHS=
            QMAKE_APPLE_SIMULATOR_ARCHS=
        }

        core_ios_nomain_arch {
            QMAKE_APPLE_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS arm64e
            !core_ios_no_32 {
                QMAKE_APPLE_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS armv7s
            }
        }

        !no_verify_bitcode {
            # for application: (using xcodebuild)
            #Q_ENABLE_BITCODE.name = ENABLE_BITCODE
            #Q_ENABLE_BITCODE.value = NO
            #
            #Q_BITCODE_GENERATION_MODE.name = BITCODE_GENERATION_MODE
            #Q_BITCODE_GENERATION_MODE.value = marker
            #
            #QMAKE_MAC_XCODE_SETTINGS += Q_ENABLE_BITCODE
            #QMAKE_MAC_XCODE_SETTINGS += Q_BITCODE_GENERATION_MODE

            # for libraries
            !core_debug {
                QMAKE_LFLAGS += -Xlinker -bitcode_verify
                QMAKE_LFLAGS += -Xlinker -bitcode_hide_symbols
                #QMAKE_LFLAGS += -Xlinker -bitcode_symbol_map -Xlinker $$CORE_BUILDS_LIBRARIES_PATH
            }
        }
    }

    !core_ios_no_unistd {
        DEFINES += HAVE_UNISTD_H
    }
}
core_android {
    equals(QT_ARCH, arm): CORE_BUILDS_PLATFORM_PREFIX = android_arm
    equals(QT_ARCH, i386): CORE_BUILDS_PLATFORM_PREFIX = android_x86
}

core_debug {
    CORE_BUILDS_CONFIGURATION_PREFIX    = debug
}
core_release {
    CORE_BUILDS_CONFIGURATION_PREFIX    = release
}

# MESSAGE
message($$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX)

# COMPILER
CONFIG += c++11

core_linux {
core_static_link_libstd {
    QMAKE_LFLAGS += -static-libstdc++ -static-libgcc
    message(core_static_link_libstd)
}
plugin {
    QMAKE_CXXFLAGS += -fvisibility=hidden
    QMAKE_CFLAGS += -fvisibility=hidden

    TARGET_EXT = .so
}
}

core_mac {
plugin {
    QMAKE_CXXFLAGS += -fvisibility=hidden
    QMAKE_CFLAGS += -fvisibility=hidden
}
}

core_windows {
plugin {
    TARGET_EXT = .dll
}
}

# BUILD_PATHS
# MUST BE DEFINED CORE_ROOT_DIR
!core_no_dst {
DESTDIR     = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX
OBJECTS_DIR = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/obj
MOC_DIR     = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/moc
RCC_DIR     = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/rcc
UI_DIR      = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX/ui
build_xp {
    OBJECTS_DIR = $$OBJECTS_DIR/xp
    MOC_DIR     = $$MOC_DIR/xp
    RCC_DIR     = $$RCC_DIR/xp
    UI_DIR      = $$UI_DIR/xp
}
}

CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/lib/$$CORE_BUILDS_PLATFORM_PREFIX
CORE_BUILDS_BINARY_PATH = $$CORE_ROOT_DIR/build/bin/$$CORE_BUILDS_PLATFORM_PREFIX

OO_BUILD_BRANDING = $$(OO_BRANDING)
!isEmpty(OO_BUILD_BRANDING) {
    CORE_BUILDS_LIBRARIES_PATH = $$CORE_ROOT_DIR/build/$$OO_BUILD_BRANDING/lib/$$CORE_BUILDS_PLATFORM_PREFIX
    CORE_BUILDS_BINARY_PATH = $$CORE_ROOT_DIR/build/$$OO_BUILD_BRANDING/bin/$$CORE_BUILDS_PLATFORM_PREFIX
}

core_debug {
    CORE_BUILDS_LIBRARIES_PATH = $$CORE_BUILDS_LIBRARIES_PATH/debug
    CORE_BUILDS_BINARY_PATH = $$CORE_BUILDS_BINARY_PATH/debug
}

plugin {
    DESTDIR = $$CORE_BUILDS_LIBRARIES_PATH
}
staticlib {
    DESTDIR = $$CORE_BUILDS_LIBRARIES_PATH
}

core_x2t {
core_windows {
    QMAKE_CXXFLAGS += /bigobj
} else {
    QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}

DEFINES += CRYPTOPP_DISABLE_ASM
}

core_ios {
    bundle_dylibs {
        plugin {
            CONFIG -= plugin
            CONFIG += lib_bundle

            QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
            #QMAKE_LFLAGS += -Xlinker -rpath -Xlinker @executable_path/Frameworks
            #QMAKE_LFLAGS += -Xlinker -rpath -Xlinker @loader_path/Frameworks

            # correct version to < 256
            VERSIONS = $$split(VERSION, ".")
            VERSION_1 = $$member(VERSIONS, 0)
            VERSION_2 = $$member(VERSIONS, 1)
            VERSION_3 = $$member(VERSIONS, 2)
            VERSION_4 = $$member(VERSIONS, 3)

            greaterThan(VERSION_1, 255): VERSION_1 = 255
            greaterThan(VERSION_2, 255): VERSION_2 = 255
            greaterThan(VERSION_3, 255): VERSION_3 = 255
            greaterThan(VERSION_4, 255): VERSION_4 = 255

            VERSION_CORRECT = $$VERSION_1
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", ".")
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", $$VERSION_2)
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", ".")
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", $$VERSION_3)
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", ".")
            VERSION_CORRECT = $$join(VERSION_CORRECT, "", "", $$VERSION_4)

            VERSION = $$VERSION_CORRECT
        }
    }
}

defineTest(ADD_DEPENDENCY) {
    libs = $$ARGS
    for(lib, libs) {
        CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH
        build_xp {
            isEqual(lib, doctrenderer):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH/xp
            isEqual(lib, ascdocumentscore):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH/xp
            isEqual(lib, videoplayer):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH/xp
        }
        !bundle_dylibs:LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH_DST -l$$lib
        bundle_dylibs:LIBS += -F$$CORE_BUILDS_LIBRARIES_PATH_DST -framework $$lib
    }
    export(LIBS)
}


version 3.8

version 3.8


Version 0.108

Version 0.108


Debug information in release builds

Debug information in release builds

# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# This file is part of the open 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/>.
# -------------------------------------------------

#
# This file contains configuration settings which are common to both the QGC Application and
# the Location Plugin. It should mainly contains intial CONFIG tag setup and compiler settings.
#

# Setup our supported build types. We do this once here and then use the defined config scopes
# to allow us to easily modify suported build types in one place instead of duplicated throughout
# the project file.

linux {
    linux-g++ | linux-g++-64 {
        message("Linux build")
        CONFIG += LinuxBuild
    } else : android-g++ {
        message("Android build")
        CONFIG  += AndroidBuild
        DEFINES += __mobile__
        DEFINES += __android__
        warning("Android build is experimental and not fully functional")
    } else {
        error("Unsuported Linux toolchain, only GCC 32- or 64-bit is supported")
    }
} else : win32 {
    win32-msvc2010 | win32-msvc2012 | win32-msvc2013 {
        message("Windows build")
        CONFIG += WindowsBuild
    } else {
        error("Unsupported Windows toolchain, only Visual Studio 2010, 2012, and 2013 are supported")
    }
} else : macx {
    macx-clang | macx-llvm {
        message("Mac build")
        CONFIG += MacBuild
        QMAKE_CXXFLAGS += -fvisibility=hidden
    } else {
        error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
    }
} else {
    error("Unsupported build platform, only Linux, Windows, and Mac are supported")
}

# Installer configuration

installer {
    CONFIG -= debug
    CONFIG -= debug_and_release
    CONFIG += release
    message(Build Installer)
}

# Setup our supported build flavors

CONFIG(debug, debug|release) {
    message(Debug flavor)
    CONFIG += DebugBuild
} else:CONFIG(release, debug|release) {
    message(Release flavor)
    CONFIG += ReleaseBuild
} else {
    error(Unsupported build flavor)
}

# Need to special case Windows debug_and_release since VS Project creation in this case does strange things [QTBUG-40351]
win32:debug_and_release {
    CONFIG += WindowsDebugAndRelease
}

# Setup our build directories

BASEDIR      = $${IN_PWD}

DebugBuild {
    DESTDIR  = $${OUT_PWD}/debug
    BUILDDIR = $${OUT_PWD}/build-debug
}

ReleaseBuild {
    DESTDIR  = $${OUT_PWD}/release
    BUILDDIR = $${OUT_PWD}/build-release
}

OBJECTS_DIR = $${BUILDDIR}/obj
MOC_DIR     = $${BUILDDIR}/moc
UI_DIR      = $${BUILDDIR}/ui
RCC_DIR     = $${BUILDDIR}/rcc
LANGUAGE    = C++

# We place the created plugin lib into the objects dir so that make clean will clean it as well
LOCATION_PLUGIN_DESTDIR = $${OBJECTS_DIR}
LOCATION_PLUGIN_NAME    = QGeoServiceProviderFactoryQGC

message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET)

# Turn off serial port warnings
DEFINES += _TTY_NOWARN_

#
# OS Specific settings
#

AndroidBuild {
    DEFINES += __STDC_LIMIT_MACROS
}

MacBuild {
    CONFIG += x86_64
    CONFIG -= x86
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
    QMAKE_MAC_SDK = macosx10.9
}

LinuxBuild {
	DEFINES += __STDC_LIMIT_MACROS
}

WindowsBuild {
	DEFINES += __STDC_LIMIT_MACROS

	# Specify multi-process compilation within Visual Studio.
	# (drastically improves compilation times for multi-core computers)
	QMAKE_CXXFLAGS_DEBUG += -MP
	QMAKE_CXXFLAGS_RELEASE += -MP
}

#
# By default warnings as errors are turned off. Even so, in order for a pull request
# to be accepted you must compile cleanly with warnings as errors turned on the default
# set of OS builds. See http://www.qgroundcontrol.org/dev/contribute for more details.
# You can use the WarningsAsErrorsOn CONFIG switch to turn warnings as errors on for your
# own builds.
#

MacBuild | LinuxBuild {
	QMAKE_CXXFLAGS_WARN_ON += -Wall
    WarningsAsErrorsOn {
        QMAKE_CXXFLAGS_WARN_ON += -Werror
    }
}

WindowsBuild {
	QMAKE_CXXFLAGS_WARN_ON += /W3 \
        /wd4996 \   # silence warnings about deprecated strcpy and whatnot
        /wd4005 \   # silence warnings about macro redefinition
        /wd4290 \   # ignore exception specifications
        /Zc:strictStrings-  # work around win 8.1 sdk sapi.h problem
    WarningsAsErrorsOn {
        QMAKE_CXXFLAGS_WARN_ON += /WX
    }
}

#
# Build-specific settings
#

ReleaseBuild {
    DEFINES += QT_NO_DEBUG

	WindowsBuild {
		# Use link time code generation for better optimization (I believe this is supported in MSVC Express, but not 100% sure)
		QMAKE_LFLAGS_LTCG = /LTCG
		QMAKE_CFLAGS_LTCG = -GL

		# Turn on debugging information so we can collect good crash dumps from release builds
		QMAKE_CXXFLAGS_RELEASE += /Zi
		QMAKE_LFLAGS_RELEASE += /DEBUG
    }
}

#
# Unit Test specific configuration goes here
#
# We have to special case Windows debug_and_release builds because you can't have files
# which are only in the debug variant [QTBUG-40351]. So in this case we include unit tests
# even in the release variant. If you want a Windows release build with no unit tests run
# qmake with CONFIG-=debug_and_release CONFIG+=release.
#

DebugBuild|WindowsDebugAndRelease {
    DEFINES += UNITTEST_BUILD
}

# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# This file is part of the open 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/>.
# -------------------------------------------------

#
# This file contains configuration settings which are common to both the QGC Application and
# the Location Plugin. It should mainly contains intial CONFIG tag setup and compiler settings.
#

# Setup our supported build types. We do this once here and then use the defined config scopes
# to allow us to easily modify suported build types in one place instead of duplicated throughout
# the project file.

linux {
    linux-g++ | linux-g++-64 {
        message("Linux build")
        CONFIG += LinuxBuild
    } else : android-g++ {
        message("Android build")
        CONFIG  += AndroidBuild
        DEFINES += __mobile__
        DEFINES += __android__
        warning("Android build is experimental and not fully functional")
    } else {
        error("Unsuported Linux toolchain, only GCC 32- or 64-bit is supported")
    }
} else : win32 {
    win32-msvc2010 | win32-msvc2012 | win32-msvc2013 {
        message("Windows build")
        CONFIG += WindowsBuild
    } else {
        error("Unsupported Windows toolchain, only Visual Studio 2010, 2012, and 2013 are supported")
    }
} else : macx {
    macx-clang | macx-llvm {
        message("Mac build")
        CONFIG += MacBuild
        QMAKE_CXXFLAGS += -fvisibility=hidden
    } else {
        error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
    }
} else {
    error("Unsupported build platform, only Linux, Windows, and Mac are supported")
}

# Installer configuration

installer {
    CONFIG -= debug
    CONFIG -= debug_and_release
    CONFIG += release
    message(Build Installer)
}

# Setup our supported build flavors

CONFIG(debug, debug|release) {
    message(Debug flavor)
    CONFIG += DebugBuild
} else:CONFIG(release, debug|release) {
    message(Release flavor)
    CONFIG += ReleaseBuild
} else {
    error(Unsupported build flavor)
}

# Need to special case Windows debug_and_release since VS Project creation in this case does strange things [QTBUG-40351]
win32:debug_and_release {
    CONFIG += WindowsDebugAndRelease
}

# Setup our build directories

BASEDIR      = $${IN_PWD}

DebugBuild {
    DESTDIR  = $${OUT_PWD}/debug
    BUILDDIR = $${OUT_PWD}/build-debug
}

ReleaseBuild {
    DESTDIR  = $${OUT_PWD}/release
    BUILDDIR = $${OUT_PWD}/build-release
}

OBJECTS_DIR = $${BUILDDIR}/obj
MOC_DIR     = $${BUILDDIR}/moc
UI_DIR      = $${BUILDDIR}/ui
RCC_DIR     = $${BUILDDIR}/rcc
LANGUAGE    = C++

# We place the created plugin lib into the objects dir so that make clean will clean it as well
LOCATION_PLUGIN_DESTDIR = $${OBJECTS_DIR}
LOCATION_PLUGIN_NAME    = QGeoServiceProviderFactoryQGC

message(BASEDIR $$BASEDIR DESTDIR $$DESTDIR TARGET $$TARGET)

# Turn off serial port warnings
DEFINES += _TTY_NOWARN_

#
# OS Specific settings
#

AndroidBuild {
    DEFINES += __STDC_LIMIT_MACROS
}

MacBuild {
    CONFIG += x86_64
    CONFIG -= x86
    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
    QMAKE_MAC_SDK = macosx10.9
}

LinuxBuild {
	DEFINES += __STDC_LIMIT_MACROS
}

WindowsBuild {
	DEFINES += __STDC_LIMIT_MACROS

	# Specify multi-process compilation within Visual Studio.
	# (drastically improves compilation times for multi-core computers)
	QMAKE_CXXFLAGS_DEBUG += -MP
	QMAKE_CXXFLAGS_RELEASE += -MP
}

#
# By default warnings as errors are turned off. Even so, in order for a pull request
# to be accepted you must compile cleanly with warnings as errors turned on the default
# set of OS builds. See http://www.qgroundcontrol.org/dev/contribute for more details.
# You can use the WarningsAsErrorsOn CONFIG switch to turn warnings as errors on for your
# own builds.
#

MacBuild | LinuxBuild {
	QMAKE_CXXFLAGS_WARN_ON += -Wall
    WarningsAsErrorsOn {
        QMAKE_CXXFLAGS_WARN_ON += -Werror
    }
}

WindowsBuild {
	QMAKE_CXXFLAGS_WARN_ON += /W3 \
        /wd4996 \   # silence warnings about deprecated strcpy and whatnot
        /wd4005 \   # silence warnings about macro redefinition
        /wd4290 \   # ignore exception specifications
        /Zc:strictStrings-  # work around win 8.1 sdk sapi.h problem
    WarningsAsErrorsOn {
        QMAKE_CXXFLAGS_WARN_ON += /WX
    }
}

#
# Build-specific settings
#

ReleaseBuild {
    DEFINES += QT_NO_DEBUG

	WindowsBuild {
		# Use link time code generation for better optimization (I believe this is supported in MSVC Express, but not 100% sure)
		QMAKE_LFLAGS_LTCG = /LTCG
		QMAKE_CFLAGS_LTCG = -GL
    }
}

#
# Unit Test specific configuration goes here
#
# We have to special case Windows debug_and_release builds because you can't have files
# which are only in the debug variant [QTBUG-40351]. So in this case we include unit tests
# even in the release variant. If you want a Windows release build with no unit tests run
# qmake with CONFIG-=debug_and_release CONFIG+=release.
#

DebugBuild|WindowsDebugAndRelease {
    DEFINES += UNITTEST_BUILD
}


Improved GCC version check

Improved GCC version check

# Copyright 2007-2015 QReal Research Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

win32 {
	PLATFORM = windows
}

unix:!macx {
	PLATFORM = linux
}

macx {
	PLATFORM = mac
}

CONFIG(debug, debug | release) {
	CONFIGURATION = debug
	CONFIGURATION_SUFFIX = -d
	unix {
		QMAKE_CXXFLAGS += -coverage
		QMAKE_LFLAGS += -coverage
	}
} else {
	CONFIGURATION = release
	CONFIGURATION_SUFFIX =
}

DESTDIR = $$PWD/bin/$$CONFIGURATION

PROJECT_BASENAME = $$basename(_PRO_FILE_)
PROJECT_NAME = $$section(PROJECT_BASENAME, ".", 0, 0)

isEmpty(TARGET) {
	TARGET = $$PROJECT_NAME$$CONFIGURATION_SUFFIX
} else {
	TARGET = $$TARGET$$CONFIGURATION_SUFFIX
}

equals(TEMPLATE, app) {
	unix:!macx {
		QMAKE_LFLAGS += -Wl,-rpath-link,$$DESTDIR
		!CONFIG(no_rpath) QMAKE_LFLAGS += -Wl,-O1,-rpath,.
	}
}

macx-clang {
	QMAKE_CXXFLAGS += -stdlib=libc++
	QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../../../
}

unix {

	# seems like we want USan always, but are afraid of ....
	!CONFIG(sanitize_address):!CONFIG(sanitize_thread):!CONFIG(sanitize_memory):!CONFIG(sanitize_kernel_address) {
		# Ubsan is turned on by default into debug build
		CONFIG += sanitizer sanitize_undefined
		macx-clang {
			# sometimes runtime is missing in clang. this hack allows to avoid runtime dependency.
			QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fsanitize-trap=undefined
			QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fsanitize-trap=undefined
			QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fsanitize-trap=undefined
		}
	}

	!CONFIG(sanitize_address):!macx-clang { CONFIG += sanitize_leak }

	CONFIG(sanitize_leak) {
		#LSan can be used without performance degrade even in release build
		QMAKE_CFLAGS += -fsanitize=leak
		QMAKE_CXXFLAGS += -fsanitize=leak
		QMAKE_LFLAGS += -fsanitize=leak
	}

	!clang:gcc:*-g++*:system($$QMAKE_CXX --version | grep -oe \'\\<5\\.[0-9]\\+\\.\' ){
		CONFIG(sanitize_undefined){
		# Ubsan has (had at least) known issues with false errors about calls of methods of the base class.
		# That must be disabled. Variables for confguring ubsan are taken from here:
		# https://codereview.qt-project.org/#/c/43420/17/mkspecs/common/sanitize.conf
		# They can change in some version of Qt, keep track of it.
		# By the way, simply setting QMAKE_CFLAGS, QMAKE_CXXFLAGS and QMAKE_LFLAGS instead of those used below
		# will not work due to arguments order ("-fsanitize=undefined" must be declared before "-fno-sanitize=vptr").
			QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fno-sanitize=vptr
			QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fno-sanitize=vptr
			QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fno-sanitize=vptr
		}
	}

	CONFIG(release, debug | release){
		!clang:gcc:*-g++*:system($$QMAKE_CXX --version | grep -oe \'\\<4\\.[0-9]\\+\\.\' ){
			message("Too old compiler: $$QMAKE_CXX")
		} else {
			QMAKE_CFLAGS += -fsanitize-recover=all
			QMAKE_CXXFLAGS += -fsanitize-recover=all
		}
	}

}

OBJECTS_DIR = .build/$$CONFIGURATION/obj
MOC_DIR = .build/$$CONFIGURATION/moc
RCC_DIR = .build/$$CONFIGURATION/rcc
UI_DIR = .build/$$CONFIGURATION/ui

INCLUDEPATH += $$_PRO_FILE_PWD_ \
	$$_PRO_FILE_PWD_/include \
	$$PWD \

LIBS += -L$$DESTDIR

CONFIG += c++11
QMAKE_CXXFLAGS += -Wextra -Wcast-qual -Wwrite-strings -Wredundant-decls -Wunreachable-code -Wnon-virtual-dtor

GLOBAL_PWD = $$PWD

# Useful function to copy additional files to destination,
# from http://stackoverflow.com/questions/3984104/qmake-how-to-copy-a-file-to-the-output
defineTest(copyToDestdir) {
	FILES = $$1
	NOW = $$2

	for(FILE, FILES) {
		DESTDIR_SUFFIX =
		isEmpty(QMAKE_SH) {
		# This ugly code is needed because xcopy requires to add source directory name to target directory name when copying directories
			win32 {
				AFTER_SLASH = $$section(FILE, "/", -1, -1)
				BASE_NAME = $$section(FILE, "/", -2, -2)
				equals(AFTER_SLASH, ""):DESTDIR_SUFFIX = /$$BASE_NAME

				FILE ~= s,/$,,g

				FILE ~= s,/,\\,g
			}
			DDIR = $$DESTDIR$$DESTDIR_SUFFIX/$$3
			win32:DDIR ~= s,/,\\,g
		} else {
			DDIR = $$DESTDIR$$DESTDIR_SUFFIX/$$3
		}

		isEmpty(NOW) {
			# In case this is directory add "*" to copy contents of a directory instead of directory itself under linux.
			!win32:equals(AFTER_SLASH, ""):FILE = $$FILE*
			QMAKE_POST_LINK += $(COPY_DIR) $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
		} else {
			win32 {
				system("cmd /C "xcopy $$quote($$FILE) $$quote($$DDIR) /s /e /q /y /i"")
			}

			unix:!macx {
				system("cp -r -f $$FILE $$DDIR")
			}

			macx {
				system("cp -af $$FILE $$DDIR/")
			}
		}
	}

	export(QMAKE_POST_LINK)
}

defineTest(includes) {
	PROJECTS = $$1

	for(PROJECT, PROJECTS) {
		INCLUDEPATH += $$GLOBAL_PWD/$$PROJECT $$GLOBAL_PWD/$$PROJECT/include
	}

	export(INCLUDEPATH)
}

defineTest(links) {
	PROJECTS = $$1

	for(PROJECT, PROJECTS) {
		LIBS += -l$$PROJECT$$CONFIGURATION_SUFFIX
	}

	export(LIBS)
}

# Copyright 2007-2015 QReal Research Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

win32 {
	PLATFORM = windows
}

unix:!macx {
	PLATFORM = linux
}

macx {
	PLATFORM = mac
}

CONFIG(debug, debug | release) {
	CONFIGURATION = debug
	CONFIGURATION_SUFFIX = -d
	unix {
		QMAKE_CXXFLAGS += -coverage
		QMAKE_LFLAGS += -coverage
	}
} else {
	CONFIGURATION = release
	CONFIGURATION_SUFFIX =
}

DESTDIR = $$PWD/bin/$$CONFIGURATION

PROJECT_BASENAME = $$basename(_PRO_FILE_)
PROJECT_NAME = $$section(PROJECT_BASENAME, ".", 0, 0)

isEmpty(TARGET) {
	TARGET = $$PROJECT_NAME$$CONFIGURATION_SUFFIX
} else {
	TARGET = $$TARGET$$CONFIGURATION_SUFFIX
}

equals(TEMPLATE, app) {
	unix:!macx {
		QMAKE_LFLAGS += -Wl,-rpath-link,$$DESTDIR
		!CONFIG(no_rpath) QMAKE_LFLAGS += -Wl,-O1,-rpath,.
	}
}

macx-clang {
	QMAKE_CXXFLAGS += -stdlib=libc++
	QMAKE_LFLAGS_SONAME = -Wl,-install_name,@executable_path/../../../
}

unix {

	# seems like we want USan always, but are afraid of ....
	!CONFIG(sanitize_address):!CONFIG(sanitize_thread):!CONFIG(sanitize_memory):!CONFIG(sanitize_kernel_address) {
		# Ubsan is turned on by default into debug build
		CONFIG += sanitizer sanitize_undefined
		macx-clang {
			# sometimes runtime is missing in clang. this hack allows to avoid runtime dependency.
			QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fsanitize-trap=undefined
			QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fsanitize-trap=undefined
			QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fsanitize-trap=undefined
		}
	}

	!CONFIG(sanitize_address):!macx-clang { CONFIG += sanitize_leak }

	CONFIG(sanitize_leak) {
		#LSan can be used without performance degrade even in release build
		QMAKE_CFLAGS += -fsanitize=leak
		QMAKE_CXXFLAGS += -fsanitize=leak
		QMAKE_LFLAGS += -fsanitize=leak
	}

	!clang:gcc:*-g++*:system($$QMAKE_CXX --version | grep -e \'\\<5\\.[0-9]\' ){
		CONFIG(sanitize_undefined){
		# Ubsan has (had at least) known issues with false errors about calls of methods of the base class.
		# That must be disabled. Variables for confguring ubsan are taken from here:
		# https://codereview.qt-project.org/#/c/43420/17/mkspecs/common/sanitize.conf
		# They can change in some version of Qt, keep track of it.
		# By the way, simply setting QMAKE_CFLAGS, QMAKE_CXXFLAGS and QMAKE_LFLAGS instead of those used below
		# will not work due to arguments order ("-fsanitize=undefined" must be declared before "-fno-sanitize=vptr").
			QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fno-sanitize=vptr
			QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fno-sanitize=vptr
			QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fno-sanitize=vptr
		}
	}

	CONFIG(release, debug | release){
		!clang:gcc:*-g++*:system($$QMAKE_CXX --version | grep -e \'\\<4\\.[0-9]\' ){
			message("Too old compiler: $$QMAKE_CXX")
		} else {
			QMAKE_CFLAGS += -fsanitize-recover=all
			QMAKE_CXXFLAGS += -fsanitize-recover=all
		}
	}

}

OBJECTS_DIR = .build/$$CONFIGURATION/obj
MOC_DIR = .build/$$CONFIGURATION/moc
RCC_DIR = .build/$$CONFIGURATION/rcc
UI_DIR = .build/$$CONFIGURATION/ui

INCLUDEPATH += $$_PRO_FILE_PWD_ \
	$$_PRO_FILE_PWD_/include \
	$$PWD \

LIBS += -L$$DESTDIR

CONFIG += c++11
QMAKE_CXXFLAGS += -Wextra -Wcast-qual -Wwrite-strings -Wredundant-decls -Wunreachable-code -Wnon-virtual-dtor

GLOBAL_PWD = $$PWD

# Useful function to copy additional files to destination,
# from http://stackoverflow.com/questions/3984104/qmake-how-to-copy-a-file-to-the-output
defineTest(copyToDestdir) {
	FILES = $$1
	NOW = $$2

	for(FILE, FILES) {
		DESTDIR_SUFFIX =
		isEmpty(QMAKE_SH) {
		# This ugly code is needed because xcopy requires to add source directory name to target directory name when copying directories
			win32 {
				AFTER_SLASH = $$section(FILE, "/", -1, -1)
				BASE_NAME = $$section(FILE, "/", -2, -2)
				equals(AFTER_SLASH, ""):DESTDIR_SUFFIX = /$$BASE_NAME

				FILE ~= s,/$,,g

				FILE ~= s,/,\\,g
			}
			DDIR = $$DESTDIR$$DESTDIR_SUFFIX/$$3
			win32:DDIR ~= s,/,\\,g
		} else {
			DDIR = $$DESTDIR$$DESTDIR_SUFFIX/$$3
		}

		isEmpty(NOW) {
			# In case this is directory add "*" to copy contents of a directory instead of directory itself under linux.
			!win32:equals(AFTER_SLASH, ""):FILE = $$FILE*
			QMAKE_POST_LINK += $(COPY_DIR) $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
		} else {
			win32 {
				system("cmd /C "xcopy $$quote($$FILE) $$quote($$DDIR) /s /e /q /y /i"")
			}

			unix:!macx {
				system("cp -r -f $$FILE $$DDIR")
			}

			macx {
				system("cp -af $$FILE $$DDIR/")
			}
		}
	}

	export(QMAKE_POST_LINK)
}

defineTest(includes) {
	PROJECTS = $$1

	for(PROJECT, PROJECTS) {
		INCLUDEPATH += $$GLOBAL_PWD/$$PROJECT $$GLOBAL_PWD/$$PROJECT/include
	}

	export(INCLUDEPATH)
}

defineTest(links) {
	PROJECTS = $$1

	for(PROJECT, PROJECTS) {
		LIBS += -l$$PROJECT$$CONFIGURATION_SUFFIX
	}

	export(LIBS)
}


better reference to current dir

better reference to current dir

################################################################################
#
# (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
#
# QGroundControl is licensed according to the terms in the file
# COPYING.md in the root of the source code directory.
#
################################################################################

#
# [REQUIRED] Add support for <inttypes.h> to Windows.
#
WindowsBuild {
    INCLUDEPATH += libs/msinttypes
}

#
# [REQUIRED] Add support for the MAVLink communications protocol.
#
# By default MAVLink dialect is hardwired to arudpilotmega. The reason being
# the current codebase supports both PX4 and APM flight stack. PX4 flight stack
# only uses common MAVLink specifications, whereas APM flight stack uses custom
# MAVLink specifications which adds to common. So by using the adupilotmega dialect
# QGC can support both in the same codebase.

# Once the mavlink helper routines include support for multiple dialects within
# a single compiled codebase this hardwiring of dialect can go away. But until then
# this "workaround" is needed.

# In the mean time, it’s possible to define a completely different dialect by defining the
# location and name below.

# check for user defined settings in user_config.pri if not already set as qmake argument
isEmpty(MAVLINKPATH_REL) {
    exists(user_config.pri):infile(user_config.pri, MAVLINKPATH_REL) {
        MAVLINKPATH_REL = $$fromfile(user_config.pri, MAVLINKPATH_REL)
        message($$sprintf("Using user-supplied relativ mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH_REL))
    } else {
        MAVLINKPATH_REL = libs/mavlink/include/mavlink/v2.0
    }
}

isEmpty(MAVLINKPATH) {
    exists(user_config.pri):infile(user_config.pri, MAVLINKPATH) {
        MAVLINKPATH     = $$fromfile(user_config.pri, MAVLINKPATH)
        message($$sprintf("Using user-supplied mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH))
    } else {
        MAVLINKPATH     = $$SOURCE_DIR/$$MAVLINKPATH_REL
    }
}

isEmpty(MAVLINK_CONF) {
    exists(user_config.pri):infile(user_config.pri, MAVLINK_CONF) {
        MAVLINK_CONF = $$fromfile(user_config.pri, MAVLINK_CONF)
        message($$sprintf("Using user-supplied mavlink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF))
    } else {
        MAVLINK_CONF = ardupilotmega
    }
}

# If defined, all APM specific MAVLink messages are disabled
contains (CONFIG, QGC_DISABLE_APM_MAVLINK) {
    message("Disable APM MAVLink support")
    DEFINES += NO_ARDUPILOT_DIALECT
    CONFIG  += ArdupilotDisabled
} else {
    CONFIG  += ArdupilotEnabled
}

# First we select the dialect, checking for valid user selection
# Users can override all other settings by specifying MAVLINK_CONF as an argument to qmake
!isEmpty(MAVLINK_CONF) {
    message($$sprintf("Using MAVLink dialect '%1'.", $$MAVLINK_CONF))
}

# Then we add the proper include paths dependent on the dialect.
INCLUDEPATH += $$MAVLINKPATH

exists($$MAVLINKPATH/common) {
    !isEmpty(MAVLINK_CONF) {
        count(MAVLINK_CONF, 1) {
            exists($$MAVLINKPATH/$$MAVLINK_CONF) {
                INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
                DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
            } else {
                error($$sprintf("MAVLink dialect '%1' does not exist at '%2'!", $$MAVLINK_CONF, $$MAVLINKPATH_REL))
            }
        } else {
            error(Only a single mavlink dialect can be specified in MAVLINK_CONF)
        }
    } else {
        INCLUDEPATH += $$MAVLINKPATH/common
    }
} else {
    error($$sprintf("MAVLink folder does not exist at '%1'! Run 'git submodule init && git submodule update' on the command line.",$$MAVLINKPATH_REL))
}

#
# [REQUIRED] EIGEN matrix library
# NOMINMAX constant required to make internal min/max work.
INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX

#
# [REQUIRED] shapelib library
INCLUDEPATH += libs/shapelib
SOURCES += \
    libs/shapelib/shpopen.c \
    libs/shapelib/safileio.c

#
# [REQUIRED] zlib library
WindowsBuild {
    INCLUDEPATH +=  $$SOURCE_DIR/libs/zlib/windows/include
    LIBS += -L$$SOURCE_DIR/libs/zlib/windows/lib
    LIBS += -lzlibstat
} else {
    LIBS += -lz
}

#
# [REQUIRED] LZMA decompression library
HEADERS+= \
    libs/xz-embedded/linux/include/linux/xz.h \
    libs/xz-embedded/linux/lib/xz/xz_lzma2.h \
    libs/xz-embedded/linux/lib/xz/xz_private.h \
    libs/xz-embedded/linux/lib/xz/xz_stream.h \
    libs/xz-embedded/userspace/xz_config.h
SOURCES += \
    libs/xz-embedded/linux/lib/xz/xz_crc32.c \
    libs/xz-embedded/linux/lib/xz/xz_crc64.c \
    libs/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \
    libs/xz-embedded/linux/lib/xz/xz_dec_stream.c
INCLUDEPATH += \
    libs/xz-embedded/userspace \
    libs/xz-embedded/linux/include/linux
DEFINES += XZ_DEC_ANY_CHECK XZ_USE_CRC64

#
# [REQUIRED] SDL dependency. Provides joystick/gamepad support.
# The SDL is packaged with QGC for the Mac and Windows. Linux support requires installing the SDL
# library (development libraries and static binaries).
#
MacBuild {
    INCLUDEPATH += \
        $$SOURCE_DIR/libs/Frameworks/SDL2.framework/Headers
    LIBS += \
        -F$$SOURCE_DIR/libs/Frameworks \
        -framework SDL2
} else:LinuxBuild {
    PKGCONFIG = sdl2
} else:WindowsBuild {
    INCLUDEPATH += $$SOURCE_DIR/libs/sdl2/msvc/include
    INCLUDEPATH += $$SOURCE_DIR/libs/OpenSSL/Windows/x64/include
    LIBS += -L$$SOURCE_DIR/libs/sdl2/msvc/lib/x64
    LIBS += -lSDL2
}

# Include Android OpenSSL libs
AndroidBuild {
    include($$SOURCE_DIR/libs/OpenSSL/android_openssl/openssl.pri)
    message("ANDROID_EXTRA_LIBS")
    message($$ANDROID_TARGET_ARCH)
    message($$ANDROID_EXTRA_LIBS)
}

# Pairing
contains(DEFINES, QGC_ENABLE_PAIRING) {
    MacBuild {
        #- Pairing is generally not supported on macOS. This is here solely for development.
        exists(/usr/local/Cellar/openssl/1.0.2t/include) {
            INCLUDEPATH += /usr/local/Cellar/openssl/1.0.2t/include
            LIBS += -L/usr/local/Cellar/openssl/1.0.2t/lib
            LIBS += -lcrypto
        } else {
            # There is some circular reference settings going on between QGCExternalLibs.pri and gqgroundcontrol.pro.
            # So this duplicates some of the enable/disable logic which would normally be in qgroundcontrol.pro.
            DEFINES -= QGC_ENABLE_PAIRING
        }
    } else:WindowsBuild {
        #- Pairing is not supported on Windows
        DEFINES -= QGC_ENABLE_PAIRING
    } else {
        LIBS += -lcrypto
        AndroidBuild {
            contains(QT_ARCH, arm) {
                LIBS += $$ANDROID_EXTRA_LIBS
                INCLUDEPATH += $$SOURCE_DIR/libs/OpenSSL/Android/arch-armeabi-v7a/include
            } else {
                LIBS += $$ANDROID_EXTRA_LIBS
                INCLUDEPATH += $$SOURCE_DIR/libs/OpenSSL/Android/arch-x86/include
            }
        }
    }
}

#
# [OPTIONAL] Zeroconf for UDP links
#
contains (DEFINES, DISABLE_ZEROCONF) {
    message("Skipping support for Zeroconf (manual override from command line)")
    DEFINES -= DISABLE_ZEROCONF
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_ZEROCONF) {
    message("Skipping support for Zeroconf (manual override from user_config.pri)")
# Mac support is built into OS
} else:MacBuild|iOSBuild {
    message("Including support for Zeroconf (Bonjour)")
    DEFINES += QGC_ZEROCONF_ENABLED
} else {
    message("Skipping support for Zeroconf (unsupported platform)")
}

#
# [OPTIONAL] AirMap Support
#
contains (DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from command line)")
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from user_config.pri)")
} else {
    AIRMAP_PLATFORM_SDK_PATH    = $${OUT_PWD}/libs/airmapd
    AIRMAP_QT_PATH              = Qt.$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}
    message('Looking for Airmap in folder "$${AIRMAP_PLATFORM_SDK_PATH}", variant: "$$AIRMAP_QT_PATH"')
    MacBuild {
        exists("$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH") {
            message("Including support for AirMap for macOS")
            LIBS += -L$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH -lairmap-qt
            DEFINES += QGC_AIRMAP_ENABLED
        }
    } else:LinuxBuild {
        exists("$${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH") {
            message("Including support for AirMap for Linux")
            LIBS += -L$${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH -lairmap-qt
            DEFINES += QGC_AIRMAP_ENABLED
        } else {
            #-- Download and install platform-sdk libs and headers
            message("Installing AirMap platform-sdk libs and headers")
            AIRMAP_PLATFORM_SDK_URL = "https://github.com/airmap/platform-sdk/releases/download/v1.1/airmap-platform-sdk-1.1.0-Linux.deb"
            AIRMAP_PLATFORM_SDK_FILENAME = "airmap-platform-sdk.deb"
            AIRMAP_PLATFORM_SDK_INSTALL_PREFIX = "airmap-platform-sdk"
            !exists("$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}") {
                system("mkdir -p $${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}")
            }
            !exists("$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap") {
                system("mkdir -p $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap")
            }
            system("wget -q -O $${AIRMAP_PLATFORM_SDK_FILENAME} $${AIRMAP_PLATFORM_SDK_URL} && dpkg -x $${AIRMAP_PLATFORM_SDK_FILENAME} $${AIRMAP_PLATFORM_SDK_PATH}/")
            system("mv $${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/lib/* $${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}/")
            system("mv $${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/include/airmap/* $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/")
            system("rm -rf $${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}")
            system("rm $${AIRMAP_PLATFORM_SDK_FILENAME}")

            exists($${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH) {
                message("Including support for AirMap for Linux")
                LIBS += -L$${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH -lairmap-qt
                DEFINES += QGC_AIRMAP_ENABLED
            } else {
                message("Failed to install AirMap support for Linux")
            }
        }
    } else {
        message("Skipping support for Airmap (unsupported platform)")
    }
    contains (DEFINES, QGC_AIRMAP_ENABLED) {
        INCLUDEPATH += \
            $${AIRMAP_PLATFORM_SDK_PATH}/include
    }
}

################################################################################
#
# (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
#
# QGroundControl is licensed according to the terms in the file
# COPYING.md in the root of the source code directory.
#
################################################################################

#
# [REQUIRED] Add support for <inttypes.h> to Windows.
#
WindowsBuild {
    INCLUDEPATH += libs/msinttypes
}

#
# [REQUIRED] Add support for the MAVLink communications protocol.
#
# By default MAVLink dialect is hardwired to arudpilotmega. The reason being
# the current codebase supports both PX4 and APM flight stack. PX4 flight stack
# only uses common MAVLink specifications, whereas APM flight stack uses custom
# MAVLink specifications which adds to common. So by using the adupilotmega dialect
# QGC can support both in the same codebase.

# Once the mavlink helper routines include support for multiple dialects within
# a single compiled codebase this hardwiring of dialect can go away. But until then
# this "workaround" is needed.

# In the mean time, it’s possible to define a completely different dialect by defining the
# location and name below.

# check for user defined settings in user_config.pri if not already set as qmake argument
isEmpty(MAVLINKPATH_REL) {
    exists(user_config.pri):infile(user_config.pri, MAVLINKPATH_REL) {
        MAVLINKPATH_REL = $$fromfile(user_config.pri, MAVLINKPATH_REL)
        message($$sprintf("Using user-supplied relativ mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH_REL))
    } else {
        MAVLINKPATH_REL = libs/mavlink/include/mavlink/v2.0
    }
}

isEmpty(MAVLINKPATH) {
    exists(user_config.pri):infile(user_config.pri, MAVLINKPATH) {
        MAVLINKPATH     = $$fromfile(user_config.pri, MAVLINKPATH)
        message($$sprintf("Using user-supplied mavlink path '%1' specified in user_config.pri", $$MAVLINKPATH))
    } else {
        MAVLINKPATH     = $$SOURCE_DIR/$$MAVLINKPATH_REL
    }
}

isEmpty(MAVLINK_CONF) {
    exists(user_config.pri):infile(user_config.pri, MAVLINK_CONF) {
        MAVLINK_CONF = $$fromfile(user_config.pri, MAVLINK_CONF)
        message($$sprintf("Using user-supplied mavlink dialect '%1' specified in user_config.pri", $$MAVLINK_CONF))
    } else {
        MAVLINK_CONF = ardupilotmega
    }
}

# If defined, all APM specific MAVLink messages are disabled
contains (CONFIG, QGC_DISABLE_APM_MAVLINK) {
    message("Disable APM MAVLink support")
    DEFINES += NO_ARDUPILOT_DIALECT
    CONFIG  += ArdupilotDisabled
} else {
    CONFIG  += ArdupilotEnabled
}

# First we select the dialect, checking for valid user selection
# Users can override all other settings by specifying MAVLINK_CONF as an argument to qmake
!isEmpty(MAVLINK_CONF) {
    message($$sprintf("Using MAVLink dialect '%1'.", $$MAVLINK_CONF))
}

# Then we add the proper include paths dependent on the dialect.
INCLUDEPATH += $$MAVLINKPATH

exists($$MAVLINKPATH/common) {
    !isEmpty(MAVLINK_CONF) {
        count(MAVLINK_CONF, 1) {
            exists($$MAVLINKPATH/$$MAVLINK_CONF) {
                INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
                DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
            } else {
                error($$sprintf("MAVLink dialect '%1' does not exist at '%2'!", $$MAVLINK_CONF, $$MAVLINKPATH_REL))
            }
        } else {
            error(Only a single mavlink dialect can be specified in MAVLINK_CONF)
        }
    } else {
        INCLUDEPATH += $$MAVLINKPATH/common
    }
} else {
    error($$sprintf("MAVLink folder does not exist at '%1'! Run 'git submodule init && git submodule update' on the command line.",$$MAVLINKPATH_REL))
}

#
# [REQUIRED] EIGEN matrix library
# NOMINMAX constant required to make internal min/max work.
INCLUDEPATH += libs/eigen
DEFINES += NOMINMAX

#
# [REQUIRED] shapelib library
INCLUDEPATH += libs/shapelib
SOURCES += \
    libs/shapelib/shpopen.c \
    libs/shapelib/safileio.c

#
# [REQUIRED] zlib library
WindowsBuild {
    INCLUDEPATH +=  $$SOURCE_DIR/libs/zlib/windows/include
    LIBS += -L$$SOURCE_DIR/libs/zlib/windows/lib
    LIBS += -lzlibstat
} else {
    LIBS += -lz
}

#
# [REQUIRED] LZMA decompression library
HEADERS+= \
    libs/xz-embedded/linux/include/linux/xz.h \
    libs/xz-embedded/linux/lib/xz/xz_lzma2.h \
    libs/xz-embedded/linux/lib/xz/xz_private.h \
    libs/xz-embedded/linux/lib/xz/xz_stream.h \
    libs/xz-embedded/userspace/xz_config.h
SOURCES += \
    libs/xz-embedded/linux/lib/xz/xz_crc32.c \
    libs/xz-embedded/linux/lib/xz/xz_crc64.c \
    libs/xz-embedded/linux/lib/xz/xz_dec_lzma2.c \
    libs/xz-embedded/linux/lib/xz/xz_dec_stream.c
INCLUDEPATH += \
    libs/xz-embedded/userspace \
    libs/xz-embedded/linux/include/linux
DEFINES += XZ_DEC_ANY_CHECK XZ_USE_CRC64

#
# [REQUIRED] SDL dependency. Provides joystick/gamepad support.
# The SDL is packaged with QGC for the Mac and Windows. Linux support requires installing the SDL
# library (development libraries and static binaries).
#
MacBuild {
    INCLUDEPATH += \
        $$SOURCE_DIR/libs/Frameworks/SDL2.framework/Headers
    LIBS += \
        -F$$SOURCE_DIR/libs/Frameworks \
        -framework SDL2
} else:LinuxBuild {
    PKGCONFIG = sdl2
} else:WindowsBuild {
    INCLUDEPATH += $$SOURCE_DIR/libs/sdl2/msvc/include
    INCLUDEPATH += $$SOURCE_DIR/libs/OpenSSL/Windows/x64/include
    LIBS += -L$$SOURCE_DIR/libs/sdl2/msvc/lib/x64
    LIBS += -lSDL2
}

# Include Android OpenSSL libs
AndroidBuild {
    include($$SOURCE_DIR/libs/OpenSSL/android_openssl/openssl.pri)
    message("ANDROID_EXTRA_LIBS")
    message($$ANDROID_TARGET_ARCH)
    message($$ANDROID_EXTRA_LIBS)
}

# Pairing
contains(DEFINES, QGC_ENABLE_PAIRING) {
    MacBuild {
        #- Pairing is generally not supported on macOS. This is here solely for development.
        exists(/usr/local/Cellar/openssl/1.0.2t/include) {
            INCLUDEPATH += /usr/local/Cellar/openssl/1.0.2t/include
            LIBS += -L/usr/local/Cellar/openssl/1.0.2t/lib
            LIBS += -lcrypto
        } else {
            # There is some circular reference settings going on between QGCExternalLibs.pri and gqgroundcontrol.pro.
            # So this duplicates some of the enable/disable logic which would normally be in qgroundcontrol.pro.
            DEFINES -= QGC_ENABLE_PAIRING
        }
    } else:WindowsBuild {
        #- Pairing is not supported on Windows
        DEFINES -= QGC_ENABLE_PAIRING
    } else {
        LIBS += -lcrypto
        AndroidBuild {
            contains(QT_ARCH, arm) {
                LIBS += $$ANDROID_EXTRA_LIBS
                INCLUDEPATH += $$SOURCE_DIR/libs/OpenSSL/Android/arch-armeabi-v7a/include
            } else {
                LIBS += $$ANDROID_EXTRA_LIBS
                INCLUDEPATH += $$SOURCE_DIR/libs/OpenSSL/Android/arch-x86/include
            }
        }
    }
}

#
# [OPTIONAL] Zeroconf for UDP links
#
contains (DEFINES, DISABLE_ZEROCONF) {
    message("Skipping support for Zeroconf (manual override from command line)")
    DEFINES -= DISABLE_ZEROCONF
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_ZEROCONF) {
    message("Skipping support for Zeroconf (manual override from user_config.pri)")
# Mac support is built into OS
} else:MacBuild|iOSBuild {
    message("Including support for Zeroconf (Bonjour)")
    DEFINES += QGC_ZEROCONF_ENABLED
} else {
    message("Skipping support for Zeroconf (unsupported platform)")
}

#
# [OPTIONAL] AirMap Support
#
contains (DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from command line)")
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from user_config.pri)")
} else {
    AIRMAP_PLATFORM_SDK_PATH    = $${PWD}/libs/airmapd
    AIRMAP_QT_PATH              = Qt.$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}
    message('Looking for Airmap in folder "$${AIRMAP_PLATFORM_SDK_PATH}", variant: "$$AIRMAP_QT_PATH"')
    MacBuild {
        exists("$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH") {
            message("Including support for AirMap for macOS")
            LIBS += -L$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH -lairmap-qt
            DEFINES += QGC_AIRMAP_ENABLED
        }
    } else:LinuxBuild {
        exists("$${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH") {
            message("Including support for AirMap for Linux")
            LIBS += -L$${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH -lairmap-qt
            DEFINES += QGC_AIRMAP_ENABLED
        } else {
            #-- Download and install platform-sdk libs and headers
            message("Installing AirMap platform-sdk libs and headers")
            AIRMAP_PLATFORM_SDK_URL = "https://github.com/airmap/platform-sdk/releases/download/v1.1/airmap-platform-sdk-1.1.0-Linux.deb"
            AIRMAP_PLATFORM_SDK_FILENAME = "airmap-platform-sdk.deb"
            AIRMAP_PLATFORM_SDK_INSTALL_PREFIX = "airmap-platform-sdk"
            !exists("$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}") {
                system("mkdir -p $${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}")
            }
            !exists("$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap") {
                system("mkdir -p $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap")
            }
            system("wget -q -O $${AIRMAP_PLATFORM_SDK_FILENAME} $${AIRMAP_PLATFORM_SDK_URL} && dpkg -x $${AIRMAP_PLATFORM_SDK_FILENAME} $${AIRMAP_PLATFORM_SDK_PATH}/")
            system("mv $${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/lib/* $${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}/")
            system("mv $${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/include/airmap/* $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/")
            system("rm -rf $${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}")
            system("rm $${AIRMAP_PLATFORM_SDK_FILENAME}")

            exists($${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH) {
                message("Including support for AirMap for Linux")
                LIBS += -L$${AIRMAP_PLATFORM_SDK_PATH}/linux/$$AIRMAP_QT_PATH -lairmap-qt
                DEFINES += QGC_AIRMAP_ENABLED
            } else {
                message("Failed to install AirMap support for Linux")
            }
        }
    } else {
        message("Skipping support for Airmap (unsupported platform)")
    }
    contains (DEFINES, QGC_AIRMAP_ENABLED) {
        INCLUDEPATH += \
            $${AIRMAP_PLATFORM_SDK_PATH}/include
    }
}


Bump version

Bump version

# Common definitions

QT += network xml
QXMPP_VERSION = 0.9.4
QXMPP_INCLUDEPATH = $$PWD/src/base $$PWD/src/client $$PWD/src/server

# Determine library name
CONFIG(debug, debug|release) {
    QXMPP_LIBRARY_NAME = qxmpp_d
} else {
    QXMPP_LIBRARY_NAME = qxmpp
}

# Determine library type (shared or staticlib)
isEmpty(QXMPP_LIBRARY_TYPE) {
    android | ios {
        QXMPP_LIBRARY_TYPE = staticlib
    } else {
        QXMPP_LIBRARY_TYPE = shared
    }
}

# Libraries used internally by QXmpp
android {

} else:contains(MEEGO_EDITION,harmattan) {
    # meego/harmattan has speex for sure
    QXMPP_USE_SPEEX=1
} else:symbian {
    QXMPP_INTERNAL_INCLUDES = $$APP_LAYER_SYSTEMINCLUDE
    QXMPP_INTERNAL_LIBS = -lesock
} else:win32 {
    QXMPP_INTERNAL_LIBS = -ldnsapi -lws2_32
}

!isEmpty(QXMPP_USE_OPUS) {
    DEFINES += QXMPP_USE_OPUS
    QXMPP_INTERNAL_LIBS += -lopus
}

!isEmpty(QXMPP_USE_SPEEX) {
    DEFINES += QXMPP_USE_SPEEX
    QXMPP_INTERNAL_LIBS += -lspeex
}

!isEmpty(QXMPP_USE_THEORA) {
    DEFINES += QXMPP_USE_THEORA
    QXMPP_INTERNAL_LIBS += -ltheoradec -ltheoraenc
}

!isEmpty(QXMPP_USE_VPX) {
    DEFINES += QXMPP_USE_VPX
    QXMPP_INTERNAL_LIBS += -lvpx
}

# Libraries for apps which use QXmpp
QXMPP_LIBS = -l$${QXMPP_LIBRARY_NAME}
contains(QXMPP_LIBRARY_TYPE,staticlib) {
    # Symbian needs a .lib extension to recognise the library as static
    symbian: QXMPP_LIBS = -l$${QXMPP_LIBRARY_NAME}.lib

    # FIXME: we should be able to use the link_prl option to automatically pull
    # in the extra libraries which the qxmpp library needs, but this does not
    # seem to work on win32, so we specify the dependencies here:
    QXMPP_LIBS += $$QXMPP_INTERNAL_LIBS
    DEFINES += QXMPP_STATIC
} else {
    # Windows needs the major library version
    win32: QXMPP_LIBS = -l$${QXMPP_LIBRARY_NAME}0
    DEFINES += QXMPP_SHARED
}

# Installation prefix and library directory
isEmpty(PREFIX) {
    contains(MEEGO_EDITION,harmattan) {
        PREFIX = /usr
    } else:unix {
        PREFIX = /usr/local
    } else {
        PREFIX = $$[QT_INSTALL_PREFIX]
    }
}
isEmpty(LIBDIR) {
    LIBDIR = lib
}

# Internal API auto-tests
!isEmpty(QXMPP_AUTOTEST_INTERNAL) {
    DEFINES += QXMPP_AUTOTEST_INTERNAL
}

# Common definitions

QT += network xml
QXMPP_VERSION = 0.9.3
QXMPP_INCLUDEPATH = $$PWD/src/base $$PWD/src/client $$PWD/src/server

# Determine library name
CONFIG(debug, debug|release) {
    QXMPP_LIBRARY_NAME = qxmpp_d
} else {
    QXMPP_LIBRARY_NAME = qxmpp
}

# Determine library type (shared or staticlib)
isEmpty(QXMPP_LIBRARY_TYPE) {
    android | ios {
        QXMPP_LIBRARY_TYPE = staticlib
    } else {
        QXMPP_LIBRARY_TYPE = shared
    }
}

# Libraries used internally by QXmpp
android {

} else:contains(MEEGO_EDITION,harmattan) {
    # meego/harmattan has speex for sure
    QXMPP_USE_SPEEX=1
} else:symbian {
    QXMPP_INTERNAL_INCLUDES = $$APP_LAYER_SYSTEMINCLUDE
    QXMPP_INTERNAL_LIBS = -lesock
} else:win32 {
    QXMPP_INTERNAL_LIBS = -ldnsapi -lws2_32
}

!isEmpty(QXMPP_USE_OPUS) {
    DEFINES += QXMPP_USE_OPUS
    QXMPP_INTERNAL_LIBS += -lopus
}

!isEmpty(QXMPP_USE_SPEEX) {
    DEFINES += QXMPP_USE_SPEEX
    QXMPP_INTERNAL_LIBS += -lspeex
}

!isEmpty(QXMPP_USE_THEORA) {
    DEFINES += QXMPP_USE_THEORA
    QXMPP_INTERNAL_LIBS += -ltheoradec -ltheoraenc
}

!isEmpty(QXMPP_USE_VPX) {
    DEFINES += QXMPP_USE_VPX
    QXMPP_INTERNAL_LIBS += -lvpx
}

# Libraries for apps which use QXmpp
QXMPP_LIBS = -l$${QXMPP_LIBRARY_NAME}
contains(QXMPP_LIBRARY_TYPE,staticlib) {
    # Symbian needs a .lib extension to recognise the library as static
    symbian: QXMPP_LIBS = -l$${QXMPP_LIBRARY_NAME}.lib

    # FIXME: we should be able to use the link_prl option to automatically pull
    # in the extra libraries which the qxmpp library needs, but this does not
    # seem to work on win32, so we specify the dependencies here:
    QXMPP_LIBS += $$QXMPP_INTERNAL_LIBS
    DEFINES += QXMPP_STATIC
} else {
    # Windows needs the major library version
    win32: QXMPP_LIBS = -l$${QXMPP_LIBRARY_NAME}0
    DEFINES += QXMPP_SHARED
}

# Installation prefix and library directory
isEmpty(PREFIX) {
    contains(MEEGO_EDITION,harmattan) {
        PREFIX = /usr
    } else:unix {
        PREFIX = /usr/local
    } else {
        PREFIX = $$[QT_INSTALL_PREFIX]
    }
}
isEmpty(LIBDIR) {
    LIBDIR = lib
}

# Internal API auto-tests
!isEmpty(QXMPP_AUTOTEST_INTERNAL) {
    DEFINES += QXMPP_AUTOTEST_INTERNAL
}


Remove reference to deleted file.

Remove reference to deleted file.

Change-Id: Ie75506c5a9d61eb50e7e2f1027b72e1c041200a9
Reviewed-on: http://codereview.qt.nokia.com/2249
Reviewed-by: Qt Sanity Bot <5581206bb7e0307f0d99eb71898ae6b694149ca5@ovi.com>
Reviewed-by: Michael Brasser <acf66a4a6ae67569abc58c29c7a264afd3e1cc1c@nokia.com>

INCLUDEPATH += $$PWD
SOURCES += \
    $$PWD/qdeclarativeparser.cpp \
    $$PWD/qdeclarativeinstruction.cpp \
    $$PWD/qdeclarativevmemetaobject.cpp \
    $$PWD/qdeclarativeengine.cpp \
    $$PWD/qdeclarativeexpression.cpp \
    $$PWD/qdeclarativebinding.cpp \
    $$PWD/qdeclarativeproperty.cpp \
    $$PWD/qdeclarativecomponent.cpp \
    $$PWD/qdeclarativecontext.cpp \
    $$PWD/qdeclarativecustomparser.cpp \
    $$PWD/qdeclarativepropertyvaluesource.cpp \
    $$PWD/qdeclarativepropertyvalueinterceptor.cpp \
    $$PWD/qdeclarativeproxymetaobject.cpp \
    $$PWD/qdeclarativevme.cpp \
    $$PWD/qdeclarativecompiler.cpp \
    $$PWD/qdeclarativecompileddata.cpp \
    $$PWD/qdeclarativeboundsignal.cpp \
    $$PWD/qdeclarativerefcount.cpp \
    $$PWD/qdeclarativemetatype.cpp \
    $$PWD/qdeclarativestringconverters.cpp \
    $$PWD/qdeclarativeparserstatus.cpp \
    $$PWD/qdeclarativetypeloader.cpp \
    $$PWD/qdeclarativeinfo.cpp \
    $$PWD/qdeclarativeerror.cpp \
    $$PWD/qdeclarativescriptparser.cpp \
    $$PWD/qdeclarativeenginedebug.cpp \
    $$PWD/qdeclarativerewrite.cpp \
    $$PWD/qdeclarativevaluetype.cpp \
    $$PWD/qdeclarativefastproperties.cpp \
    $$PWD/qdeclarativexmlhttprequest.cpp \
    $$PWD/qdeclarativesqldatabase.cpp \
    $$PWD/qmetaobjectbuilder.cpp \
    $$PWD/qdeclarativewatcher.cpp \
    $$PWD/qdeclarativecleanup.cpp \
    $$PWD/qdeclarativepropertycache.cpp \
    $$PWD/qdeclarativenotifier.cpp \
    $$PWD/qdeclarativeintegercache.cpp \
    $$PWD/qdeclarativetypenotavailable.cpp \
    $$PWD/qdeclarativetypenamecache.cpp \
    $$PWD/qdeclarativescriptstring.cpp \
    $$PWD/qdeclarativeworkerscript.cpp \
    $$PWD/qdeclarativeimageprovider.cpp \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \
    $$PWD/qdeclarativedirparser.cpp \
    $$PWD/qdeclarativeextensionplugin.cpp \
    $$PWD/qdeclarativeimport.cpp \
    $$PWD/qdeclarativelist.cpp \
    $$PWD/qintrusivelist.cpp \

HEADERS += \
    $$PWD/qdeclarativeparser_p.h \
    $$PWD/qdeclarativeglobal_p.h \
    $$PWD/qdeclarativeinstruction_p.h \
    $$PWD/qdeclarativevmemetaobject_p.h \
    $$PWD/qdeclarative.h \
    $$PWD/qdeclarativebinding_p.h \
    $$PWD/qdeclarativebinding_p_p.h \
    $$PWD/qdeclarativeproperty.h \
    $$PWD/qdeclarativecomponent.h \
    $$PWD/qdeclarativecomponent_p.h \
    $$PWD/qdeclarativecustomparser_p.h \
    $$PWD/qdeclarativecustomparser_p_p.h \
    $$PWD/qdeclarativepropertyvaluesource.h \
    $$PWD/qdeclarativepropertyvalueinterceptor.h \
    $$PWD/qdeclarativeboundsignal_p.h \
    $$PWD/qdeclarativeparserstatus.h \
    $$PWD/qdeclarativeproxymetaobject_p.h \
    $$PWD/qdeclarativevme_p.h \
    $$PWD/qdeclarativecompiler_p.h \
    $$PWD/qdeclarativeengine_p.h \
    $$PWD/qdeclarativeexpression_p.h \
    $$PWD/qdeclarativeprivate.h \
    $$PWD/qdeclarativerefcount_p.h \
    $$PWD/qdeclarativemetatype_p.h \
    $$PWD/qdeclarativeengine.h \
    $$PWD/qdeclarativecontext.h \
    $$PWD/qdeclarativeexpression.h \
    $$PWD/qdeclarativestringconverters_p.h \
    $$PWD/qdeclarativeinfo.h \
    $$PWD/qdeclarativeproperty_p.h \
    $$PWD/qdeclarativecontext_p.h \
    $$PWD/qdeclarativetypeloader_p.h \
    $$PWD/qdeclarativelist.h \
    $$PWD/qdeclarativelist_p.h \
    $$PWD/qdeclarativedata_p.h \
    $$PWD/qdeclarativeerror.h \
    $$PWD/qdeclarativescriptparser_p.h \
    $$PWD/qdeclarativeenginedebug_p.h \
    $$PWD/qdeclarativerewrite_p.h \
    $$PWD/qpodvector_p.h \
    $$PWD/qbitfield_p.h \
    $$PWD/qdeclarativevaluetype_p.h \
    $$PWD/qdeclarativefastproperties_p.h \
    $$PWD/qdeclarativexmlhttprequest_p.h \
    $$PWD/qdeclarativesqldatabase_p.h \
    $$PWD/qmetaobjectbuilder_p.h \
    $$PWD/qdeclarativewatcher_p.h \
    $$PWD/qdeclarativecleanup_p.h \
    $$PWD/qdeclarativepropertycache_p.h \
    $$PWD/qdeclarativenotifier_p.h \
    $$PWD/qdeclarativeintegercache_p.h \
    $$PWD/qdeclarativetypenotavailable_p.h \
    $$PWD/qdeclarativetypenamecache_p.h \
    $$PWD/qdeclarativescriptstring.h \
    $$PWD/qdeclarativeworkerscript_p.h \
    $$PWD/qdeclarativeguard_p.h \
    $$PWD/qdeclarativeimageprovider.h \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.h \
    $$PWD/qdeclarativedirparser_p.h \
    $$PWD/qdeclarativeextensioninterface.h \
    $$PWD/qdeclarativeimport_p.h \
    $$PWD/qdeclarativeextensionplugin.h \
    $$PWD/qdeclarativenullablevalue_p_p.h \
    $$PWD/qintrusivelist_p.h \
    $$PWD/qdeclarativescriptstring_p.h

QT += sql
include(parser/parser.pri)
include(rewriter/rewriter.pri)
include(v4/v4.pri)
include(v8/v8.pri)

INCLUDEPATH += $$PWD
SOURCES += \
    $$PWD/qdeclarativeparser.cpp \
    $$PWD/qdeclarativeinstruction.cpp \
    $$PWD/qdeclarativevmemetaobject.cpp \
    $$PWD/qdeclarativeengine.cpp \
    $$PWD/qdeclarativeexpression.cpp \
    $$PWD/qdeclarativebinding.cpp \
    $$PWD/qdeclarativeproperty.cpp \
    $$PWD/qdeclarativecomponent.cpp \
    $$PWD/qdeclarativecontext.cpp \
    $$PWD/qdeclarativecustomparser.cpp \
    $$PWD/qdeclarativepropertyvaluesource.cpp \
    $$PWD/qdeclarativepropertyvalueinterceptor.cpp \
    $$PWD/qdeclarativeproxymetaobject.cpp \
    $$PWD/qdeclarativevme.cpp \
    $$PWD/qdeclarativecompiler.cpp \
    $$PWD/qdeclarativecompileddata.cpp \
    $$PWD/qdeclarativeboundsignal.cpp \
    $$PWD/qdeclarativerefcount.cpp \
    $$PWD/qdeclarativemetatype.cpp \
    $$PWD/qdeclarativestringconverters.cpp \
    $$PWD/qdeclarativeparserstatus.cpp \
    $$PWD/qdeclarativetypeloader.cpp \
    $$PWD/qdeclarativeinfo.cpp \
    $$PWD/qdeclarativeerror.cpp \
    $$PWD/qdeclarativescriptparser.cpp \
    $$PWD/qdeclarativeenginedebug.cpp \
    $$PWD/qdeclarativerewrite.cpp \
    $$PWD/qdeclarativevaluetype.cpp \
    $$PWD/qdeclarativefastproperties.cpp \
    $$PWD/qdeclarativexmlhttprequest.cpp \
    $$PWD/qdeclarativesqldatabase.cpp \
    $$PWD/qmetaobjectbuilder.cpp \
    $$PWD/qdeclarativewatcher.cpp \
    $$PWD/qdeclarativecleanup.cpp \
    $$PWD/qdeclarativepropertycache.cpp \
    $$PWD/qdeclarativenotifier.cpp \
    $$PWD/qdeclarativeintegercache.cpp \
    $$PWD/qdeclarativetypenotavailable.cpp \
    $$PWD/qdeclarativetypenamecache.cpp \
    $$PWD/qdeclarativescriptstring.cpp \
    $$PWD/qdeclarativeworkerscript.cpp \
    $$PWD/qdeclarativeimageprovider.cpp \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \
    $$PWD/qdeclarativedirparser.cpp \
    $$PWD/qdeclarativeextensionplugin.cpp \
    $$PWD/qdeclarativeimport.cpp \
    $$PWD/qdeclarativelist.cpp \
    $$PWD/qintrusivelist.cpp \

HEADERS += \
    $$PWD/qdeclarativeparser_p.h \
    $$PWD/qdeclarativeglobal_p.h \
    $$PWD/qdeclarativeinstruction_p.h \
    $$PWD/qdeclarativevmemetaobject_p.h \
    $$PWD/qdeclarative.h \
    $$PWD/qdeclarativebinding_p.h \
    $$PWD/qdeclarativebinding_p_p.h \
    $$PWD/qdeclarativeproperty.h \
    $$PWD/qdeclarativecomponent.h \
    $$PWD/qdeclarativecomponent_p.h \
    $$PWD/qdeclarativecustomparser_p.h \
    $$PWD/qdeclarativecustomparser_p_p.h \
    $$PWD/qdeclarativepropertyvaluesource.h \
    $$PWD/qdeclarativepropertyvalueinterceptor.h \
    $$PWD/qdeclarativeboundsignal_p.h \
    $$PWD/qdeclarativeparserstatus.h \
    $$PWD/qdeclarativeproxymetaobject_p.h \
    $$PWD/qdeclarativevme_p.h \
    $$PWD/qdeclarativecompiler_p.h \
    $$PWD/qdeclarativeengine_p.h \
    $$PWD/qdeclarativeexpression_p.h \
    $$PWD/qdeclarativeprivate.h \
    $$PWD/qdeclarativerefcount_p.h \
    $$PWD/qdeclarativemetatype_p.h \
    $$PWD/qdeclarativeengine.h \
    $$PWD/qdeclarativecontext.h \
    $$PWD/qdeclarativeexpression.h \
    $$PWD/qdeclarativestringconverters_p.h \
    $$PWD/qdeclarativeinfo.h \
    $$PWD/qdeclarativeproperty_p.h \
    $$PWD/qdeclarativecontext_p.h \
    $$PWD/qdeclarativetypeloader_p.h \
    $$PWD/qdeclarativelist.h \
    $$PWD/qdeclarativelist_p.h \
    $$PWD/qdeclarativedata_p.h \
    $$PWD/qdeclarativeerror.h \
    $$PWD/qdeclarativescriptparser_p.h \
    $$PWD/qdeclarativeenginedebug_p.h \
    $$PWD/qdeclarativerewrite_p.h \
    $$PWD/qpodvector_p.h \
    $$PWD/qbitfield_p.h \
    $$PWD/qdeclarativevaluetype_p.h \
    $$PWD/qdeclarativefastproperties_p.h \
    $$PWD/qdeclarativexmlhttprequest_p.h \
    $$PWD/qdeclarativesqldatabase_p.h \
    $$PWD/qmetaobjectbuilder_p.h \
    $$PWD/qdeclarativewatcher_p.h \
    $$PWD/qdeclarativecleanup_p.h \
    $$PWD/qdeclarativepropertycache_p.h \
    $$PWD/qdeclarativenotifier_p.h \
    $$PWD/qdeclarativeintegercache_p.h \
    $$PWD/qdeclarativetypenotavailable_p.h \
    $$PWD/qdeclarativetypenamecache_p.h \
    $$PWD/qdeclarativescriptstring.h \
    $$PWD/qdeclarativeworkerscript_p.h \
    $$PWD/qdeclarativeguard_p.h \
    $$PWD/qdeclarativeimageprovider.h \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.h \
    $$PWD/qdeclarativedirparser_p.h \
    $$PWD/qdeclarativeextensioninterface.h \
    $$PWD/qdeclarativeimport_p.h \
    $$PWD/qdeclarativeextensionplugin.h \
    $$PWD/qperformancetimer_p.h \
    $$PWD/qdeclarativenullablevalue_p_p.h \
    $$PWD/qintrusivelist_p.h \
    $$PWD/qdeclarativescriptstring_p.h

QT += sql
include(parser/parser.pri)
include(rewriter/rewriter.pri)
include(v4/v4.pri)
include(v8/v8.pri)


Install QtQuick1 imports to the correct location

Change-Id: I61597e008f34424ff3fc4254ca5e2e00bd638260
Reviewed-by: Rafael Roquetto <14999faec5bfd0b55ab2dfc74ae05bcf46969760@kdab.com>
Reviewed-by: Andrew den Exter <5c44ede4e4bee77273938fbabc342a419870e9ab@nokia.com>

symbian:include(../plugins/qpluginbase.pri)
TEMPLATE = lib
CONFIG += qt plugin

win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release

isEmpty(TARGETPATH) {
    error("qimportbase.pri: You must provide a TARGETPATH!")
}
isEmpty(TARGET) {
    error("qimportbase.pri: You must provide a TARGET!")
}

QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
copy2build.input = QMLDIRFILE
copy2build.output = $$QT.quick1.imports/imports/$$TARGETPATH/qmldir
!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.CONFIG += no_link
# `clean' should leave the build in a runnable state, which means it shouldn't delete qmldir
copy2build.CONFIG += no_clean
QMAKE_EXTRA_COMPILERS += copy2build

TARGET = $$qtLibraryTarget($$TARGET)
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols

include(../qt_targets.pri)

wince*:LIBS += $$QMAKE_LIBS_GUI

symbian: {
    TARGET.EPOCALLOWDLLDATA=1
    TARGET.CAPABILITY = All -Tcb
    load(armcc_warnings)
}

symbian:include(../plugins/qpluginbase.pri)
TEMPLATE = lib
CONFIG += qt plugin

win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release

isEmpty(TARGETPATH) {
    error("qimportbase.pri: You must provide a TARGETPATH!")
}
isEmpty(TARGET) {
    error("qimportbase.pri: You must provide a TARGET!")
}

QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
copy2build.input = QMLDIRFILE
copy2build.output = $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir
!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.CONFIG += no_link
# `clean' should leave the build in a runnable state, which means it shouldn't delete qmldir
copy2build.CONFIG += no_clean
QMAKE_EXTRA_COMPILERS += copy2build

TARGET = $$qtLibraryTarget($$TARGET)
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols

include(../qt_targets.pri)

wince*:LIBS += $$QMAKE_LIBS_GUI

symbian: {
    TARGET.EPOCALLOWDLLDATA=1
    TARGET.CAPABILITY = All -Tcb
    load(armcc_warnings)
}


add _windll_import for PVRTexTool

add _windll_import for PVRTexTool

INCLUDEPATH += $$PWD/Include

HEADERS += $$PWD/Include/PVRTArray.h \
    $$PWD/Include/PVRTDecompress.h \
    $$PWD/Include/PVRTError.h \
    $$PWD/Include/PVRTexture.h \
    $$PWD/Include/PVRTextureDefines.h \
    $$PWD/Include/PVRTextureFormat.h \
    $$PWD/Include/PVRTextureHeader.h \
    $$PWD/Include/PVRTextureUtilities.h \
    $$PWD/Include/PVRTextureVersion.h \
    $$PWD/Include/PVRTGlobal.h \
    $$PWD/Include/PVRTMap.h \
    $$PWD/Include/PVRTString.h \
    $$PWD/Include/PVRTTexture.h

macx {
    LIBS += $$PWD/OSX_x86/libPVRTexLib.dylib

    export_dylib.files = $$PWD/OSX_x86/libPVRTexLib.dylib
    export_dylib.path = Contents/lib
    QMAKE_BUNDLE_DATA += export_dylib
}

DEFINES += _WINDLL_IMPORT

#TODO: test on windows platform
win32:contains(QMAKE_HOST.arch, x86_64) {
    LIBS += $$PWD/Windows_x86_64/PVRTexLib.lib
    export_dll.files = $$PWD/Windows_x86_64/PVRTexLib.dll
    export_dll.path = ./
    DEPLOYMENT += export_dll
}
win32:contains(QMAKE_HOST.arch, x86_32) {
    LIBS += $$PWD/Windows_x86_32/PVRTexLib.lib
    export_dll.files = $$PWD/Windows_x86_32/PVRTexLib.dll
    export_dll.path = ./
    DEPLOYMENT += export_dll
}

INCLUDEPATH += $$PWD/Include

HEADERS += $$PWD/Include/PVRTArray.h \
    $$PWD/Include/PVRTDecompress.h \
    $$PWD/Include/PVRTError.h \
    $$PWD/Include/PVRTexture.h \
    $$PWD/Include/PVRTextureDefines.h \
    $$PWD/Include/PVRTextureFormat.h \
    $$PWD/Include/PVRTextureHeader.h \
    $$PWD/Include/PVRTextureUtilities.h \
    $$PWD/Include/PVRTextureVersion.h \
    $$PWD/Include/PVRTGlobal.h \
    $$PWD/Include/PVRTMap.h \
    $$PWD/Include/PVRTString.h \
    $$PWD/Include/PVRTTexture.h

macx {
    LIBS += $$PWD/OSX_x86/libPVRTexLib.dylib

    export_dylib.files = $$PWD/OSX_x86/libPVRTexLib.dylib
    export_dylib.path = Contents/lib
    QMAKE_BUNDLE_DATA += export_dylib
}

DEFINES += _WINDLL_EXPORT

#TODO: test on windows platform
win32:contains(QMAKE_HOST.arch, x86_64) {
    LIBS += $$PWD/Windows_x86_64/PVRTexLib.lib
    export_dll.files = $$PWD/Windows_x86_64/PVRTexLib.dll
    export_dll.path = ./
    DEPLOYMENT += export_dll
}
win32:contains(QMAKE_HOST.arch, x86_32) {
    LIBS += $$PWD/Windows_x86_32/PVRTexLib.lib
    export_dll.files = $$PWD/Windows_x86_32/PVRTexLib.dll
    export_dll.path = ./
    DEPLOYMENT += export_dll
}


Fixes a warning

Fixes a warning

# This include file makes generation and installation of .qm files
# from .ts files and updating .ts files from the sources easier.
#
# An application which has translations can use this include file as
# in the following example for “widgetsgallery”:
#
# Create a subdirectory “translations” in the source folder of the
# application which contains a translations.po file and the .ts
# files, for example if the source dir is “libm/demos/widgetsgallery”:
#
#    libm/demos/widgetsgallery/translations.pro
#    libm/demos/widgetsgallery/widgetsgallery_ar.ts
#    libm/demos/widgetsgallery/widgetsgallery_de.ts
#    libm/demos/widgetsgallery/widgetsgallery_en.ts
#    libm/demos/widgetsgallery/widgetsgallery_fi.ts
#
# The translations.pro file should have contents like this:
#
#    LANGUAGES = ar de en fi
#    CATALOGNAME = widgetsgallery
#    SOURCEDIR = $$PWD/..
#    TRANSLATIONDIR = $$PWD
#    MROOT = ../../..
#    include($$MROOT/mconfig.pri)
#    include($$MROOT/translations.pri)
#
# It is better to have an extra translations.pro file in the directory
# where the translations are instead of adding the stuff for the translations
# to the .pro file of the application (“widgetsgallery.pro”).
# It is possible to add similar stuff to update the .qm files
# directly to the application profile but the disadvantage is that
# changing the .ts files then causes the application to rebuild
# (because of qmake limitations).
#
# Introducing the extra translations/translations.pro file makes it
# necessary to add the widgetsgallery/translations directory to the
# list of sub-directories in a .pro file higher up in the directory
# hierarchy. For example the libm/demos/demos.pro file contains
# something like the following:
#
#    SUBDIRS     =  \
#        servicefw \
#        widgetsgallery \
#        widgetsgallery/translations \
#        animatedlayout \
#        animatedlayout/translations \
#        launcher \
#        qtstyleexample
#

# get around lack of sleep on Windows:
unix:SLEEP = sleep 1
else:SLEEP = ping -n 5 localhost > NUL
# null device:
unix:NULL = /dev/null
else:NULL = NUL

# var, prepend, append
defineReplace(prependAll) {
    for(a,$$1):result += $$2$${a}$$3
    return($$result)
}

isEmpty(LRELEASE_OPTIONS) {
    LRELEASE_OPTIONS = -idbased
}
isEmpty(LUPDATE_OPTIONS) {
    LUPDATE_OPTIONS = -locations absolute -no-ui-lines -no-sort
}
defineReplace(targetPath) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease) $$LRELEASE_OPTIONS
LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) $$LUPDATE_OPTIONS
# add “-markuntranslated '!!\ '” if available (needs new Qt 4.6):
out = $$system($$LRELEASE -help)
# the second parameter of contains can be a regexp!
contains(out, .*markuntranslated.*) {
    LRELEASE += -markuntranslated '!!\\ '
}

TRANSLATIONS = $$prependAll(LANGUAGES, $$TRANSLATIONDIR/$${CATALOGNAME}_,.ts)

isEqual(TEMPLATE_PREFIX, vc):vcproj=1
isEmpty(vcproj) {
    QMAKE_LINK = @: IGNORE THIS LINE
    OBJECTS_DIR =
    win32:CONFIG -= embed_manifest_exe
} else {
    CONFIG += console
    PHONY_DEPS = .
    phony_src.input = PHONY_DEPS
    phony_src.output = phony.c
    phony_src.variable_out = GENERATED_SOURCES
    phony_src.commands = echo int main() { return 0; } > phony.c
    phony_src.name = CREATE phony.c
    phony_src.CONFIG += combine
    QMAKE_EXTRA_COMPILERS += phony_src
}

!isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
    ENGINEERING_ENGLISH = $$OUT_PWD/$${CATALOGNAME}.ts
    # updating the engineering English .ts file should be done *always*
    # because it is fully auto-generated, no manual editing is needed:

    DUMMY_DEP = $$OUT_PWD/dummy-dependency-this-file-will-never-be-created
    updateeets.input = DUMMY_DEP
    updateeets.output = $$ENGINEERING_ENGLISH
    !isEmpty(vcproj):updateeets.variable_out = GENERATED_SOURCES
    updateeets.commands = $$LUPDATE $$SOURCEDIR -ts $$ENGINEERING_ENGLISH
    updateeets.name = LUPDATE $$ENGINEERING_ENGLISH
    updateeets.CONFIG += no_link target_predeps
    QMAKE_EXTRA_COMPILERS += updateeets

    FORCED_DEP = .
    dummy.input = FORCED_DEP
    dummy.output = $$DUMMY_DEP
    !isEmpty(vcproj):dummy.variable_out = GENERATED_SOURCES
    # we do not really create $$DUMMY_DEP here, make does not check the
    # output of the build steps, it assumes that the build command either
    # fails or that the output is created:
    dummy.commands = echo > $$NULL
    dummy.CONFIG += no_link target_predeps
    QMAKE_EXTRA_COMPILERS += dummy
}

# the stuff below works as well on Linux, but does not work with vcproj
# because PRE_TARGETDEPS (just like .CONFIG += target_predeps) does
# not work for vcproj output.
#
# !isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
#     ENGINEERING_ENGLISH = $$OUT_PWD/$${CATALOGNAME}.ts
#     # updating the engineering English .ts file should be done *always*
#     # because it is fully auto-generated, no manual editing is needed:
#
#     updateeets.commands = $$LUPDATE $$SOURCEDIR -ts $$ENGINEERING_ENGLISH
#     QMAKE_EXTRA_TARGETS += updateeets
#     QMAKE_CLEAN += $$ENGINEERING_ENGLISH
#     PRE_TARGETDEPS = updateeets
# }

# other .ts files besides the engineering English one should only be updated
# on request, i.e. only when calling “make updatets” manually:
updatets.commands = $$LUPDATE $$SOURCEDIR -ts $$TRANSLATIONS
updatets.target = updatets
QMAKE_EXTRA_TARGETS += updatets

updateqm.input = TRANSLATIONS
!isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
    updateqm.input += ENGINEERING_ENGLISH
}
updateqm.output = $$OUT_PWD/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT};
updateqm.name = LRELEASE ${QMAKE_FILE_IN}
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm

isEqual(INSTALL_TRANSLATIONS, "no") {
    # do not install the .qm files
}
else {
    isEmpty(TRANSLATION_INSTALLDIR) {
        TRANSLATION_INSTALLDIR = $${M_TRANSLATION_DIR}
    }
    qmfiles.files = $$prependAll(LANGUAGES, $$OUT_PWD/$${CATALOGNAME}_,.qm)
    !isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
        qmfiles.files += $$OUT_PWD/$${CATALOGNAME}.qm
    }
    qmfiles.CONFIG += no_check_exist
    qmfiles.path = $${TRANSLATION_INSTALLDIR}

    INSTALLS += qmfiles
}

# This include file makes generation and installation of .qm files
# from .ts files and updating .ts files from the sources easier.
#
# An application which has translations can use this include file as
# in the following example for “widgetsgallery”:
#
# Create a subdirectory “translations” in the source folder of the
# application which contains a translations.po file and the .ts
# files, for example if the source dir is “libm/demos/widgetsgallery”:
#
#    libm/demos/widgetsgallery/translations.pro
#    libm/demos/widgetsgallery/widgetsgallery_ar.ts
#    libm/demos/widgetsgallery/widgetsgallery_de.ts
#    libm/demos/widgetsgallery/widgetsgallery_en.ts
#    libm/demos/widgetsgallery/widgetsgallery_fi.ts
#
# The translations.pro file should have contents like this:
#
#    LANGUAGES = ar de en fi
#    CATALOGNAME = widgetsgallery
#    SOURCEDIR = $$PWD/..
#    TRANSLATIONDIR = $$PWD
#    MROOT = ../../..
#    include($$MROOT/mconfig.pri)
#    include($$MROOT/translations.pri)
#
# It is better to have an extra translations.pro file in the directory
# where the translations are instead of adding the stuff for the translations
# to the .pro file of the application (“widgetsgallery.pro”).
# It is possible to add similar stuff to update the .qm files
# directly to the application profile but the disadvantage is that
# changing the .ts files then causes the application to rebuild
# (because of qmake limitations).
#
# Introducing the extra translations/translations.pro file makes it
# necessary to add the widgetsgallery/translations directory to the
# list of sub-directories in a .pro file higher up in the directory
# hierarchy. For example the libm/demos/demos.pro file contains
# something like the following:
#
#    SUBDIRS     =  \
#        servicefw \
#        widgetsgallery \
#        widgetsgallery/translations \
#        animatedlayout \
#        animatedlayout/translations \
#        launcher \
#        qtstyleexample
#

# get around lack of sleep on Windows:
unix:SLEEP = sleep 1
else:SLEEP = ping -n 5 localhost > NUL
# null device:
unix:NULL = /dev/null
else:NULL = NUL

# var, prepend, append
defineReplace(prependAll) {
    for(a,$$1):result += $$2$${a}$$3
    return($$result)
}

isEmpty(LRELEASE_OPTIONS) {
    LRELEASE_OPTIONS = -idbased
}
isEmpty(LUPDATE_OPTIONS) {
    LUPDATE_OPTIONS = -locations absolute -no-ui-lines -no-sort
}
defineReplace(targetPath) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}
LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease) $$LRELEASE_OPTIONS
LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) $$LUPDATE_OPTIONS
# add “-markuntranslated '!!\ '” if available (needs new Qt 4.6):
out = $$system($$LRELEASE -help)
# the second parameter of contains can be a regexp!
contains(out, .*markuntranslated.*) {
    LRELEASE += -markuntranslated '!!\ '
}

TRANSLATIONS = $$prependAll(LANGUAGES, $$TRANSLATIONDIR/$${CATALOGNAME}_,.ts)

isEqual(TEMPLATE_PREFIX, vc):vcproj=1
isEmpty(vcproj) {
    QMAKE_LINK = @: IGNORE THIS LINE
    OBJECTS_DIR =
    win32:CONFIG -= embed_manifest_exe
} else {
    CONFIG += console
    PHONY_DEPS = .
    phony_src.input = PHONY_DEPS
    phony_src.output = phony.c
    phony_src.variable_out = GENERATED_SOURCES
    phony_src.commands = echo int main() { return 0; } > phony.c
    phony_src.name = CREATE phony.c
    phony_src.CONFIG += combine
    QMAKE_EXTRA_COMPILERS += phony_src
}

!isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
    ENGINEERING_ENGLISH = $$OUT_PWD/$${CATALOGNAME}.ts
    # updating the engineering English .ts file should be done *always*
    # because it is fully auto-generated, no manual editing is needed:

    DUMMY_DEP = $$OUT_PWD/dummy-dependency-this-file-will-never-be-created
    updateeets.input = DUMMY_DEP
    updateeets.output = $$ENGINEERING_ENGLISH
    !isEmpty(vcproj):updateeets.variable_out = GENERATED_SOURCES
    updateeets.commands = $$LUPDATE $$SOURCEDIR -ts $$ENGINEERING_ENGLISH
    updateeets.name = LUPDATE $$ENGINEERING_ENGLISH
    updateeets.CONFIG += no_link target_predeps
    QMAKE_EXTRA_COMPILERS += updateeets

    FORCED_DEP = .
    dummy.input = FORCED_DEP
    dummy.output = $$DUMMY_DEP
    !isEmpty(vcproj):dummy.variable_out = GENERATED_SOURCES
    # we do not really create $$DUMMY_DEP here, make does not check the
    # output of the build steps, it assumes that the build command either
    # fails or that the output is created:
    dummy.commands = echo > $$NULL
    dummy.CONFIG += no_link target_predeps
    QMAKE_EXTRA_COMPILERS += dummy
}

# the stuff below works as well on Linux, but does not work with vcproj
# because PRE_TARGETDEPS (just like .CONFIG += target_predeps) does
# not work for vcproj output.
#
# !isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
#     ENGINEERING_ENGLISH = $$OUT_PWD/$${CATALOGNAME}.ts
#     # updating the engineering English .ts file should be done *always*
#     # because it is fully auto-generated, no manual editing is needed:
#
#     updateeets.commands = $$LUPDATE $$SOURCEDIR -ts $$ENGINEERING_ENGLISH
#     QMAKE_EXTRA_TARGETS += updateeets
#     QMAKE_CLEAN += $$ENGINEERING_ENGLISH
#     PRE_TARGETDEPS = updateeets
# }

# other .ts files besides the engineering English one should only be updated
# on request, i.e. only when calling “make updatets” manually:
updatets.commands = $$LUPDATE $$SOURCEDIR -ts $$TRANSLATIONS
updatets.target = updatets
QMAKE_EXTRA_TARGETS += updatets

updateqm.input = TRANSLATIONS
!isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
    updateqm.input += ENGINEERING_ENGLISH
}
updateqm.output = $$OUT_PWD/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT};
updateqm.name = LRELEASE ${QMAKE_FILE_IN}
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm

isEqual(INSTALL_TRANSLATIONS, "no") {
    # do not install the .qm files
}
else {
    isEmpty(TRANSLATION_INSTALLDIR) {
        TRANSLATION_INSTALLDIR = $${M_TRANSLATION_DIR}
    }
    qmfiles.files = $$prependAll(LANGUAGES, $$OUT_PWD/$${CATALOGNAME}_,.qm)
    !isEqual(DISABLE_QTTRID_ENGINEERING_ENGLISH, "yes") {
        qmfiles.files += $$OUT_PWD/$${CATALOGNAME}.qm
    }
    qmfiles.CONFIG += no_check_exist
    qmfiles.path = $${TRANSLATION_INSTALLDIR}

    INSTALLS += qmfiles
}


- fix  opencv include path

- fix  opencv include path

git-svn-id: a6b1f342adda8e857528e759c3404af7b76d6bed@213 8f13a6d9-6203-4c43-9b9f-a3039379152f

win32 {
    INCLUDEPATH += $$PWD/include
    LIBPATH += $$PWD/lib
    LIBS += -lcv210 -lcxcore210 -lcvaux210 -lhighgui210

    # DShow
    # LIBS += -ldxguid -lstrmbase -lstrmiids -luuid -lole32 -loleaut32
}

# debian/ubuntu: aptitude install libcv-dev libcvaux-dev libhighgui-dev libswscale-dev
unix:LIBS += -lcv -lcxcore -lcvaux #-lhighgui -lswscale

win32 {
    INCLUDEPATH += $$PWD/include/opencv
    LIBPATH += $$PWD/lib
    LIBS += -lcv210 -lcxcore210 -lcvaux210 -lhighgui210

    # DShow
    # LIBS += -ldxguid -lstrmbase -lstrmiids -luuid -lole32 -loleaut32
}

# debian/ubuntu: aptitude install libcv-dev libcvaux-dev libhighgui-dev libswscale-dev
unix:LIBS += -lcv -lcxcore -lcvaux #-lhighgui -lswscale