fix win lib path

fix win lib path

TEMPLATE = app

QT = core testlib datasync-private

CONFIG   += console
CONFIG   -= app_bundle

DEFINES += SRCDIR=\\\"$$_PRO_FILE_PWD_/\\\"

linux: BUILD_LIB_DIR = $$shadowed($$dirname(_QMAKE_CONF_))/lib
else: BUILD_LIB_DIR = $$OUT_PWD/../TestLib/

win32:CONFIG(release, debug|release): LIBS += -L$$BUILD_LIB_DIR/release -lTestLib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$BUILD_LIB_DIR/debug -lTestLib
else:unix: LIBS += -L$$BUILD_LIB_DIR -lTestLib

INCLUDEPATH += $$PWD/TestLib
DEPENDPATH += $$PWD/TestLib

!linux {
	win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/release/libTestLib.a
	else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/debug/libTestLib.a
	else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/release/TestLib.lib
	else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/debug/TestLib.lib
	else:unix: PRE_TARGETDEPS += $$OUT_PWD/../TestLib/libTestLib.a
}

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

mac: QMAKE_LFLAGS += '-Wl,-rpath,\'$$OUT_PWD/../../../../lib\''

DEFINES += KEYSTORE_PATH=\\\"$$OUT_PWD/../../../../plugins/keystores/\\\"

include(../../../src/3rdparty/cryptopp/cryptopp.pri)

TEMPLATE = app

QT = core testlib datasync-private

CONFIG   += console
CONFIG   -= app_bundle

DEFINES += SRCDIR=\\\"$$_PRO_FILE_PWD_/\\\"

linux: BUILD_LIB_DIR = $$shadowed($$dirname(_QMAKE_CONF_))/lib
else: BUILD_LIB_DIR = $$OUT_PWD/../TestLib/

win32:CONFIG(release, debug|release): LIBS += -L$$BUILD_LIB_DIR -lTestLib
else:win32:CONFIG(debug, debug|release): LIBS += -L$$BUILD_LIB_DIR -lTestLib
else:unix: LIBS += -L$$BUILD_LIB_DIR -lTestLib

INCLUDEPATH += $$PWD/TestLib
DEPENDPATH += $$PWD/TestLib

!linux {
	win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/release/libTestLib.a
	else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/debug/libTestLib.a
	else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/release/TestLib.lib
	else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../TestLib/debug/TestLib.lib
	else:unix: PRE_TARGETDEPS += $$OUT_PWD/../TestLib/libTestLib.a
}

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

mac: QMAKE_LFLAGS += '-Wl,-rpath,\'$$OUT_PWD/../../../../lib\''

DEFINES += KEYSTORE_PATH=\\\"$$OUT_PWD/../../../../plugins/keystores/\\\"

include(../../../src/3rdparty/cryptopp/cryptopp.pri)


QCGExternalLibs: Getting independent of dpkg

Basically unextracting the deb-file with ar and tar as dpkg would do, too.
This is more handy if you are in a non-Debian environment or very minimal one.

Signed-off-by: Thomas Karl Pietrowski <577bd929aac66f0b9c44f9468f77ade244b79210@gmail.com>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#
# [OPTIONAL] AirMap Support
#
contains (DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from command line)")
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from user_config.pri)")
} else {
    AIRMAP_PLATFORM_SDK_PATH    = $${OUT_PWD}/libs/airmap-platform-sdk
    AIRMAP_QT_PATH              = Qt.$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}
    message("Including support for AirMap")
    MacBuild {
        exists("$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH") {
            message("Including support for AirMap for macOS")
            LIBS += -L$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH -lairmap-qt
            DEFINES += QGC_AIRMAP_ENABLED
        }
    } else:LinuxBuild {
        #-- Download and install platform-sdk libs and headers iff they're not already in the build directory
        AIRMAP_PLATFORM_SDK_URL = "https://github.com/airmap/platform-sdk/releases/download/v1.1/airmap-platform-sdk-1.1.0-Linux.deb"
        AIRMAP_PLATFORM_SDK_FILENAME = "airmap-platform-sdk.deb"
        AIRMAP_PLATFORM_SDK_INSTALL_PREFIX = "airmap-platform-sdk"

        airmap_platform_sdk_install.target = $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap
        airmap_platform_sdk_install.commands = \
            rm -rf $${AIRMAP_PLATFORM_SDK_PATH} && \
            mkdir -p "$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}" && \
            mkdir -p "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap" && \
            wget -q -O "$${OUT_PWD}/$${AIRMAP_PLATFORM_SDK_FILENAME}" "$${AIRMAP_PLATFORM_SDK_URL}" && \
            ar p "$${AIRMAP_PLATFORM_SDK_FILENAME}" data.tar.gz | tar xvz -C "$${AIRMAP_PLATFORM_SDK_PATH}/" --strip-components=1 && \
            mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/lib/x86_64-linux-gnu/*" "$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}/" && \
            mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/include/airmap/*" "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/" && \
            rm -rf "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}" && \
            rm "$${AIRMAP_PLATFORM_SDK_FILENAME}"
        airmap_platform_sdk_install.depends =
        QMAKE_EXTRA_TARGETS += airmap_platform_sdk_install
        PRE_TARGETDEPS += $$airmap_platform_sdk_install.target

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#
# [OPTIONAL] AirMap Support
#
contains (DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from command line)")
# Otherwise the user can still disable this feature in the user_config.pri file.
} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_AIRMAP) {
    message("Skipping support for AirMap (manual override from user_config.pri)")
} else {
    AIRMAP_PLATFORM_SDK_PATH    = $${OUT_PWD}/libs/airmap-platform-sdk
    AIRMAP_QT_PATH              = Qt.$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}
    message("Including support for AirMap")
    MacBuild {
        exists("$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH") {
            message("Including support for AirMap for macOS")
            LIBS += -L$${AIRMAPD_PATH}/macOS/$$AIRMAP_QT_PATH -lairmap-qt
            DEFINES += QGC_AIRMAP_ENABLED
        }
    } else:LinuxBuild {
        #-- Download and install platform-sdk libs and headers iff they're not already in the build directory
        AIRMAP_PLATFORM_SDK_URL = "https://github.com/airmap/platform-sdk/releases/download/v1.1/airmap-platform-sdk-1.1.0-Linux.deb"
        AIRMAP_PLATFORM_SDK_FILENAME = "airmap-platform-sdk.deb"
        AIRMAP_PLATFORM_SDK_INSTALL_PREFIX = "airmap-platform-sdk"

        airmap_platform_sdk_install.target = $${AIRMAP_PLATFORM_SDK_PATH}/include/airmap
        airmap_platform_sdk_install.commands = \
            rm -rf $${AIRMAP_PLATFORM_SDK_PATH} && \
            mkdir -p "$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}" && \
            mkdir -p "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap" && \
            wget -q -O "$${OUT_PWD}/$${AIRMAP_PLATFORM_SDK_FILENAME}" "$${AIRMAP_PLATFORM_SDK_URL}" && dpkg -x "$${AIRMAP_PLATFORM_SDK_FILENAME} $${AIRMAP_PLATFORM_SDK_PATH}/" && \
            mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/lib/x86_64-linux-gnu/*" "$${AIRMAP_PLATFORM_SDK_PATH}/linux/$${AIRMAP_QT_PATH}/" && \
            mv -u "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}/include/airmap/*" "$${AIRMAP_PLATFORM_SDK_PATH}/include/airmap/" && \
            rm -rf "$${AIRMAP_PLATFORM_SDK_PATH}/$${AIRMAP_PLATFORM_SDK_INSTALL_PREFIX}" && \
            rm "$${AIRMAP_PLATFORM_SDK_FILENAME}"
        airmap_platform_sdk_install.depends =
        QMAKE_EXTRA_TARGETS += airmap_platform_sdk_install
        PRE_TARGETDEPS += $$airmap_platform_sdk_install.target

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


build: only use -isystem if Qt 5.8+

build: only use -isystem if Qt 5.8+

This uses $$take_first, which was only added in Qt 5.8.

include(check-version.pri)

# Treat Qt headers as system headers
# Only available for Qt 5.8+.
if(checkVersionAtLeast(5,8)) {
    QMAKE_CXXFLAGS += -isystem $$shell_quote($$[QT_INSTALL_HEADERS])
    for(module, QT) {
        equals(module, "testlib") {
            QMAKE_CXXFLAGS += \
                -isystem $$shell_quote($$[QT_INSTALL_HEADERS]/QtTest)
        } else {
            # Capitalize a first letter, result: -isystem .../include/QtCore
            moduleList = $$split(module, )
            QMAKE_CXXFLAGS += \
                -isystem $$shell_quote($$[QT_INSTALL_HEADERS]/Qt$$upper(\
                         $$take_first(moduleList))$$join(moduleList, ))
        }
    }
    unset(moduleList)
}

# Pick up extra flags from the environment
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_CFLAGS += $$(CFLAGS)
QMAKE_LFLAGS += $$(LDFLAGS)
env_CC = $$(QMAKE_CC)
!isEmpty(env_CC) {
	QMAKE_CC = $$(QMAKE_CC)
}
env_CXX = $$(QMAKE_CXX)
!isEmpty(env_CXX) {
	QMAKE_CXX = $$(QMAKE_CXX)
}
env_LINK = $$(QMAKE_LINK)
!isEmpty(env_LINK) {
	QMAKE_LINK = $$(QMAKE_LINK)
}

# Treat Qt headers as system headers
QMAKE_CXXFLAGS += -isystem $$shell_quote($$[QT_INSTALL_HEADERS])
for(module, QT) {
    equals(module, "testlib") {
        QMAKE_CXXFLAGS += \
            -isystem $$shell_quote($$[QT_INSTALL_HEADERS]/QtTest)
    } else {
        # Capitalize a first letter, result: -isystem .../include/QtCore
        moduleList = $$split(module, )
        QMAKE_CXXFLAGS += \
            -isystem $$shell_quote($$[QT_INSTALL_HEADERS]/Qt$$upper(\
                     $$take_first(moduleList))$$join(moduleList, ))
    }
}
unset(moduleList)

# Pick up extra flags from the environment
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_CFLAGS += $$(CFLAGS)
QMAKE_LFLAGS += $$(LDFLAGS)
env_CC = $$(QMAKE_CC)
!isEmpty(env_CC) {
	QMAKE_CC = $$(QMAKE_CC)
}
env_CXX = $$(QMAKE_CXX)
!isEmpty(env_CXX) {
	QMAKE_CXX = $$(QMAKE_CXX)
}
env_LINK = $$(QMAKE_LINK)
!isEmpty(env_LINK) {
	QMAKE_LINK = $$(QMAKE_LINK)
}


Version 1.4

Version 1.4


Version 0.140

Version 0.140


Version 5.3

Version 5.3


x2t version up 2.0.2.401

x2t version up 2.0.2.401

#-------------------------------------------------
#
# Project created by QtCreator 2014-10-03T18:30:31
#
#-------------------------------------------------

QT       -= core
QT       -= gui

VERSION = 2.0.2.421
DEFINES += INTVER=$$VERSION

TARGET = x2t

CORE_ROOT_DIR = $$PWD/../../..
PWD_ROOT_DIR = $$PWD

CONFIG += core_static_link_libstd
CONFIG += core_x2t
include(../../../Common/base.pri)
include(../../../Common/3dParty/icu/icu.pri)

core_windows {
    QMAKE_LFLAGS += /INCREMENTAL:NO

    contains(QMAKE_TARGET.arch, x86_64):{
        QMAKE_LFLAGS_CONSOLE  = /SUBSYSTEM:CONSOLE,5.02
    } else {
        QMAKE_LFLAGS_CONSOLE  = /SUBSYSTEM:CONSOLE,5.01
    }

} else {
    QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}

#CONFIG += build_for_centos6
build_for_centos6 {
    QMAKE_LFLAGS += -Wl,--dynamic-linker=./ld-linux-x86-64.so.2
}

DEFINES += UNICODE \
    _UNICODE \
    _USE_LIBXML2_READER_ \
    _USE_XMLLITE_READER_ \
    USE_LITE_READER \
    PPTX_DEF\
    PPT_DEF\
    ENABLE_PPT_TO_PPTX_CONVERT\
    NODOCX \
    #DISABLE_FILE_DOWNLOADER \
    FILTER_FLATE_DECODE_ENABLED \
    CXIMAGE_DONT_DECLARE_TCHAR \
    BUILD_CONFIG_FULL_VERSION \
    DONT_WRITE_EMBEDDED_FONTS \
    AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \
    LIBXML_READER_ENABLED

DEFINES += PDFREADER_USE_DYNAMIC_LIBRARY
DEFINES += PDFWRITER_USE_DYNAMIC_LIBRARY
DEFINES += XPS_USE_DYNAMIC_LIBRARY
DEFINES += DJVU_USE_DYNAMIC_LIBRARY
DEFINES += HTMLRENDERER_USE_DYNAMIC_LIBRARY
DEFINES += HTMLFILE_USE_DYNAMIC_LIBRARY
DEFINES += UNICODECONVERTER_USE_DYNAMIC_LIBRARY

core_windows {
    INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
}
core_mac {
    INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
}

INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include
INCLUDEPATH += ../../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../../DesktopEditor/agg-2.4/include

INCLUDEPATH += $$PWD/../../../Common/DocxFormat
DEPENDPATH += $$PWD/../../../Common/DocxFormat

INCLUDEPATH += $$PWD/../../../ASCOfficePPTXFile/
DEPENDPATH += $$PWD/../../../ASCOfficePPTXFile/

INCLUDEPATH += $$PWD/../../../ASCOfficePPTXFile/Editor/
DEPENDPATH += $$PWD/../../../ASCOfficePPTXFile/Editor/

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

INCLUDEPATH += $$PWD/../../../ASCOfficeDocxFile2
DEPENDPATH += $$PWD/../../../ASCOfficeDocxFile2

##############################################################################################################

SOURCES += ../../src/cextracttools.cpp \
    ../../../Common/OfficeFileFormatChecker2.cpp \
	../../src/ASCConverters.cpp
HEADERS += ../../src/cextracttools.h \
    ../../../Common/OfficeFileFormatChecker.h \
	../../src/ASCConverters.h \
	../../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h

#Xls file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXlsFormatLib
# odf format writer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOdfFileWriterLib
# odf format reader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOdfFileReaderLib
#doc file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDocFormatLib
# ppt file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPptFormatLib
#rtf file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lRtfFormatLib
#txt(xml) file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lTxtXmlFormatLib
# pdf writer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfWriter
#docxfile2
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lASCOfficeDocxFile2Lib
#pptxformat
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPPTXFormatLib
#docxformat
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDocxFormatLib
#office utils
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOfficeUtils
#graphics
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lgraphics
#doctrenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -ldoctrenderer
#HtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfReader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDjVuFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXpsFile
#HtmlFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlFile
#UnicodeConverter
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter
#Crypto++
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib

#####################################################
# внешнее подключение сторонних библиотек

#BOOST
CONFIG += core_boost_regex
include($$PWD/../../../Common/3dParty/boost/boost.pri)

core_windows {
    LIBS += -lurlmon
    LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -llibxml
}

core_linux {
    LIBS += -lz
    LIBS += -lxml2
    LIBS += -lcurl
}

mac {
    LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -llibxml
    LIBS += -framework AppKit
}
########################################################

#-------------------------------------------------
#
# Project created by QtCreator 2014-10-03T18:30:31
#
#-------------------------------------------------

QT       -= core
QT       -= gui

VERSION = 2.0.2.420
DEFINES += INTVER=$$VERSION

TARGET = x2t

CORE_ROOT_DIR = $$PWD/../../..
PWD_ROOT_DIR = $$PWD

CONFIG += core_static_link_libstd
CONFIG += core_x2t
include(../../../Common/base.pri)
include(../../../Common/3dParty/icu/icu.pri)

core_windows {
    QMAKE_LFLAGS += /INCREMENTAL:NO

    contains(QMAKE_TARGET.arch, x86_64):{
        QMAKE_LFLAGS_CONSOLE  = /SUBSYSTEM:CONSOLE,5.02
    } else {
        QMAKE_LFLAGS_CONSOLE  = /SUBSYSTEM:CONSOLE,5.01
    }

} else {
    QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
}

#CONFIG += build_for_centos6
build_for_centos6 {
    QMAKE_LFLAGS += -Wl,--dynamic-linker=./ld-linux-x86-64.so.2
}

DEFINES += UNICODE \
    _UNICODE \
    _USE_LIBXML2_READER_ \
    _USE_XMLLITE_READER_ \
    USE_LITE_READER \
    PPTX_DEF\
    PPT_DEF\
    ENABLE_PPT_TO_PPTX_CONVERT\
    NODOCX \
    #DISABLE_FILE_DOWNLOADER \
    FILTER_FLATE_DECODE_ENABLED \
    CXIMAGE_DONT_DECLARE_TCHAR \
    BUILD_CONFIG_FULL_VERSION \
    DONT_WRITE_EMBEDDED_FONTS \
    AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \
    LIBXML_READER_ENABLED

DEFINES += PDFREADER_USE_DYNAMIC_LIBRARY
DEFINES += PDFWRITER_USE_DYNAMIC_LIBRARY
DEFINES += XPS_USE_DYNAMIC_LIBRARY
DEFINES += DJVU_USE_DYNAMIC_LIBRARY
DEFINES += HTMLRENDERER_USE_DYNAMIC_LIBRARY
DEFINES += HTMLFILE_USE_DYNAMIC_LIBRARY
DEFINES += UNICODECONVERTER_USE_DYNAMIC_LIBRARY

core_windows {
    INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
}
core_mac {
    INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
}

INCLUDEPATH += ../../../DesktopEditor/xml/libxml2/include
INCLUDEPATH += ../../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../../DesktopEditor/agg-2.4/include

INCLUDEPATH += $$PWD/../../../Common/DocxFormat
DEPENDPATH += $$PWD/../../../Common/DocxFormat

INCLUDEPATH += $$PWD/../../../ASCOfficePPTXFile/
DEPENDPATH += $$PWD/../../../ASCOfficePPTXFile/

INCLUDEPATH += $$PWD/../../../ASCOfficePPTXFile/Editor/
DEPENDPATH += $$PWD/../../../ASCOfficePPTXFile/Editor/

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

INCLUDEPATH += $$PWD/../../../ASCOfficeDocxFile2
DEPENDPATH += $$PWD/../../../ASCOfficeDocxFile2

##############################################################################################################

SOURCES += ../../src/cextracttools.cpp \
    ../../../Common/OfficeFileFormatChecker2.cpp \
	../../src/ASCConverters.cpp
HEADERS += ../../src/cextracttools.h \
    ../../../Common/OfficeFileFormatChecker.h \
	../../src/ASCConverters.h \
	../../../DesktopEditor/graphics/MetafileToGraphicsRenderer.h

#Xls file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXlsFormatLib
# odf format writer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOdfFileWriterLib
# odf format reader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOdfFileReaderLib
#doc file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDocFormatLib
# ppt file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPptFormatLib
#rtf file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lRtfFormatLib
#txt(xml) file
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lTxtXmlFormatLib
# pdf writer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfWriter
#docxfile2
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lASCOfficeDocxFile2Lib
#pptxformat
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPPTXFormatLib
#docxformat
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDocxFormatLib
#office utils
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOfficeUtils
#graphics
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lgraphics
#doctrenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -ldoctrenderer
#HtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfReader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDjVuFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXpsFile
#HtmlFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlFile
#UnicodeConverter
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter
#Crypto++
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lCryptoPPLib

#####################################################
# внешнее подключение сторонних библиотек

#BOOST
CONFIG += core_boost_regex
include($$PWD/../../../Common/3dParty/boost/boost.pri)

core_windows {
    LIBS += -lurlmon
    LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -llibxml
}

core_linux {
    LIBS += -lz
    LIBS += -lxml2
    LIBS += -lcurl
}

mac {
    LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -llibxml
    LIBS += -framework AppKit
}
########################################################


compiler.pri: add CONFIG(verbose-linker) option for diagnosing MSVC runtime library issues.

include(qt.pri)

CONFIG *= warn_on

win32 {
	# Import dependency paths for windows
	include(winpaths_default.pri)

	INCLUDEPATH *= "$$BOOST_PATH/include"
	QMAKE_LIBDIR *= "$$OPENSSL_PATH/lib" "$$LIBSNDFILE_PATH/lib" "$$BOOST_PATH/lib"
	INCLUDEPATH *= "$$OPENSSL_PATH/include" "$$LIBSNDFILE_PATH/include"

	# Sanity check that DXSDK_DIR, LIB and INCLUDE are properly set up.
	#
	# On Windows/x86, we build using the VS2013 v120_xp toolchain, which targets
	# a slightly modified Win7 SDK that still allows building for Windows XP. In that
	# environment, we must use the "external" DirectX SDK (June 2010). This SDK is
	# specified via the SXSDK_DIR.
	#
	# On Windows/amd64, we build using the VS2013 v120 platform, and we target the
	# Windows 8.1 SDK. In this setup, we use the DirectX SDK included with the Windows
	# 8.1 SDK, but only to a point. The bundled SDK does not include all things that
	# we depend on for the overlay, such as d3dx{9,10,11}. To overcome this, we use
	# both SDKs: the one bundled with the Windows 8.1 SDK for most libraries, and the
	# external June 2010 variant for the things that are not in the Windows 8.1 SDK
	# variant of the DirectX SDK. This is the approach recommended by Microsoft:
	# http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275(v=vs.85).aspx
	# (see step 5).
	#
	# Because of these things, the Windows build currently expects the build environment
	# to properly set up the LIB and INCLUDE environment variables, with correct ordering
	# of the Windows SDK and DirectX depending on the platform we're targetting.
	# It's tough to check these things with qmake, we'll have to do with a simple sanity
	# check for the presence of the variables.
	DXSDK_DIR_VAR=$$(DXSDK_DIR)
	INCLUDE_VAR=$$(INCLUDE)
	LIB_VAR=$$(LIB)
	isEmpty(DXSDK_DIR_VAR) {
		error("Missing DXSDK_DIR environment variable. Are you missing the DirectX SDK (June 2010)?")
	}
	isEmpty(LIB_VAR) {
		error("The LIB environment variable is not set. Are you not in a build environment?")
	}
	isEmpty(INCLUDE_VAR) {
		error("The INCLUDE environment variable is not set. Are you not in a build environment?")
	}

	CONFIG(analyze) {
		QMAKE_CFLAGS_DEBUG *= /analyze
		QMAKE_CXXFLAGS_DEBUG *= /analyze
		QMAKE_CFLAGS_RELEASE *= /analyze
		QMAKE_CXXFLAGS_RELEASE *= /analyze

		# Do not treat warnings as errors when
		# running the static analyzer.
		# Otherwise, we won't get very far!
		CONFIG *= no-warnings-as-errors
	}

	!CONFIG(no-warnings-as-errors) {
		QMAKE_CFLAGS *= -WX
		QMAKE_CXXFLAGS *= -WX
	}

	# Increase the verbosity of the linker.
	# For now, only increases the verbosity
	# of searching for libraries.
	# This is useful when diagnosing libraries
	# that use a wrong runtime library DLL.
	CONFIG(verbose-linker) {
		QMAKE_LFLAGS *= /VERBOSE:LIB
	}

	# Increase PCH heap to 150MB: https://msdn.microsoft.com/en-us/library/bdscwf1c.aspx
	QMAKE_CFLAGS *= -Zm200
	QMAKE_CXXFLAGS *= -Zm200

	QMAKE_CFLAGS_RELEASE *= -Ox /fp:fast
	QMAKE_CXXFLAGS_RELEASE *= -Ox /fp:fast

	equals(QMAKE_TARGET.arch, x86) {
		QMAKE_LFLAGS_RELEASE -= /SafeSEH
	}

	# MSVS 2012 and 2013's cl.exe will generate SSE2 code by default,
	# unless an explict arch is set.
	# For our non-64 x86 builds, our binaries should not contain any
	# SSE2 code, so override the default by using -arch:SSE.
	equals(QMAKE_TARGET.arch, x86) {
		QMAKE_CFLAGS_RELEASE *= -arch:SSE
		QMAKE_CXXFLAGS_RELEASE *= -arch:SSE
	}

	# Qt 5.4 uses -Zc:strictStrings by default on MSVS 2013.
	# TextToSpeech_win.cpp uses sapi.h, which isn't compatible
	# with the strictStrings option due to bad conversions
	# in some of its functions's default parameters.
	QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings
	QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
	QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings
	QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings

	# Explicitly set the subsystem versions to
	# 5.01 (XP) for x86 and 6.00 (Vista) for x64.
	#
	# Qt expands the @QMAKE_SUBSYSTEM_SUFFIX@ via
	# qt_config.prf, which doesn't seem to trigger
	# for us. So we'll just try our luck.
	QMAKE_LFLAGS_CONSOLE -= /SUBSYSTEM:CONSOLE
	QMAKE_LFLAGS_CONSOLE -= /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@
	QMAKE_LFLAGS_WINDOWS -= /SUBSYSTEM:WINDOWS
	QMAKE_LFLAGS_WINDOWS -= /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@
	!isEmpty(QMAKE_LFLAGS_WINDOWS) {
		error("QMAKE_LFLAGS_WINDOWS is not empty. Please adjust the pri file.")
	}
	!isEmpty(QMAKE_LFLAGS_CONSOLE) {
		error("QMAKE_LFLAGS_CONSOLE is not empty. Please adjust the pri file.")
	}
	equals(QMAKE_TARGET.arch, x86) {
		QMAKE_LFLAGS_CONSOLE += /SUBSYSTEM:CONSOLE,5.01
		QMAKE_LFLAGS_WINDOWS += /SUBSYSTEM:WINDOWS,5.01
	}
	equals(QMAKE_TARGET.arch, x86_64) {
		QMAKE_LFLAGS_CONSOLE += /SUBSYSTEM:CONSOLE,6.00
		QMAKE_LFLAGS_WINDOWS += /SUBSYSTEM:WINDOWS,6.00
	}

	DEFINES *= RESTRICT=
	CONFIG(sse2) {
	      QMAKE_CFLAGS_RELEASE -= -arch:SSE
	      QMAKE_CFLAGS_DEBUG -= -arch:SSE
	      QMAKE_CFLAGS += -arch:SSE2
	}

	# Define the CONFIG options 'force-x86-toolchain' and
	# 'force-x86_64-toolchain'. These can be used to force
	# the target of a .pro file to be built for a specific
	# architecture, regardless of the actual architecture
	# used by the current build environment.
	FULL_MKSPEC_PATH = $$QMAKESPEC
	CURRENT_MKSPEC = $$basename(QMAKESPEC)

	CONFIG(force-x86-toolchain) {
		include(toolchain/$${CURRENT_MKSPEC}/x86-xp.toolchain)
	}

	CONFIG(force-x86_64-toolchain) {
		include(toolchain/$${CURRENT_MKSPEC}/x64.toolchain)
	}

	CONFIG(symbols) {
		# Configure build to be able to properly debug release builds
		# (https://msdn.microsoft.com/en-us/library/fsk896zz.aspx).
		# This includes explicitely disabling /Oy to help debugging
		# (https://msdn.microsoft.com/en-us/library/2kxx5t2c.aspx).
		# Also set /Zo to enhance optimized debugging
		# (https://msdn.microsoft.com/en-us/library/dn785163.aspx?f=255&MSPPError=-2147217396).
		QMAKE_CFLAGS_RELEASE -= -Oy
		QMAKE_CXXFLAGS_RELEASE -= -Oy

		QMAKE_CFLAGS_RELEASE *= -GR -Zi -Zo -Oy-
		QMAKE_CXXFLAGS_RELEASE *= -GR -Zi -Zo -Oy-

		QMAKE_LFLAGS *= /DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO
	}

	CONFIG(vld) {
		CONFIG(debug, debug|release) {
			DEFINES *= USE_VLD
			INCLUDEPATH *= "$$VLD_PATH/include"
			QMAKE_LIBDIR *= "$$VLD_PATH/lib"
		}
	}
}

unix {
	DEFINES *= RESTRICT=__restrict__
	QMAKE_CFLAGS *= -fvisibility=hidden
	QMAKE_CXXFLAGS *= -fvisibility=hidden
	QMAKE_OBJECTIVE_CFLAGS *= -fvisibility=hidden
	QMAKE_OBJECTIVE_CXXFLAGS *= -fvisibility=hidden

	QMAKE_CFLAGS	         *= -Wall -Wextra
	QMAKE_CXXFLAGS           *= -Wall -Wextra
	QMAKE_OBJECTIVE_CFLAGS   *= -Wall -Wextra
	QMAKE_OBJECTIVE_CXXFLAGS *= -Wall -Wextra

	!CONFIG(no-warnings-as-errors) {
		QMAKE_CFLAGS	         *= -Werror
		QMAKE_CXXFLAGS	         *= -Werror
		QMAKE_OBJECTIVE_CFLAGS   *= -Werror
		QMAKE_OBJECTIVE_CXXFLAGS *= -Werror
	}

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

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

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

freebsd {
	QMAKE_CFLAGS *= -isystem /usr/local/include
	QMAKE_CXXFLAGS *= -isystem /usr/local/include
	QMAKE_LIBDIR *= /usr/lib
	QMAKE_LIBDIR *= /usr/local/lib
}

unix:!macx {
	# If we're building in a Mumble build environment,
	# add its include and lib dirs to the build configuration.
	MUMBLE_PREFIX=$$(MUMBLE_PREFIX)
	!isEmpty(MUMBLE_PREFIX) {
		SYSTEM_INCLUDES = $$(MUMBLE_PREFIX)/include $$[QT_INSTALL_HEADERS]
		QMAKE_LIBDIR *= $$(MUMBLE_PREFIX)/lib

		for(inc, $$list($$SYSTEM_INCLUDES)) {
			QMAKE_CFLAGS += -isystem $$inc
			QMAKE_CXXFLAGS += -isystem $$inc
		}
	}

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

	QMAKE_CFLAGS *= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
	QMAKE_CXXFLAGS *= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
	QMAKE_LFLAGS *= -Wl,-z,relro -Wl,-z,now

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

macx {
	SYSTEM_INCLUDES = $$(MUMBLE_PREFIX)/include $$[QT_INSTALL_HEADERS]
	QMAKE_LIBDIR *= $$(MUMBLE_PREFIX)/lib

	for(inc, $$list($$SYSTEM_INCLUDES)) {
		QMAKE_CFLAGS += -isystem $$inc
		QMAKE_CXXFLAGS += -isystem $$inc
		QMAKE_OBJECTIVE_CFLAGS += -isystem $$inc
		QMAKE_OBJECTIVE_CXXFLAGS += -isystem $$inc
	}

	!CONFIG(universal) {
		CONFIG += no-pch

		# Qt 5.1 and greater want short-form OS X SDKs.
		isEqual(QT_MAJOR_VERSION, 5) {
			QMAKE_MAC_SDK = macosx
		} else {
			QMAKE_MAC_SDK = $$system(xcrun --sdk macosx --show-sdk-path 2>/dev/null)
			isEmpty(QMAKE_MAC_SDK) {
				QMAKE_MAC_SDK = $$system(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
				!exists($$QMAKE_MAC_SDK) {
					message("Unable to find usable OS X SDK")
					error("Aborting build")
				}
			}
		}

		QMAKE_CC = $$system(xcrun -find clang)
		QMAKE_CXX = $$system(xcrun -find clang++)
		QMAKE_LINK = $$system(xcrun -find clang++)
		QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
		QMAKE_CFLAGS += -mmacosx-version-min=10.7
		QMAKE_CXXFLAGS += -mmacosx-version-min=10.7
		QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.7
		QMAKE_OBJECTIVE_CXXFLAGS += -mmacosx-version-min=10.7
	} else {
		XCODE_PATH=$$system(xcode-select -print-path)
		CONFIG += x86 ppc no-cocoa
		QMAKE_MAC_SDK = $${XCODE_PATH}/SDKs/MacOSX10.5.sdk
		QMAKE_CC = $${XCODE_PATH}/usr/bin/gcc-4.2
		QMAKE_CXX = $${XCODE_PATH}/usr/bin/g++-4.2
		QMAKE_LINK = $${XCODE_PATH}/usr/bin/g++-4.2
		QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
		QMAKE_CFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		QMAKE_CXXFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		QMAKE_OBJECTIVE_CXXFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		DEFINES += USE_MAC_UNIVERSAL
	}

	QMAKE_LFLAGS += -Wl,-dead_strip -framework Cocoa -framework Carbon

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

CONFIG(clang-analyzer) {
	QMAKE_CC = $$(CC)
	QMAKE_CXX = $$(CXX)
}

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

CONFIG(debug, debug|release) {
	DEFINES *= SNAPSHOT_BUILD
}

include(qt.pri)

CONFIG *= warn_on

win32 {
	# Import dependency paths for windows
	include(winpaths_default.pri)

	INCLUDEPATH *= "$$BOOST_PATH/include"
	QMAKE_LIBDIR *= "$$OPENSSL_PATH/lib" "$$LIBSNDFILE_PATH/lib" "$$BOOST_PATH/lib"
	INCLUDEPATH *= "$$OPENSSL_PATH/include" "$$LIBSNDFILE_PATH/include"

	# Sanity check that DXSDK_DIR, LIB and INCLUDE are properly set up.
	#
	# On Windows/x86, we build using the VS2013 v120_xp toolchain, which targets
	# a slightly modified Win7 SDK that still allows building for Windows XP. In that
	# environment, we must use the "external" DirectX SDK (June 2010). This SDK is
	# specified via the SXSDK_DIR.
	#
	# On Windows/amd64, we build using the VS2013 v120 platform, and we target the
	# Windows 8.1 SDK. In this setup, we use the DirectX SDK included with the Windows
	# 8.1 SDK, but only to a point. The bundled SDK does not include all things that
	# we depend on for the overlay, such as d3dx{9,10,11}. To overcome this, we use
	# both SDKs: the one bundled with the Windows 8.1 SDK for most libraries, and the
	# external June 2010 variant for the things that are not in the Windows 8.1 SDK
	# variant of the DirectX SDK. This is the approach recommended by Microsoft:
	# http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275(v=vs.85).aspx
	# (see step 5).
	#
	# Because of these things, the Windows build currently expects the build environment
	# to properly set up the LIB and INCLUDE environment variables, with correct ordering
	# of the Windows SDK and DirectX depending on the platform we're targetting.
	# It's tough to check these things with qmake, we'll have to do with a simple sanity
	# check for the presence of the variables.
	DXSDK_DIR_VAR=$$(DXSDK_DIR)
	INCLUDE_VAR=$$(INCLUDE)
	LIB_VAR=$$(LIB)
	isEmpty(DXSDK_DIR_VAR) {
		error("Missing DXSDK_DIR environment variable. Are you missing the DirectX SDK (June 2010)?")
	}
	isEmpty(LIB_VAR) {
		error("The LIB environment variable is not set. Are you not in a build environment?")
	}
	isEmpty(INCLUDE_VAR) {
		error("The INCLUDE environment variable is not set. Are you not in a build environment?")
	}

	CONFIG(analyze) {
		QMAKE_CFLAGS_DEBUG *= /analyze
		QMAKE_CXXFLAGS_DEBUG *= /analyze
		QMAKE_CFLAGS_RELEASE *= /analyze
		QMAKE_CXXFLAGS_RELEASE *= /analyze

		# Do not treat warnings as errors when
		# running the static analyzer.
		# Otherwise, we won't get very far!
		CONFIG *= no-warnings-as-errors
	}

	!CONFIG(no-warnings-as-errors) {
		QMAKE_CFLAGS *= -WX
		QMAKE_CXXFLAGS *= -WX
	}

	# Increase PCH heap to 150MB: https://msdn.microsoft.com/en-us/library/bdscwf1c.aspx
	QMAKE_CFLAGS *= -Zm200
	QMAKE_CXXFLAGS *= -Zm200

	QMAKE_CFLAGS_RELEASE *= -Ox /fp:fast
	QMAKE_CXXFLAGS_RELEASE *= -Ox /fp:fast

	equals(QMAKE_TARGET.arch, x86) {
		QMAKE_LFLAGS_RELEASE -= /SafeSEH
	}

	# MSVS 2012 and 2013's cl.exe will generate SSE2 code by default,
	# unless an explict arch is set.
	# For our non-64 x86 builds, our binaries should not contain any
	# SSE2 code, so override the default by using -arch:SSE.
	equals(QMAKE_TARGET.arch, x86) {
		QMAKE_CFLAGS_RELEASE *= -arch:SSE
		QMAKE_CXXFLAGS_RELEASE *= -arch:SSE
	}

	# Qt 5.4 uses -Zc:strictStrings by default on MSVS 2013.
	# TextToSpeech_win.cpp uses sapi.h, which isn't compatible
	# with the strictStrings option due to bad conversions
	# in some of its functions's default parameters.
	QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings
	QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
	QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings
	QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings

	# Explicitly set the subsystem versions to
	# 5.01 (XP) for x86 and 6.00 (Vista) for x64.
	#
	# Qt expands the @QMAKE_SUBSYSTEM_SUFFIX@ via
	# qt_config.prf, which doesn't seem to trigger
	# for us. So we'll just try our luck.
	QMAKE_LFLAGS_CONSOLE -= /SUBSYSTEM:CONSOLE
	QMAKE_LFLAGS_CONSOLE -= /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@
	QMAKE_LFLAGS_WINDOWS -= /SUBSYSTEM:WINDOWS
	QMAKE_LFLAGS_WINDOWS -= /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@
	!isEmpty(QMAKE_LFLAGS_WINDOWS) {
		error("QMAKE_LFLAGS_WINDOWS is not empty. Please adjust the pri file.")
	}
	!isEmpty(QMAKE_LFLAGS_CONSOLE) {
		error("QMAKE_LFLAGS_CONSOLE is not empty. Please adjust the pri file.")
	}
	equals(QMAKE_TARGET.arch, x86) {
		QMAKE_LFLAGS_CONSOLE += /SUBSYSTEM:CONSOLE,5.01
		QMAKE_LFLAGS_WINDOWS += /SUBSYSTEM:WINDOWS,5.01
	}
	equals(QMAKE_TARGET.arch, x86_64) {
		QMAKE_LFLAGS_CONSOLE += /SUBSYSTEM:CONSOLE,6.00
		QMAKE_LFLAGS_WINDOWS += /SUBSYSTEM:WINDOWS,6.00
	}

	DEFINES *= RESTRICT=
	CONFIG(sse2) {
	      QMAKE_CFLAGS_RELEASE -= -arch:SSE
	      QMAKE_CFLAGS_DEBUG -= -arch:SSE
	      QMAKE_CFLAGS += -arch:SSE2
	}

	# Define the CONFIG options 'force-x86-toolchain' and
	# 'force-x86_64-toolchain'. These can be used to force
	# the target of a .pro file to be built for a specific
	# architecture, regardless of the actual architecture
	# used by the current build environment.
	FULL_MKSPEC_PATH = $$QMAKESPEC
	CURRENT_MKSPEC = $$basename(QMAKESPEC)

	CONFIG(force-x86-toolchain) {
		include(toolchain/$${CURRENT_MKSPEC}/x86-xp.toolchain)
	}

	CONFIG(force-x86_64-toolchain) {
		include(toolchain/$${CURRENT_MKSPEC}/x64.toolchain)
	}

	CONFIG(symbols) {
		# Configure build to be able to properly debug release builds
		# (https://msdn.microsoft.com/en-us/library/fsk896zz.aspx).
		# This includes explicitely disabling /Oy to help debugging
		# (https://msdn.microsoft.com/en-us/library/2kxx5t2c.aspx).
		# Also set /Zo to enhance optimized debugging
		# (https://msdn.microsoft.com/en-us/library/dn785163.aspx?f=255&MSPPError=-2147217396).
		QMAKE_CFLAGS_RELEASE -= -Oy
		QMAKE_CXXFLAGS_RELEASE -= -Oy

		QMAKE_CFLAGS_RELEASE *= -GR -Zi -Zo -Oy-
		QMAKE_CXXFLAGS_RELEASE *= -GR -Zi -Zo -Oy-

		QMAKE_LFLAGS *= /DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO
	}

	CONFIG(vld) {
		CONFIG(debug, debug|release) {
			DEFINES *= USE_VLD
			INCLUDEPATH *= "$$VLD_PATH/include"
			QMAKE_LIBDIR *= "$$VLD_PATH/lib"
		}
	}
}

unix {
	DEFINES *= RESTRICT=__restrict__
	QMAKE_CFLAGS *= -fvisibility=hidden
	QMAKE_CXXFLAGS *= -fvisibility=hidden
	QMAKE_OBJECTIVE_CFLAGS *= -fvisibility=hidden
	QMAKE_OBJECTIVE_CXXFLAGS *= -fvisibility=hidden

	QMAKE_CFLAGS	         *= -Wall -Wextra
	QMAKE_CXXFLAGS           *= -Wall -Wextra
	QMAKE_OBJECTIVE_CFLAGS   *= -Wall -Wextra
	QMAKE_OBJECTIVE_CXXFLAGS *= -Wall -Wextra

	!CONFIG(no-warnings-as-errors) {
		QMAKE_CFLAGS	         *= -Werror
		QMAKE_CXXFLAGS	         *= -Werror
		QMAKE_OBJECTIVE_CFLAGS   *= -Werror
		QMAKE_OBJECTIVE_CXXFLAGS *= -Werror
	}

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

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

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

freebsd {
	QMAKE_CFLAGS *= -isystem /usr/local/include
	QMAKE_CXXFLAGS *= -isystem /usr/local/include
	QMAKE_LIBDIR *= /usr/lib
	QMAKE_LIBDIR *= /usr/local/lib
}

unix:!macx {
	# If we're building in a Mumble build environment,
	# add its include and lib dirs to the build configuration.
	MUMBLE_PREFIX=$$(MUMBLE_PREFIX)
	!isEmpty(MUMBLE_PREFIX) {
		SYSTEM_INCLUDES = $$(MUMBLE_PREFIX)/include $$[QT_INSTALL_HEADERS]
		QMAKE_LIBDIR *= $$(MUMBLE_PREFIX)/lib

		for(inc, $$list($$SYSTEM_INCLUDES)) {
			QMAKE_CFLAGS += -isystem $$inc
			QMAKE_CXXFLAGS += -isystem $$inc
		}
	}

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

	QMAKE_CFLAGS *= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
	QMAKE_CXXFLAGS *= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
	QMAKE_LFLAGS *= -Wl,-z,relro -Wl,-z,now

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

macx {
	SYSTEM_INCLUDES = $$(MUMBLE_PREFIX)/include $$[QT_INSTALL_HEADERS]
	QMAKE_LIBDIR *= $$(MUMBLE_PREFIX)/lib

	for(inc, $$list($$SYSTEM_INCLUDES)) {
		QMAKE_CFLAGS += -isystem $$inc
		QMAKE_CXXFLAGS += -isystem $$inc
		QMAKE_OBJECTIVE_CFLAGS += -isystem $$inc
		QMAKE_OBJECTIVE_CXXFLAGS += -isystem $$inc
	}

	!CONFIG(universal) {
		CONFIG += no-pch

		# Qt 5.1 and greater want short-form OS X SDKs.
		isEqual(QT_MAJOR_VERSION, 5) {
			QMAKE_MAC_SDK = macosx
		} else {
			QMAKE_MAC_SDK = $$system(xcrun --sdk macosx --show-sdk-path 2>/dev/null)
			isEmpty(QMAKE_MAC_SDK) {
				QMAKE_MAC_SDK = $$system(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
				!exists($$QMAKE_MAC_SDK) {
					message("Unable to find usable OS X SDK")
					error("Aborting build")
				}
			}
		}

		QMAKE_CC = $$system(xcrun -find clang)
		QMAKE_CXX = $$system(xcrun -find clang++)
		QMAKE_LINK = $$system(xcrun -find clang++)
		QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
		QMAKE_CFLAGS += -mmacosx-version-min=10.7
		QMAKE_CXXFLAGS += -mmacosx-version-min=10.7
		QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.7
		QMAKE_OBJECTIVE_CXXFLAGS += -mmacosx-version-min=10.7
	} else {
		XCODE_PATH=$$system(xcode-select -print-path)
		CONFIG += x86 ppc no-cocoa
		QMAKE_MAC_SDK = $${XCODE_PATH}/SDKs/MacOSX10.5.sdk
		QMAKE_CC = $${XCODE_PATH}/usr/bin/gcc-4.2
		QMAKE_CXX = $${XCODE_PATH}/usr/bin/g++-4.2
		QMAKE_LINK = $${XCODE_PATH}/usr/bin/g++-4.2
		QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4
		QMAKE_CFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		QMAKE_CXXFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		QMAKE_OBJECTIVE_CFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		QMAKE_OBJECTIVE_CXXFLAGS += -mmacosx-version-min=10.4 -Xarch_i386 -mmmx -Xarch_i386 -msse -Xarch_i386 -msse2
		DEFINES += USE_MAC_UNIVERSAL
	}

	QMAKE_LFLAGS += -Wl,-dead_strip -framework Cocoa -framework Carbon

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

CONFIG(clang-analyzer) {
	QMAKE_CC = $$(CC)
	QMAKE_CXX = $$(CXX)
}

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

CONFIG(debug, debug|release) {
	DEFINES *= SNAPSHOT_BUILD
}


QmlDesigner: V8 is not anymore present in 5.2

Change-Id: Ie154a02719f4706b9edc872767b137fe6f9977bc
Reviewed-by: Maurice Kalinowski <4a4c8e0f704a5a30e402fd2bb0da8c84a569e2df@digia.com>
Reviewed-by: Thomas Hartmann <588ee739c05aab7547907becfd1420d2b7316069@digia.com>

QT += core gui widgets qml quick network
!isEmpty(QT.webkit.name) {
    QT += webkit
}

!isEmpty(QT.v8.name) {
    QT += v8
}

QT += core-private qml-private quick-private gui-private script-private

!isEmpty(QT.v8.name) {
    QT += v8-private
}

!macx {
    CONFIG += c++11
}

DEFINES += QWEAKPOINTER_ENABLE_ARROW

include (../instances/instances.pri)
include (instances/instances.pri)
include (../commands/commands.pri)
include (../container/container.pri)
include (../interfaces/interfaces.pri)

QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
!isEmpty(QT_BREAKPAD_ROOT_PATH) {
    include($$QT_BREAKPAD_ROOT_PATH/qtbreakpad.pri)
}

SOURCES +=  $$PWD/qml2puppetmain.cpp
RESOURCES +=  $$PWD/../qmlpuppet.qrc
DEFINES -= QT_NO_CAST_FROM_ASCII

OTHER_FILES += Info.plist.in
macx {
    isEmpty(QTCREATOR_PRI_INCLUDED) {
        # So this .pri file is used by
        # compiling the sources that were deployed to Qt Creator,
        # and the Info.plist was generated by static.pro at build time
        QMAKE_INFO_PLIST = $$PWD/Info.plist
    } else {
        # So this .pri file is used from Qt Creator source tree,
        # and we need to generate the Info.plist
        info.input = $$PWD/Info.plist.in
        info.output = $$DESTDIR/$${TARGET}.app/Contents/Info.plist
        QMAKE_SUBSTITUTES += info
    }
} else {
    target.path  = $$QTC_PREFIX/bin
    INSTALLS    += target
}

QT += core gui widgets qml quick network v8
!isEmpty(QT.webkit.name) {
    QT += webkit
}

QT += core-private qml-private quick-private gui-private script-private v8-private

!macx {
    CONFIG += c++11
}

DEFINES += QWEAKPOINTER_ENABLE_ARROW

include (../instances/instances.pri)
include (instances/instances.pri)
include (../commands/commands.pri)
include (../container/container.pri)
include (../interfaces/interfaces.pri)

QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
!isEmpty(QT_BREAKPAD_ROOT_PATH) {
    include($$QT_BREAKPAD_ROOT_PATH/qtbreakpad.pri)
}

SOURCES +=  $$PWD/qml2puppetmain.cpp
RESOURCES +=  $$PWD/../qmlpuppet.qrc
DEFINES -= QT_NO_CAST_FROM_ASCII

OTHER_FILES += Info.plist.in
macx {
    isEmpty(QTCREATOR_PRI_INCLUDED) {
        # So this .pri file is used by
        # compiling the sources that were deployed to Qt Creator,
        # and the Info.plist was generated by static.pro at build time
        QMAKE_INFO_PLIST = $$PWD/Info.plist
    } else {
        # So this .pri file is used from Qt Creator source tree,
        # and we need to generate the Info.plist
        info.input = $$PWD/Info.plist.in
        info.output = $$DESTDIR/$${TARGET}.app/Contents/Info.plist
        QMAKE_SUBSTITUTES += info
    }
} else {
    target.path  = $$QTC_PREFIX/bin
    INSTALLS    += target
}


libssh2.pri: added LIBS += -lz

libssh2.pri: added LIBS += -lz

INCLUDEPATH +=  $$PWD/libssh2/include \
                $$PWD/libssh2/include \
                $$PWD/libssh2/src

SOURCES += $$PWD/libssh2/src/agent.c \
           $$PWD/libssh2/src/channel.c \
           $$PWD/libssh2/src/comp.c \
           $$PWD/libssh2/src/crypt.c \
           $$PWD/libssh2/src/global.c \
           $$PWD/libssh2/src/hostkey.c \
           $$PWD/libssh2/src/keepalive.c \
           $$PWD/libssh2/src/kex.c \
           $$PWD/libssh2/src/knownhost.c \
           $$PWD/libssh2/src/libgcrypt.c \
           $$PWD/libssh2/src/mac.c \
           $$PWD/libssh2/src/misc.c \
           $$PWD/libssh2/src/openssl.c \
           $$PWD/libssh2/src/packet.c \
           $$PWD/libssh2/src/pem.c \
           $$PWD/libssh2/src/publickey.c \
           $$PWD/libssh2/src/scp.c \
           $$PWD/libssh2/src/session.c \
           $$PWD/libssh2/src/sftp.c \
           $$PWD/libssh2/src/transport.c \
           $$PWD/libssh2/src/userauth.c \
           $$PWD/libssh2/src/version.c

win32{
 INCLUDEPATH +=  $$PWD/libssh2/win32/
}

!win32:!symbian{
  INCLUDEPATH +=  $$PWD/linux
  LIBS+=-lcrypto -lz
}

INCLUDEPATH +=  $$PWD/libssh2/include \
                $$PWD/libssh2/include \
                $$PWD/libssh2/src

SOURCES += $$PWD/libssh2/src/agent.c \
           $$PWD/libssh2/src/channel.c \
           $$PWD/libssh2/src/comp.c \
           $$PWD/libssh2/src/crypt.c \
           $$PWD/libssh2/src/global.c \
           $$PWD/libssh2/src/hostkey.c \
           $$PWD/libssh2/src/keepalive.c \
           $$PWD/libssh2/src/kex.c \
           $$PWD/libssh2/src/knownhost.c \
           $$PWD/libssh2/src/libgcrypt.c \
           $$PWD/libssh2/src/mac.c \
           $$PWD/libssh2/src/misc.c \
           $$PWD/libssh2/src/openssl.c \
           $$PWD/libssh2/src/packet.c \
           $$PWD/libssh2/src/pem.c \
           $$PWD/libssh2/src/publickey.c \
           $$PWD/libssh2/src/scp.c \
           $$PWD/libssh2/src/session.c \
           $$PWD/libssh2/src/sftp.c \
           $$PWD/libssh2/src/transport.c \
           $$PWD/libssh2/src/userauth.c \
           $$PWD/libssh2/src/version.c

win32{
 INCLUDEPATH +=  $$PWD/libssh2/win32/
}

!win32:!symbian{
  INCLUDEPATH +=  $$PWD/linux
  LIBS+=-lcrypto
}


Add wayland_common static lib to PRE_TARGETDEPS

Previously, if a change was made to libwayland_common.a after the first
build, the platform plugins were not re-linked against the new library.
By adding the library to the PRE_TARGETDEPS of the platform plugins,
this assures that if the wayland_common library changes, the plugin gets
relinked.

Change-Id: Ia8b3e9c5d92c9ed21bba196897f6b9fa70b6f889
Reviewed-by: Paul Olav Tvete <97541fb6312d77f06e19078c7c70b2c1f75fb828@digia.com>
Reviewed-by: Oswald Buddenhagen <6a8868beda3e139b5ac22b2534a23d3e6ba81819@digia.com>
Reviewed-by: Jørgen Lind <6105bb7d7ebdd613cef5835c4a38d29949bd95ac@gmail.com>

QT += core-private gui-private platformsupport-private
CONFIG += link_pkgconfig qpa/genericunixfontdatabase

!equals(QT_WAYLAND_GL_CONFIG, nogl) {
    DEFINES += QT_WAYLAND_GL_SUPPORT
}

config_xkbcommon {
    !contains(QT_CONFIG, no-pkg-config) {
        PKGCONFIG += xkbcommon
    } else {
        LIBS += -lxkbcommon
    }
} else {
    DEFINES += QT_NO_WAYLAND_XKB
}

INCLUDEPATH += $$PWD $$PWD/../../../shared

!contains(QT_CONFIG, no-pkg-config) {
    PKGCONFIG += wayland-client wayland-cursor
} else {
    LIBS += -lwayland-client -lwayland-cursor
}

staticlib = $$PWD/libwayland_common.$${QMAKE_EXTENSION_STATICLIB}
LIBS += $$staticlib
PRE_TARGETDEPS += $$staticlib

QT += core-private gui-private platformsupport-private
CONFIG += link_pkgconfig qpa/genericunixfontdatabase

!equals(QT_WAYLAND_GL_CONFIG, nogl) {
    DEFINES += QT_WAYLAND_GL_SUPPORT
}

config_xkbcommon {
    !contains(QT_CONFIG, no-pkg-config) {
        PKGCONFIG += xkbcommon
    } else {
        LIBS += -lxkbcommon
    }
} else {
    DEFINES += QT_NO_WAYLAND_XKB
}

INCLUDEPATH += $$PWD $$PWD/../../../shared

!contains(QT_CONFIG, no-pkg-config) {
    PKGCONFIG += wayland-client wayland-cursor
} else {
    LIBS += -lwayland-client -lwayland-cursor
}

LIBS += $$PWD/libwayland_common.a


Fixed #130 DEPENTPATH = DEPENDPATH?

Fixed #130 DEPENTPATH = DEPENDPATH?

INCLUDEPATH += $${QXT_SOURCE_TREE}/include
DEPENDPATH += $${QXT_SOURCE_TREE}/include
QMAKE_RPATHDIR += $${QXT_BUILD_TREE}/lib
macx:LIBS += -F$${QXT_BUILD_TREE}/lib
LIBS += -L$${QXT_BUILD_TREE}/lib

defineTest(qxtAddLibrary) {
    INCLUDEPATH += $${QXT_SOURCE_TREE}/src/$$1
    INCLUDEPATH += $${QXT_SOURCE_TREE}/include/$$2
    DEPENDPATH += $${QXT_SOURCE_TREE}/src/$$1
    DEPENDPATH += $${QXT_SOURCE_TREE}/include/$$2
    qtAddLibrary($$2)
}

contains(QXT, berkeley) {
    qxtAddLibrary(berkeley, QxtBerkeley)
    QXT += core
}

contains(QXT, web) {
    qxtAddLibrary(web, QxtWeb)
    QXT += core network
    QT  += network
}

contains(QXT, gui) {
    qxtAddLibrary(gui, QxtGui)
    QXT += core
    QT  += gui
}

contains(QXT, network) {
    qxtAddLibrary(network, QxtNetwork)
    QXT += core
    QT  += network
}

contains(QXT, sql) {
    qxtAddLibrary(sql, QxtSql)
    QXT += core
    QT  += sql
}

contains(QXT, core) {
    qxtAddLibrary(core, QxtCore)
}

INCLUDEPATH += $${QXT_SOURCE_TREE}/include
DEPENDPATH += $${QXT_SOURCE_TREE}/include
QMAKE_RPATHDIR += $${QXT_BUILD_TREE}/lib
macx:LIBS += -F$${QXT_BUILD_TREE}/lib
LIBS += -L$${QXT_BUILD_TREE}/lib

defineTest(qxtAddLibrary) {
    INCLUDEPATH += $${QXT_SOURCE_TREE}/src/$$1
    INCLUDEPATH += $${QXT_SOURCE_TREE}/include/$$2
    DEPENDPATH += $${QXT_SOURCE_TREE}/src/$$1
    DEPENTPATH += $${QXT_SOURCE_TREE}/include/$$2
    qtAddLibrary($$2)
}

contains(QXT, berkeley) {
    qxtAddLibrary(berkeley, QxtBerkeley)
    QXT += core
}

contains(QXT, web) {
    qxtAddLibrary(web, QxtWeb)
    QXT += core network
    QT  += network
}

contains(QXT, gui) {
    qxtAddLibrary(gui, QxtGui)
    QXT += core
    QT  += gui
}

contains(QXT, network) {
    qxtAddLibrary(network, QxtNetwork)
    QXT += core
    QT  += network
}

contains(QXT, sql) {
    qxtAddLibrary(sql, QxtSql)
    QXT += core
    QT  += sql
}

contains(QXT, core) {
    qxtAddLibrary(core, QxtCore)
}


fixed PRE_TARGETDEPS

fixed PRE_TARGETDEPS

# SourceMap-Qt
# (C) Copyright 2014 HicknHack Software GmbH
#
# The original code can be found at:
#    https://github.com/hicknhack-software/SourceMap-Qt
#
# 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.
TEMPLATE = app
CONFIG += console

include(_common.pri)

# SourceMap {
LIBS += -L$$LIB_PATH -lSourceMap
DEPENDPATH += $$DESTDIR

win32:!win32-g++: PRE_TARGETDEPS += $$LIB_PATH/SourceMap.lib
else: PRE_TARGETDEPS += $$LIB_PATH/libSourceMap.a
# }

# SourceMap-Qt
# (C) Copyright 2014 HicknHack Software GmbH
#
# The original code can be found at:
#    https://github.com/hicknhack-software/SourceMap-Qt
#
# 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.
TEMPLATE = app
CONFIG += console

include(_common.pri)

# SourceMap {
LIBS += -L$$LIB_PATH -lSourceMap
DEPENDPATH += $$DESTDIR

win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$LIB_PATH/SourceMap.lib
else: PRE_TARGETDEPS += $$LIB_PATH/libSourceMap.a
# }


Include build includes first

Include build includes first


Ensure that symbian test code uses correct include directories

# Symbian plugin header and source files
SYMBIAN_PATHS += \
        ..\inc \
        ..\rss \
        ..\..\..\..\src\contacts \
        ..\..\..\..\src\contacts\details \
        ..\..\..\..\src\contacts\filters \
        ..\..\..\..\src\contacts\requests

SYMBIAN_HEADERS += \
        ../inc/cntsymbianengine.h \
        ../inc/cnttransformcontact.h \
        ../inc/cnttransformcontactdata.h \
        ../inc/cnttransformname.h \
        ../inc/cnttransformnickname.h \
        ../inc/cnttransformphonenumber.h \
        ../inc/cnttransformemail.h \
        ../inc/cnttransformaddress.h \
        ../inc/cnttransformurl.h \
        ../inc/cnttransformbirthday.h \
        ../inc/cnttransformonlineaccount.h \
        ../inc/cnttransformorganisation.h \
        ../inc/cnttransformavatar.h \
        ../inc/cnttransformavatarsimple.h \
        ../inc/cntthumbnailcreator.h \
        ../inc/cnttransformsynctarget.h \
        ../inc/cnttransformgender.h \
        ../inc/cnttransformanniversary.h \
        ../inc/cnttransformanniversarysimple.h \
        ../inc/cnttransformgeolocation.h \
        ../inc/cnttransformnote.h \
        ../inc/cnttransformfamily.h \
        ../inc/cnttransformempty.h \
        ../inc/cntabstractcontactfilter.h \
        ../inc/cntsymbianfilterdbms.h \
        ../inc/cntsymbianfiltersql.h \
        ../inc/cntsymbiansorterdbms.h \
        ../inc/cntabstractcontactsorter.h \
        ../inc/cntrelationship.h \
        ../inc/cntabstractrelationship.h \
        ../inc/cntrelationshipgroup.h \
        ../inc/cntsymbianfiltersqlhelper.h \
        ../inc/cntsymbiansrvconnection.h \
        ../inc/cntsymbiantransformerror.h \
        ../inc/cntsymbiandatabase.h \
        ../inc/cntdisplaylabel.h \
        ../inc/cntdisplaylabelsqlfilter.h

SYMBIAN_SOURCES += \
        ../src/cntsymbianengine.cpp \
        ../src/cnttransformcontact.cpp \
        ../src/cnttransformcontactdata.cpp \
        ../src/cnttransformname.cpp \
        ../src/cnttransformnickname.cpp \
        ../src/cnttransformphonenumber.cpp \
        ../src/cnttransformemail.cpp \
        ../src/cnttransformaddress.cpp \
        ../src/cnttransformurl.cpp \
        ../src/cnttransformbirthday.cpp \
        ../src/cnttransformonlineaccount.cpp \
        ../src/cnttransformorganisation.cpp \
        ../src/cnttransformavatar.cpp \
        ../src/cnttransformavatarsimple.cpp \
        ../src/cntthumbnailcreator.cpp \
        ../src/cnttransformsynctarget.cpp \
        ../src/cnttransformgender.cpp \
        ../src/cnttransformanniversarysimple.cpp \
        ../src/cnttransformanniversary.cpp \
        ../src/cnttransformgeolocation.cpp \
        ../src/cnttransformnote.cpp \
        ../src/cnttransformfamily.cpp \
        ../src/cnttransformempty.cpp \
        ../src/cntsymbianfilterdbms.cpp \
        ../src/cntsymbiansorterdbms.cpp \
        ../src/cntsymbianfiltersql.cpp \
        ../src/cntrelationship.cpp \
        ../src/cntabstractrelationship.cpp \
        ../src/cntrelationshipgroup.cpp \
        ../src/cntsymbianfiltersqlhelper.cpp \
        ../src/cntsymbiansrvconnection.cpp \
        ../src/cntsymbiantransformerror.cpp \
        ../src/cntsymbiandatabase.cpp \
        ../src/cntdisplaylabel.cpp \
        ../src/cntdisplaylabelsqlfilter.cpp

SYMBIAN_LIBS += \
        -lcntmodel \
        -lQtContacts \
        -lcentralrepository \
        -lestor \
        -lefsrv \
        -lfbscli \
        -limageconversion \
        -lbitmaptransforms \
        -lbafl

# Symbian plugin header and source files
SYMBIAN_PATHS += \
        ..\..\inc \
        ..\..\rss \
        ..\..\..\..\..\src\contacts \
        ..\..\..\..\..\src\contacts\details \
        ..\..\..\..\..\src\contacts\filters \
        ..\..\..\..\..\src\contacts\requests

SYMBIAN_HEADERS += \
        ../../inc/cntsymbianengine.h \
        ../../inc/cnttransformcontact.h \
        ../../inc/cnttransformcontactdata.h \
        ../../inc/cnttransformname.h \
        ../../inc/cnttransformnickname.h \
        ../../inc/cnttransformphonenumber.h \
        ../../inc/cnttransformemail.h \
        ../../inc/cnttransformaddress.h \
        ../../inc/cnttransformurl.h \
        ../../inc/cnttransformbirthday.h \
        ../../inc/cnttransformonlineaccount.h \
        ../../inc/cnttransformorganisation.h \
        ../../inc/cnttransformavatar.h \
        ../../inc/cnttransformavatarsimple.h \
        ../../inc/cntthumbnailcreator.h \
        ../../inc/cnttransformsynctarget.h \
        ../../inc/cnttransformgender.h \
        ../../inc/cnttransformanniversary.h \
        ../../inc/cnttransformanniversarysimple.h \
        ../../inc/cnttransformgeolocation.h \
        ../../inc/cnttransformnote.h \
        ../../inc/cnttransformfamily.h \
        ../../inc/cnttransformempty.h \
        ../../inc/cntabstractcontactfilter.h \
        ../../inc/cntsymbianfilterdbms.h \
        ../../inc/cntsymbianfiltersql.h \
        ../../inc/cntsymbiansorterdbms.h \
        ../../inc/cntabstractcontactsorter.h \
        ../../inc/cntrelationship.h \
        ../../inc/cntabstractrelationship.h \
        ../../inc/cntrelationshipgroup.h \
        ../../inc/cntsymbianfiltersqlhelper.h \
        ../../inc/cntsymbiansrvconnection.h \
        ../../inc/cntsymbiantransformerror.h \
        ../../inc/cntsymbiandatabase.h \
        ../../inc/cntdisplaylabel.h \
        ../../inc/cntdisplaylabelsqlfilter.h

SYMBIAN_SOURCES += \
        ../../src/cntsymbianengine.cpp \
        ../../src/cnttransformcontact.cpp \
        ../../src/cnttransformcontactdata.cpp \
        ../../src/cnttransformname.cpp \
        ../../src/cnttransformnickname.cpp \
        ../../src/cnttransformphonenumber.cpp \
        ../../src/cnttransformemail.cpp \
        ../../src/cnttransformaddress.cpp \
        ../../src/cnttransformurl.cpp \
        ../../src/cnttransformbirthday.cpp \
        ../../src/cnttransformonlineaccount.cpp \
        ../../src/cnttransformorganisation.cpp \
        ../../src/cnttransformavatar.cpp \
        ../../src/cnttransformavatarsimple.cpp \
        ../../src/cntthumbnailcreator.cpp \
        ../../src/cnttransformsynctarget.cpp \
        ../../src/cnttransformgender.cpp \
        ../../src/cnttransformanniversarysimple.cpp \
        ../../src/cnttransformanniversary.cpp \
        ../../src/cnttransformgeolocation.cpp \
        ../../src/cnttransformnote.cpp \
        ../../src/cnttransformfamily.cpp \
        ../../src/cnttransformempty.cpp \
        ../../src/cntsymbianfilterdbms.cpp \
        ../../src/cntsymbiansorterdbms.cpp \
        ../../src/cntsymbianfiltersql.cpp \
        ../../src/cntrelationship.cpp \
        ../../src/cntabstractrelationship.cpp \
        ../../src/cntrelationshipgroup.cpp \
        ../../src/cntsymbianfiltersqlhelper.cpp \
        ../../src/cntsymbiansrvconnection.cpp \
        ../../src/cntsymbiantransformerror.cpp \
        ../../src/cntsymbiandatabase.cpp \
        ../../src/cntdisplaylabel.cpp \
        ../../src/cntdisplaylabelsqlfilter.cpp

SYMBIAN_LIBS += \
        -lcntmodel \
        -lQtContacts \
        -lcentralrepository \
        -lestor \
        -lefsrv \
        -lfbscli \
        -limageconversion \
        -lbitmaptransforms \
        -lbafl


increase version

increase version


Version 5.4

Version 5.4


Version 0.68

Version 0.68


Version 5.9

Version 5.9


Use the same compatibility defines in qmake and qbs build

The defines QT_NO_CAST_FROM_ASCII and
QT_NO_PROCESS_COMBINED_ARGUMENT_START were missing from the application
defines in the qmake build system.

Change-Id: Ibfd860303099521d8ac2f33d256f34b243477006
Reviewed-by: Christian Kandeler <3aa99dcdd3f0cac61fb81c2a11771c0cc2497607@qt.io>
Reviewed-by: Jake Petroules <2d627e1cecd5435752fa500bacbe05f7cc90c369@qt.io>

include(../install_prefix.pri)

QT = core
TEMPLATE = app
DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_PROCESS_COMBINED_ARGUMENT_START
!isEmpty(QBS_APPS_DESTDIR):DESTDIR = $${QBS_APPS_DESTDIR}
else:DESTDIR = ../../../bin

!isEmpty(QBS_APPS_RPATH_DIR) {
    linux-*:QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${QBS_APPS_RPATH_DIR}\'
    macx:QMAKE_LFLAGS += -Wl,-rpath,$${QBS_APPS_RPATH_DIR}
}

CONFIG += console
CONFIG -= app_bundle
CONFIG += c++11

include($${PWD}/../lib/corelib/use_corelib.pri)
include($${PWD}/shared/logging/logging.pri)

!isEmpty(QBS_APPS_INSTALL_DIR):target.path = $${QBS_APPS_INSTALL_DIR}
else:target.path = $${QBS_INSTALL_PREFIX}/bin
INSTALLS += target

include(../install_prefix.pri)

QT = core
TEMPLATE = app
!isEmpty(QBS_APPS_DESTDIR):DESTDIR = $${QBS_APPS_DESTDIR}
else:DESTDIR = ../../../bin

!isEmpty(QBS_APPS_RPATH_DIR) {
    linux-*:QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${QBS_APPS_RPATH_DIR}\'
    macx:QMAKE_LFLAGS += -Wl,-rpath,$${QBS_APPS_RPATH_DIR}
}

CONFIG += console
CONFIG -= app_bundle
CONFIG += c++11

include($${PWD}/../lib/corelib/use_corelib.pri)
include($${PWD}/shared/logging/logging.pri)

!isEmpty(QBS_APPS_INSTALL_DIR):target.path = $${QBS_APPS_INSTALL_DIR}
else:target.path = $${QBS_INSTALL_PREFIX}/bin
INSTALLS += target


added qtNetwork

added qtNetwork

QT += widgets network

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

LIBS += -L$$PWD/../../../../bin/ -lqrkernel -lqrutils

DEFINES += ROBOTS_UTILS_LIBRARY

HEADERS += \
	$$PWD/../include/utils/timelineInterface.h \
	$$PWD/../include/utils/abstractTimer.h \
	$$PWD/../include/utils/realTimeline.h \
	$$PWD/../include/utils/realTimer.h \
	$$PWD/../include/utils/textExpressionProcessor.h \
	$$PWD/../include/utils/tracer.h \
	$$PWD/../include/utils/robotCommunication/robotCommunicationThreadInterface.h \
	$$PWD/../include/utils/robotCommunication/robotCommunicator.h \
	$$PWD/../include/utils/robotCommunication/robotCommunicationException.h \
	$$PWD/../include/utils/tcpRobotCommunicator.h \

SOURCES += \
	$$PWD/abstractTimer.cpp \
	$$PWD/realTimeline.cpp \
	$$PWD/realTimer.cpp \
	$$PWD/textExpressionProcessor.cpp \
	$$PWD/tracer.cpp \
	$$PWD/robotCommunication/robotCommunicator.cpp \
	$$PWD/robotCommunication/robotCommunicationException.cpp \
	$$PWD/tcpRobotCommunicator.cpp \

QT += widgets

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

LIBS += -L$$PWD/../../../../bin/ -lqrkernel -lqrutils

DEFINES += ROBOTS_UTILS_LIBRARY

HEADERS += \
	$$PWD/../include/utils/timelineInterface.h \
	$$PWD/../include/utils/abstractTimer.h \
	$$PWD/../include/utils/realTimeline.h \
	$$PWD/../include/utils/realTimer.h \
	$$PWD/../include/utils/textExpressionProcessor.h \
	$$PWD/../include/utils/tracer.h \
	$$PWD/../include/utils/robotCommunication/robotCommunicationThreadInterface.h \
	$$PWD/../include/utils/robotCommunication/robotCommunicator.h \
	$$PWD/../include/utils/robotCommunication/robotCommunicationException.h \
	$$PWD/../include/utils/tcpRobotCommunicator.h \

SOURCES += \
	$$PWD/abstractTimer.cpp \
	$$PWD/realTimeline.cpp \
	$$PWD/realTimer.cpp \
	$$PWD/textExpressionProcessor.cpp \
	$$PWD/tracer.cpp \
	$$PWD/robotCommunication/robotCommunicator.cpp \
	$$PWD/robotCommunication/robotCommunicationException.cpp \
	$$PWD/tcpRobotCommunicator.cpp \


[build] Removed -ffast-math from qmake.

[build] Removed -ffast-math from qmake.

# This file is a template commmon for all qmake projects.
#
# To use it, define ROOT_DIR variable and include($$ROOT_DIR/common.pri)

# We use some library features that were introduced in Mac OS X 10.8.
# Qt5.6.x sets target OS X version to 10.7 which leads to compile errors.
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9

CONFIG(map_designer) {
  DEFINES *= STANDALONE_APP
  DEFINES *= BUILD_DESIGNER
}

# our own version variables
VERSION_MAJOR = 2
VERSION_MINOR = 4

# qt's variable
VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}

# ROOT_DIR is in INCLUDEPATH now according to the new include policy.
INCLUDEPATH *= $$ROOT_DIR
# Do not set DEPENDPATH - it causes rebuild all with minor changes.
#DEPENDPATH  *= $$ROOT_DIR
INCLUDEPATH *= $$ROOT_DIR/3party/boost
INCLUDEPATH *= $$ROOT_DIR/3party/glm

# Hack for Qt5 qmake to make it much faster.
# Turns off any external headers modification check (see DEPENDPATH).
# Do not remove depend_includepath in CONFIG. Need to check modifications within ROOT_DIR.
#CONFIG -= depend_includepath

CONFIG *= c++11

# Automatically enable release config for production
CONFIG(production) {
  CONFIG *= release
}

CONFIG(release, debug|release) {
  DEFINES *= RELEASE _RELEASE NDEBUG
  CONFIG(production) {
    CONFIG_NAME = production
  } else {
    CONFIG_NAME = release
  }
} else {
  DEFINES *= DEBUG _DEBUG
  CONFIG_NAME = debug
}

BINARIES_PATH = $$ROOT_DIR/out/$$CONFIG_NAME
TEMP_PATH = $$ROOT_DIR/out/$$CONFIG_NAME/tmp/$$TARGET

DESTDIR = $$BINARIES_PATH
OBJECTS_DIR = $$TEMP_PATH
RCC_DIR = $$TEMP_PATH
MOC_DIR = $$TEMP_PATH
UI_DIR = $$TEMP_PATH

QMAKE_LIBDIR = $$BINARIES_PATH $$QMAKE_LIBDIR

# By default, do not include base QT classes in any project.
QT -= core gui

# Libraries' dependencies hack.
win32-msvc* {
  LIB_EXT = .lib
  LIB_PREFIX =
}
unix|win32-g++|tizen* {
 LIB_EXT = .a
 LIB_PREFIX = lib
}

# Add libraries' dependencies.
for(project, DEPENDENCIES) {
  PRE_TARGETDEPS += $$BINARIES_PATH/$$LIB_PREFIX$$project$$LIB_EXT
  LIBS += -l$$project
}

#INCLUDEPATH += $$ROOT_DIR/3party/protobuf/src/

# Windows-specific options for all projects
win32 {
  DEFINES += _WIN32_WINNT=0x0501
  DEFINES += WINVER=0x0501
  DEFINES += _WIN32_IE=0x0501
  DEFINES += WIN32_LEAN_AND_MEAN=1
  DEFINES += NTDDI_VERSION=0x05010000
  LIBS *= -lShell32
}

win32-msvc* {
  QMAKE_CLEAN += *.user
  DEFINES += _SCL_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS NOMINMAX NO_MIN_MAX BOOST_ALL_NO_LIB
  QMAKE_CXXFLAGS += /Zi /fp:fast
  QMAKE_CFLAGS += /Zi /fp:fast

  QMAKE_CXXFLAGS_RELEASE -= /O2
  # don't set -GL - bug in msvc2008
  QMAKE_CXXFLAGS_RELEASE += /Ox /GF
  # don't set /LTCG - bug in msvc2008
  QMAKE_LFLAGS_RELEASE += /MACHINE:X86

  QMAKE_LFLAGS *= /OPT:REF
  QMAKE_LFLAGS_RELEASE *= /OPT:REF,ICF
  QMAKE_LFLAGS_DEBUG *= /OPT:NOICF

  CONFIG(release, debug|release) {
    DEFINES += _SECURE_SCL=0
  }
}

win32-msvc201* {
  # disable tr1 and c++0x features to avoid build errors
#  DEFINES += _HAS_CPP0X=0
#  DEFINES += BOOST_NO_CXX11_HDR_ARRAY BOOST_NO_CXX11_HDR_TYPEINDEX BOOST_NO_CXX11_SMART_PTR
  QMAKE_CFLAGS *= /wd4100
  QMAKE_CXXFLAGS *= /wd4100
  QMAKE_CFLAGS_RELEASE += /GL
  QMAKE_CXXFLAGS_RELEASE += /GL
  QMAKE_LFLAGS_RELEASE += /LTCG
  QMAKE_LIB += /LTCG
}

# unix also works for Android
unix|win32-g++ {
  LIBS *= -lz
  QMAKE_CXXFLAGS_WARN_ON += -Wno-strict-aliasing -Wsign-compare
  # -Wno-unused-local-typedef is not supported on clang 3.5.
  IS_CLANG35 = $$system( echo | $$QMAKE_CXX -dM -E - | grep '__clang_version__.*3\.5.*' )
  if (isEmpty(IS_CLANG35)){
    QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedef
  }
  # TODO: Check if we really need these warnings on every platform (by syershov).
  *-clang* {
    QMAKE_CXXFLAGS_WARN_ON += -Werror=return-type -Wshorten-64-to-32
  }

tizen{
  QMAKE_CFLAGS_RELEASE -= -O2
  QMAKE_CFLAGS_RELEASE += -O1
  QMAKE_CXXFLAGS_RELEASE -= -O2
  QMAKE_CXXFLAGS_RELEASE += -O1
} else {
  QMAKE_CFLAGS_RELEASE -= -O2
  QMAKE_CFLAGS_RELEASE += -O3
  QMAKE_CXXFLAGS_RELEASE -= -O2
  QMAKE_CXXFLAGS_RELEASE += -O3
}

}

linux-* {
  QMAKE_CFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_CXXFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_LFLAGS *= -Wl,--gc-sections -Wl,-Bsymbolic-functions
  linux-g++* {
    QMAKE_CFLAGS_RELEASE *= -ffloat-store
    QMAKE_CXXFLAGS_RELEASE *= -ffloat-store
  }
  # debian build requirements
  CONFIG(production) {
    QMAKE_CFLAGS_RELEASE = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
    QMAKE_CXXFLAGS_RELEASE = -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
    QMAKE_LFLAGS *= -Wl,-z,relro
  }

}

android-g++ {
  QMAKE_CFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_CXXFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_LFLAGS *= -Wl,--gc-sections
}

win32-g++ {
  QMAKE_CFLAGS *= -Wextra
  QMAKE_CXXFLAGS *= -Wextra
  QMAKE_LFLAGS *= -s
  QMAKE_LFLAGS_RELEASE *= -O
  LIBS *= -lpthread
}

macx-* {
  QMAKE_LFLAGS *= -dead_strip
  LIBS *= "-framework Foundation" "-framework CFNetwork"

#  macx-clang {
#    QMAKE_CFLAGS_RELEASE -= -O3
#    QMAKE_CFLAGS_RELEASE += -O4 -flto
#    QMAKE_CXXFLAGS_RELEASE -= -O3
#    QMAKE_CXXFLAGS_RELEASE += -O4 -flto
#    QMAKE_LFLAGS_RELEASE += -O4 -flto
#  }
}

CONFIG(production) {
  DEFINES += OMIM_PRODUCTION
} else {
  # enable debugging information for non-production release builds
  unix|win32-g++ {
    QMAKE_CFLAGS_RELEASE += -g
    QMAKE_CXXFLAGS_RELEASE += -g
  } win32-msvc* {
    QMAKE_LFLAGS += /PDB:$${DESTDIR}/$${TARGET}.pdb /DEBUG
  }
}

# Fix boost compilation error
win32* {
    QMAKE_MOC = $$[QT_INSTALL_BINS]/moc.exe -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
} else {
    QMAKE_MOC = $$[QT_INSTALL_BINS]/moc -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
}

# Include with private variables.
HEADERS += \
  $$ROOT_DIR/private.h

# Standard includes wrappers.
HEADERS += \
  $$ROOT_DIR/std/algorithm.hpp \
  $$ROOT_DIR/std/array.hpp \
  $$ROOT_DIR/std/atomic.hpp \
  $$ROOT_DIR/std/auto_ptr.hpp \
  $$ROOT_DIR/std/bind.hpp \
  $$ROOT_DIR/std/bitset.hpp \
  $$ROOT_DIR/std/cctype.hpp \
  $$ROOT_DIR/std/cerrno.hpp \
  $$ROOT_DIR/std/chrono.hpp \
  $$ROOT_DIR/std/cmath.hpp \
  $$ROOT_DIR/std/complex.hpp \
  $$ROOT_DIR/std/condition_variable.hpp \
  $$ROOT_DIR/std/cstdarg.hpp \
  $$ROOT_DIR/std/cstdint.hpp \
  $$ROOT_DIR/std/cstdio.hpp \
  $$ROOT_DIR/std/cstdlib.hpp \
  $$ROOT_DIR/std/cstring.hpp \
  $$ROOT_DIR/std/ctime.hpp \
  $$ROOT_DIR/std/deque.hpp \
  $$ROOT_DIR/std/errno.hpp \
  $$ROOT_DIR/std/exception.hpp \
  $$ROOT_DIR/std/fstream.hpp \
  $$ROOT_DIR/std/function.hpp \
  $$ROOT_DIR/std/functional.hpp \
  $$ROOT_DIR/std/future.hpp \
  $$ROOT_DIR/std/initializer_list.hpp \
  $$ROOT_DIR/std/iomanip.hpp \
  $$ROOT_DIR/std/ios.hpp \
  $$ROOT_DIR/std/iostream.hpp \
  $$ROOT_DIR/std/iterator.hpp \
  $$ROOT_DIR/std/iterator_facade.hpp \
  $$ROOT_DIR/std/limits.hpp \
  $$ROOT_DIR/std/list.hpp \
  $$ROOT_DIR/std/map.hpp \
  $$ROOT_DIR/std/msvc_cpp11_workarounds.hpp \
  $$ROOT_DIR/std/mutex.hpp \
  $$ROOT_DIR/std/noncopyable.hpp \
  $$ROOT_DIR/std/numeric.hpp \
  $$ROOT_DIR/std/queue.hpp \
  $$ROOT_DIR/std/set.hpp \
  $$ROOT_DIR/std/shared_array.hpp \
  $$ROOT_DIR/std/shared_ptr.hpp \
  $$ROOT_DIR/std/sstream.hpp \
  $$ROOT_DIR/std/stack.hpp \
  $$ROOT_DIR/std/string.hpp \
  $$ROOT_DIR/std/systime.hpp \
  $$ROOT_DIR/std/target_os.hpp \
  $$ROOT_DIR/std/thread.hpp \
  $$ROOT_DIR/std/transform_iterator.hpp \
  $$ROOT_DIR/std/tuple.hpp \
  $$ROOT_DIR/std/type_traits.hpp \
  $$ROOT_DIR/std/typeinfo.hpp \
  $$ROOT_DIR/std/unique_ptr.hpp \
  $$ROOT_DIR/std/unordered_map.hpp \
  $$ROOT_DIR/std/unordered_set.hpp \
  $$ROOT_DIR/std/utility.hpp \
  $$ROOT_DIR/std/vector.hpp \
  $$ROOT_DIR/std/weak_ptr.hpp \
  $$ROOT_DIR/std/windows.hpp \

# This file is a template commmon for all qmake projects.
#
# To use it, define ROOT_DIR variable and include($$ROOT_DIR/common.pri)

# We use some library features that were introduced in Mac OS X 10.8.
# Qt5.6.x sets target OS X version to 10.7 which leads to compile errors.
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9

CONFIG(map_designer) {
  DEFINES *= STANDALONE_APP
  DEFINES *= BUILD_DESIGNER
}

# our own version variables
VERSION_MAJOR = 2
VERSION_MINOR = 4

# qt's variable
VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}

# ROOT_DIR is in INCLUDEPATH now according to the new include policy.
INCLUDEPATH *= $$ROOT_DIR
# Do not set DEPENDPATH - it causes rebuild all with minor changes.
#DEPENDPATH  *= $$ROOT_DIR
INCLUDEPATH *= $$ROOT_DIR/3party/boost
INCLUDEPATH *= $$ROOT_DIR/3party/glm

# Hack for Qt5 qmake to make it much faster.
# Turns off any external headers modification check (see DEPENDPATH).
# Do not remove depend_includepath in CONFIG. Need to check modifications within ROOT_DIR.
#CONFIG -= depend_includepath

CONFIG *= c++11

# Automatically enable release config for production
CONFIG(production) {
  CONFIG *= release
}

CONFIG(release, debug|release) {
  DEFINES *= RELEASE _RELEASE NDEBUG
  CONFIG(production) {
    CONFIG_NAME = production
  } else {
    CONFIG_NAME = release
  }
} else {
  DEFINES *= DEBUG _DEBUG
  CONFIG_NAME = debug
}

BINARIES_PATH = $$ROOT_DIR/out/$$CONFIG_NAME
TEMP_PATH = $$ROOT_DIR/out/$$CONFIG_NAME/tmp/$$TARGET

DESTDIR = $$BINARIES_PATH
OBJECTS_DIR = $$TEMP_PATH
RCC_DIR = $$TEMP_PATH
MOC_DIR = $$TEMP_PATH
UI_DIR = $$TEMP_PATH

QMAKE_LIBDIR = $$BINARIES_PATH $$QMAKE_LIBDIR

# By default, do not include base QT classes in any project.
QT -= core gui

# Libraries' dependencies hack.
win32-msvc* {
  LIB_EXT = .lib
  LIB_PREFIX =
}
unix|win32-g++|tizen* {
 LIB_EXT = .a
 LIB_PREFIX = lib
}

# Add libraries' dependencies.
for(project, DEPENDENCIES) {
  PRE_TARGETDEPS += $$BINARIES_PATH/$$LIB_PREFIX$$project$$LIB_EXT
  LIBS += -l$$project
}

#INCLUDEPATH += $$ROOT_DIR/3party/protobuf/src/

# Windows-specific options for all projects
win32 {
  DEFINES += _WIN32_WINNT=0x0501
  DEFINES += WINVER=0x0501
  DEFINES += _WIN32_IE=0x0501
  DEFINES += WIN32_LEAN_AND_MEAN=1
  DEFINES += NTDDI_VERSION=0x05010000
  LIBS *= -lShell32
}

win32-msvc* {
  QMAKE_CLEAN += *.user
  DEFINES += _SCL_SECURE_NO_WARNINGS _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS NOMINMAX NO_MIN_MAX BOOST_ALL_NO_LIB
  QMAKE_CXXFLAGS += /Zi /fp:fast
  QMAKE_CFLAGS += /Zi /fp:fast

  QMAKE_CXXFLAGS_RELEASE -= /O2
  # don't set -GL - bug in msvc2008
  QMAKE_CXXFLAGS_RELEASE += /Ox /GF
  # don't set /LTCG - bug in msvc2008
  QMAKE_LFLAGS_RELEASE += /MACHINE:X86

  QMAKE_LFLAGS *= /OPT:REF
  QMAKE_LFLAGS_RELEASE *= /OPT:REF,ICF
  QMAKE_LFLAGS_DEBUG *= /OPT:NOICF

  CONFIG(release, debug|release) {
    DEFINES += _SECURE_SCL=0
  }
}

win32-msvc201* {
  # disable tr1 and c++0x features to avoid build errors
#  DEFINES += _HAS_CPP0X=0
#  DEFINES += BOOST_NO_CXX11_HDR_ARRAY BOOST_NO_CXX11_HDR_TYPEINDEX BOOST_NO_CXX11_SMART_PTR
  QMAKE_CFLAGS *= /wd4100
  QMAKE_CXXFLAGS *= /wd4100
  QMAKE_CFLAGS_RELEASE += /GL
  QMAKE_CXXFLAGS_RELEASE += /GL
  QMAKE_LFLAGS_RELEASE += /LTCG
  QMAKE_LIB += /LTCG
}

# unix also works for Android
unix|win32-g++ {
  LIBS *= -lz
  QMAKE_CXXFLAGS_WARN_ON += -Wno-strict-aliasing -Wsign-compare
  # -Wno-unused-local-typedef is not supported on clang 3.5.
  IS_CLANG35 = $$system( echo | $$QMAKE_CXX -dM -E - | grep '__clang_version__.*3\.5.*' )
  if (isEmpty(IS_CLANG35)){
    QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedef
  }
  # TODO: Check if we really need these warnings on every platform (by syershov).
  *-clang* {
    QMAKE_CXXFLAGS_WARN_ON += -Werror=return-type -Wshorten-64-to-32
  }

tizen{
  QMAKE_CFLAGS_RELEASE -= -O2
  QMAKE_CFLAGS_RELEASE += -O1
  QMAKE_CXXFLAGS_RELEASE -= -O2
  QMAKE_CXXFLAGS_RELEASE += -O1
  QMAKE_CFLAGS_RELEASE *= -ffast-math
  QMAKE_CXXFLAGS_RELEASE *= -ffast-math
} else {
  QMAKE_CFLAGS_RELEASE -= -O2
  QMAKE_CFLAGS_RELEASE += -O3
  QMAKE_CXXFLAGS_RELEASE -= -O2
  QMAKE_CXXFLAGS_RELEASE += -O3
  QMAKE_CFLAGS_RELEASE *= -ffast-math
  QMAKE_CXXFLAGS_RELEASE *= -ffast-math
}

}

linux-* {
  QMAKE_CFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_CXXFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_LFLAGS *= -Wl,--gc-sections -Wl,-Bsymbolic-functions
  linux-g++* {
    QMAKE_CFLAGS_RELEASE *= -ffloat-store
    QMAKE_CXXFLAGS_RELEASE *= -ffloat-store
  }
  # debian build requirements
  CONFIG(production) {
    QMAKE_CFLAGS_RELEASE = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
    QMAKE_CXXFLAGS_RELEASE = -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
    QMAKE_LFLAGS *= -Wl,-z,relro
  }

}

android-g++ {
  QMAKE_CFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_CXXFLAGS *= -fdata-sections -ffunction-sections
  QMAKE_LFLAGS *= -Wl,--gc-sections
}

win32-g++ {
  QMAKE_CFLAGS *= -Wextra
  QMAKE_CXXFLAGS *= -Wextra
  QMAKE_LFLAGS *= -s
  QMAKE_LFLAGS_RELEASE *= -O
  LIBS *= -lpthread
}

macx-* {
  QMAKE_LFLAGS *= -dead_strip
  LIBS *= "-framework Foundation" "-framework CFNetwork"

#  macx-clang {
#    QMAKE_CFLAGS_RELEASE -= -O3
#    QMAKE_CFLAGS_RELEASE += -O4 -flto
#    QMAKE_CXXFLAGS_RELEASE -= -O3
#    QMAKE_CXXFLAGS_RELEASE += -O4 -flto
#    QMAKE_LFLAGS_RELEASE += -O4 -flto
#  }
}

CONFIG(production) {
  DEFINES += OMIM_PRODUCTION
} else {
  # enable debugging information for non-production release builds
  unix|win32-g++ {
    QMAKE_CFLAGS_RELEASE += -g
    QMAKE_CXXFLAGS_RELEASE += -g
  } win32-msvc* {
    QMAKE_LFLAGS += /PDB:$${DESTDIR}/$${TARGET}.pdb /DEBUG
  }
}

# Fix boost compilation error
win32* {
    QMAKE_MOC = $$[QT_INSTALL_BINS]/moc.exe -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
} else {
    QMAKE_MOC = $$[QT_INSTALL_BINS]/moc -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED
}

# Include with private variables.
HEADERS += \
  $$ROOT_DIR/private.h

# Standard includes wrappers.
HEADERS += \
  $$ROOT_DIR/std/algorithm.hpp \
  $$ROOT_DIR/std/array.hpp \
  $$ROOT_DIR/std/atomic.hpp \
  $$ROOT_DIR/std/auto_ptr.hpp \
  $$ROOT_DIR/std/bind.hpp \
  $$ROOT_DIR/std/bitset.hpp \
  $$ROOT_DIR/std/cctype.hpp \
  $$ROOT_DIR/std/cerrno.hpp \
  $$ROOT_DIR/std/chrono.hpp \
  $$ROOT_DIR/std/cmath.hpp \
  $$ROOT_DIR/std/complex.hpp \
  $$ROOT_DIR/std/condition_variable.hpp \
  $$ROOT_DIR/std/cstdarg.hpp \
  $$ROOT_DIR/std/cstdint.hpp \
  $$ROOT_DIR/std/cstdio.hpp \
  $$ROOT_DIR/std/cstdlib.hpp \
  $$ROOT_DIR/std/cstring.hpp \
  $$ROOT_DIR/std/ctime.hpp \
  $$ROOT_DIR/std/deque.hpp \
  $$ROOT_DIR/std/errno.hpp \
  $$ROOT_DIR/std/exception.hpp \
  $$ROOT_DIR/std/fstream.hpp \
  $$ROOT_DIR/std/function.hpp \
  $$ROOT_DIR/std/functional.hpp \
  $$ROOT_DIR/std/future.hpp \
  $$ROOT_DIR/std/initializer_list.hpp \
  $$ROOT_DIR/std/iomanip.hpp \
  $$ROOT_DIR/std/ios.hpp \
  $$ROOT_DIR/std/iostream.hpp \
  $$ROOT_DIR/std/iterator.hpp \
  $$ROOT_DIR/std/iterator_facade.hpp \
  $$ROOT_DIR/std/limits.hpp \
  $$ROOT_DIR/std/list.hpp \
  $$ROOT_DIR/std/map.hpp \
  $$ROOT_DIR/std/msvc_cpp11_workarounds.hpp \
  $$ROOT_DIR/std/mutex.hpp \
  $$ROOT_DIR/std/noncopyable.hpp \
  $$ROOT_DIR/std/numeric.hpp \
  $$ROOT_DIR/std/queue.hpp \
  $$ROOT_DIR/std/set.hpp \
  $$ROOT_DIR/std/shared_array.hpp \
  $$ROOT_DIR/std/shared_ptr.hpp \
  $$ROOT_DIR/std/sstream.hpp \
  $$ROOT_DIR/std/stack.hpp \
  $$ROOT_DIR/std/string.hpp \
  $$ROOT_DIR/std/systime.hpp \
  $$ROOT_DIR/std/target_os.hpp \
  $$ROOT_DIR/std/thread.hpp \
  $$ROOT_DIR/std/transform_iterator.hpp \
  $$ROOT_DIR/std/tuple.hpp \
  $$ROOT_DIR/std/type_traits.hpp \
  $$ROOT_DIR/std/typeinfo.hpp \
  $$ROOT_DIR/std/unique_ptr.hpp \
  $$ROOT_DIR/std/unordered_map.hpp \
  $$ROOT_DIR/std/unordered_set.hpp \
  $$ROOT_DIR/std/utility.hpp \
  $$ROOT_DIR/std/vector.hpp \
  $$ROOT_DIR/std/weak_ptr.hpp \
  $$ROOT_DIR/std/windows.hpp \


track qzmq path

track qzmq path

DEFINES += NO_IRISNET
HEADERS += $$PWD/processquit.h
SOURCES += $$PWD/processquit.cpp

INCLUDEPATH += $$PWD/../../qzmq/src
include(../../qzmq/src/src.pri)

HEADERS += \
	$$PWD/packet/tnetstring.h \
	$$PWD/packet/httpheaders.h \
	$$PWD/packet/httprequestdata.h \
	$$PWD/packet/httpresponsedata.h \
	$$PWD/packet/m2requestpacket.h \
	$$PWD/packet/m2responsepacket.h \
	$$PWD/packet/zurlrequestpacket.h \
	$$PWD/packet/zurlresponsepacket.h \
	$$PWD/packet/inspectrequestpacket.h \
	$$PWD/packet/inspectresponsepacket.h \
	$$PWD/packet/acceptresponsepacket.h \
	$$PWD/packet/retryrequestpacket.h

SOURCES += \
	$$PWD/packet/tnetstring.cpp \
	$$PWD/packet/httpheaders.cpp \
	$$PWD/packet/m2requestpacket.cpp \
	$$PWD/packet/m2responsepacket.cpp \
	$$PWD/packet/zurlrequestpacket.cpp \
	$$PWD/packet/zurlresponsepacket.cpp \
	$$PWD/packet/inspectrequestpacket.cpp \
	$$PWD/packet/inspectresponsepacket.cpp \
	$$PWD/packet/acceptresponsepacket.cpp \
	$$PWD/packet/retryrequestpacket.cpp

HEADERS += \
	$$PWD/log.h \
	$$PWD/jwt.h \
	$$PWD/layertracker.h \
	$$PWD/m2manager.h \
	$$PWD/m2request.h \
	$$PWD/m2response.h \
	$$PWD/zurlmanager.h \
	$$PWD/zurlrequest.h \
	$$PWD/inspectdata.h \
	$$PWD/inspectmanager.h \
	$$PWD/inspectrequest.h \
	$$PWD/acceptdata.h \
	$$PWD/domainmap.h \
	$$PWD/xffrule.h \
	$$PWD/inspectchecker.h \
	$$PWD/requestsession.h \
	$$PWD/proxysession.h \
	$$PWD/app.h

SOURCES += \
	$$PWD/log.cpp \
	$$PWD/jwt.cpp \
	$$PWD/layertracker.cpp \
	$$PWD/m2manager.cpp \
	$$PWD/m2request.cpp \
	$$PWD/m2response.cpp \
	$$PWD/zurlmanager.cpp \
	$$PWD/zurlrequest.cpp \
	$$PWD/inspectmanager.cpp \
	$$PWD/inspectrequest.cpp \
	$$PWD/domainmap.cpp \
	$$PWD/inspectchecker.cpp \
	$$PWD/requestsession.cpp \
	$$PWD/proxysession.cpp \
	$$PWD/app.cpp \
	$$PWD/main.cpp

DEFINES += NO_IRISNET
HEADERS += $$PWD/processquit.h
SOURCES += $$PWD/processquit.cpp

INCLUDEPATH += $$PWD/qzmq/src
include(qzmq/src/src.pri)

HEADERS += \
	$$PWD/packet/tnetstring.h \
	$$PWD/packet/httpheaders.h \
	$$PWD/packet/httprequestdata.h \
	$$PWD/packet/httpresponsedata.h \
	$$PWD/packet/m2requestpacket.h \
	$$PWD/packet/m2responsepacket.h \
	$$PWD/packet/zurlrequestpacket.h \
	$$PWD/packet/zurlresponsepacket.h \
	$$PWD/packet/inspectrequestpacket.h \
	$$PWD/packet/inspectresponsepacket.h \
	$$PWD/packet/acceptresponsepacket.h \
	$$PWD/packet/retryrequestpacket.h

SOURCES += \
	$$PWD/packet/tnetstring.cpp \
	$$PWD/packet/httpheaders.cpp \
	$$PWD/packet/m2requestpacket.cpp \
	$$PWD/packet/m2responsepacket.cpp \
	$$PWD/packet/zurlrequestpacket.cpp \
	$$PWD/packet/zurlresponsepacket.cpp \
	$$PWD/packet/inspectrequestpacket.cpp \
	$$PWD/packet/inspectresponsepacket.cpp \
	$$PWD/packet/acceptresponsepacket.cpp \
	$$PWD/packet/retryrequestpacket.cpp

HEADERS += \
	$$PWD/log.h \
	$$PWD/jwt.h \
	$$PWD/layertracker.h \
	$$PWD/m2manager.h \
	$$PWD/m2request.h \
	$$PWD/m2response.h \
	$$PWD/zurlmanager.h \
	$$PWD/zurlrequest.h \
	$$PWD/inspectdata.h \
	$$PWD/inspectmanager.h \
	$$PWD/inspectrequest.h \
	$$PWD/acceptdata.h \
	$$PWD/domainmap.h \
	$$PWD/xffrule.h \
	$$PWD/inspectchecker.h \
	$$PWD/requestsession.h \
	$$PWD/proxysession.h \
	$$PWD/app.h

SOURCES += \
	$$PWD/log.cpp \
	$$PWD/jwt.cpp \
	$$PWD/layertracker.cpp \
	$$PWD/m2manager.cpp \
	$$PWD/m2request.cpp \
	$$PWD/m2response.cpp \
	$$PWD/zurlmanager.cpp \
	$$PWD/zurlrequest.cpp \
	$$PWD/inspectmanager.cpp \
	$$PWD/inspectrequest.cpp \
	$$PWD/domainmap.cpp \
	$$PWD/inspectchecker.cpp \
	$$PWD/requestsession.cpp \
	$$PWD/proxysession.cpp \
	$$PWD/app.cpp \
	$$PWD/main.cpp


Add another directory for libraries

Add another directory for libraries

CONFIG(debug, debug|release) {
  BUILD_TYPE = debug
}
else:CONFIG(release, debug|release) {
  BUILD_TYPE = release
}
else {
  warning("Unknown build type; defaulting to debug")
  BUILD_TYPE = debug
}

OBJECTS_DIR = temp
MOC_DIR = temp
UI_DIR = temp
RCC_DIR = temp

INCLUDEPATH *= \
  $$MOC_DIR \
  $$UI_DIR \
  $$RCC_DIR \
  /usr/include \
  /usr/local/include \
  /usr/include/x86_64-linux-gnu \
  /usr/include/x86_64-linux-gnu/qt5 \
  /usr/include/qt5 \

DESTDIR = $$PWD/../build/$${BUILD_TYPE}-$${QMAKE_CC}/dist

LIBS *= \
  -L/usr/lib \
  -L/usr/local/lib \
  -L/usr/local/clang-3.5.0/lib \
  -L/usr/local/clang-3.6.0/lib \
  -L/usr/local/clang-3.7.0/lib \
  -L/usr/local/clang-3.8.0/lib \
  -L/usr/lib/x86_64-linux-gnu