Fix build on xp

Fix build on xp

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("echo %Date:~6,4%")
}

!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 _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
}

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§
            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
}

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("echo %Date:~6,4%")
}

!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 _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
}

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§
            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
}

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
        }
        !bundle_dylibs:LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH_DST -l$$lib
        bundle_dylibs:LIBS += -F$$CORE_BUILDS_LIBRARIES_PATH_DST -framework $$lib
    }
    export(LIBS)
}


Use "qmake -r QMLPLUGINDUMP=0" to disable QMLPLUGINDUMP

include(../paths.pri)
TARGETPATH = $$replace(uri, \\., /)
DESIGNER = designer
DESTDIR = $$OUT_PWD/../../imports/$$TARGETPATH

isEmpty(PLUGIN_VERSION): PLUGIN_VERSION = 1.0

# ========== copy additional files ==========
copyqmlinfra.input = QML_INFRA_FILES
copyqmlinfra.output = $$OUT_PWD/../../imports/$$TARGETPATH/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
!win32: copyqmlinfra.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyqmlinfra.output)) $$escape_expand(\n\t)
copyqmlinfra.commands +=  $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copyqmlinfra.CONFIG += no_link no_clean
copyqmlinfra.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmlinfra

copyqmlprivateinfra.input = QML_PRIVATE_INFRA_FILES
copyqmlprivateinfra.output = $$OUT_PWD/../../imports/$$TARGETPATH/Private/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
!win32: copyqmlprivateinfra.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyqmlprivateinfra.output)) $$escape_expand(\n\t)
copyqmlprivateinfra.commands +=  $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copyqmlprivateinfra.CONFIG += no_link no_clean
copyqmlprivateinfra.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmlprivateinfra

copyqmldesigner.input = QML_DESIGNER_FILES
copyqmldesigner.output = $$OUT_PWD/../../imports/$$DESIGNER/$$TARGETPATH/designer/
copyqmldesigner.commands = $(COPY_DIR) ${QMAKE_FILE_IN} $$shell_path($$OUT_PWD/../../imports/$$DESIGNER/$$TARGETPATH/designer/)
copyqmldesigner.CONFIG += no_link no_clean
copyqmldesigner.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmldesigner

copyqmlpropertyeditor.input = QML_PROPERTY_EDITOR_FILES
copyqmlpropertyeditor.output = $$OUT_PWD/../../imports/$$DESIGNER/$$TARGETPATH/propertyEditorQmlSources/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
!win32: copyqmlpropertyeditor.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyqmlpropertyeditor.output)) $$escape_expand(\n\t)
copyqmlpropertyeditor.commands += $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copyqmlpropertyeditor.CONFIG += no_link no_clean
copyqmlpropertyeditor.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmlpropertyeditor

android: {
    copyjavafiles.input = JAVAFILES
    copyjavafiles.output = $$OUT_PWD/../../src/android/java/
    copyjavafiles.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyjavafiles.output)) $$escape_expand(\n\t)
    copyjavafiles.commands += $(COPY_DIR) ${QMAKE_FILE_IN} $$shell_path($$OUT_PWD/../../src/android/java/)
    copyjavafiles.CONFIG += no_link no_clean
    copyjavafiles.variable_out = PRE_TARGETDEPS
    QMAKE_EXTRA_COMPILERS += copyjavafiles
}

win32: QMAKE_DEL_FILE = del /q /f
!win32:QMAKE_DEL_FILE = rm -r -f
QMAKE_CLEAN += $$OUT_PWD/../../imports/$$TARGETPATH/

# ========== install additional files ==========
isEmpty(QMLPLUGINDUMP): QMLPLUGINDUMP = 1
equals(QMLPLUGINDUMP, 1): !ios: !android: release: {
    dumppluginqmltypes.CONFIG = no_files no_path
    dumppluginqmltypes.commands = $$dirname(QMAKE_QMAKE)/qmlplugindump -nonrelocatable "$$uri $$PLUGIN_VERSION $$shell_path($$OUT_PWD/../../imports/) > $$shell_path($$OUT_PWD/../../imports/$$TARGETPATH/plugins.qmltypes)"
    INSTALLS += dumppluginqmltypes

    copypluginqmltypes.CONFIG = no_files no_path
# make sure the directory exists
    !win32: copypluginqmltypes.commands = $$QMAKE_MKDIR $$shell_path($$[QT_INSTALL_QML]/$$TARGETPATH/) $$escape_expand(\n\t)
    !win32: copypluginqmltypes.commands += $$QMAKE_COPY $$shell_path($$OUT_PWD/../../imports/$$TARGETPATH/plugins.qmltypes) $$shell_path($$[QT_INSTALL_QML]/$$TARGETPATH/plugins.qmltypes)
# ignore any errors on Windows
    win32: copypluginqmltypes.commands = xcopy $$shell_path($$OUT_PWD/../../imports/$$TARGETPATH/plugins.qmltypes) $$shell_path($$[QT_INSTALL_QML]/$$TARGETPATH/plugins.qmltypes) /C /E /Q /Y $$escape_expand(\n\t)
    win32: copypluginqmltypes.commands = exit 0
    INSTALLS += copypluginqmltypes
}

copyqmlinfra_install.files = $$QML_INFRA_FILES
copyqmlinfra_install.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += copyqmlinfra_install

copyqmlprivateinfra_install.files = $$QML_PRIVATE_INFRA_FILES
copyqmlprivateinfra_install.path = $$[QT_INSTALL_QML]/$$TARGETPATH/Private
INSTALLS += copyqmlprivateinfra_install

copyqmldesigner_install.files = $$QML_DESIGNER_FILES
copyqmldesigner_install.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += copyqmldesigner_install

copyqmlpropertyeditor_install.files = $$QML_PROPERTY_EDITOR_FILES
copyqmlpropertyeditor_install.path = $$QTCREATOR_INSTALL_DIR/share/qtcreator/qmldesigner/propertyEditorQmlSources/$$TARGETPATH
INSTALLS += copyqmlpropertyeditor_install

android: {
    copyjavafiles_install.CONFIG = no_files no_path
    copyjavafiles_install.commands += $(COPY_DIR) $$shell_path($$OUT_PWD/../../src/android) $$shell_path($$[QT_INSTALL_ARCHDATA]/src)
    INSTALLS += copyjavafiles_install
}

target.path = $$[QT_INSTALL_QML]/$$TARGETPATH

INSTALLS += target

OTHER_FILES += \
    $$QML_INFRA_FILES \
    $$QML_PRIVATE_INFRA_FILES \
    $$QML_DESIGNER_FILES \
    $$QML_PROPERTY_EDITOR_FILES \
    $$JAVAFILES

include(../paths.pri)
TARGETPATH = $$replace(uri, \\., /)
DESIGNER = designer
DESTDIR = $$OUT_PWD/../../imports/$$TARGETPATH

isEmpty(PLUGIN_VERSION): PLUGIN_VERSION = 1.0

# ========== copy additional files ==========
copyqmlinfra.input = QML_INFRA_FILES
copyqmlinfra.output = $$OUT_PWD/../../imports/$$TARGETPATH/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
!win32: copyqmlinfra.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyqmlinfra.output)) $$escape_expand(\n\t)
copyqmlinfra.commands +=  $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copyqmlinfra.CONFIG += no_link no_clean
copyqmlinfra.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmlinfra

copyqmlprivateinfra.input = QML_PRIVATE_INFRA_FILES
copyqmlprivateinfra.output = $$OUT_PWD/../../imports/$$TARGETPATH/Private/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
!win32: copyqmlprivateinfra.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyqmlprivateinfra.output)) $$escape_expand(\n\t)
copyqmlprivateinfra.commands +=  $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copyqmlprivateinfra.CONFIG += no_link no_clean
copyqmlprivateinfra.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmlprivateinfra

copyqmldesigner.input = QML_DESIGNER_FILES
copyqmldesigner.output = $$OUT_PWD/../../imports/$$DESIGNER/$$TARGETPATH/designer/
copyqmldesigner.commands = $(COPY_DIR) ${QMAKE_FILE_IN} $$shell_path($$OUT_PWD/../../imports/$$DESIGNER/$$TARGETPATH/designer/)
copyqmldesigner.CONFIG += no_link no_clean
copyqmldesigner.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmldesigner

copyqmlpropertyeditor.input = QML_PROPERTY_EDITOR_FILES
copyqmlpropertyeditor.output = $$OUT_PWD/../../imports/$$DESIGNER/$$TARGETPATH/propertyEditorQmlSources/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT}
!win32: copyqmlpropertyeditor.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyqmlpropertyeditor.output)) $$escape_expand(\n\t)
copyqmlpropertyeditor.commands += $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
copyqmlpropertyeditor.CONFIG += no_link no_clean
copyqmlpropertyeditor.variable_out = PRE_TARGETDEPS
QMAKE_EXTRA_COMPILERS += copyqmlpropertyeditor

android: {
    copyjavafiles.input = JAVAFILES
    copyjavafiles.output = $$OUT_PWD/../../src/android/java/
    copyjavafiles.commands = $$QMAKE_MKDIR $$shell_path($$dirname(copyjavafiles.output)) $$escape_expand(\n\t)
    copyjavafiles.commands += $(COPY_DIR) ${QMAKE_FILE_IN} $$shell_path($$OUT_PWD/../../src/android/java/)
    copyjavafiles.CONFIG += no_link no_clean
    copyjavafiles.variable_out = PRE_TARGETDEPS
    QMAKE_EXTRA_COMPILERS += copyjavafiles
}

win32: QMAKE_DEL_FILE = del /q /f
!win32:QMAKE_DEL_FILE = rm -r -f
QMAKE_CLEAN += $$OUT_PWD/../../imports/$$TARGETPATH/

# ========== install additional files ==========
isEmpty(QMLPLUGINDUMP): QMLPLUGINDUMP = 1
equals(QMLPLUGINDUMP, 1): !ios: !android: release: {
    dumppluginqmltypes.CONFIG = no_files no_path
    dumppluginqmltypes.commands = $$dirname(QMAKE_QMAKE)/qmlplugindump -nonrelocatable "$$uri $$PLUGIN_VERSION $$shell_path($$OUT_PWD/../../imports/) > $$shell_path($$OUT_PWD/../../imports/$$TARGETPATH/plugins.qmltypes)"
    # INSTALLS += dumppluginqmltypes

    copypluginqmltypes.CONFIG = no_files no_path
# make sure the directory exists
    !win32: copypluginqmltypes.commands = $$QMAKE_MKDIR $$shell_path($$[QT_INSTALL_QML]/$$TARGETPATH/) $$escape_expand(\n\t)
    !win32: copypluginqmltypes.commands += $$QMAKE_COPY $$shell_path($$OUT_PWD/../../imports/$$TARGETPATH/plugins.qmltypes) $$shell_path($$[QT_INSTALL_QML]/$$TARGETPATH/plugins.qmltypes)
# ignore any errors on Windows
    win32: copypluginqmltypes.commands = xcopy $$shell_path($$OUT_PWD/../../imports/$$TARGETPATH/plugins.qmltypes) $$shell_path($$[QT_INSTALL_QML]/$$TARGETPATH/plugins.qmltypes) /C /E /Q /Y $$escape_expand(\n\t)
    win32: copypluginqmltypes.commands = exit 0
    # INSTALLS += copypluginqmltypes
}

copyqmlinfra_install.files = $$QML_INFRA_FILES
copyqmlinfra_install.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += copyqmlinfra_install

copyqmlprivateinfra_install.files = $$QML_PRIVATE_INFRA_FILES
copyqmlprivateinfra_install.path = $$[QT_INSTALL_QML]/$$TARGETPATH/Private
INSTALLS += copyqmlprivateinfra_install

copyqmldesigner_install.files = $$QML_DESIGNER_FILES
copyqmldesigner_install.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += copyqmldesigner_install

copyqmlpropertyeditor_install.files = $$QML_PROPERTY_EDITOR_FILES
copyqmlpropertyeditor_install.path = $$QTCREATOR_INSTALL_DIR/share/qtcreator/qmldesigner/propertyEditorQmlSources/$$TARGETPATH
INSTALLS += copyqmlpropertyeditor_install

android: {
    copyjavafiles_install.CONFIG = no_files no_path
    copyjavafiles_install.commands += $(COPY_DIR) $$shell_path($$OUT_PWD/../../src/android) $$shell_path($$[QT_INSTALL_ARCHDATA]/src)
    INSTALLS += copyjavafiles_install
}

target.path = $$[QT_INSTALL_QML]/$$TARGETPATH

INSTALLS += target

OTHER_FILES += \
    $$QML_INFRA_FILES \
    $$QML_PRIVATE_INFRA_FILES \
    $$QML_DESIGNER_FILES \
    $$QML_PROPERTY_EDITOR_FILES \
    $$JAVAFILES


Removed duplicate symbols.

Removed duplicate symbols.

contains(CONFIG, dll) {
    DEFINES += QML_BUILD_LIB
} else {
    DEFINES += QML_BUILD_STATIC_LIB
}

INCLUDEPATH += $$PWD

include($$PWD/../../shared/qml/qml.pri)

##contains(QT, gui) {
##HEADERS += \
##    $$PWD/Nothing.h
##
##SOURCES += \
##    $$PWD/Nothing.cpp
##}

#HEADERS += \
#    $$PWD/qmlsymbol.h

#SOURCES += \
#    $$PWD/qmlsymbol.cpp

contains(CONFIG, dll) {
    DEFINES += QML_BUILD_LIB
} else {
    DEFINES += QML_BUILD_STATIC_LIB
}

INCLUDEPATH += $$PWD

include($$PWD/../../shared/qml/qml.pri)
include($$PWD/../../shared/qscripthighlighter/qscripthighlighter.pri)

##contains(QT, gui) {
##HEADERS += \
##    $$PWD/Nothing.h
##
##SOURCES += \
##    $$PWD/Nothing.cpp
##}

#HEADERS += \
#    $$PWD/qmlsymbol.h

#SOURCES += \
#    $$PWD/qmlsymbol.cpp


removing useless code

removing useless code

RAYTRACER_ROOT = $$PWD

RAYTRACER_BIN = $$RAYTRACER_ROOT/bin

RAYTRACER_OBJ = $$RAYTRACER_ROOT/obj

RAYTRACER_MOC = $$RAYTRACER_ROOT/moc

RAYTRACER_OBJ_TESTS = $$RAYTRACER_ROOT/obj_tests

RAYTRACER_MOC_TESTS = $$RAYTRACER_ROOT/moc_tests

RAYTRACER_OBJ_LIB = $$RAYTRACER_ROOT/obj_lib

RAYTRACER_OBJ_GUI = $$RAYTRACER_ROOT/obj_gui

RAYTRACER_MOC_GUI = $$RAYTRACER_ROOT/moc_gui

RAYTRACER_LIB = $$RAYTRACER_ROOT/lib

DESTDIR = $$RAYTRACER_BIN

QCONFIG += c++14

#QMAKE_CXXFLAGS += -std=c++11 --coverage -O0
#LIBS += --coverage -O0

#LIBS += $$RAYTRACER_BIN


Enhanced qmake build environment to work under Visual C++.

######################################################################
# $Revision: 1.12 $ $Author: shoops $ $Date: 2003/05/30 18:46:11 $
######################################################################

# In the case the BUILD_OS is not specified we make a guess.
isEmpty(BUILD_OS) {
  win32 {
    BUILD_OS = WIN32
  } else {
    BUILD_OS = $$system(uname)
  }
}
DEFINES += $${BUILD_OS}
message("Configuring for $${BUILD_OS}.")

# Common configuration settings
CONFIG += exceptions
CONFIG += rtti
CONFIG += thread

!contains(BUILD_OS, WIN32) {
  QMAKE_QMAKE = $(QTDIR)/bin/qmake

  # The character # (hex 23) can not be escaped we therefore create
  # a variable containing it
  HASH = $$system(echo "\\043")
  contains(HASH, \\043){
    HASH = $$system(echo -e "\\043")
  }

  myLex = \
          $(LEX) -t $< | \
          sed -e 's/class istream;/$${HASH}include "copasi.h"/' \
              -e 's/<FlexLexer.h>/"FlexLexer.h"/' \
              -e 's/$${HASH}include <unistd.h>/using namespace std;/' > $@
}

contains(BUILD_OS, Darwin) {
  INCLUDEPATH += /System/Library/Frameworks/vecLib.framework/Headers
  LIBS += -framework vecLib
  LIBS += -framework Carbon
  LIBS += -framework QuickTime
  LIBS += -lz
  CONFIG -= thread
}

contains(BUILD_OS, WIN32) {
  QMAKE_QMAKE = $(QTDIR)\bin\qmake.exe
  DEFINES -= UNICODE
  debug {
    QMAKE_LFLAGS_WINDOWS += /NODEFAULTLIB:"msvcrt.lib"
  }

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS_DEBUG   += -I"$${MKL_PATH}\include"
    QMAKE_CXXFLAGS_RELEASE += -I"$${MKL_PATH}\include"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${MKL_PATH}\ia32\lib"
    LIBS += mkl_lapack.lib mkl_p3.lib mkl_c.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS_DEBUG   += -I"$${CLAPACK_PATH}\include"
      QMAKE_CXXFLAGS_RELEASE += -I"$${CLAPACK_PATH}\include"
      QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${CLAPACK_PATH}\lib"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

  !isEmpty(EXPAT_PATH) {
    QMAKE_CXXFLAGS_DEBUG   += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_CXXFLAGS_RELEASE += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${EXPAT_PATH}\StaticLibs"
    LIBS += libexpat.lib
  } else {
    error( "EXPAT_PATH must be specified" )
  }
}

contains(BUILD_OS, SunOS) {
  !isEmpty(CLAPACK_PATH) {
    DEFINES += USE_CLAPACK
    INCLUDEPATH += $${CLAPACK_PATH}/include
    LIBS += -llapack -lblas -lF77 -lfl
    LIBS += -L$${CLAPACK_PATH}/lib
  } else {
    error( "CLAPACK_PATH must be specified" )
  }
  LIBS += -lSM
}

contains(BUILD_OS, Linux) {
  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    INCLUDEPATH += $${MKL_PATH}/include
    LIBS += -lmkl_lapack -lmkl_p3 -lg2c -lpthread
    LIBS +=  -L$${MKL_PATH}/lib/32
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      INCLUDEPATH += $${CLAPACK_PATH}/include
      LIBS += -llapack -lblas -lF77 -lfl
      LIBS += -L$${CLAPACK_PATH}/lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }
}

######################################################################
# $Revision: 1.11 $ $Author: shoops $ $Date: 2003/05/30 18:07:07 $
######################################################################

# In the case the BUILD_OS is not specified we make a guess.
isEmpty(BUILD_OS) {
  win32 {
    BUILD_OS = WIN32
  } else {
    BUILD_OS = $$system(uname)
  }
}
DEFINES += $${BUILD_OS}
message("Configuring for $${BUILD_OS}.")
QMAKE_QMAKE = $(QTDIR)/bin/qmake

# Common configuration settings
CONFIG += exceptions
CONFIG += rtti
CONFIG += thread

!contains(BUILD_OS, WIN32) {
  # The character # (hex 23) can not be escaped we therefore create
  # a variable containing it
  HASH = $$system(echo "\\043")
  contains(HASH, \\043){
    HASH = $$system(echo -e "\\043")
  }

  myLex = \
          $(LEX) -t $< | \
          sed -e 's/class istream;/$${HASH}include "copasi.h"/' \
              -e 's/<FlexLexer.h>/"FlexLexer.h"/' \
              -e 's/$${HASH}include <unistd.h>/using namespace std;/' > $@
}

contains(BUILD_OS, Darwin) {
  INCLUDEPATH += /System/Library/Frameworks/vecLib.framework/Headers
  LIBS += -framework vecLib
  LIBS += -framework Carbon
  LIBS += -framework QuickTime
  LIBS += -lz
  CONFIG -= thread
}

contains(BUILD_OS, WIN32) {
  DEFINES -= UNICODE
  debug {
    QMAKE_LFLAGS_WINDOWS += /NODEFAULTLIB:"msvcrt.lib"
  }

  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    QMAKE_CXXFLAGS_DEBUG   += -I"$${MKL_PATH}\include"
    QMAKE_CXXFLAGS_RELEASE += -I"$${MKL_PATH}\include"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${MKL_PATH}\ia32\lib"
    LIBS += mkl_lapack.lib mkl_p3.lib mkl_c.lib
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      QMAKE_CXXFLAGS_DEBUG   += -I"$${CLAPACK_PATH}\include"
      QMAKE_CXXFLAGS_RELEASE += -I"$${CLAPACK_PATH}\include"
      QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${CLAPACK_PATH}\lib"
      LIBS += clapack.lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }

  !isEmpty(EXPAT_PATH) {
    QMAKE_CXXFLAGS_DEBUG   += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_CXXFLAGS_RELEASE += -I"$${EXPAT_PATH}\Source\lib"
    QMAKE_LFLAGS_WINDOWS += /LIBPATH:"$${EXPAT_PATH}\StaticLibs"
    LIBS += libexpat.lib
  } else {
    error( "EXPAT_PATH must be specified" )
  }
}

contains(BUILD_OS, SunOS) {
  !isEmpty(CLAPACK_PATH) {
    DEFINES += USE_CLAPACK
    INCLUDEPATH += $${CLAPACK_PATH}/include
    LIBS += -llapack -lblas -lF77 -lfl
    LIBS += -L$${CLAPACK_PATH}/lib
  } else {
    error( "CLAPACK_PATH must be specified" )
  }
  LIBS += -lSM
}

contains(BUILD_OS, Linux) {
  !isEmpty(MKL_PATH) {
    DEFINES += USE_MKL
    INCLUDEPATH += $${MKL_PATH}/include
    LIBS += -lmkl_lapack -lmkl_p3 -lg2c -lpthread
    LIBS +=  -L$${MKL_PATH}/lib/32
  } else {
    !isEmpty(CLAPACK_PATH) {
      DEFINES += USE_CLAPACK
      INCLUDEPATH += $${CLAPACK_PATH}/include
      LIBS += -llapack -lblas -lF77 -lfl
      LIBS += -L$${CLAPACK_PATH}/lib
    } else {
      error( "Either MKL_PATH or CLAPACK_PATH must be specified" )
    }
  }
}


Pumped up version.

Pumped up version.


Version 1.0

Version 1.0


Version 2.4

Version 2.4


Version 8.50

Version 8.50


Version 0.25

Version 0.25


Version 9.14

Version 9.14


Version 2.9

Version 2.9


Add -lgtest_main

Add -lgtest_main

win32-msvc* {
	DEFINES += _VARIADIC_MAX=10
}
DEFINES += GTEST

#-------------------------------------------------
# gtest
#-------------------------------------------------
GTEST_PATH = $${PWD}
INCLUDEPATH += $${GTEST_PATH}/include
win32 {
	contains(QMAKE_TARGET.arch, x86) {
		CONFIG(debug, debug|release) {
			contains(QMAKE_CFLAGS_DEBUG, -MDd) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest-md/Debug -lgtestd -lgtest_maind
			}
			contains(QMAKE_CFLAGS_DEBUG, -MTd) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest/Debug -lgtestd -lgtest_maind
			}
		}
		CONFIG(release, debug|release) {
			contains(QMAKE_CFLAGS_RELEASE, -MD) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest-md/Release -lgtest -lgtest_main
			}
			contains(QMAKE_CFLAGS_RELEASE, -MT) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest/Release -lgtest -lgtest_main
			}
		}
	}
	contains(QMAKE_TARGET.arch, x86_64) {
		CONFIG(debug, debug|release) {
			LIBS += -L$${GTEST_PATH}/msvc/x64/Debug -lgtestd -lgtest_main
		}
		win32:CONFIG(release, debug|release) {
			LIBS += -L$${GTEST_PATH}/msvc/x64/Release -lgtest -lgtest_main
		}
	}
}
gcc:LIBS += -L$${GTEST_PATH}/lib -lgtest -lgtest_main

win32-msvc* {
	DEFINES += _VARIADIC_MAX=10
}
DEFINES += GTEST

#-------------------------------------------------
# gtest
#-------------------------------------------------
GTEST_PATH = $${PWD}
INCLUDEPATH += $${GTEST_PATH}/include
win32 {
	contains(QMAKE_TARGET.arch, x86) {
		CONFIG(debug, debug|release) {
			contains(QMAKE_CFLAGS_DEBUG, -MDd) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest-md/Debug -lgtestd
			}
			contains(QMAKE_CFLAGS_DEBUG, -MTd) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest/Debug -lgtestd
			}
		}
		CONFIG(release, debug|release) {
			contains(QMAKE_CFLAGS_RELEASE, -MD) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest-md/Release -lgtest
			}
			contains(QMAKE_CFLAGS_RELEASE, -MT) {
				LIBS += -L$${GTEST_PATH}/msvc/gtest/Release -lgtest
			}
		}
	}
	contains(QMAKE_TARGET.arch, x86_64) {
		CONFIG(debug, debug|release) {
			LIBS += -L$${GTEST_PATH}/msvc/x64/Debug -lgtestd
		}
		win32:CONFIG(release, debug|release) {
			LIBS += -L$${GTEST_PATH}/msvc/x64/Release -lgtest
		}
	}
}
gcc:LIBS += -L$${GTEST_PATH}/lib -lgtest


try include ../text

try include ../text

Former-commit-id: cce899114e3d54e68bcb97cd6bcfb1123df11148
Former-commit-id: 91848fde312c310dd2257ff47c5d9e274042597b


Allow non-X11 to use Freetype font engine.

http://code.google.com/p/phantomjs/issues/detail?id=163

# Qt kernel module

HEADERS += \
	text/qfont.h \
	text/qfontdatabase.h \
	text/qfontengine_p.h \
	text/qfontengineglyphcache_p.h \
	text/qfontinfo.h \
	text/qfontmetrics.h \
	text/qfont_p.h \
	text/qfontsubset_p.h \
	text/qtextcontrol_p.h \
	text/qtextcontrol_p_p.h \
	text/qtextengine_p.h \
	text/qtextlayout.h \
	text/qtextformat.h \
	text/qtextformat_p.h \
	text/qtextobject.h \
	text/qtextobject_p.h \
	text/qtextoption.h \
	text/qfragmentmap_p.h \
	text/qtextdocument.h \
	text/qtextdocument_p.h \
	text/qtexthtmlparser_p.h \
	text/qabstracttextdocumentlayout.h \
	text/qtextdocumentlayout_p.h \
	text/qtextcursor.h \
        text/qtextcursor_p.h \
	text/qtextdocumentfragment.h \
	text/qtextdocumentfragment_p.h \
	text/qtextimagehandler_p.h \
	text/qtexttable.h \
	text/qtextlist.h \
	text/qsyntaxhighlighter.h \
	text/qtextdocumentwriter.h \
	text/qcssparser_p.h \
	text/qtexttable_p.h \
	text/qzipreader_p.h \
	text/qzipwriter_p.h \
	text/qtextodfwriter_p.h \
	text/qstatictext_p.h \
	text/qstatictext.h \
        text/qrawfont.h \
        text/qrawfont_p.h \
    text/qglyphrun.h \
    text/qglyphrun_p.h

SOURCES += \
	text/qfont.cpp \
	text/qfontengine.cpp \
	text/qfontsubset.cpp \
	text/qfontmetrics.cpp \
	text/qfontdatabase.cpp \
	text/qtextcontrol.cpp \
	text/qtextengine.cpp \
	text/qtextlayout.cpp \
	text/qtextformat.cpp \
	text/qtextobject.cpp \
	text/qtextoption.cpp \
	text/qfragmentmap.cpp \
	text/qtextdocument.cpp \
	text/qtextdocument_p.cpp \
	text/qtexthtmlparser.cpp \
	text/qabstracttextdocumentlayout.cpp \
	text/qtextdocumentlayout.cpp \
	text/qtextcursor.cpp \
	text/qtextdocumentfragment.cpp \
	text/qtextimagehandler.cpp \
	text/qtexttable.cpp \
	text/qtextlist.cpp \
	text/qtextdocumentwriter.cpp \
	text/qsyntaxhighlighter.cpp \
	text/qcssparser.cpp \
	text/qzip.cpp \
	text/qtextodfwriter.cpp \
	text/qstatictext.cpp \
        text/qrawfont.cpp \
    text/qglyphrun.cpp

win32 {
	SOURCES += \
		text/qfont_win.cpp \
                text/qfontengine_win.cpp \
                text/qrawfont_win.cpp
	HEADERS += text/qfontengine_win_p.h
}

contains(QT_CONFIG, directwrite) {
    LIBS_PRIVATE += -ldwrite
    HEADERS += text/qfontenginedirectwrite_p.h
    SOURCES += text/qfontenginedirectwrite.cpp
}

unix:x11 {
	HEADERS += \
		text/qfontengine_x11_p.h \
		text/qfontdatabase_x11.cpp \
		text/qfontengine_ft_p.h
	SOURCES += \
		text/qfont_x11.cpp \
		text/qfontengine_x11.cpp \
                text/qfontengine_ft.cpp \
                text/qrawfont_ft.cpp
}

!embedded:!qpa:!x11:mac {
        HEADERS += \
                text/qfontengine_mac_p.h
	SOURCES += \
                text/qfont_mac.cpp \
                text/qrawfont_mac.cpp
        OBJECTIVE_SOURCES += \
                text/qfontengine_mac.mm
}
!embedded:!qpa:!x11:mac {
        OBJECTIVE_HEADERS += \
                text/qfontengine_coretext_p.h
        OBJECTIVE_SOURCES += \
                text/qfontengine_coretext.mm
        contains(QT_CONFIG, harfbuzz) {
            DEFINES += QT_ENABLE_HARFBUZZ_FOR_MAC
        }
}

embedded {
	SOURCES += \
		text/qfont_qws.cpp \
		text/qfontengine_qws.cpp \
		text/qfontengine_ft.cpp \
		text/qfontengine_qpf.cpp \
                text/qabstractfontengine_qws.cpp \
                text/qrawfont_ft.cpp
	HEADERS += \
		text/qfontengine_ft_p.h \
		text/qfontengine_qpf_p.h \
		text/qabstractfontengine_qws.h \
		text/qabstractfontengine_p.h
	DEFINES += QT_NO_FONTCONFIG
}

qpa {
	SOURCES += \
                text/qfont_qpa.cpp \
                text/qfontengine_qpa.cpp \
                text/qfontengine_ft.cpp \
                text/qplatformfontdatabase_qpa.cpp \
                text/qrawfont_qpa.cpp

	HEADERS += \
                text/qplatformfontdatabase_qpa.h \
                text/qfontengine_ft_p.h
}

symbian {
	SOURCES += \
		text/qfont_s60.cpp
	contains(QT_CONFIG, freetype) {
		SOURCES += \
                        text/qfontengine_ft.cpp \
                        text/qrawfont_ft.cpp
		HEADERS += \
			text/qfontengine_ft_p.h
		DEFINES += \
			QT_NO_FONTCONFIG
	} else {
		SOURCES += \
			text/qfontengine_s60.cpp
		HEADERS += \
			text/qfontengine_s60_p.h
	}
	LIBS += -lfntstr -lecom
}

!qpa {
contains(QT_CONFIG, freetype) {
    SOURCES += \
	../3rdparty/freetype/src/base/ftbase.c \
	../3rdparty/freetype/src/base/ftbbox.c \
	../3rdparty/freetype/src/base/ftdebug.c \
	../3rdparty/freetype/src/base/ftglyph.c \
	../3rdparty/freetype/src/base/ftinit.c \
	../3rdparty/freetype/src/base/ftmm.c \
	../3rdparty/freetype/src/base/fttype1.c \
	../3rdparty/freetype/src/base/ftsynth.c \
	../3rdparty/freetype/src/base/ftbitmap.c \
	../3rdparty/freetype/src/bdf/bdf.c \
	../3rdparty/freetype/src/cache/ftcache.c \
	../3rdparty/freetype/src/cff/cff.c \
	../3rdparty/freetype/src/cid/type1cid.c \
	../3rdparty/freetype/src/gzip/ftgzip.c \
	../3rdparty/freetype/src/pcf/pcf.c \
	../3rdparty/freetype/src/pfr/pfr.c \
	../3rdparty/freetype/src/psaux/psaux.c \
	../3rdparty/freetype/src/pshinter/pshinter.c \
	../3rdparty/freetype/src/psnames/psmodule.c \
	../3rdparty/freetype/src/raster/raster.c \
	../3rdparty/freetype/src/sfnt/sfnt.c \
	../3rdparty/freetype/src/smooth/smooth.c \
	../3rdparty/freetype/src/truetype/truetype.c \
	../3rdparty/freetype/src/type1/type1.c \
	../3rdparty/freetype/src/type42/type42.c \
	../3rdparty/freetype/src/winfonts/winfnt.c \
	../3rdparty/freetype/src/lzw/ftlzw.c\
          ../3rdparty/freetype/src/otvalid/otvalid.c\
          ../3rdparty/freetype/src/otvalid/otvbase.c\
          ../3rdparty/freetype/src/otvalid/otvgdef.c\
          ../3rdparty/freetype/src/otvalid/otvjstf.c\
          ../3rdparty/freetype/src/otvalid/otvcommn.c\
          ../3rdparty/freetype/src/otvalid/otvgpos.c\
          ../3rdparty/freetype/src/otvalid/otvgsub.c\
          ../3rdparty/freetype/src/otvalid/otvmod.c\
          ../3rdparty/freetype/src/autofit/afangles.c\
          ../3rdparty/freetype/src/autofit/afglobal.c\
          ../3rdparty/freetype/src/autofit/aflatin.c\
          ../3rdparty/freetype/src/autofit/afmodule.c\
          ../3rdparty/freetype/src/autofit/afdummy.c\
          ../3rdparty/freetype/src/autofit/afhints.c\
          ../3rdparty/freetype/src/autofit/afloader.c\
          ../3rdparty/freetype/src/autofit/autofit.c

    symbian {
        SOURCES += \
            ../3rdparty/freetype/src/base/ftsystem.c
    } else {
        SOURCES += \
            ../3rdparty/freetype/builds/unix/ftsystem.c
        INCLUDEPATH += \
            ../3rdparty/freetype/builds/unix
    }

    INCLUDEPATH += \
	../3rdparty/freetype/src \
	../3rdparty/freetype/include

    DEFINES += FT2_BUILD_LIBRARY FT_CONFIG_OPTION_SYSTEM_ZLIB

    embedded:CONFIG += opentype
} else:contains(QT_CONFIG, system-freetype) {
    embedded:CONFIG += opentype
    # pull in the proper freetype2 include directory
    include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
    LIBS_PRIVATE += -lfreetype
}

contains(QT_CONFIG, fontconfig) {
    CONFIG += opentype
}
}#!qpa

DEFINES += QT_NO_OPENTYPE
INCLUDEPATH += ../3rdparty/harfbuzz/src

# Qt kernel module

HEADERS += \
	text/qfont.h \
	text/qfontdatabase.h \
	text/qfontengine_p.h \
	text/qfontengineglyphcache_p.h \
	text/qfontinfo.h \
	text/qfontmetrics.h \
	text/qfont_p.h \
	text/qfontsubset_p.h \
	text/qtextcontrol_p.h \
	text/qtextcontrol_p_p.h \
	text/qtextengine_p.h \
	text/qtextlayout.h \
	text/qtextformat.h \
	text/qtextformat_p.h \
	text/qtextobject.h \
	text/qtextobject_p.h \
	text/qtextoption.h \
	text/qfragmentmap_p.h \
	text/qtextdocument.h \
	text/qtextdocument_p.h \
	text/qtexthtmlparser_p.h \
	text/qabstracttextdocumentlayout.h \
	text/qtextdocumentlayout_p.h \
	text/qtextcursor.h \
        text/qtextcursor_p.h \
	text/qtextdocumentfragment.h \
	text/qtextdocumentfragment_p.h \
	text/qtextimagehandler_p.h \
	text/qtexttable.h \
	text/qtextlist.h \
	text/qsyntaxhighlighter.h \
	text/qtextdocumentwriter.h \
	text/qcssparser_p.h \
	text/qtexttable_p.h \
	text/qzipreader_p.h \
	text/qzipwriter_p.h \
	text/qtextodfwriter_p.h \
	text/qstatictext_p.h \
	text/qstatictext.h \
        text/qrawfont.h \
        text/qrawfont_p.h \
    text/qglyphrun.h \
    text/qglyphrun_p.h

SOURCES += \
	text/qfont.cpp \
	text/qfontengine.cpp \
	text/qfontsubset.cpp \
	text/qfontmetrics.cpp \
	text/qfontdatabase.cpp \
	text/qtextcontrol.cpp \
	text/qtextengine.cpp \
	text/qtextlayout.cpp \
	text/qtextformat.cpp \
	text/qtextobject.cpp \
	text/qtextoption.cpp \
	text/qfragmentmap.cpp \
	text/qtextdocument.cpp \
	text/qtextdocument_p.cpp \
	text/qtexthtmlparser.cpp \
	text/qabstracttextdocumentlayout.cpp \
	text/qtextdocumentlayout.cpp \
	text/qtextcursor.cpp \
	text/qtextdocumentfragment.cpp \
	text/qtextimagehandler.cpp \
	text/qtexttable.cpp \
	text/qtextlist.cpp \
	text/qtextdocumentwriter.cpp \
	text/qsyntaxhighlighter.cpp \
	text/qcssparser.cpp \
	text/qzip.cpp \
	text/qtextodfwriter.cpp \
	text/qstatictext.cpp \
        text/qrawfont.cpp \
    text/qglyphrun.cpp

win32 {
	SOURCES += \
		text/qfont_win.cpp \
                text/qfontengine_win.cpp \
                text/qrawfont_win.cpp
	HEADERS += text/qfontengine_win_p.h
}

contains(QT_CONFIG, directwrite) {
    LIBS_PRIVATE += -ldwrite
    HEADERS += text/qfontenginedirectwrite_p.h
    SOURCES += text/qfontenginedirectwrite.cpp
}

unix:x11 {
	HEADERS += \
		text/qfontengine_x11_p.h \
		text/qfontdatabase_x11.cpp \
		text/qfontengine_ft_p.h
	SOURCES += \
		text/qfont_x11.cpp \
		text/qfontengine_x11.cpp \
                text/qfontengine_ft.cpp \
                text/qrawfont_ft.cpp
}

!embedded:!qpa:!x11:mac {
        HEADERS += \
                text/qfontengine_mac_p.h
	SOURCES += \
                text/qfont_mac.cpp \
                text/qrawfont_mac.cpp
        OBJECTIVE_SOURCES += \
                text/qfontengine_mac.mm
}
!embedded:!qpa:!x11:mac {
        OBJECTIVE_HEADERS += \
                text/qfontengine_coretext_p.h
        OBJECTIVE_SOURCES += \
                text/qfontengine_coretext.mm
        contains(QT_CONFIG, harfbuzz) {
            DEFINES += QT_ENABLE_HARFBUZZ_FOR_MAC
        }
}

embedded {
	SOURCES += \
		text/qfont_qws.cpp \
		text/qfontengine_qws.cpp \
		text/qfontengine_ft.cpp \
		text/qfontengine_qpf.cpp \
                text/qabstractfontengine_qws.cpp \
                text/qrawfont_ft.cpp
	HEADERS += \
		text/qfontengine_ft_p.h \
		text/qfontengine_qpf_p.h \
		text/qabstractfontengine_qws.h \
		text/qabstractfontengine_p.h
	DEFINES += QT_NO_FONTCONFIG
}

qpa {
	SOURCES += \
                text/qfont_qpa.cpp \
                text/qfontengine_qpa.cpp \
                text/qplatformfontdatabase_qpa.cpp \
                text/qrawfont_qpa.cpp

	HEADERS += \
                text/qplatformfontdatabase_qpa.h

	DEFINES += QT_NO_FONTCONFIG
        DEFINES += QT_NO_FREETYPE
}

symbian {
	SOURCES += \
		text/qfont_s60.cpp
	contains(QT_CONFIG, freetype) {
		SOURCES += \
                        text/qfontengine_ft.cpp \
                        text/qrawfont_ft.cpp
		HEADERS += \
			text/qfontengine_ft_p.h
		DEFINES += \
			QT_NO_FONTCONFIG
	} else {
		SOURCES += \
			text/qfontengine_s60.cpp
		HEADERS += \
			text/qfontengine_s60_p.h
	}
	LIBS += -lfntstr -lecom
}

!qpa {
contains(QT_CONFIG, freetype) {
    SOURCES += \
	../3rdparty/freetype/src/base/ftbase.c \
	../3rdparty/freetype/src/base/ftbbox.c \
	../3rdparty/freetype/src/base/ftdebug.c \
	../3rdparty/freetype/src/base/ftglyph.c \
	../3rdparty/freetype/src/base/ftinit.c \
	../3rdparty/freetype/src/base/ftmm.c \
	../3rdparty/freetype/src/base/fttype1.c \
	../3rdparty/freetype/src/base/ftsynth.c \
	../3rdparty/freetype/src/base/ftbitmap.c \
	../3rdparty/freetype/src/bdf/bdf.c \
	../3rdparty/freetype/src/cache/ftcache.c \
	../3rdparty/freetype/src/cff/cff.c \
	../3rdparty/freetype/src/cid/type1cid.c \
	../3rdparty/freetype/src/gzip/ftgzip.c \
	../3rdparty/freetype/src/pcf/pcf.c \
	../3rdparty/freetype/src/pfr/pfr.c \
	../3rdparty/freetype/src/psaux/psaux.c \
	../3rdparty/freetype/src/pshinter/pshinter.c \
	../3rdparty/freetype/src/psnames/psmodule.c \
	../3rdparty/freetype/src/raster/raster.c \
	../3rdparty/freetype/src/sfnt/sfnt.c \
	../3rdparty/freetype/src/smooth/smooth.c \
	../3rdparty/freetype/src/truetype/truetype.c \
	../3rdparty/freetype/src/type1/type1.c \
	../3rdparty/freetype/src/type42/type42.c \
	../3rdparty/freetype/src/winfonts/winfnt.c \
	../3rdparty/freetype/src/lzw/ftlzw.c\
          ../3rdparty/freetype/src/otvalid/otvalid.c\
          ../3rdparty/freetype/src/otvalid/otvbase.c\
          ../3rdparty/freetype/src/otvalid/otvgdef.c\
          ../3rdparty/freetype/src/otvalid/otvjstf.c\
          ../3rdparty/freetype/src/otvalid/otvcommn.c\
          ../3rdparty/freetype/src/otvalid/otvgpos.c\
          ../3rdparty/freetype/src/otvalid/otvgsub.c\
          ../3rdparty/freetype/src/otvalid/otvmod.c\
          ../3rdparty/freetype/src/autofit/afangles.c\
          ../3rdparty/freetype/src/autofit/afglobal.c\
          ../3rdparty/freetype/src/autofit/aflatin.c\
          ../3rdparty/freetype/src/autofit/afmodule.c\
          ../3rdparty/freetype/src/autofit/afdummy.c\
          ../3rdparty/freetype/src/autofit/afhints.c\
          ../3rdparty/freetype/src/autofit/afloader.c\
          ../3rdparty/freetype/src/autofit/autofit.c

    symbian {
        SOURCES += \
            ../3rdparty/freetype/src/base/ftsystem.c
    } else {
        SOURCES += \
            ../3rdparty/freetype/builds/unix/ftsystem.c
        INCLUDEPATH += \
            ../3rdparty/freetype/builds/unix
    }

    INCLUDEPATH += \
	../3rdparty/freetype/src \
	../3rdparty/freetype/include

    DEFINES += FT2_BUILD_LIBRARY FT_CONFIG_OPTION_SYSTEM_ZLIB

    embedded:CONFIG += opentype
} else:contains(QT_CONFIG, system-freetype) {
    embedded:CONFIG += opentype
    # pull in the proper freetype2 include directory
    include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
    LIBS_PRIVATE += -lfreetype
}

contains(QT_CONFIG, fontconfig) {
    CONFIG += opentype
}
}#!qpa

DEFINES += QT_NO_OPENTYPE
INCLUDEPATH += ../3rdparty/harfbuzz/src


Pri cleanup

Pri cleanup

QT += core widgets network

CONFIG   += c++11

DEPENDPATH += "$$PWD"
INCLUDEPATH += "$$PWD"

!include("../../thirdparty/miniz-cpp/Miniz.pri") {
	error("Unable to include Minz.")
}

SOURCES += \
        $$PWD/HandlerManager.cpp \
        $$PWD/Features/UpdateChecker.cpp \
        $$PWD/Features/ParseUpdate.cpp \
        $$PWD/Features/GetUpdate.cpp \
        $$PWD/Features/Ssl.cpp \
        $$PWD/../Common/UpdateFileData.cpp \
        $$PWD/../Common/VersionComparator.cpp \
        $$PWD/../Common/Platform.cpp \
        $$PWD/../Common/IgnoredVersions.cpp \

HEADERS += \
        $$PWD/HandlerManager.h \
        $$PWD/Features/UpdateChecker.h \
        $$PWD/Features/ParseUpdate.h \
        $$PWD/Features/GetUpdate.h \
        $$PWD/Features/Ssl.h \
        $$PWD/../Common/UpdateFileData.h \
        $$PWD/../Common/VersionComparator.h \
        $$PWD/../Common/Platform.h \
        $$PWD/../Common/IgnoredVersions.h \

FORMS += \

QT += core widgets network

CONFIG   += c++11

DEPENDPATH += "$$PWD"
INCLUDEPATH += "$$PWD"

!include("../../thirdparty/miniz-cpp/Miniz.pri") {
	error("Unable to include Minz.")
}

SOURCES += \
        $$PWD/Features/UpdateChecker.cpp \
        $$PWD/Features/GetUpdate.cpp \
        $$PWD/Features/ParseUpdate.cpp \
        $$PWD/HandlerManager.cpp \
        $$PWD/../Common/UpdateFileData.cpp \
        $$PWD/../Common/VersionComparator.cpp \
        $$PWD/../Common/Platform.cpp \
        $$PWD/../Common/IgnoredVersions.cpp \
    $$PWD/Features/Ssl.cpp

HEADERS += \
        $$PWD/Features/UpdateChecker.h \
        $$PWD/Features/ParseUpdate.h \
        $$PWD/HandlerManager.h \
        $$PWD/Features/GetUpdate.h \
        $$PWD/../Common/UpdateFileData.h \
        $$PWD/../Common/VersionComparator.h \
        $$PWD/../Common/Platform.h \
        $$PWD/../Common/IgnoredVersions.h \
    $$PWD/Features/Ssl.h

FORMS += \


Fix: endpoint driver can now be built into libqtsparql.so.

# if sparql-drivers contains the driver name, we build the driver into QtSparql library.

contains(sparql-drivers, all ) {
    sparql-driver +=   tracker tracker_direct virtuoso endpoint
}

contains(sparql-drivers, tracker) {
    HEADERS +=      drivers/tracker/qsparql_tracker_p.h
    SOURCES +=      drivers/tracker/qsparql_tracker.cpp
    DEFINES += QT_SPARQL_TRACKER

    QT += dbus
}

contains(sparql-drivers, tracker_direct) {
    HEADERS +=      drivers/tracker_direct/qsparql_tracker_direct_p.h
    SOURCES +=      drivers/tracker_direct/qsparql_tracker_direct.cpp
    CONFIG += link_pkgconfig
    PKGCONFIG += tracker-sparql-0.10
    DEFINES += QT_SPARQL_TRACKER_DIRECT
}

contains(sparql-drivers, virtuoso) {
     HEADERS += drivers/virtuoso/qsparql_virtuoso.h
     SOURCES += drivers/virtuoso/qsparql_virtuoso.cpp

     mac:!contains( LIBS, .*odbc.* ):LIBS        *= -liodbc
     unix:!contains( LIBS, .*odbc.* ):LIBS       *= -lodbc

     win32 {
         !win32-borland:LIBS     *= -lodbc32
         win32-borland:LIBS      *= $(BCB)/lib/PSDK/odbc32.lib
     }
     DEFINES += QT_SPARQL_VIRTUOSO
}

contains(sparql-drivers, endpoint) {
    HEADERS +=      drivers/endpoint/qsparql_endpoint_p.h
    SOURCES +=      drivers/endpoint/qsparql_endpoint.cpp
    DEFINES += QT_SPARQL_ENDPOINT
}

# if sparql-drivers contains the driver name, we build the driver into QtSparql library.

contains(sparql-drivers, all ) {
    sparql-driver +=   tracker tracker_direct virtuoso endpoint
}

contains(sparql-drivers, tracker) {
    HEADERS +=      drivers/tracker/qsparql_tracker_p.h
    SOURCES +=      drivers/tracker/qsparql_tracker.cpp
    DEFINES += QT_SPARQL_TRACKER

    QT += dbus
}

contains(sparql-drivers, tracker_direct) {
    HEADERS +=      drivers/tracker_direct/qsparql_tracker_direct_p.h
    SOURCES +=      drivers/tracker_direct/qsparql_tracker_direct.cpp
    CONFIG += link_pkgconfig
    PKGCONFIG += tracker-sparql-0.10
    DEFINES += QT_SPARQL_TRACKER_DIRECT
}

contains(sparql-drivers, virtuoso) {
     HEADERS += drivers/virtuoso/qsparql_virtuoso.h
     SOURCES += drivers/virtuoso/qsparql_virtuoso.cpp

     mac:!contains( LIBS, .*odbc.* ):LIBS        *= -liodbc
     unix:!contains( LIBS, .*odbc.* ):LIBS       *= -lodbc

     win32 {
         !win32-borland:LIBS     *= -lodbc32
         win32-borland:LIBS      *= $(BCB)/lib/PSDK/odbc32.lib
     }
     DEFINES += QT_SPARQL_VIRTUOSO
}

contains(sparql-drivers, endpoint) {
    HEADERS +=      drivers/endpoint/qsparql_endpoint.h
    SOURCES +=      drivers/endpoint/qsparql_endpoint.cpp
    DEFINES += QT_SPARQL_ENDPOINT
}


Use dynamically linked sanitizers

Use dynamically linked sanitizers

# Copyright 2014 - 2018 CyberTech Co. Ltd., Yurii Litvinov, Iakov Kirilenko
#
# 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.

# Build settings common to all projects in TrikRuntime.
# Provides:
# CONFIGURATION_SUFFIX variable that shall be consistently used in TARGET and LIBS variables in all projects.
# copyToDestdir function to copy arbitrary files and directories to DESTDIR
# uses function to automatically add a library to INCLUDEPATH and LIBS.
#
# Uses environment variable INSTALL_ROOT as a root of a file structure for install rules.
#
# Uses CONFIG variable to control support for Google Sanitizers:
# - CONFIG+=sanitize-address will enable address sanitizer
# - CONFIG+=sanitize-undefined will enable undefined behavior sanitizer
# - CONFIG+=sanitize-thread will enable thread sanitizer

!isEmpty(_PRO_FILE_):!isEmpty(CONFIG):isEmpty(GLOBAL_PRI_INCLUDED){
# commented out, seems like there is no need for this var, but let's wait
false:GLOBAL_PRI_INCLUDED=1

COMPILER = $$(CXX)
!isEmpty(QMAKE_GCC_MAJOR_VERSION) {
	COMPILER_VERSION=$${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}
}

COMPILER_IS_ARM = $$find(COMPILER, arm-.*)

PYTHONQTALL_CONFIG=PythonQtCore

count(COMPILER_IS_ARM, 1) {
	ARCHITECTURE = arm
} else {
	ARCHITECTURE = x86
}

win32 {
	PLATFORM = windows
}

unix:!macx {
	PLATFORM = linux
}

macx {
	PLATFORM = mac
}

CONFIG *= qt

CONFIG -= app_bundle

!win32:CONFIG *= use_gold_linker
#CONFIG *= fat-lto

#deal with mixed configurations
CONFIG -= debug_and_release debug_and_release_target
CONFIG(debug, debug | release): CONFIG -= release
else:!debug:CONFIG *= release
release:CONFIG -= debug
no-sanitizers: CONFIG *= nosanitizers
CONFIG = $$unique(CONFIG)

QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Og

CONFIG(debug) {
	isEmpty(CONFIGURATION): CONFIGURATION = $$ARCHITECTURE-debug
	unix {
		QMAKE_CXXFLAGS += -coverage
		QMAKE_LFLAGS += -coverage
	}
	CONFIGURATION_SUFFIX=
} else {
	isEmpty(CONFIGURATION): CONFIGURATION = $$ARCHITECTURE-release
	CONFIGURATION_SUFFIX=
}

!gcc4:!gcc5:!clang:!win32:gcc:*-g++*:system($$QMAKE_CXX --version | grep -qEe '"\\<5\\.[0-9]+\\."' ){ CONFIG += gcc5 }
!gcc4:!gcc5:!clang:!win32:gcc:*-g++*:system($$QMAKE_CXX --version | grep -qEe '"\\<4\\.[0-9]+\\."' ){ CONFIG += gcc4 }

GLOBAL_PWD = $$absolute_path($$PWD)
GLOBAL_OUTPWD = $$absolute_path($$OUT_PWD)

isEmpty(GLOBAL_DESTDIR) {
	GLOBAL_DESTDIR = $$GLOBAL_OUTPWD/bin/$$CONFIGURATION
}
isEmpty(DESTDIR) {
	DESTDIR = $$GLOBAL_DESTDIR
}

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

isEmpty(TARGET) {
	TARGET = $$PROJECT_NAME$$CONFIGURATION_SUFFIX
} else {
	R=$$find( TARGET, "$$CONFIGURATION_SUFFIX$" )
	isEmpty(R):TARGET = $$TARGET$$CONFIGURATION_SUFFIX
}

equals(TEMPLATE, app) {
	!no_rpath {
		unix:!macx {
			QMAKE_LFLAGS += -Wl,-rpath-link,$$GLOBAL_DESTDIR
			QMAKE_LFLAGS += -Wl,-O1,-rpath,\'\$$ORIGIN\'
		} macx {
			QMAKE_LFLAGS += -rpath @executable_path
			QMAKE_LFLAGS += -rpath @executable_path/../Lib
			QMAKE_LFLAGS += -rpath @executable_path/../Frameworks
			QMAKE_LFLAGS += -rpath @executable_path/../../../
		}
	}
} else:equals(TEMPLATE, lib){

	CONFIG += create_pc create_libtool
	QMAKE_PKGCONFIG_NAME=$$TARGET
	QMAKE_PKGCONFIG_PREFIX = $$INSTALLBASE
	QMAKE_PKGCONFIG_LIBDIR = $$target.path
	QMAKE_PKGCONFIG_INCDIR = $$headers.path
	QMAKE_PKGCONFIG_VERSION = $$VERSION
#	QMAKE_PKGCONFIG_DESCRIPTION =
}

#Workaround for a known gcc/ld (before 7.3/bionic) issue
use_gold_linker:!clang: QMAKE_LFLAGS += -Wl,--disable-new-dtags

macx-clang {
	QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9
	QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
}

!nosanitizers:!clang:gcc:*-g++*:gcc4{
	warning("Disabled sanitizers, failed to detect compiler version or too old compiler: $$QMAKE_CXX")
	CONFIG += nosanitizers
}

!nosanitizers {
	CONFIG += sanitizer
}

unix:!nosanitizers {

	# 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
		#CONFIG += sanitizer sanitize_undefined
		#QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fsanitize-trap=undefined -fsanitize-undefined-trap-on-error
	}

	CONFIG(sanitize_address) {
	# GCC 5.5 does not know this
	#	QMAKE_SANITIZE_ADDRESS_CXXFLAGS += -fsanitize-address-use-after-scope
		#!clang:QMAKE_LFLAGS_RELEASE *= -static-libasan
	}
	#LSan can be used without performance degrade even in release build
	#But at the moment we can not, because of Qt  problems
        CONFIG(debug):!CONFIG(sanitize_address):!CONFIG(sanitize_memory):!CONFIG(sanitize_thread):!macx-clang {
             CONFIG += sanitize_leak
        }

        sanitize_leak {
		QMAKE_CFLAGS *= -fsanitize=leak
		QMAKE_CXXFLAGS *= -fsanitize=leak
		QMAKE_LFLAGS *= -fsanitize=leak
		#!clang:QMAKE_LFLAGS_RELEASE *= -static-liblsan
	}

        sanitize_memory {
                QMAKE_CFLAGS *= -fsanitize-memory-use-after-dtor -fsanitize-memory-track-origins
                QMAKE_CXXFLAGS *= -fsanitize-memory-use-after-dtor -fsanitize-memory-track-origins
        }

	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
		}
		#!clang:QMAKE_LFLAGS_RELEASE *= -static-libubsan
	}

	sanitize_thread {
		#!clang:QMAKE_LFLAGS_RELEASE *= -static-libtsan
	}

	gcc5 {
		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").

# Useless since 2019? Commented out.
#			QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fno-sanitize=vptr
#			QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fno-sanitize=vptr
#			QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fno-sanitize=vptr
		}
	}

	QMAKE_CFLAGS += -fno-sanitize-recover=all
	QMAKE_CXXFLAGS += -fno-sanitize-recover=all
}

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

CONFIG += precompile_header
precompile_header {
	PRECOMPILED_HEADER = $$PWD/pch.h
	QMAKE_CXXFLAGS *= -Wno-error=invalid-pch
}

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

THIS_IS_QS_LOG=$$find(PROJECT_NAME, [qQ]s[lL]og)
isEmpty(THIS_IS_QS_LOG) {
        INCLUDEPATH += $$GLOBAL_PWD/qslog/qslog
}

CONFIG += c++11

DEFINES += QT_FORCE_ASSERTS

QMAKE_CXXFLAGS += -pedantic-errors -Wextra -Werror

!clang: QMAKE_CXXFLAGS += -ansi

gcc5 | clang {
	QMAKE_CXXFLAGS +=-Werror=pedantic -Werror=delete-incomplete
}

clang {
	#treat git submodules as system path
	SYSTEM_INCLUDE_PREFIX_OPTION += $$system(git submodule status 2>/dev/null | sed $$shell_quote('s/^.[0-9a-fA-F]* \\([^ ]*\\).*$/--system-header-prefix=\\1/g'))

	#treat Qt includes as system headers
	SYSTEM_INCLUDE_PREFIX_OPTION += --system-header-prefix=$$[QT_INSTALL_HEADERS]
}

gcc {
	#treat Qt includes as system headers
	#but -isystem causes problems in OE thud
	!count(COMPILER_IS_ARM, 1):SYSTEM_INCLUDE_PREFIX_OPTION *= -isystem $$[QT_INSTALL_HEADERS]
}

QMAKE_CXXFLAGS += $$SYSTEM_INCLUDE_PREFIX_OPTION

gcc:versionAtLeast(QT_VERSION, 5.15.0):QMAKE_CXXFLAGS *= -Wno-error=deprecated-declarations

false:clang {
# Problem from Qt system headers
	QMAKE_CXXFLAGS += -Wno-error=expansion-to-defined -Wno-error=c++98-compat -Wno-error=sign-conversion \
			-Wno-error=covered-switch-default -Wno-error=c++98-compat-pedantic \
			-Wno-error=documentation-unknown-command -Wno-error=inconsistent-missing-destructor-override \
			-Wno-error=used-but-marked-unused -Wno-error=extra-semi-stmt -Wno-error=padded \
			-Wno-error=float-equal -Wno-error=float-conversion -Wno-error=implicit-float-conversion \
			-Wno-error=redundant-parens -Wno-error=deprecated -Wno-error=shift-sign-overflow \
			-Wno-error=zero-as-null-pointer-constant -Wno-error=exit-time-destructors \
			-Wno-error=double-promotion -Wno-error=shadow-field -Wno-error=documentation \
			-Wno-error=reserved-id-macro -Wno-error=extra-semi -Wno-error=comma
}

QMAKE_CXXFLAGS += -Werror=cast-qual -Werror=write-strings -Werror=redundant-decls -Werror=unreachable-code \
			-Werror=non-virtual-dtor -Wno-error=overloaded-virtual \
			-Werror=uninitialized -Werror=init-self

gcc4:QMAKE_CXXFLAGS += -Wno-error=missing-field-initializers

# Simple function that checks if given argument is a file or directory.
# Returns false if argument 1 is a file or does not exist.
defineTest(isDir) {
	exists($$system_path($$1/*)):return(true)
	return(false)
}

# 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 =
		AFTER_SLASH = $$section(FILE, "/", -1, -1)
		isDir($$FILE) {
			ABSOLUTE_PATH = $$absolute_path($$FILE, $$GLOBAL_PWD)
			BASE_NAME = $$section(ABSOLUTE_PATH, "/", -1, -1)
			DESTDIR_SUFFIX = $$BASE_NAME/
			FILE = $$FILE/*
		}

		DDIR = $$quote($$system_path($$DESTDIR/$$3$$DESTDIR_SUFFIX))
		FILE = $$quote($$system_path($$FILE))

		mkpath($$DDIR)

		win32 {
			# probably, xcopy needs /s and /e for directories
			COPY_DIR = "cmd.exe /C xcopy /y /i /s /e "
			!silent: COPY_DIR += /f
		} else {
			COPY_DIR = rsync -a
			!silent: COPY_DIR += -v
		}

		COPY_COMMAND = $$COPY_DIR $$FILE $$DDIR
		isEmpty(NOW) {
			QMAKE_POST_LINK += $$COPY_COMMAND $$escape_expand(\\n\\t)
		} else {
			system($$COPY_COMMAND)
		}
	}

	export(QMAKE_POST_LINK)
}

defineTest(interfaceIncludes) {
	PROJECTS = $$1

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

	export(INCLUDEPATH)
}

defineTest(implementationIncludes) {
	interfaceIncludes($$1)
}

defineTest(transitiveIncludes) {
	interfaceIncludes($$1)
}

defineTest(PythonQtIncludes) {
	INCLUDEPATH += $$GLOBAL_PWD/PythonQt/PythonQt/src
	export(INCLUDEPATH)
}

defineTest(links) {
	LIBS *= -L$$GLOBAL_DESTDIR
	LIBS *= -L$$DESTDIR
	PROJECTS = $$1

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

	export(LIBS)
}

defineTest(installs) {
	unix {
		equals(TEMPLATE, lib) {
			target.path = $$INSTALL_ROOT/usr/lib/
			isEmpty(PUBLIC_HEADERS) {
				headers.files = $$HEADERS
				headers.path = $$INSTALL_ROOT/usr/include/$$PROJECT_NAME/
			} else {
				headers.files = $$PUBLIC_HEADERS
				headers.path = $$INSTALL_ROOT/usr/include/$$PROJECT_NAME/
			}
		}

		equals(TEMPLATE, app) {
			target.path = $$INSTALL_ROOT/usr/bin/
		}

		INSTALLS += target
		export(target.path)

		equals(TEMPLATE, lib) {
			INSTALLS += headers
			export(headers.files)
			export(headers.path)
		}

		export(INSTALLS)
	}

	HEADERS += $$PUBLIC_HEADERS
	export(HEADERS)
}

defineTest(installAdditionalConfigs) {
	FILES = $$1

	unix {
		additionalConfigs.files += $$FILES
		additionalConfigs.path = $$INSTALL_ROOT/etc/trik/trikRuntime/

		INSTALLS += additionalConfigs

		export(additionalConfigs.path)
		export(additionalConfigs.files)
		export(INSTALLS)
	}
}

defineTest(installAdditionalSharedFiles) {
	FILES = $$1

	unix {
		additionalSharedFiles.files += $$FILES
		additionalSharedFiles.path = $$INSTALL_ROOT/usr/share/trikRuntime/

		INSTALLS *= additionalSharedFiles

		export(additionalSharedFiles.path)
		export(additionalSharedFiles.files)
		export(INSTALLS)
	}
}

defineTest(noPch) {
	CONFIG -= precompile_header
	PRECOMPILED_HEADER =
	export(CONFIG)
	export(PRECOMPILED_HEADER)
}

defineTest(enableFlagIfCan) {
  system(echo $$shell_quote(int main(){return 0;}) | $$QMAKE_CXX $$QMAKE_CXXFLAGS $$1 -x c++ -c - -o $$system(mktemp) 2>/dev/null ) {
	QMAKE_CXXFLAGS += $$1
	export(QMAKE_CXXFLAGS)
  } else {
	message(Cannot enable $$1)
  }
}

CONFIG(noPch) {
	noPch()
}
} # GLOBAL_PRI_INCLUDED

# Copyright 2014 - 2018 CyberTech Co. Ltd., Yurii Litvinov, Iakov Kirilenko
#
# 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.

# Build settings common to all projects in TrikRuntime.
# Provides:
# CONFIGURATION_SUFFIX variable that shall be consistently used in TARGET and LIBS variables in all projects.
# copyToDestdir function to copy arbitrary files and directories to DESTDIR
# uses function to automatically add a library to INCLUDEPATH and LIBS.
#
# Uses environment variable INSTALL_ROOT as a root of a file structure for install rules.
#
# Uses CONFIG variable to control support for Google Sanitizers:
# - CONFIG+=sanitize-address will enable address sanitizer
# - CONFIG+=sanitize-undefined will enable undefined behavior sanitizer
# - CONFIG+=sanitize-thread will enable thread sanitizer

!isEmpty(_PRO_FILE_):!isEmpty(CONFIG):isEmpty(GLOBAL_PRI_INCLUDED){
# commented out, seems like there is no need for this var, but let's wait
false:GLOBAL_PRI_INCLUDED=1

COMPILER = $$(CXX)
!isEmpty(QMAKE_GCC_MAJOR_VERSION) {
	COMPILER_VERSION=$${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}
}

COMPILER_IS_ARM = $$find(COMPILER, arm-.*)

PYTHONQTALL_CONFIG=PythonQtCore

count(COMPILER_IS_ARM, 1) {
	ARCHITECTURE = arm
} else {
	ARCHITECTURE = x86
}

win32 {
	PLATFORM = windows
}

unix:!macx {
	PLATFORM = linux
}

macx {
	PLATFORM = mac
}

CONFIG *= qt

CONFIG -= app_bundle

!win32:CONFIG *= use_gold_linker
#CONFIG *= fat-lto

#deal with mixed configurations
CONFIG -= debug_and_release debug_and_release_target
CONFIG(debug, debug | release): CONFIG -= release
else:!debug:CONFIG *= release
release:CONFIG -= debug
no-sanitizers: CONFIG *= nosanitizers
CONFIG = $$unique(CONFIG)

QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Og

CONFIG(debug) {
	isEmpty(CONFIGURATION): CONFIGURATION = $$ARCHITECTURE-debug
	unix {
		QMAKE_CXXFLAGS += -coverage
		QMAKE_LFLAGS += -coverage
	}
	CONFIGURATION_SUFFIX=
} else {
	isEmpty(CONFIGURATION): CONFIGURATION = $$ARCHITECTURE-release
	CONFIGURATION_SUFFIX=
}

!gcc4:!gcc5:!clang:!win32:gcc:*-g++*:system($$QMAKE_CXX --version | grep -qEe '"\\<5\\.[0-9]+\\."' ){ CONFIG += gcc5 }
!gcc4:!gcc5:!clang:!win32:gcc:*-g++*:system($$QMAKE_CXX --version | grep -qEe '"\\<4\\.[0-9]+\\."' ){ CONFIG += gcc4 }

GLOBAL_PWD = $$absolute_path($$PWD)
GLOBAL_OUTPWD = $$absolute_path($$OUT_PWD)

isEmpty(GLOBAL_DESTDIR) {
	GLOBAL_DESTDIR = $$GLOBAL_OUTPWD/bin/$$CONFIGURATION
}
isEmpty(DESTDIR) {
	DESTDIR = $$GLOBAL_DESTDIR
}

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

isEmpty(TARGET) {
	TARGET = $$PROJECT_NAME$$CONFIGURATION_SUFFIX
} else {
	R=$$find( TARGET, "$$CONFIGURATION_SUFFIX$" )
	isEmpty(R):TARGET = $$TARGET$$CONFIGURATION_SUFFIX
}

equals(TEMPLATE, app) {
	!no_rpath {
		unix:!macx {
			QMAKE_LFLAGS += -Wl,-rpath-link,$$GLOBAL_DESTDIR
			QMAKE_LFLAGS += -Wl,-O1,-rpath,\'\$$ORIGIN\'
		} macx {
			QMAKE_LFLAGS += -rpath @executable_path
			QMAKE_LFLAGS += -rpath @executable_path/../Lib
			QMAKE_LFLAGS += -rpath @executable_path/../Frameworks
			QMAKE_LFLAGS += -rpath @executable_path/../../../
		}
	}
} else:equals(TEMPLATE, lib){

	CONFIG += create_pc create_libtool
	QMAKE_PKGCONFIG_NAME=$$TARGET
	QMAKE_PKGCONFIG_PREFIX = $$INSTALLBASE
	QMAKE_PKGCONFIG_LIBDIR = $$target.path
	QMAKE_PKGCONFIG_INCDIR = $$headers.path
	QMAKE_PKGCONFIG_VERSION = $$VERSION
#	QMAKE_PKGCONFIG_DESCRIPTION =
}

#Workaround for a known gcc/ld (before 7.3/bionic) issue
use_gold_linker:!clang: QMAKE_LFLAGS += -Wl,--disable-new-dtags

macx-clang {
	QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9
	QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
}

!nosanitizers:!clang:gcc:*-g++*:gcc4{
	warning("Disabled sanitizers, failed to detect compiler version or too old compiler: $$QMAKE_CXX")
	CONFIG += nosanitizers
}

!nosanitizers {
	CONFIG += sanitizer
}

unix:!nosanitizers {

	# 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
		#CONFIG += sanitizer sanitize_undefined
		#QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fsanitize-trap=undefined -fsanitize-undefined-trap-on-error
	}

	CONFIG(sanitize_address) {
	# GCC 5.5 does not know this
	#	QMAKE_SANITIZE_ADDRESS_CXXFLAGS += -fsanitize-address-use-after-scope
		!clang:QMAKE_LFLAGS_RELEASE *= -static-libasan
	}
	#LSan can be used without performance degrade even in release build
	#But at the moment we can not, because of Qt  problems
        CONFIG(debug):!CONFIG(sanitize_address):!CONFIG(sanitize_memory):!CONFIG(sanitize_thread):!macx-clang {
             CONFIG += sanitize_leak
        }

        sanitize_leak {
		QMAKE_CFLAGS *= -fsanitize=leak
		QMAKE_CXXFLAGS *= -fsanitize=leak
		QMAKE_LFLAGS *= -fsanitize=leak
		!clang:QMAKE_LFLAGS_RELEASE *= -static-liblsan
	}

        sanitize_memory {
                QMAKE_CFLAGS *= -fsanitize-memory-use-after-dtor -fsanitize-memory-track-origins
                QMAKE_CXXFLAGS *= -fsanitize-memory-use-after-dtor -fsanitize-memory-track-origins
        }

	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
		}
		!clang:QMAKE_LFLAGS_RELEASE *= -static-libubsan
	}

	sanitize_thread {
		!clang:QMAKE_LFLAGS_RELEASE *= -static-libtsan
	}

	gcc5 {
		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").

# Useless since 2019? Commented out.
#			QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fno-sanitize=vptr
#			QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fno-sanitize=vptr
#			QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fno-sanitize=vptr
		}
	}

	QMAKE_CFLAGS += -fno-sanitize-recover=all
	QMAKE_CXXFLAGS += -fno-sanitize-recover=all
}

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

CONFIG += precompile_header
precompile_header {
	PRECOMPILED_HEADER = $$PWD/pch.h
	QMAKE_CXXFLAGS *= -Wno-error=invalid-pch
}

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

THIS_IS_QS_LOG=$$find(PROJECT_NAME, [qQ]s[lL]og)
isEmpty(THIS_IS_QS_LOG) {
        INCLUDEPATH += $$GLOBAL_PWD/qslog/qslog
}

CONFIG += c++11

DEFINES += QT_FORCE_ASSERTS

QMAKE_CXXFLAGS += -pedantic-errors -Wextra -Werror

!clang: QMAKE_CXXFLAGS += -ansi

gcc5 | clang {
	QMAKE_CXXFLAGS +=-Werror=pedantic -Werror=delete-incomplete
}

clang {
	#treat git submodules as system path
	SYSTEM_INCLUDE_PREFIX_OPTION += $$system(git submodule status 2>/dev/null | sed $$shell_quote('s/^.[0-9a-fA-F]* \\([^ ]*\\).*$/--system-header-prefix=\\1/g'))

	#treat Qt includes as system headers
	SYSTEM_INCLUDE_PREFIX_OPTION += --system-header-prefix=$$[QT_INSTALL_HEADERS]
}

gcc {
	#treat Qt includes as system headers
	#but -isystem causes problems in OE thud
	!count(COMPILER_IS_ARM, 1):SYSTEM_INCLUDE_PREFIX_OPTION *= -isystem $$[QT_INSTALL_HEADERS]
}

QMAKE_CXXFLAGS += $$SYSTEM_INCLUDE_PREFIX_OPTION

gcc:versionAtLeast(QT_VERSION, 5.15.0):QMAKE_CXXFLAGS *= -Wno-error=deprecated-declarations

false:clang {
# Problem from Qt system headers
	QMAKE_CXXFLAGS += -Wno-error=expansion-to-defined -Wno-error=c++98-compat -Wno-error=sign-conversion \
			-Wno-error=covered-switch-default -Wno-error=c++98-compat-pedantic \
			-Wno-error=documentation-unknown-command -Wno-error=inconsistent-missing-destructor-override \
			-Wno-error=used-but-marked-unused -Wno-error=extra-semi-stmt -Wno-error=padded \
			-Wno-error=float-equal -Wno-error=float-conversion -Wno-error=implicit-float-conversion \
			-Wno-error=redundant-parens -Wno-error=deprecated -Wno-error=shift-sign-overflow \
			-Wno-error=zero-as-null-pointer-constant -Wno-error=exit-time-destructors \
			-Wno-error=double-promotion -Wno-error=shadow-field -Wno-error=documentation \
			-Wno-error=reserved-id-macro -Wno-error=extra-semi -Wno-error=comma
}

QMAKE_CXXFLAGS += -Werror=cast-qual -Werror=write-strings -Werror=redundant-decls -Werror=unreachable-code \
			-Werror=non-virtual-dtor -Wno-error=overloaded-virtual \
			-Werror=uninitialized -Werror=init-self

gcc4:QMAKE_CXXFLAGS += -Wno-error=missing-field-initializers

# Simple function that checks if given argument is a file or directory.
# Returns false if argument 1 is a file or does not exist.
defineTest(isDir) {
	exists($$system_path($$1/*)):return(true)
	return(false)
}

# 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 =
		AFTER_SLASH = $$section(FILE, "/", -1, -1)
		isDir($$FILE) {
			ABSOLUTE_PATH = $$absolute_path($$FILE, $$GLOBAL_PWD)
			BASE_NAME = $$section(ABSOLUTE_PATH, "/", -1, -1)
			DESTDIR_SUFFIX = $$BASE_NAME/
			FILE = $$FILE/*
		}

		DDIR = $$quote($$system_path($$DESTDIR/$$3$$DESTDIR_SUFFIX))
		FILE = $$quote($$system_path($$FILE))

		mkpath($$DDIR)

		win32 {
			# probably, xcopy needs /s and /e for directories
			COPY_DIR = "cmd.exe /C xcopy /y /i /s /e "
			!silent: COPY_DIR += /f
		} else {
			COPY_DIR = rsync -a
			!silent: COPY_DIR += -v
		}

		COPY_COMMAND = $$COPY_DIR $$FILE $$DDIR
		isEmpty(NOW) {
			QMAKE_POST_LINK += $$COPY_COMMAND $$escape_expand(\\n\\t)
		} else {
			system($$COPY_COMMAND)
		}
	}

	export(QMAKE_POST_LINK)
}

defineTest(interfaceIncludes) {
	PROJECTS = $$1

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

	export(INCLUDEPATH)
}

defineTest(implementationIncludes) {
	interfaceIncludes($$1)
}

defineTest(transitiveIncludes) {
	interfaceIncludes($$1)
}

defineTest(PythonQtIncludes) {
	INCLUDEPATH += $$GLOBAL_PWD/PythonQt/PythonQt/src
	export(INCLUDEPATH)
}

defineTest(links) {
	LIBS *= -L$$GLOBAL_DESTDIR
	LIBS *= -L$$DESTDIR
	PROJECTS = $$1

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

	export(LIBS)
}

defineTest(installs) {
	unix {
		equals(TEMPLATE, lib) {
			target.path = $$INSTALL_ROOT/usr/lib/
			isEmpty(PUBLIC_HEADERS) {
				headers.files = $$HEADERS
				headers.path = $$INSTALL_ROOT/usr/include/$$PROJECT_NAME/
			} else {
				headers.files = $$PUBLIC_HEADERS
				headers.path = $$INSTALL_ROOT/usr/include/$$PROJECT_NAME/
			}
		}

		equals(TEMPLATE, app) {
			target.path = $$INSTALL_ROOT/usr/bin/
		}

		INSTALLS += target
		export(target.path)

		equals(TEMPLATE, lib) {
			INSTALLS += headers
			export(headers.files)
			export(headers.path)
		}

		export(INSTALLS)
	}

	HEADERS += $$PUBLIC_HEADERS
	export(HEADERS)
}

defineTest(installAdditionalConfigs) {
	FILES = $$1

	unix {
		additionalConfigs.files += $$FILES
		additionalConfigs.path = $$INSTALL_ROOT/etc/trik/trikRuntime/

		INSTALLS += additionalConfigs

		export(additionalConfigs.path)
		export(additionalConfigs.files)
		export(INSTALLS)
	}
}

defineTest(installAdditionalSharedFiles) {
	FILES = $$1

	unix {
		additionalSharedFiles.files += $$FILES
		additionalSharedFiles.path = $$INSTALL_ROOT/usr/share/trikRuntime/

		INSTALLS *= additionalSharedFiles

		export(additionalSharedFiles.path)
		export(additionalSharedFiles.files)
		export(INSTALLS)
	}
}

defineTest(noPch) {
	CONFIG -= precompile_header
	PRECOMPILED_HEADER =
	export(CONFIG)
	export(PRECOMPILED_HEADER)
}

defineTest(enableFlagIfCan) {
  system(echo $$shell_quote(int main(){return 0;}) | $$QMAKE_CXX $$QMAKE_CXXFLAGS $$1 -x c++ -c - -o $$system(mktemp) 2>/dev/null ) {
	QMAKE_CXXFLAGS += $$1
	export(QMAKE_CXXFLAGS)
  } else {
	message(Cannot enable $$1)
  }
}

CONFIG(noPch) {
	noPch()
}
} # GLOBAL_PRI_INCLUDED


Fix package generation

Fix package generation

package directory was showing up in dmg file

# -------------------------------------------------
# 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
# License terms set in COPYING.md
# -------------------------------------------------

installer {
    DEFINES += QGC_INSTALL_RELEASE
    MacBuild {
        VideoEnabled {
            # Install the gstreamer framework
            # This will:
            # Copy from the original distibution into DESTDIR/gstwork (if not already there)
            # Prune the framework, removing stuff we don't need
            # Relocate all dylibs so they can work under @executable_path/...
            # Copy the result into the app bundle
            # Make sure qgroundcontrol can find them
            message("Preparing GStreamer Framework")
            QMAKE_POST_LINK += && $$BASEDIR/tools/prepare_gstreamer_framework.sh $${OUT_PWD}/gstwork/ $${DESTDIR}/$${TARGET}.app $${TARGET}
        } else {
            message("Skipping GStreamer Framework")
        }
        # We cd to release directory so we can run macdeployqt without a path to the
        # qgroundcontrol.app file. If you specify a path to the .app file the symbolic
        # links to plugins will not be created correctly.
        QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt $${TARGET}.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src
        # macdeploy is missing some relocations once in a while. "Fix" it:
        QMAKE_POST_LINK += && python $$BASEDIR/tools/osxrelocator.py $${TARGET}.app/Contents @rpath @executable_path/../Frameworks -r > /dev/null 2>&1
        # Create package
        QMAKE_POST_LINK += && hdiutil create /tmp/tmp.dmg -ov -volname "$${TARGET}-$${MAC_VERSION}" -fs HFS+ -srcfolder "$${DESTDIR}/"
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && hdiutil convert /tmp/tmp.dmg -format UDBZ -o $${DESTDIR}/package/$${TARGET}.dmg
        QMAKE_POST_LINK += && rm /tmp/tmp.dmg
    }
    WindowsBuild {
        QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /DINSTALLER_ICON="\"$${QGC_INSTALLER_ICON}\"" /DHEADER_BITMAP="\"$${QGC_INSTALLER_HEADER_BITMAP}\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
        OTHER_FILES += deploy/qgroundcontrol_installer.nsi
    }
    LinuxBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p release/package
        QMAKE_POST_LINK += && tar -cjf release/package/QGroundControl.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
    }
    AndroidBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && make install INSTALL_ROOT=$${DESTDIR}/android-build/
        QMAKE_POST_LINK += && androiddeployqt --input android-libQGroundControl.so-deployment-settings.json --output $${DESTDIR}/android-build --deployment bundled --gradle --sign $${BASEDIR}/android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS)
        QMAKE_POST_LINK += && cp $${DESTDIR}/android-build/build/outputs/apk/android-build-release-signed.apk $${DESTDIR}/package/QGroundControl.apk
    }
}

# -------------------------------------------------
# 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
# License terms set in COPYING.md
# -------------------------------------------------

installer {
    DEFINES += QGC_INSTALL_RELEASE
    MacBuild {
        VideoEnabled {
            # Install the gstreamer framework
            # This will:
            # Copy from the original distibution into DESTDIR/gstwork (if not already there)
            # Prune the framework, removing stuff we don't need
            # Relocate all dylibs so they can work under @executable_path/...
            # Copy the result into the app bundle
            # Make sure qgroundcontrol can find them
            message("Preparing GStreamer Framework")
            QMAKE_POST_LINK += && $$BASEDIR/tools/prepare_gstreamer_framework.sh $${OUT_PWD}/gstwork/ $${DESTDIR}/$${TARGET}.app $${TARGET}
        } else {
            message("Skipping GStreamer Framework")
        }
        # We cd to release directory so we can run macdeployqt without a path to the
        # qgroundcontrol.app file. If you specify a path to the .app file the symbolic
        # links to plugins will not be created correctly.
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && cd $${DESTDIR} && $$dirname(QMAKE_QMAKE)/macdeployqt $${TARGET}.app -appstore-compliant -verbose=2 -qmldir=$${BASEDIR}/src
        # macdeploy is missing some relocations once in a while. "Fix" it:
        QMAKE_POST_LINK += && python $$BASEDIR/tools/osxrelocator.py $${TARGET}.app/Contents @rpath @executable_path/../Frameworks -r > /dev/null 2>&1
        # Create package
        QMAKE_POST_LINK += && hdiutil create /tmp/tmp.dmg -ov -volname "$${TARGET}-$${MAC_VERSION}" -fs HFS+ -srcfolder "$${DESTDIR}/"
        QMAKE_POST_LINK += && hdiutil convert /tmp/tmp.dmg -format UDBZ -o $${DESTDIR}/package/$${TARGET}.dmg
        QMAKE_POST_LINK += && rm /tmp/tmp.dmg
    }
    WindowsBuild {
        QMAKE_POST_LINK += $$escape_expand(\\n) cd $$BASEDIR_WIN && $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /DINSTALLER_ICON="\"$${QGC_INSTALLER_ICON}\"" /DHEADER_BITMAP="\"$${QGC_INSTALLER_HEADER_BITMAP}\"" /DAPPNAME="\"$${QGC_APP_NAME}\"" /DEXENAME="\"$${TARGET}\"" /DORGNAME="\"$${QGC_ORG_NAME}\"" /DDESTDIR=$${DESTDIR} /NOCD "\"/XOutFile $${DESTDIR_WIN}\\$${TARGET}-installer.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
        OTHER_FILES += deploy/qgroundcontrol_installer.nsi
    }
    LinuxBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p release/package
        QMAKE_POST_LINK += && tar -cjf release/package/QGroundControl.tar.bz2 release --exclude='package' --transform 's/release/qgroundcontrol/'
    }
    AndroidBuild {
        #-- TODO: This uses hardcoded paths. It should use $${DESTDIR}
        QMAKE_POST_LINK += && mkdir -p $${DESTDIR}/package
        QMAKE_POST_LINK += && make install INSTALL_ROOT=$${DESTDIR}/android-build/
        QMAKE_POST_LINK += && androiddeployqt --input android-libQGroundControl.so-deployment-settings.json --output $${DESTDIR}/android-build --deployment bundled --gradle --sign $${BASEDIR}/android/android_release.keystore dagar --storepass $$(ANDROID_STOREPASS)
        QMAKE_POST_LINK += && cp $${DESTDIR}/android-build/build/outputs/apk/android-build-release-signed.apk $${DESTDIR}/package/QGroundControl.apk
    }
}


fixed typo

fixed typo

CONFIG += console c++11
CONFIG -= app_bundle
CONFIG += test
DESTDIR = ../bin

QT -= gui
QT += testlib

include(../dependency.pri)

unix : LIBS += -ldl -L$$DESTDIR -lgamscpp
win32: LIBS += -L$$DESTDIR/ -lgamscpp

INCLUDEPATH += $$PWD/../src/

CONFIG += console c++11
CONFIG -= app_bundle
CONFIG += test
DESTDIR = ../bin

QT -= gui
QT += testlib

include(../dependency.pri)

unix : LIBS += -ldl -L$$DESTDIR/ -lgamscpp
win32: LIBS += -L$$DESTDIR/ -lgamscpp

INCLUDEPATH += $$PWD/../src/


libUtils likes capital 'U' to be linked correctly

Change-Id: I9b32e720ab31c369edc16e5fdcd956d22f6f7eac
Reviewed-by: Marco Bubke <5254e489b34ec8bbce36789100e3fc0f41fa62ef@digia.com>

TARGET = componentsplugin
TEMPLATE = lib
CONFIG += plugin

QT += qml

include (../designercore/iwidgetplugin.pri)
include (../qmldesigner_dependencies.pri)

LIBS += -L$$IDE_PLUGIN_PATH
LIBS += -l$$qtLibraryName(QmlDesigner)
LIBS += -l$$qtLibraryName(Core)
LIBS += -l$$qtLibraryName(Utils)

DEFINES += COMPONENTS_LIBRARY

RESOURCES += $$PWD/componentsplugin.qrc

HEADERS += \
    $$PWD/tabviewindexmodel.h \
    $$PWD/componentsplugin.h \
    $$PWD/../designercore/include/iwidgetplugin.h \
    $$PWD/addtabdesigneraction.h \
    $$PWD/addtabtotabviewdialog.h

SOURCES += \
    $$PWD/componentsplugin.cpp \
    $$PWD/tabviewindexmodel.cpp \
    $$PWD/addtabdesigneraction.cpp \
    $$PWD/addtabtotabviewdialog.cpp

FORMS += \
    $$PWD/addtabtotabviewdialog.ui

OTHER_FILES += $$PWD/components.metainfo

TARGET = componentsplugin
TEMPLATE = lib
CONFIG += plugin

QT += qml

include (../designercore/iwidgetplugin.pri)
include (../qmldesigner_dependencies.pri)

LIBS += -L$$IDE_PLUGIN_PATH
LIBS += -l$$qtLibraryName(QmlDesigner)
LIBS += -l$$qtLibraryName(Core)
LIBS += -l$$qtLibraryName(utils)

DEFINES += COMPONENTS_LIBRARY

RESOURCES += $$PWD/componentsplugin.qrc

HEADERS += \
    $$PWD/tabviewindexmodel.h \
    $$PWD/componentsplugin.h \
    $$PWD/../designercore/include/iwidgetplugin.h \
    $$PWD/addtabdesigneraction.h \
    $$PWD/addtabtotabviewdialog.h

SOURCES += \
    $$PWD/componentsplugin.cpp \
    $$PWD/tabviewindexmodel.cpp \
    $$PWD/addtabdesigneraction.cpp \
    $$PWD/addtabtotabviewdialog.cpp

FORMS += \
    $$PWD/addtabtotabviewdialog.ui

OTHER_FILES += $$PWD/components.metainfo