QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = \
    TESTING_IN_SANDBOX=1 \
    TESTPLUGIN_PATH=../plugins \
    TESTDATA_PATH=$$IN_PWD \
    LD_LIBRARY_PATH=../../input-method-quick:../../src:../../input-context/:../../maliit:../plugins:$(LD_LIBRARY_PATH) \
    ./$$TARGET

check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda

Adjust LD_LIBRARY_PATH for test runs

QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = \
    TESTING_IN_SANDBOX=1 \
    TESTPLUGIN_PATH=../plugins \
    TESTDATA_PATH=$$IN_PWD \
    LD_LIBRARY_PATH=../../maliit-plugins-quick/input-method:../../maliit-plugins-quick/plugin-factory:../../src:../../input-context/:../../maliit:../plugins:$(LD_LIBRARY_PATH) \
    ./$$TARGET

check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda


QT       += testlib
QT       -= gui

CONFIG   += console
CONFIG   -= app_bundle
CONFIG   += testcase
TEMPLATE = app
DEFINES  += SRCDIR=\\\"$$PWD/\\\"

win32 {
    INCLUDEPATH += $$PWD/..
    LIBS += -L$$PWD/../framework -L$$PWD/../mlt++ -lmlt++ -lmlt
    isEmpty(PREFIX) {
        message("Install PREFIX not set; using C:\\Projects\\Shotcut. You can change this with 'qmake PREFIX=...'")
        PREFIX = C:\\Projects\\Shotcut
    }
    target.path = $$PREFIX
    INSTALLS += target
} else {
    CONFIG += link_pkgconfig
    PKGCONFIG += mlt++
}

Add c++11 support to fix unit test compilation.

QT       += testlib
QT       -= gui

CONFIG   += console
CONFIG   -= app_bundle
CONFIG   += testcase
CONFIG   += c++11
QMAKE_CXXFLAGS += -std=c++11
TEMPLATE = app
DEFINES  += SRCDIR=\\\"$$PWD/\\\"

win32 {
    INCLUDEPATH += $$PWD/..
    LIBS += -L$$PWD/../framework -L$$PWD/../mlt++ -lmlt++ -lmlt
    isEmpty(PREFIX) {
        message("Install PREFIX not set; using C:\\Projects\\Shotcut. You can change this with 'qmake PREFIX=...'")
        PREFIX = C:\\Projects\\Shotcut
    }
    target.path = $$PREFIX
    INSTALLS += target
} else {
    CONFIG += link_pkgconfig
    PKGCONFIG += mlt++
}


ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++11 -pedantic-errors -Werror -Wextra -O2 -g -fno-omit-frame-pointer
INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h

Change .pro file to specify explicit path for a custom build of qt

ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++11 -pedantic-errors -Werror -Wextra -O2 -g -fno-omit-frame-pointer
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/qt\'' # Used so that the main executable can link to custom built Qt
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/../qt\'' # Used so that plugins can link to custom built Qt
INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h


DBUS_XML_DIR = $$TOP_DIR/dbus_interfaces

DBUS_CONTEXT_XML = $$DBUS_XML_DIR/minputmethodcontext1interface.xml
DBUS_SERVER_XML = $$DBUS_XML_DIR/minputmethodserver1interface.xml

Fix OOT build with DBus interface definitions

DBUS_XML_DIR = $$IN_PWD

DBUS_CONTEXT_XML = $$DBUS_XML_DIR/minputmethodcontext1interface.xml
DBUS_SERVER_XML = $$DBUS_XML_DIR/minputmethodserver1interface.xml


DEFINES+=QMESSAGING_OPTIONAL QMESSAGING_OPTIONAL_FOLDER

win32|symbian{
    EXAMPLES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT
    LIBRARIES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT
    TESTS_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT
} else {
    EXAMPLES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT/bin
    LIBRARIES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT/lib
    TESTS_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT/tests
}

Apply single image directory only to windows for now.

DEFINES+=QMESSAGING_OPTIONAL QMESSAGING_OPTIONAL_FOLDER

win32 {
    EXAMPLES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT
    LIBRARIES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT
    TESTS_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT
} else {
    EXAMPLES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT/bin
    LIBRARIES_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT/lib
    TESTS_INSTALL_ROOT=$$MESSAGING_INSTALL_ROOT/tests
}


QT.activeqt.VERSION = 4.8.0
QT.activeqt.MAJOR_VERSION = 4
QT.activeqt.MINOR_VERSION = 8
QT.activeqt.PATCH_VERSION = 0

QT.activeqt.name = ActiveQt
QT.activeqt.bins = $$QT_MODULE_BIN_BASE
QT.activeqt.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/ActiveQt
QT.activeqt.private_includes = $$QT_MODULE_INCLUDE_BASE/ActiveQt/$$QT.activeqt.VERSION
QT.activeqt.sources = $$QT_MODULE_BASE/src/activeqt
QT.activeqt.libs = $$QT_MODULE_LIB_BASE
QT.activeqt.plugins = $$QT_MODULE_PLUGIN_BASE
QT.activeqt.imports = $$QT_MODULE_IMPORT_BASE
QT.activeqt.depends = gui
QT.activeqt.DEFINES = QT_ACTIVEQT_LIB

QT_CONFIG += activeqt

Update module version number to 5.0.0

QT.activeqt.VERSION = 5.0.0
QT.activeqt.MAJOR_VERSION = 5
QT.activeqt.MINOR_VERSION = 0
QT.activeqt.PATCH_VERSION = 0

QT.activeqt.name = ActiveQt
QT.activeqt.bins = $$QT_MODULE_BIN_BASE
QT.activeqt.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/ActiveQt
QT.activeqt.private_includes = $$QT_MODULE_INCLUDE_BASE/ActiveQt/$$QT.activeqt.VERSION
QT.activeqt.sources = $$QT_MODULE_BASE/src/activeqt
QT.activeqt.libs = $$QT_MODULE_LIB_BASE
QT.activeqt.plugins = $$QT_MODULE_PLUGIN_BASE
QT.activeqt.imports = $$QT_MODULE_IMPORT_BASE
QT.activeqt.depends = gui
QT.activeqt.DEFINES = QT_ACTIVEQT_LIB

QT_CONFIG += activeqt


#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
#UI_DIR          = ui
#UI_HEADERS_DIR  = ui/include
#UI_SOURCES_DIR  = ui/src

# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror -Wno-write-strings

TOP_SRC_DIR     = $$PWD
TOP_BUILD_DIR   = $${TOP_SRC_DIR}/$(BUILD_DIR)
QMAKE_LIBDIR   += $${TOP_BUILD_DIR}/lib/SignOn
INCLUDEPATH    += $${TOP_SRC_DIR}/lib

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += SIGNON_TRACE
#TODO comment this to restrict plugins to run under signon user
DEFINES += NO_SIGNON_USER

# Default directory for signond extensions
DEFINES += SIGNON_EXTENSIONS_DIR=\\\"/usr/lib/signon/extensions\\\"
# End of File

Disable RTTI for the whole project

#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
#UI_DIR          = ui
#UI_HEADERS_DIR  = ui/include
#UI_SOURCES_DIR  = ui/src

# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror -Wno-write-strings
# Disable RTTI
QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti

TOP_SRC_DIR     = $$PWD
TOP_BUILD_DIR   = $${TOP_SRC_DIR}/$(BUILD_DIR)
QMAKE_LIBDIR   += $${TOP_BUILD_DIR}/lib/SignOn
INCLUDEPATH    += $${TOP_SRC_DIR}/lib

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += SIGNON_TRACE
#TODO comment this to restrict plugins to run under signon user
DEFINES += NO_SIGNON_USER

# Default directory for signond extensions
DEFINES += SIGNON_EXTENSIONS_DIR=\\\"/usr/lib/signon/extensions\\\"
# End of File


VERSION = 0.1.0

memory = shared
remote = nope

CONFIG += debug
CONFIG -= release

CONFIG += glib

INCLUDE_PATH += /home/lew21/Projects/Xtreeme

include(paths.pri)

Remove useless include path ;)

VERSION = 0.1.0

memory = shared
remote = nope

CONFIG += debug
CONFIG -= release

CONFIG += glib

include(paths.pri)


load(qt_module)

symbian:load(qt_plugin)
TEMPLATE = lib
CONFIG += qt plugin

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

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

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

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

load(qt_targets)

wince*:LIBS += $$QMAKE_LIBS_GUI

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

Use correct varible name in targets for imports

load(qt_module)

symbian:load(qt_plugin)
TEMPLATE = lib
CONFIG += qt plugin

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

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

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

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

load(qt_targets)

wince*:LIBS += $$QMAKE_LIBS_GUI

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


# Common configuration for all .pro files.

ROOT_DIRECTORY = $$PWD
BUILD_DIRECTORY = $$shadowed($$PWD)

QT += core gui widgets

# Activate C++11 support.

QMAKE_CXXFLAGS += -std=c++11

# Add code coverage support.

CONFIG(debug)
{
	LIBS += -lgcov
	QMAKE_CXXFLAGS += -g -fprofile-arcs -ftest-coverage -O0
	QMAKE_LFLAGS += -g -fprofile-arcs -ftest-coverage -O0
}

Add QtNetwork to the project.

# Common configuration for all .pro files.

ROOT_DIRECTORY = $$PWD
BUILD_DIRECTORY = $$shadowed($$PWD)

QT += core gui widgets network

# Activate C++11 support.

QMAKE_CXXFLAGS += -std=c++11

# Add code coverage support.

CONFIG(debug)
{
	LIBS += -lgcov
	QMAKE_CXXFLAGS += -g -fprofile-arcs -ftest-coverage -O0
	QMAKE_LFLAGS += -g -fprofile-arcs -ftest-coverage -O0
}


packagesExist(brew) {
    BREW_PREFIX = $$system(brew --prefix)
    exists($$BREW_PREFIX/opt/admesh/stl.h){
        QMAKE_CXXFLAGS += -I/usr/local/opt/admesh/include
        LIBS += -L/usr/local/opt/admesh/lib
    }
    exists($$BREW_PREFIX/opt/stlsplit/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/stlsplit/include
        LIBS += -L/usr/local/opt/stlsplit/lib
    }
    exists($$BREW_PREFIX/opt/gettext/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/gettext/include
        LIBS += -L/usr/local/opt/gettext/lib
    }
}

Check for files in lib/ dir for Brew

packagesExist(brew) {
    BREW_PREFIX = $$system(brew --prefix)
    exists($$BREW_PREFIX/opt/admesh/lib/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/admesh/include
        LIBS += -L/usr/local/opt/admesh/lib
    }
    exists($$BREW_PREFIX/opt/stlsplit/lib/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/stlsplit/include
        LIBS += -L/usr/local/opt/stlsplit/lib
    }
    exists($$BREW_PREFIX/opt/gettext/lib/*){
        QMAKE_CXXFLAGS += -I/usr/local/opt/gettext/include
        LIBS += -L/usr/local/opt/gettext/lib
    }
}


HEADERS += \
    $$PWD/wlcompositor.h \
    $$PWD/wldisplay.h \
    $$PWD/wloutput.h \
    $$PWD/wlshmbuffer.h \
    $$PWD/wlsurface.h \
    ../../src/qt-compositor/wayland_wrapper/wlselection.h

SOURCES += \
    $$PWD/wlcompositor.cpp \
    $$PWD/wldisplay.cpp \
    $$PWD/wloutput.cpp \
    $$PWD/wlshmbuffer.cpp \
    $$PWD/wlsurface.cpp \
    ../../src/qt-compositor/wayland_wrapper/wlselection.cpp

Fix support for making compositors in different directory

HEADERS += \
    $$PWD/wlcompositor.h \
    $$PWD/wldisplay.h \
    $$PWD/wloutput.h \
    $$PWD/wlshmbuffer.h \
    $$PWD/wlsurface.h \
    $$PWD/wlselection.h

SOURCES += \
    $$PWD/wlcompositor.cpp \
    $$PWD/wldisplay.cpp \
    $$PWD/wloutput.cpp \
    $$PWD/wlshmbuffer.cpp \
    $$PWD/wlsurface.cpp \
    $$PWD/wlselection.cpp


INCLUDEPATH += filters

PUBLIC_HEADERS += \
    filters/qcontactactionfilter.h \
    filters/qcontactchangelogfilter.h \
    filters/qcontactdetailfilter.h \
    filters/qcontactdetailrangefilter.h \
    filters/qcontactfilters.h \
    filters/qcontactintersectionfilter.h \
    filters/qcontactunionfilter.h \
    filters/qcontactinvalidfilter.h \
    filters/qcontactidlistfilter.h

PRIVATE_HEADERS += \
    filters/qcontactactionfilter_p.h \
    filters/qcontactchangelogfilter_p.h \
    filters/qcontactdetailfilter_p.h \
    filters/qcontactdetailrangefilter_p.h \
    filters/qcontactgroupmembershipfilter.h \
    filters/qcontactgroupmembershipfilter_p.h \
    filters/qcontactintersectionfilter_p.h \
    filters/qcontactunionfilter_p.h \
    filters/qcontactidlistfilter_p.h

SOURCES += \
    filters/qcontactactionfilter.cpp \
    filters/qcontactchangelogfilter.cpp \
    filters/qcontactdetailfilter.cpp \
    filters/qcontactdetailrangefilter.cpp \
    filters/qcontactgroupmembershipfilter.cpp \
    filters/qcontactintersectionfilter.cpp \
    filters/qcontactunionfilter.cpp \
    filters/qcontactinvalidfilter.cpp \
    filters/qcontactidlistfilter.cpp

Make group membership filter public

INCLUDEPATH += filters

PUBLIC_HEADERS += \
    filters/qcontactactionfilter.h \
    filters/qcontactchangelogfilter.h \
    filters/qcontactdetailfilter.h \
    filters/qcontactdetailrangefilter.h \
    filters/qcontactfilters.h \
    filters/qcontactgroupmembershipfilter.h \
    filters/qcontactidlistfilter.h \
    filters/qcontactintersectionfilter.h \
    filters/qcontactinvalidfilter.h \
    filters/qcontactunionfilter.h

PRIVATE_HEADERS += \
    filters/qcontactactionfilter_p.h \
    filters/qcontactchangelogfilter_p.h \
    filters/qcontactdetailfilter_p.h \
    filters/qcontactdetailrangefilter_p.h \
    filters/qcontactgroupmembershipfilter_p.h \
    filters/qcontactintersectionfilter_p.h \
    filters/qcontactunionfilter_p.h \
    filters/qcontactidlistfilter_p.h

SOURCES += \
    filters/qcontactactionfilter.cpp \
    filters/qcontactchangelogfilter.cpp \
    filters/qcontactdetailfilter.cpp \
    filters/qcontactdetailrangefilter.cpp \
    filters/qcontactgroupmembershipfilter.cpp \
    filters/qcontactintersectionfilter.cpp \
    filters/qcontactunionfilter.cpp \
    filters/qcontactinvalidfilter.cpp \
    filters/qcontactidlistfilter.cpp


load(qt_module)

TEMPLATE = lib
CONFIG += qt plugin

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

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

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

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

load(qt_targets)

Fix build break for Mac.

load(qt_module)

TEMPLATE = lib
CONFIG += qt plugin

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

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

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

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

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

load(qt_targets)


LIBS += -Wl,--as-needed

contains(MEEGO_EDITION, "harmattan") {
    message("Building for harmattan")
    DEFINES += HARMATTAN
    CONFIG += harmattan
} else {
    # We will assume sailfish for now since it's the only platform I am familiar with
    message("Building for sailfish")
    DEFINES += SAILFISH
    CONFIG += sailfish
}

equals(QT_MAJOR_VERSION, 4) {
    CONFIG += qt4
    DEFINES += QT4
}

equals(QT_MAJOR_VERSION, 5) {
    CONFIG += qt5
    DEFINES += QT5
}

Add -ggdb to debug CFLAGS and CXXFLAGS

LIBS += -Wl,--as-needed

contains(MEEGO_EDITION, "harmattan") {
    message("Building for harmattan")
    DEFINES += HARMATTAN
    CONFIG += harmattan
} else {
    # We will assume sailfish for now since it's the only platform I am familiar with
    message("Building for sailfish")
    DEFINES += SAILFISH
    CONFIG += sailfish
}

equals(QT_MAJOR_VERSION, 4) {
    CONFIG += qt4
    DEFINES += QT4
}

equals(QT_MAJOR_VERSION, 5) {
    CONFIG += qt5
    DEFINES += QT5
}

QMAKE_CXXFLAGS_DEBUG=-ggdb
QMAKE_CFLAGS_DEBUG=-ggdb


QT.location.VERSION = 4.8.0
QT.location.MAJOR_VERSION = 4
QT.location.MINOR_VERSION = 8
QT.location.PATCH_VERSION = 0

QT.location.name = QtLocation
QT.location.bins = $$QT_MODULE_BIN_BASE
QT.location.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtLocation
QT.location.private_includes = $$QT_MODULE_INCLUDE_BASE/QtLocation/private
QT.location.sources = $$QT_MODULE_BASE/src/location
QT.location.libs = $$QT_MODULE_LIB_BASE
QT.location.plugins = $$QT_MODULE_PLUGIN_BASE
QT.location.imports = $$QT_MODULE_IMPORT_BASE
QT.location.depends = gui sql network
QT.location.DEFINES = QT_LOCATION_LIB

QT_CONFIG += location

Update module version number to 5.0.0

QT.location.VERSION = 5.0.0
QT.location.MAJOR_VERSION = 5
QT.location.MINOR_VERSION = 0
QT.location.PATCH_VERSION = 0

QT.location.name = QtLocation
QT.location.bins = $$QT_MODULE_BIN_BASE
QT.location.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtLocation
QT.location.private_includes = $$QT_MODULE_INCLUDE_BASE/QtLocation/private
QT.location.sources = $$QT_MODULE_BASE/src/location
QT.location.libs = $$QT_MODULE_LIB_BASE
QT.location.plugins = $$QT_MODULE_PLUGIN_BASE
QT.location.imports = $$QT_MODULE_IMPORT_BASE
QT.location.depends = gui sql network
QT.location.DEFINES = QT_LOCATION_LIB

QT_CONFIG += location


QMAKE_EXTRA_TARGETS += check
check.target = check

# This enables the maliit library for C++ code
CONFIG += maliit-plugins

qws {
    test_arguments += -qws
}

check.commands = \
    LD_LIBRARY_PATH=$$MALIIT_INSTALL_LIBS:$$[QT_INSTALL_LIBS]:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$test_arguments

check.depends += $$TARGET

LIBS += ../common/libtests-common.a
POST_TARGETDEPS += ../common/libtests-common.a
INCLUDEPATH += ../common

Use maliitStaticLib portability function also in tests

QMAKE_EXTRA_TARGETS += check
check.target = check

# This enables the maliit library for C++ code
CONFIG += maliit-plugins

qws {
    test_arguments += -qws
}

check.commands = \
    LD_LIBRARY_PATH=$$MALIIT_INSTALL_LIBS:$$[QT_INSTALL_LIBS]:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$test_arguments

check.depends += $$TARGET

LIBS += ../common/$$maliitStaticLib(tests-common)
POST_TARGETDEPS += ../common/$$maliitStaticLib(tests-common)
INCLUDEPATH += ../common


QMAKE_CACHE=$${OUT_PWD}/.qmake.cache
BASE_NAME=$$PWD

# Detect stale .qmake.cache
exists($$QMAKE_CACHE) {
    !equals(PROJECTROOT, $$BASE_NAME): system(rm $$QMAKE_CACHE)
}

linux* {
    # If you change the defaults here, fix src/common.pri
    message(We set these variables in the toplevel .qmake.cache file)
    message(that qmake ascends to in perpetuity)
    message()
    message(Linux specific options: ('*' indicates that option is enabled by default))
    message(Use CONFIG+=<option> to enable and CONFIG-=<option> to disable)
    message(avahi* - Enabled Avahi support)
    message(glviewport* - Render using a GL Viewport)
    message(glgs - Render using GL graphics system (Avoid like the plague!))
}

isEmpty(PROJECTROOT) {
    message()
    system(echo "PROJECTROOT=$$BASE_NAME" > $$QMAKE_CACHE)
    system(echo "#minimal config useful for bare bones targets" >> $$QMAKE_CACHE)
    system(echo "#CONFIG+=no-pkg-cfg no-avahi" >> $$QMAKE_CACHE)
    system(echo "CONFIG-=qt_framework" >> $$QMAKE_CACHE)
    system(echo "CONFIG+=cache-exists" >> $$QMAKE_CACHE)
    message(Cache created)
    message(Please rerun qmake)
    system(echo "equals\\(QT_MAJOR_VERSION, \\\"5\\\"\\) CONFIG+=qt5" >> $$QMAKE_CACHE)
}

Fix convenience .qmake.cache to actually function

QMAKE_CACHE=$${OUT_PWD}/.qmake.cache
BASE_NAME=$$PWD

# Detect stale .qmake.cache
exists($$QMAKE_CACHE) {
    !equals(PROJECTROOT, $$BASE_NAME): system(rm $$QMAKE_CACHE)
}

linux* {
    # If you change the defaults here, fix src/common.pri
    message(We set these variables in the toplevel .qmake.cache file)
    message(that qmake ascends to in perpetuity)
    message()
    message(Linux specific options: ('*' indicates that option is enabled by default))
    message(Use CONFIG+=<option> to enable and CONFIG-=<option> to disable)
    message(avahi* - Enabled Avahi support)
    message(glviewport* - Render using a GL Viewport)
    message(glgs - Render using GL graphics system (Avoid like the plague!))
}

isEmpty(PROJECTROOT) {
    message()
    system(echo "PROJECTROOT=$$BASE_NAME" > $$QMAKE_CACHE)
#$$LITERAL_HASH is not jiving in system( calls fine in echo(
    system(echo "false: CONFIG+=no-pkg-cfg no-avahi" >> $$QMAKE_CACHE)
    system(echo "CONFIG-=qt_framework" >> $$QMAKE_CACHE)
    system(echo "CONFIG+=cache-exists" >> $$QMAKE_CACHE)
    message(Cache created)
    message(Please rerun qmake)
    system(echo "equals\\(QT_MAJOR_VERSION, \\\"5\\\"\\) CONFIG+=qt5" >> $$QMAKE_CACHE)
}


# Try to find location of Qt private headers (see README)
isEmpty(QT_PRIVATE_HEADERS) {
    QT_PRIVATE_HEADERS = $$[QT_INSTALL_HEADERS]
} else {
    INCLUDEPATH += $$quote($${QT_PRIVATE_HEADERS}) \
                   $$quote($${QT_PRIVATE_HEADERS}/QtDeclarative) \
                   $$quote($${QT_PRIVATE_HEADERS}/QtCore) \
                   $$quote($${QT_PRIVATE_HEADERS}/QtScript)
}

Fix compilation of Quick Designer / Inspector for installed qt headers

# Try to find location of Qt private headers (see README)
isEmpty(QT_PRIVATE_HEADERS) {
    QT_PRIVATE_HEADERS = $$[QT_INSTALL_HEADERS]
} else {
    INCLUDEPATH += $$quote($${QT_PRIVATE_HEADERS}) \
                   $$quote($${QT_PRIVATE_HEADERS}/QtDeclarative) \
                   $$quote($${QT_PRIVATE_HEADERS}/QtCore) \
                   $$quote($${QT_PRIVATE_HEADERS}/QtScript) \
                   $$quote($${QT_PRIVATE_HEADERS}/QtGui)
}


QT_HELP_VERSION = $$QT_VERSION
QT_HELP_MAJOR_VERSION = $$QT_MAJOR_VERSION
QT_HELP_MINOR_VERSION = $$QT_MINOR_VERSION
QT_HELP_PATCH_VERSION = $$QT_PATCH_VERSION

QT.help.name = QtHelp
QT.help.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtHelp
QT.help.libs = $$QT_MODULE_LIB_BASE
QT.help.depends = network xml sql

Add the source path to the modules .pri file

QT_HELP_VERSION = $$QT_VERSION
QT_HELP_MAJOR_VERSION = $$QT_MAJOR_VERSION
QT_HELP_MINOR_VERSION = $$QT_MINOR_VERSION
QT_HELP_PATCH_VERSION = $$QT_PATCH_VERSION

QT.help.name = QtHelp
QT.help.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtHelp
QT.help.sources = $$QT_MODULE_BASE/src/assistant/lib
QT.help.libs = $$QT_MODULE_LIB_BASE
QT.help.depends = network xml sql


HEADERS += \
        $$PWD/include/fiol.h

SOURCES += \
    $$PWD/src/fiolBReadBE.c \
    $$PWD/src/fiolBReadLE.c \
    $$PWD/src/fiolBReadUBE.c \
    $$PWD/src/fiolBReadULE.c \
    $$PWD/src/fiolSReadChar.c \
    $$PWD/src/fiolSReadInt.c \
    $$PWD/src/fiolSReadFloat.c \
    $$PWD/src/fiolSReadDouble.c \
    $$PWD/src/fiolSReadUInt.c \
    $$PWD/src/fiolSWriteChar.c \
    $$PWD/src/fiolSWriteInt.c \
    $$PWD/src/fiolSWriteFloat.c \
    $$PWD/src/fiolSWriteDouble.c \
    $$PWD/src/fiolSWriteUInt.c

Add mechanism to avoid double inclusion

!contains( INCLUDEPATH, $$PWD ) {
    INCLUDEPATH += $$PWD

    HEADERS += \
        $$PWD/include/fiol.h

    SOURCES += \
        $$PWD/src/fiolBReadBE.c \
        $$PWD/src/fiolBReadLE.c \
        $$PWD/src/fiolBReadUBE.c \
        $$PWD/src/fiolBReadULE.c \
        $$PWD/src/fiolSReadChar.c \
        $$PWD/src/fiolSReadInt.c \
        $$PWD/src/fiolSReadFloat.c \
        $$PWD/src/fiolSReadDouble.c \
        $$PWD/src/fiolSReadUInt.c \
        $$PWD/src/fiolSWriteChar.c \
        $$PWD/src/fiolSWriteInt.c \
        $$PWD/src/fiolSWriteFloat.c \
        $$PWD/src/fiolSWriteDouble.c \
        $$PWD/src/fiolSWriteUInt.c
}


QMAKE_CXXFLAGS += -fexceptions

HEADERS += $$PWD/jkqtfastplotter/jkqtfastplotter.h \
           $$PWD/jkqtplottertools/jkqtptools.h \
           $$PWD/jkqtplottertools/jkqtphighrestimer.h \
           $$PWD/jkqtplottertools/jkqtp_imexport.h

SOURCES += $$PWD/jkqtfastplotter/jkqtfastplotter.cpp \
           $$PWD/jkqtplottertools/jkqtptools.cpp \
           $$PWD/jkqtplottertools/jkqtphighrestimer.cpp

RESOURCES += $$PWD/jkqtplotterressources/jkqtpbaseplotter.qrc

INCLUDEPATH += $$PWD

QT += core gui opengl
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

Fix compile issues of JKQtFastPlotter

!win32-msvc* {
    QMAKE_CXXFLAGS += -fexceptions
} else {
    QMAKE_CXXFLAGS += /EHsc
    # To enable M_PI, M_E,...
    DEFINES += _USE_MATH_DEFINES
    # To fix error: C2338: va_start argument must not
    # have reference type and must not be parenthesized
    DEFINES += _CRT_NO_VA_START_VALIDATION
}

HEADERS += $$PWD/jkqtfastplotter/jkqtfastplotter.h \
           $$PWD/jkqtplottertools/jkqtptools.h \
           $$PWD/jkqtplottertools/jkqtphighrestimer.h \
           $$PWD/jkqtplottertools/jkqtp_imexport.h

SOURCES += $$PWD/jkqtfastplotter/jkqtfastplotter.cpp \
           $$PWD/jkqtplottertools/jkqtptools.cpp \
           $$PWD/jkqtplottertools/jkqtphighrestimer.cpp

RESOURCES += $$PWD/jkqtplotterressources/jkqtpbaseplotter.qrc

INCLUDEPATH += $$PWD

QT += core gui opengl
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport


QTX.core.MAJOR_VERSION = 0
QTX.core.MINOR_VERSION = 0
QTX.core.PATCH_VERSION = 0
QTX.core.VERSION = $${QTX.core.MAJOR_VERSION}.$${QTX.core.MINOR_VERSION}.$${QTX.core.PATCH_VERSION}

QTX.core.name = QtxCore
QTX.core.bins = $$PWD/../bin
QTX.core.includes = $$PWD/../include
QTX.core.sources = $$PWD/../src/version
QTX.core.libs = $$PWD/../lib
QTX.core.plugins = $$PWD/../plugins
QTX.core.imports = $$PWD/../imports

Set module sources to correct path.

QTX.core.MAJOR_VERSION = 0
QTX.core.MINOR_VERSION = 0
QTX.core.PATCH_VERSION = 0
QTX.core.VERSION = $${QTX.core.MAJOR_VERSION}.$${QTX.core.MINOR_VERSION}.$${QTX.core.PATCH_VERSION}

QTX.core.name = QtxCore
QTX.core.bins = $$PWD/../bin
QTX.core.includes = $$PWD/../include
QTX.core.sources = $$PWD/../src/core
QTX.core.libs = $$PWD/../lib
QTX.core.plugins = $$PWD/../plugins
QTX.core.imports = $$PWD/../imports


# Qt core mimetype module

HEADERS += \
        $$PWD/mimedatabase.h \
        $$PWD/mimetype.h \
        $$PWD/mimemagicrulematcher_p.h \
        $$PWD/mimetype_p.h \
        $$PWD/mimetypeparser_p.h \
        $$PWD/mimedatabase_p.h \
        $$PWD/mimemagicrule_p.h \
        $$PWD/mimeglobpattern_p.h \
        $$PWD/mimeprovider_p.h

SOURCES += \
        $$PWD/mimedatabase.cpp \
        $$PWD/mimetype.cpp \
        $$PWD/mimemagicrulematcher.cpp \
        $$PWD/mimetypeparser.cpp \
        $$PWD/mimemagicrule.cpp \
        $$PWD/mimeglobpattern.cpp \
        $$PWD/mimeprovider.cpp

Add freedesktop.org.xml to .pri file for easy access in locator.

# Qt core mimetype module

HEADERS += \
        $$PWD/mimedatabase.h \
        $$PWD/mimetype.h \
        $$PWD/mimemagicrulematcher_p.h \
        $$PWD/mimetype_p.h \
        $$PWD/mimetypeparser_p.h \
        $$PWD/mimedatabase_p.h \
        $$PWD/mimemagicrule_p.h \
        $$PWD/mimeglobpattern_p.h \
        $$PWD/mimeprovider_p.h

SOURCES += \
        $$PWD/mimedatabase.cpp \
        $$PWD/mimetype.cpp \
        $$PWD/mimemagicrulematcher.cpp \
        $$PWD/mimetypeparser.cpp \
        $$PWD/mimemagicrule.cpp \
        $$PWD/mimeglobpattern.cpp \
        $$PWD/mimeprovider.cpp

OTHER_FILES += $$[QT_HOST_DATA/src]/src/corelib/mimetypes/mime/packages/freedesktop.org.xml


contains(QT_MAJOR_VERSION, 4) {
    unittest_arguments += -graphicssystem raster
}

qws {
    unittest_arguments += -qws
}

QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = \
    TESTING_IN_SANDBOX=1 \
    TESTPLUGIN_PATH=../plugins \
    TESTDATA_PATH=$$IN_PWD \
    LD_LIBRARY_PATH=../../connection:../../maliit-plugins-quick/input-method:../../maliit-plugins-quick/plugin-factory:../../src:../../input-context/input-context-plugin:../../maliit:../../maliit-settings:../plugins:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$unittest_arguments

check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda

Update LD_LIBRARY_PATH in tests to reflect build dir changes

contains(QT_MAJOR_VERSION, 4) {
    unittest_arguments += -graphicssystem raster
}

qws {
    unittest_arguments += -qws
}

QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = \
    TESTING_IN_SANDBOX=1 \
    TESTPLUGIN_PATH=../plugins \
    TESTDATA_PATH=$$IN_PWD \
    LD_LIBRARY_PATH=../../lib:../../lib/plugins:../plugins:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$unittest_arguments

check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda


!ios: DEFINES += V4_ENABLE_JIT

DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

win*: DEFINES += NOMINMAX

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

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

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

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

Fix JIT selection on Android with ARM builds

!ios: DEFINES += V4_ENABLE_JIT

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

DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

win*: DEFINES += NOMINMAX

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

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

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

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


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

QT += declarative
INCLUDEPATH += $$PWD/include
LIBS += -L$$PWD -lQmlJSDebugger

Fix compilation for debug builds on Windows

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

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

DEBUGLIB=QmlJSDebugger
CONFIG(debug, debug|release) {
    windows:DEBUGLIB = QmlJSDebuggerd
}
LIBS += -L$$PWD -l$$DEBUGLIB


QT += declarative

SOURCES += $$PWD/sailfishapplication.cpp
HEADERS += $$PWD/sailfishapplication.h
INCLUDEPATH += $$PWD

TARGETPATH = /opt/sdk/bin
target.path = $$TARGETPATH

DEPLOYMENT_PATH = /opt/sdk/share/$$TARGET
qml.path = $$DEPLOYMENT_PATH
desktop.path = /opt/sdk/share/applications

contains(CONFIG, desktop) {
    DEFINES *= DESKTOP
    QT += opengl
}

INSTALLS += target qml desktop

DEFINES += DEPLOYMENT_PATH=\"\\\"\"$${DEPLOYMENT_PATH}/\"\\\"\"

CONFIG += link_pkgconfig
packagesExist(qdeclarative-boostable) {
    message("Building with qdeclarative-boostable support")
    DEFINES += HAS_BOOSTER
    PKGCONFIG += qdeclarative-boostable
} else {
    warning("qdeclarative-boostable not available; startup times will be slower")
}

Adjust application templete for rsync

QT += declarative

SOURCES += $$PWD/sailfishapplication.cpp
HEADERS += $$PWD/sailfishapplication.h
INCLUDEPATH += $$PWD

TARGETPATH = /usr/bin
target.path = $$TARGETPATH
DEPLOYMENT_PATH = /opt/sdk/$$TARGET/usr/share/$$TARGET
qml.path =/usr/share/$$TARGET
desktop.path =  /usr/share/$$TARGET/applications

contains(CONFIG, desktop) {
    DEFINES *= DESKTOP
    QT += opengl
}

INSTALLS += target qml desktop

DEFINES += DEPLOYMENT_PATH=\"\\\"\"$${DEPLOYMENT_PATH}/\"\\\"\"

CONFIG += link_pkgconfig
packagesExist(qdeclarative-boostable) {
    message("Building with qdeclarative-boostable support")
    DEFINES += HAS_BOOSTER
    PKGCONFIG += qdeclarative-boostable
} else {
    warning("qdeclarative-boostable not available; startup times will be slower")
}


# This file was generated by the Qt Quick Application wizard of Qt Creator.
# The code below adds the QmlApplicationViewer to the project and handles the
# activation of QML debugging.
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.

QT += declarative

SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD

# Include JS debugger library if QMLJSDEBUGGER_PATH is set
!isEmpty(QMLJSDEBUGGER_PATH) {
    include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
} else {
    DEFINES -= QMLJSDEBUGGER
}

Remove qmljs debugging helper setup code from QtQuickApp template


# Use when a .pro file requires libmaliit-plugins
# The .pro file must define TOP_DIR to be a relative path
# to the top-level source/build directory, and include config.pri

INCLUDEPATH += $$TOP_DIR/src
LIBS += $$TOP_DIR/lib/$$maliitDynamicLib($${MALIIT_PLUGINS_LIB})
POST_TARGETDEPS += $$TOP_DIR/lib/$$maliitDynamicLib($${MALIIT_PLUGINS_LIB})

Fix out-of-tree build of ut_mimonscreenplugins.

# Use when a .pro file requires libmaliit-plugins
# The .pro file must define TOP_DIR to be a relative path
# to the top-level source/build directory, and include config.pri

INCLUDEPATH += $$TOP_DIR/src $$OUT_PWD/$$TOP_DIR/src
LIBS += $$TOP_DIR/lib/$$maliitDynamicLib($${MALIIT_PLUGINS_LIB})
POST_TARGETDEPS += $$TOP_DIR/lib/$$maliitDynamicLib($${MALIIT_PLUGINS_LIB})


ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++11 -pedantic-errors -Werror -Wextra
INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h

Enable O2 optimizations for debug builds

ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++11 -pedantic-errors -Werror -Wextra -O2 -g -fno-omit-frame-pointer
INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h


android-no-sdk {
    target.path = /data/user/qt
    export(target.path)
    INSTALLS += target
} else:android {
    x86 {
        target.path = /libs/x86
    } else: armeabi-v7a {
        target.path = /libs/armeabi-v7a
    } else {
        target.path = /libs/armeabi
    }
    export(target.path)
    INSTALLS += target
} else:unix {
    isEmpty(target.path) {
        target.path = /opt/$${TARGET}/bin
        export(target.path)
    }
    INSTALLS += target
}

export(INSTALLS)

Set correct settings for qnx target

android-no-sdk {
    target.path = /data/user/qt
    export(target.path)
    INSTALLS += target
} else:android {
    x86 {
        target.path = /libs/x86
    } else: armeabi-v7a {
        target.path = /libs/armeabi-v7a
    } else {
        target.path = /libs/armeabi
    }
    export(target.path)
    INSTALLS += target
} else:unix {
    isEmpty(target.path) {
        qnx {
            target.path = /tmp/$${TARGET}/bin
        } else {
            target.path = /opt/$${TARGET}/bin
        }
        export(target.path)
    }
    INSTALLS += target
}

export(INSTALLS)


# Copyright (c) 2015 Piotr Tworek. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE.YTPlayer file.

TRANSLATIONS += \
        languages/de_DE.ts \
        languages/en_GB.ts \
        languages/nl_NL.ts \
        languages/ru_RU.ts

OTHER_FILES += languages/translations.json

updateqm.input = TRANSLATIONS
updateqm.output = $$top_builddir/languages/${QMAKE_FILE_BASE}.qm
updateqm.commands = \
	lrelease -idbased ${QMAKE_FILE_IN} \
        -qm $$top_builddir/languages/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += updateqm

PRE_TARGETDEPS += compiler_updateqm_make_all

localization.files = $$files($$top_builddir/languages/*.qm)
localization.path = /usr/share/$${TARGET}/languages

INSTALLS += localization

Add sv translation to TRANSLATIONS variable.

# Copyright (c) 2015 Piotr Tworek. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE.YTPlayer file.

TRANSLATIONS += \
        languages/de_DE.ts \
        languages/en_GB.ts \
        languages/nl_NL.ts \
        languages/ru_RU.ts \
        languages/sv.ts

OTHER_FILES += languages/translations.json

updateqm.input = TRANSLATIONS
updateqm.output = $$top_builddir/languages/${QMAKE_FILE_BASE}.qm
updateqm.commands = \
	lrelease -idbased ${QMAKE_FILE_IN} \
        -qm $$top_builddir/languages/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += updateqm

PRE_TARGETDEPS += compiler_updateqm_make_all

localization.files = $$files($$top_builddir/languages/*.qm)
localization.path = /usr/share/$${TARGET}/languages

INSTALLS += localization


INCLUDEPATH += $$PWD
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT

!mac:use_pkgconfig {
    QMAKE_CXXFLAGS += $$system(pkg-config --cflags wayland-server)

    LIBS += $$system(pkg-config --libs wayland-server)

    #set the rpath
    !isEmpty(QMAKE_LFLAGS_RPATH) {
        WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
        !isEmpty(WAYLAND_NEEDS_RPATH) {
            WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
            !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
        }
    }
} else {
    INCLUDEPATH += $$PWD/../3rdparty/wayland
    LIBS += -L$$PWD/../../lib
    LIBS += -lwayland-server -lffi
}

include ($$PWD/util/util.pri)
include ($$PWD/wayland_wrapper/wayland_wrapper.pri)
include ($$PWD/hardware_integration/hardware_integration.pri)
include ($$PWD/compositor_api/compositor_api.pri)
include ($$PWD/windowmanagerprotocol/windowmanagerprotocol.pri)

Make it compile with pkg-config.

INCLUDEPATH += $$PWD
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT

!mac:use_pkgconfig {
    CONFIG += link_pkgconfig
    PKGCONFIG += wayland-server

    #set the rpath
    !isEmpty(QMAKE_LFLAGS_RPATH) {
        WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
        !isEmpty(WAYLAND_NEEDS_RPATH) {
            WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
            !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
        }
    }
} else {
    INCLUDEPATH += $$PWD/../3rdparty/wayland
    LIBS += -L$$PWD/../../lib
    LIBS += -lwayland-server -lffi
}

include ($$PWD/util/util.pri)
include ($$PWD/wayland_wrapper/wayland_wrapper.pri)
include ($$PWD/hardware_integration/hardware_integration.pri)
include ($$PWD/compositor_api/compositor_api.pri)
include ($$PWD/windowmanagerprotocol/windowmanagerprotocol.pri)


QMAKE_CACHE=$${OUT_PWD}/.qmake.cache
BASE_NAME=$$PWD

# Detect stale .qmake.cache
exists($$QMAKE_CACHE) {
    !equals(PROJECTROOT, $$BASE_NAME): system(rm $$QMAKE_CACHE)
}

linux* {
    # If you change the defaults here, fix src/common.pri
    message(We set these variables in the toplevel .qmake.cache file)
    message(that qmake ascends to in perpetuity)
    message()
    message(Linux specific options: ('*' indicates that option is enabled by default))
    message(Use CONFIG+=<option> to enable and CONFIG-=<option> to disable)
    message(avahi* - Enabled Avahi support)
    message(glviewport* - Render using a GL Viewport)
    message(glgs - Render using GL graphics system (Avoid like the plague!))
}

isEmpty(PROJECTROOT) {
    message()
    system(echo "PROJECTROOT=$$BASE_NAME" > $$QMAKE_CACHE)
    system(echo "CONFIG-=qt_framework" >> $$QMAKE_CACHE)
    message(Cache created)
    message(Please rerun qmake)
}

Add qt5 check to .qmake.cache

QMAKE_CACHE=$${OUT_PWD}/.qmake.cache
BASE_NAME=$$PWD

# Detect stale .qmake.cache
exists($$QMAKE_CACHE) {
    !equals(PROJECTROOT, $$BASE_NAME): system(rm $$QMAKE_CACHE)
}

linux* {
    # If you change the defaults here, fix src/common.pri
    message(We set these variables in the toplevel .qmake.cache file)
    message(that qmake ascends to in perpetuity)
    message()
    message(Linux specific options: ('*' indicates that option is enabled by default))
    message(Use CONFIG+=<option> to enable and CONFIG-=<option> to disable)
    message(avahi* - Enabled Avahi support)
    message(glviewport* - Render using a GL Viewport)
    message(glgs - Render using GL graphics system (Avoid like the plague!))
}

isEmpty(PROJECTROOT) {
    message()
    system(echo "PROJECTROOT=$$BASE_NAME" > $$QMAKE_CACHE)
    system(echo "CONFIG-=qt_framework" >> $$QMAKE_CACHE)
    message(Cache created)
    message(Please rerun qmake)
    system(echo "equals\\(QT_MAJOR_VERSION, \\\"5\\\"\\) CONFIG+=qt5" >> $$QMAKE_CACHE)
}


contains(QT_CONFIG, egl): {
	CONFIG += egl

	HEADERS += \
	    egl/qegl_p.h \
	    egl/qeglcontext_p.h \
	    egl/qeglproperties_p.h

	SOURCES += \
	    egl/qegl.cpp \
	    egl/qeglproperties.cpp

	wince*: SOURCES += egl/qegl_wince.cpp

	unix {
	    embedded {
	        SOURCES += egl/qegl_qws.cpp
	    } else {
	        symbian {
	            SOURCES += egl/qegl_symbian.cpp
	        } else {
	            SOURCES += egl/qegl_x11.cpp
	        }
	    }
	}
} else:symbian {
	SOURCES += egl/qegl_stub.cpp
	SOURCES += egl/qeglproperties_stub.cpp
}

Fix for EGL for symbian on 3.1/3.2/5.0, define QT_NO_EGL.

contains(QT_CONFIG, egl): {
	CONFIG += egl

	HEADERS += \
	    egl/qegl_p.h \
	    egl/qeglcontext_p.h \
	    egl/qeglproperties_p.h

	SOURCES += \
	    egl/qegl.cpp \
	    egl/qeglproperties.cpp

	wince*: SOURCES += egl/qegl_wince.cpp

	unix {
	    embedded {
	        SOURCES += egl/qegl_qws.cpp
	    } else {
	        symbian {
	            SOURCES += egl/qegl_symbian.cpp
	        } else {
	            SOURCES += egl/qegl_x11.cpp
	        }
	    }
	}
} else:symbian {
	DEFINES += QT_NO_EGL
	SOURCES += egl/qegl_stub.cpp
	SOURCES += egl/qeglproperties_stub.cpp
}


QTC_PLUGIN_NAME = QmlDesigner
QTC_LIB_DEPENDS += \
    utils \
    qmljs \
    qmleditorwidgets
QTC_PLUGIN_DEPENDS += \
    coreplugin \
    texteditor \
    qmljseditor \
    qtsupport \
    projectexplorer
INCLUDEPATH *= \
    $$PWD/../../../share/qtcreator/qml/qmlpuppet/interfaces \
    $$PWD/designercore \
    $$PWD/designercore/include \
    $$PWD/components/componentcore \
    $$PWD/components/formeditor \
    $$PWD/components/itemlibrary \
    $$PWD/components/navigator \
    $$PWD/components/propertyeditor \
    $$PWD/components/stateseditor \
    $$PWD/components/debugview \
    $$PWD/components/integration \
    $$PWD/components/logger

Add plugin directory to the exported directories

QTC_PLUGIN_NAME = QmlDesigner
QTC_LIB_DEPENDS += \
    utils \
    qmljs \
    qmleditorwidgets
QTC_PLUGIN_DEPENDS += \
    coreplugin \
    texteditor \
    qmljseditor \
    qtsupport \
    projectexplorer
INCLUDEPATH *= \
    $$PWD \
    $$PWD/../../../share/qtcreator/qml/qmlpuppet/interfaces \
    $$PWD/designercore \
    $$PWD/designercore/include \
    $$PWD/components/componentcore \
    $$PWD/components/formeditor \
    $$PWD/components/itemlibrary \
    $$PWD/components/navigator \
    $$PWD/components/propertyeditor \
    $$PWD/components/stateseditor \
    $$PWD/components/debugview \
    $$PWD/components/integration \
    $$PWD/components/logger


contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols

# MOC_DIR = moc
DEFINES += QT_NO_STYLE_S60

debug {
  DEFINES += VIEWLOGGER
}

TMP_BAUHAUS_NO_OUTPUT = $$[BAUHAUS_NO_OUTPUT]
equals(TMP_BAUHAUS_NO_OUTPUT, true):DEFINES += QT_NO_DEBUG_OUTPUT \
    QT_NO_WARNING_OUTPUT
DEFINES += ENABLE_TEXT_VIEW \
    QWEAKPOINTER_ENABLE_ARROW

isEmpty($$(BAUHAUS_OUTPUT_IN_TEST)):DEFINES += QDEBUG_IN_TESTS WARNINGS_IN_TESTS

Remove reduce_exports / hide_symbols qmake magic


SUBDIRS +=  qserviceinterfacedescriptor \
	qservicefilter \
        qservicecontext \
        qremoteserviceregister

Revert "Enable 2 more autotests for harmattan"


QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += *.gcno *.gcda

Fix make check for non-legacy mode

QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../../maliit:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += *.gcno *.gcda


# exportacao e configuracoes de build

INCLUDEPATH += $$PWD/project/src

win32 {
	win32-g++ {
		unit_tests {
		    LIBS += -Wl,--whole-archive -lexception_tests -Wl,--no-whole-archive
		    EXE_DEPS += $$BUILD_DIR/libexception_tests.a
		}
                LIBS += -lexception -limagehlp -Wl,--wrap,__cxa_throw
		bfd {
			LIBS += -lbfd -liberty
		}
		EXE_DEPS += $$BUILD_DIR/libexception.a
	} else {
		unit_tests {
		    LIBS += exception_tests.lib
		    EXE_DEPS += $$BUILD_DIR/exception_tests.lib
		}
		LIBS += exception.lib imagehlp.lib
		EXE_DEPS += $$BUILD_DIR/exception.lib
	}
}

unix {
        unit_tests {
            EXE_DEPS += $$BUILD_DIR/libexception_tests.a
	    LIBS += -Wl,--whole-archive -lexception_tests -Wl,--no-whole-archive
        }
        LIBS += -lexception -Wl,--wrap,__cxa_throw
	bfd {
		LIBS += -lbfd -ldl -lz -liberty
	}

	EXE_DEPS += $$BUILD_DIR/libexception.a
}

Remove trailing whitespace de todos os arquivos de novo


CONFIG += module
MODULE_PRI += $$PWD/../../modules/qt_compositor.pri

INCLUDEPATH += $$PWD
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
DEFINES += QT_BUILD_COMPOSITOR_LIB

!mac:use_pkgconfig {
    CONFIG += link_pkgconfig
    PKGCONFIG += wayland-server

    #set the rpath
    !isEmpty(QMAKE_LFLAGS_RPATH) {
        WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
        !isEmpty(WAYLAND_NEEDS_RPATH) {
            WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
            !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
        }
    }
} else {
    INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
    !isEmpty(QMAKE_LIBDIR_WAYLAND) {
        LIBS += -L$$QMAKE_LIBDIR_WAYLAND
    }
    LIBS += -lwayland-server -lffi
}

HEADERS += qtcompositorversion.h

include ($$PWD/global/global.pri)
include ($$PWD/wayland_wrapper/wayland_wrapper.pri)
include ($$PWD/hardware_integration/hardware_integration.pri)
include ($$PWD/compositor_api/compositor_api.pri)
include ($$PWD/windowmanagerprotocol/windowmanagerprotocol.pri)

Load the module so we get the correct QT_CONFIG

CONFIG += module

load(qt_module)
MODULE_PRI += $$PWD/../../modules/qt_compositor.pri

INCLUDEPATH += $$PWD
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
DEFINES += QT_BUILD_COMPOSITOR_LIB

!mac:use_pkgconfig {
    CONFIG += link_pkgconfig
    PKGCONFIG += wayland-server

    #set the rpath
    !isEmpty(QMAKE_LFLAGS_RPATH) {
        WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
        !isEmpty(WAYLAND_NEEDS_RPATH) {
            WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
            !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
        }
    }
} else {
    INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
    !isEmpty(QMAKE_LIBDIR_WAYLAND) {
        LIBS += -L$$QMAKE_LIBDIR_WAYLAND
    }
    LIBS += -lwayland-server -lffi
}

HEADERS += qtcompositorversion.h

include ($$PWD/global/global.pri)
include ($$PWD/wayland_wrapper/wayland_wrapper.pri)
include ($$PWD/hardware_integration/hardware_integration.pri)
include ($$PWD/compositor_api/compositor_api.pri)
include ($$PWD/windowmanagerprotocol/windowmanagerprotocol.pri)


QMAKE_EXTRA_TARGETS += check
check.target = check

# This enables the maliit library for C++ code
CONFIG += maliit-plugins

qws {
    test_arguments += -qws
}

DATA_DIR = $$OUT_PWD/../../data

check.commands = \
    MALIIT_PLUGINS_DATADIR=$$DATA_DIR \
    MALIIT_KEYBOARD_DATADIR=$$DATA_DIR \
    LD_LIBRARY_PATH=$$MALIIT_INSTALL_LIBS:$$[QT_INSTALL_LIBS]:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$test_arguments

check.depends += $$TARGET

LIBS += ../common/$$maliitStaticLib(tests-common)
POST_TARGETDEPS += ../common/$$maliitStaticLib(tests-common)
INCLUDEPATH += ../common

Fix failing make check in out-of-tree build

QMAKE_EXTRA_TARGETS += check
check.target = check

# This enables the maliit library for C++ code
CONFIG += maliit-plugins

qws {
    test_arguments += -qws
}

# Note that if datafiles are generated they would end out in
# $$OUT_PWD and this would fail
DATA_DIR = $$IN_PWD/../data

check.commands = \
    MALIIT_PLUGINS_DATADIR=$$DATA_DIR \
    MALIIT_KEYBOARD_DATADIR=$$DATA_DIR \
    LD_LIBRARY_PATH=$$MALIIT_INSTALL_LIBS:$$[QT_INSTALL_LIBS]:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$test_arguments

check.depends += $$TARGET

LIBS += ../common/$$maliitStaticLib(tests-common)
POST_TARGETDEPS += ../common/$$maliitStaticLib(tests-common)
INCLUDEPATH += ../common


SUBDIRS +=  qserviceinterfacedescriptor \
	qservicefilter \
	qservicecontext

Enable 2 more autotests for harmattan

SUBDIRS +=  qserviceinterfacedescriptor \
	qservicefilter \
        qservicecontext \
        qremoteserviceregister \
        qservicemanager_ipc


include(../config.pri)

OBJECTS_DIR = .obj
MOC_DIR = .moc

CONFIG += debug
QT += testlib xml

QMAKE_CLEAN += *.log *~

target.path = $$MALIIT_TEST_LIBDIR/$$TARGET
INSTALLS += target

SRC_DIR = ../../src
PASSTHROUGH_DIR = ../../passthroughserver

INCLUDEPATH += . \
               $$SRC_DIR \
               $$PASSTHROUGH_DIR

code_coverage_option=off
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        code_coverage_option=on
    }
}

Include topsrcdir into the includepath

include(../config.pri)

OBJECTS_DIR = .obj
MOC_DIR = .moc

CONFIG += debug
QT += testlib xml

QMAKE_CLEAN += *.log *~

target.path = $$MALIIT_TEST_LIBDIR/$$TARGET
INSTALLS += target

TOP_DIR = ../..
SRC_DIR = $$TOP_DIR/src
PASSTHROUGH_DIR = $$TOP_DIR/passthroughserver

INCLUDEPATH += . \
               $$TOP_DIR \
               $$SRC_DIR \
               $$PASSTHROUGH_DIR

code_coverage_option=off
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        code_coverage_option=on
    }
}


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

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

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

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

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

include(../qt_targets.pri)

wince*:LIBS += $$QMAKE_LIBS_GUI

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

Install QtQuick1 imports to the correct location

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

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

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

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

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

include(../qt_targets.pri)

wince*:LIBS += $$QMAKE_LIBS_GUI

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


include(../../3rdparty/libexif-0.6.19/libexif/libexif.pri)
include(../3rdparty/taglib/taglib.pri)

INCLUDEPATH += ../3rdparty/taglib/ ../3rdparty/

HEADERS += $$PWD/mediainfo.h \
           $$PWD/mediamodel.h \
           $$PWD/tagreader.h \
           $$PWD/exifreader.h

SOURCES += $$PWD/mediainfo.cpp \
           $$PWD/mediamodel.cpp \
           $$PWD/tagreader.cpp \
           $$PWD/exifreader.cpp

Fix up exif dependency building

SRCDIR=$$PROJECTROOT/src
message($$SRCDIR)

include($$SRCDIR/3rdparty/libexif-0.6.19/libexif/libexif.pri)
include($$SRCDIR/3rdparty/taglib/taglib.pri)

INCLUDEPATH += $$SRCDIR/3rdparty/taglib/ $$SRCDIR/3rdparty/ $$SRCDIR/3rdparty/libexif-0.6.19

HEADERS += $$PWD/mediainfo.h \
           $$PWD/mediamodel.h \
           $$PWD/tagreader.h \
           $$PWD/exifreader.h

SOURCES += $$PWD/mediainfo.cpp \
           $$PWD/mediamodel.cpp \
           $$PWD/tagreader.cpp \
           $$PWD/exifreader.cpp


SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
!isEmpty(SUPPORT_QT_S60) {
    message("Adding experimental support for Qt/S60 applications.")
    DEFINES += QTCREATOR_WITH_S60
    SOURCES += $$PWD/s60devices.cpp \
        $$PWD/s60devicespreferencepane.cpp \
        $$PWD/s60manager.cpp \
        $$PWD/winscwtoolchain.cpp \
        $$PWD/gccetoolchain.cpp \
        $$PWD/s60emulatorrunconfiguration.cpp \
        $$PWD/s60devicerunconfiguration.cpp \
        $$PWD/serialdevicelister.cpp \
        $$PWD/rvcttoolchain.cpp
    HEADERS += $$PWD/s60devices.h \
        $$PWD/s60devicespreferencepane.h \
        $$PWD/s60manager.h \
        $$PWD/winscwtoolchain.h \
        $$PWD/gccetoolchain.h \
        $$PWD/s60emulatorrunconfiguration.h \
        $$PWD/s60devicerunconfiguration.h \
        $$PWD/serialdevicelister.h \
        $$PWD/rvcttoolchain.h
    FORMS += $$PWD/s60devicespreferencepane.ui
    OTHER_FILES += $$PWD/qt-s60-todo.txt
    include(../../../shared/trk/trk.pri)||error("could not include trk.pri")
}

Enable Qt for Symbian parts on windows by default

win32:SUPPORT_QT_S60=1
else:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
!isEmpty(SUPPORT_QT_S60) {
    message("Adding experimental support for Qt/S60 applications.")
    DEFINES += QTCREATOR_WITH_S60
    SOURCES += $$PWD/s60devices.cpp \
        $$PWD/s60devicespreferencepane.cpp \
        $$PWD/s60manager.cpp \
        $$PWD/winscwtoolchain.cpp \
        $$PWD/gccetoolchain.cpp \
        $$PWD/s60emulatorrunconfiguration.cpp \
        $$PWD/s60devicerunconfiguration.cpp \
        $$PWD/serialdevicelister.cpp \
        $$PWD/rvcttoolchain.cpp
    HEADERS += $$PWD/s60devices.h \
        $$PWD/s60devicespreferencepane.h \
        $$PWD/s60manager.h \
        $$PWD/winscwtoolchain.h \
        $$PWD/gccetoolchain.h \
        $$PWD/s60emulatorrunconfiguration.h \
        $$PWD/s60devicerunconfiguration.h \
        $$PWD/serialdevicelister.h \
        $$PWD/rvcttoolchain.h
    FORMS += $$PWD/s60devicespreferencepane.ui
    OTHER_FILES += $$PWD/qt-s60-todo.txt
    include(../../../shared/trk/trk.pri)||error("could not include trk.pri")
}


DBUS_XML_DIR = $$TOP_DIR/dbus_interfaces

DBUS_CONTEXT_XML = $$DBUS_XML_DIR/minputmethodcontext1interface.xml
DBUS_SERVER_XML = $$DBUS_XML_DIR/minputmethodserver1interface.xml

Fix OOT build with DBus interface definitions

DBUS_XML_DIR = $$IN_PWD

DBUS_CONTEXT_XML = $$DBUS_XML_DIR/minputmethodcontext1interface.xml
DBUS_SERVER_XML = $$DBUS_XML_DIR/minputmethodserver1interface.xml


include($$PWD/build.pri)

QT += core
QT -= gui

CONFIG += qt warn_on
CONFIG -= debug

QMAKE_CXXFLAGS += -Werror

DEBUG_MODE = $$(DEBUG_MODE)
contains(DEBUG_MODE, 1) {
  CONFIG += debug
}

Add some additional cflags like disabling rtti and exceptions.

include($$PWD/build.pri)

QT += core
QT -= gui

CONFIG += qt thread warn_on
CONFIG -= debug rtti exceptions

QMAKE_CXXFLAGS += -Werror -fno-rtti -fno-exceptions

DEBUG_MODE = $$(DEBUG_MODE)
contains(DEBUG_MODE, 1) {
  CONFIG += debug
}


QMAKE_CXXFLAGS += -std=c++11

CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

INCLUDEPATH += $$PWD/src
SRC_DIR = $$PWD

Add qt to the project

QMAKE_CXXFLAGS += -std=c++11

CONFIG += console
CONFIG -= app_bundle

INCLUDEPATH += $$PWD/src
SRC_DIR = $$PWD


ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++0x -Werror -Wextra -pedantic-errors
INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h

Add extra warning diagnostics on gcc command line.

ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++0x -pedantic-errors -Werror -Wextra -Winline
INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h


INCLUDEPATH += $$PWD

HEADERS += \
    $$PWD/qcdevice.h \
    $$PWD/qcstandardpaths.h \
    $$PWD/qcrect.h \
    $$PWD/qcline.h \
    $$PWD/qcimageloader.h \
    $$PWD/qcimageloaderwrapper.h \
    $$PWD/qcimageprovider.h

SOURCES += \
    $$PWD/qcdevice.cpp \
    $$PWD/qcqmltypes.cpp \
    $$PWD/qcstandardpaths.cpp \
    $$PWD/qcrect.cpp \
    $$PWD/qcline.cpp \
    $$PWD/qcimageloader.cpp \
    $$PWD/qcimageloaderwrapper.cpp \
    $$PWD/qcimageprovider.cpp

DISTFILES +=

Add androidextras if the target is Android

INCLUDEPATH += $$PWD

HEADERS += \
    $$PWD/qcdevice.h \
    $$PWD/qcstandardpaths.h \
    $$PWD/qcrect.h \
    $$PWD/qcline.h \
    $$PWD/qcimageloader.h \
    $$PWD/qcimageloaderwrapper.h \
    $$PWD/qcimageprovider.h

SOURCES += \
    $$PWD/qcdevice.cpp \
    $$PWD/qcqmltypes.cpp \
    $$PWD/qcstandardpaths.cpp \
    $$PWD/qcrect.cpp \
    $$PWD/qcline.cpp \
    $$PWD/qcimageloader.cpp \
    $$PWD/qcimageloaderwrapper.cpp \
    $$PWD/qcimageprovider.cpp

DISTFILES +=

android {
    QT += androidextras
}


# Linker optimization for release build
QMAKE_LFLAGS_RELEASE+=-Wl,--as-needed
# Compiler warnings are error if the build type is debug
QMAKE_CXXFLAGS_DEBUG+=-Werror -O0

CONFIG += no_keywords

# The feature maliit-defines initializes some variables related for MALIIT, such as installation paths
# here have to load it early, to start using the defines immediately
!load(maliit-defines) {
   error(Cannot find $$[QT_INSTALL_DATA]/mkspecs/features/maliit-defines.prf. Probably Maliit framework not installed)
}
# This enables the maliit library for C++ code
CONFIG += maliit-plugins

isEmpty(PREFIX) {
   PREFIX = $$MALIIT_PREFIX
}

isEmpty(LIBDIR) {
   LIBDIR = $$PREFIX/lib
}

INSTALL_BIN = $$PREFIX/bin
INSTALL_LIBS = $$LIBDIR
INSTALL_HEADERS = $$PREFIX/include
INSTALL_DOCS = $$PREFIX/share/doc

enable-opengl {
    QT += opengl
    DEFINES += MALIIT_KEYBOARD_HAVE_OPENGL
}

enable-coverage {
    LIBS += -lgcov
    QMAKE_CXXFLAGS += -g -fprofile-arcs -ftest-coverage -O0
    QMAKE_LDFLAGS += -g -fprofile-arcs -ftest-coverage  -O0
}

MALIIT_PACKAGENAME = maliit-plugins
MALIIT_VERSION = $$system(cat $$IN_PWD/VERSION)

Check if QT_CONFIG contains embedded to enable QWS build

# Linker optimization for release build
QMAKE_LFLAGS_RELEASE+=-Wl,--as-needed
# Compiler warnings are error if the build type is debug
QMAKE_CXXFLAGS_DEBUG+=-Werror -O0

CONFIG += no_keywords

# The feature maliit-defines initializes some variables related for MALIIT, such as installation paths
# here have to load it early, to start using the defines immediately
!load(maliit-defines) {
   error(Cannot find $$[QT_INSTALL_DATA]/mkspecs/features/maliit-defines.prf. Probably Maliit framework not installed)
}
# This enables the maliit library for C++ code
CONFIG += maliit-plugins

isEmpty(PREFIX) {
   PREFIX = $$MALIIT_PREFIX
}

isEmpty(LIBDIR) {
   LIBDIR = $$PREFIX/lib
}

contains(QT_CONFIG, embedded) {
    CONFIG += qws
}

INSTALL_BIN = $$PREFIX/bin
INSTALL_LIBS = $$LIBDIR
INSTALL_HEADERS = $$PREFIX/include
INSTALL_DOCS = $$PREFIX/share/doc

enable-opengl {
    QT += opengl
    DEFINES += MALIIT_KEYBOARD_HAVE_OPENGL
}

enable-coverage {
    LIBS += -lgcov
    QMAKE_CXXFLAGS += -g -fprofile-arcs -ftest-coverage -O0
    QMAKE_LDFLAGS += -g -fprofile-arcs -ftest-coverage  -O0
}

MALIIT_PACKAGENAME = maliit-plugins
MALIIT_VERSION = $$system(cat $$IN_PWD/VERSION)


unittest_arguments += -graphicssystem raster

qws {
    unittest_arguments += -qws
}

QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = \
    TESTING_IN_SANDBOX=1 \
    TESTPLUGIN_PATH=../plugins \
    TESTDATA_PATH=$$IN_PWD \
    LD_LIBRARY_PATH=../../connection:../../maliit-plugins-quick/input-method:../../maliit-plugins-quick/plugin-factory:../../src:../../input-context/:../../maliit:../plugins:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$unittest_arguments

check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda

Fix ut_minputcontextplugin not finding libmaliit-qt4.so

unittest_arguments += -graphicssystem raster

qws {
    unittest_arguments += -qws
}

QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = \
    TESTING_IN_SANDBOX=1 \
    TESTPLUGIN_PATH=../plugins \
    TESTDATA_PATH=$$IN_PWD \
    LD_LIBRARY_PATH=../../connection:../../maliit-plugins-quick/input-method:../../maliit-plugins-quick/plugin-factory:../../src:../../input-context/input-context-plugin:../../maliit:../plugins:$(LD_LIBRARY_PATH) \
    ./$$TARGET $$unittest_arguments

check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda


# Linker optimization for release build
QMAKE_LFLAGS_RELEASE+=-Wl,--as-needed
# Compiler warnings are error if the build type is debug
QMAKE_CXXFLAGS_DEBUG+=-Werror

enable-legacy {
    MALIIT_PLUGINS_DIR=$$system(pkg-config --variable pluginsdir MeegoImFramework)
} else {
    MALIIT_PLUGINS_DIR=$$system(pkg-config --variable pluginsdir maliit-plugins-0.80)
}

Make pluginsdatadir available to plugins

# Linker optimization for release build
QMAKE_LFLAGS_RELEASE+=-Wl,--as-needed
# Compiler warnings are error if the build type is debug
QMAKE_CXXFLAGS_DEBUG+=-Werror

enable-legacy {
    MALIIT_PLUGINS_DIR=$$system(pkg-config --variable pluginsdir MeegoImFramework)
    MALIIT_PLUGINS_DATA_DIR=$$system(pkg-config --variable pluginsdatadir MeegoImFramework)
} else {
    MALIIT_PLUGINS_DIR=$$system(pkg-config --variable pluginsdir maliit-plugins-0.80)
    MALIIT_PLUGINS_DATA_DIR=$$system(pkg-config --variable pluginsdatadir maliit-plugins-0.80)
}


DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

win*: DEFINES += NOMINMAX

DEFINES += ENABLE_LLINT=0
DEFINES += ENABLE_DFG_JIT=0
DEFINES += ENABLE_DFG_JIT_UTILITY_METHODS=1
DEFINES += ENABLE_JIT_CONSTANT_BLINDING=0
DEFINES += BUILDING_QT__

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

disassembler {
    if(isEqual(QT_ARCH, "i386")|isEqual(QT_ARCH, "x86_64")):!win*: DEFINES += WTF_USE_UDIS86=1
    if(isEqual(QT_ARCH, "arm")):contains(DEFINES, V4_ENABLE_JIT): DEFINES += WTF_USE_ARMV7_DISASSEMBLER=1
} else {
    DEFINES += WTF_USE_UDIS86=0
}

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

win32-msvc2008|wince*: INCLUDEPATH += $$PWD/stubs/compat

Disable WTF assertions in release builds

DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

win*: DEFINES += NOMINMAX

DEFINES += ENABLE_LLINT=0
DEFINES += ENABLE_DFG_JIT=0
DEFINES += ENABLE_DFG_JIT_UTILITY_METHODS=1
DEFINES += ENABLE_JIT_CONSTANT_BLINDING=0
DEFINES += BUILDING_QT__

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

disassembler {
    if(isEqual(QT_ARCH, "i386")|isEqual(QT_ARCH, "x86_64")):!win*: DEFINES += WTF_USE_UDIS86=1
    if(isEqual(QT_ARCH, "arm")):contains(DEFINES, V4_ENABLE_JIT): DEFINES += WTF_USE_ARMV7_DISASSEMBLER=1
} else {
    DEFINES += WTF_USE_UDIS86=0
}

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

win32-msvc2008|wince*: INCLUDEPATH += $$PWD/stubs/compat

CONFIG(release, debug|release): DEFINES += NDEBUG


DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

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

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

DEFINES += WTF_USE_UDIS86=1
INCLUDEPATH += $$PWD/disassembler
INCLUDEPATH += $$PWD/disassembler/udis86
INCLUDEPATH += $$_OUT_PWD

Work around broken min/max macro definitions on Windows

DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE=""

win*: DEFINES += NOMINMAX

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

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

DEFINES += WTF_USE_UDIS86=1
INCLUDEPATH += $$PWD/disassembler
INCLUDEPATH += $$PWD/disassembler/udis86
INCLUDEPATH += $$_OUT_PWD


HEADERS += \
	$$PWD/jid.h

SOURCES += \
	$$PWD/jid.cpp

Add include paths to Jid module.

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

HEADERS += \
	$$PWD/jid.h

SOURCES += \
	$$PWD/jid.cpp


INCLUDEPATH += effects \
               ./

unix:!mac:!symbian {
   contains(QT_CONFIG, pulseaudio) {
        CONFIG += link_pkgconfig
        PKGCONFIG += libpulse

        DEFINES += QT_MULTIMEDIA_PULSEAUDIO
        PRIVATE_HEADERS += effects/qsoundeffect_pulse_p.h
        SOURCES += effects/qsoundeffect_pulse_p.cpp
        QMAKE_CXXFLAGS += $$QT_CFLAGS_PULSEAUDIO
        LIBS += $$QT_LIBS_PULSEAUDIO
    } else {
        DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER
        PRIVATE_HEADERS += effects/qsoundeffect_qmedia_p.h
        SOURCES += effects/qsoundeffect_qmedia_p.cpp
    }
} else {
    PRIVATE_HEADERS += effects/qsoundeffect_qsound_p.h
    SOURCES += effects/qsoundeffect_qsound_p.cpp
}

PRIVATE_HEADERS += effects/wavedecoder_p.h
PUBLIC_HEADERS += effects/qsoundeffect.h

SOURCES += \
    effects/qsoundeffect.cpp \
    effects/wavedecoder_p.cpp

Remove reference to pulseaudio flags from Qt configure step.

INCLUDEPATH += effects \
               ./

unix:!mac:!symbian {
   contains(QT_CONFIG, pulseaudio) {
        CONFIG += link_pkgconfig
        PKGCONFIG += libpulse

        DEFINES += QT_MULTIMEDIA_PULSEAUDIO
        PRIVATE_HEADERS += effects/qsoundeffect_pulse_p.h
        SOURCES += effects/qsoundeffect_pulse_p.cpp
    } else {
        DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER
        PRIVATE_HEADERS += effects/qsoundeffect_qmedia_p.h
        SOURCES += effects/qsoundeffect_qmedia_p.cpp
    }
} else {
    PRIVATE_HEADERS += effects/qsoundeffect_qsound_p.h
    SOURCES += effects/qsoundeffect_qsound_p.cpp
}

PRIVATE_HEADERS += effects/wavedecoder_p.h
PUBLIC_HEADERS += effects/qsoundeffect.h

SOURCES += \
    effects/qsoundeffect.cpp \
    effects/wavedecoder_p.cpp


################################################################################
# Copyright 2012-2017 Esri
#
#  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.
################################################################################

# this file will include a locally build version of the toolkit components into an application

Support for building against local output.

################################################################################
# Copyright 2012-2017 Esri
#
#  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.
################################################################################

INCLUDEPATH += $PWD/include
QMAKE_LFLAGS += -L$PWD/output -lArcGISRuntimeSolutions


######################################################################
# Communi
######################################################################

!verbose:!symbian:CONFIG += silent

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

!symbian {
    CONFIG(debug, debug|release) {
        OBJECTS_DIR = debug
        MOC_DIR = debug
        RCC_DIR = debug
        UI_DIR = debug
    } else {
        OBJECTS_DIR = release
        MOC_DIR = release
        RCC_DIR = release
        UI_DIR = release
    }
}

macx:!qt_no_framework {
    LIBS += -F$$PWD/../lib -framework Communi
} else {
    TEMPLATE += fakelib
    LIBS += -L$$PWD/../lib -l$$qtLibraryTarget(Communi)
    TEMPLATE -= fakelib
    QMAKE_RPATHDIR += $$PWD/../lib
}

Fix msvc specific linkage problems

######################################################################
# Communi
######################################################################

!verbose:!symbian:CONFIG += silent

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

!symbian {
    CONFIG(debug, debug|release) {
        OBJECTS_DIR = debug
        MOC_DIR = debug
        RCC_DIR = debug
        UI_DIR = debug
    } else {
        OBJECTS_DIR = release
        MOC_DIR = release
        RCC_DIR = release
        UI_DIR = release
    }
}

macx:!qt_no_framework {
    LIBS += -F$$PWD/../lib -framework Communi
} else {
    REAL_TEMPLATE = $$TEMPLATE
    TEMPLATE = fakelib
    LIBS += -L$$PWD/../lib -l$$qtLibraryTarget(Communi)
    TEMPLATE = $$REAL_TEMPLATE
    QMAKE_RPATHDIR += $$PWD/../lib
}


######################################################################
# Communi
######################################################################

isEmpty(IRC_MODULE):error(IRC_MODULE must be set)

TEMPLATE = lib
TARGET = $$qtLibraryTarget($$IRC_MODULE)
QT = core network
!verbose:CONFIG += silent
win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all

include(../version.pri)
!win32:VERSION = $$COMMUNI_VERSION

isEmpty(COMMUNI_BUILDDIR):COMMUNI_BUILDDIR = $$OUT_PWD/../..

DESTDIR = $$COMMUNI_BUILDDIR/lib
DLLDESTDIR = $$COMMUNI_BUILDDIR/bin

CONFIG(debug, debug|release) {
    OBJECTS_DIR = debug
    MOC_DIR = debug
} else {
    OBJECTS_DIR = release
    MOC_DIR = release
}

Build system: do not force debug_and_release & build_all on win32

######################################################################
# Communi
######################################################################

isEmpty(IRC_MODULE):error(IRC_MODULE must be set)

TEMPLATE = lib
TARGET = $$qtLibraryTarget($$IRC_MODULE)
QT = core network
!verbose:CONFIG += silent
contains(QT_CONFIG, debug_and_release) {
    win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release build_all
}

include(../version.pri)
!win32:VERSION = $$COMMUNI_VERSION

isEmpty(COMMUNI_BUILDDIR):COMMUNI_BUILDDIR = $$OUT_PWD/../..

DESTDIR = $$COMMUNI_BUILDDIR/lib
DLLDESTDIR = $$COMMUNI_BUILDDIR/bin

CONFIG(debug, debug|release) {
    OBJECTS_DIR = debug
    MOC_DIR = debug
} else {
    OBJECTS_DIR = release
    MOC_DIR = release
}


QTCREATOR_VERSION = 3.0.1

## set the QTC_SOURCE environment variable to override the setting here
QTCREATOR_SOURCES = $$(QTC_SOURCE)
isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=C:/Projects/qt-creator/$$QTCREATOR_VERSION/src

## set the QTC_BUILD environment variable to override the setting here
IDE_BUILD_TREE = $$(QTC_BUILD)
isEmpty(IDE_BUILD_TREE){
  msvc{
    IDE_BUILD_TREE=c:/Projects/qt-creator/$$QTCREATOR_VERSION/qtcreator-$$QT_VERSION-vc10
    Release:IDE_BUILD_TREE+=release
  }
  else{
    IDE_BUILD_TREE=c:/Projects/qt-creator/$$QTCREATOR_VERSION/qtcreator-$$QT_VERSION
    Release:IDE_BUILD_TREE+=release
  }
}

Revert "Improved work with different compilers"

QTCREATOR_VERSION = 3.0.1

## set the QTC_SOURCE environment variable to override the setting here
QTCREATOR_SOURCES = $$(QTC_SOURCE)
isEmpty(QTCREATOR_SOURCES):QTCREATOR_SOURCES=C:/Projects/qt-creator/$$QTCREATOR_VERSION/src

## set the QTC_BUILD environment variable to override the setting here
IDE_BUILD_TREE = $$(QTC_BUILD)
isEmpty(IDE_BUILD_TREE){
  Release {
    IDE_BUILD_TREE=c:/Projects/qt-creator/$$QTCREATOR_VERSION/$$QT_VERSION-vc10-release
  }
  Debug {
    IDE_BUILD_TREE=c:/Projects/qt-creator/$$QTCREATOR_VERSION/$$QT_VERSION-vc10-debug
  }
}


HEADERS += $$PWD/duperagent.h \
    $$PWD/qpm.h \
    $$PWD/request.h \
    $$PWD/response.h \
    $$PWD/serialization.h \
    $$PWD/jsvalueiterator.h \
    $$PWD/config.h \
    $$PWD/cookiejar.h \
    $$PWD/promise.h

SOURCES += $$PWD/duperagent.cpp \
    $$PWD/request.cpp \
    $$PWD/response.cpp \
    $$PWD/serialization.cpp \
    $$PWD/config.cpp \
    $$PWD/cookiejar.cpp \
    $$PWD/promise.cpp

contains(QT_CONFIG, ssl) {
    HEADERS += $$PWD/ssl.h
    SOURCES += $$PWD/ssl.cpp
}

Check for more SSL options in QT_CONFIG

HEADERS += $$PWD/duperagent.h \
    $$PWD/qpm.h \
    $$PWD/request.h \
    $$PWD/response.h \
    $$PWD/serialization.h \
    $$PWD/jsvalueiterator.h \
    $$PWD/config.h \
    $$PWD/cookiejar.h \
    $$PWD/promise.h

SOURCES += $$PWD/duperagent.cpp \
    $$PWD/request.cpp \
    $$PWD/response.cpp \
    $$PWD/serialization.cpp \
    $$PWD/config.cpp \
    $$PWD/cookiejar.cpp \
    $$PWD/promise.cpp

contains(QT_CONFIG, ssl) | contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
    HEADERS += $$PWD/ssl.h
    SOURCES += $$PWD/ssl.cpp
}


QTC_LIB_NAME = Sqlite
INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/3rdparty/sqlite
INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/sqlite

Remove INCLUDEPATH export from sqlite

QTC_LIB_NAME = Sqlite
INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/sqlite


#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
#UI_DIR          = ui
#UI_HEADERS_DIR  = ui/include
#UI_SOURCES_DIR  = ui/src

# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror -Wno-write-strings

TOP_SRC_DIR     = $$PWD
TOP_BUILD_DIR   = $${TOP_SRC_DIR}/$(BUILD_DIR)
QMAKE_LIBDIR   += $${TOP_BUILD_DIR}/lib/SignOn
INCLUDEPATH    += $${TOP_SRC_DIR}/lib

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += SIGNON_TRACE
#TODO comment this to restrict plugins to run under signon user
DEFINES += NO_SIGNON_USER

# Default directory for signond extensions
DEFINES += SIGNON_EXTENSIONS_DIR=\\\"/usr/lib/signon/extensions\\\"
# End of File

Disable RTTI for the whole project

#-----------------------------------------------------------------------------
# Common configuration for all projects.
#-----------------------------------------------------------------------------

CONFIG         += link_pkgconfig
#MOC_DIR         = .moc
#OBJECTS_DIR     = .obj
RCC_DIR         = resources
#UI_DIR          = ui
#UI_HEADERS_DIR  = ui/include
#UI_SOURCES_DIR  = ui/src

# we don't like warnings...
QMAKE_CXXFLAGS -= -Werror -Wno-write-strings
# Disable RTTI
QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti

TOP_SRC_DIR     = $$PWD
TOP_BUILD_DIR   = $${TOP_SRC_DIR}/$(BUILD_DIR)
QMAKE_LIBDIR   += $${TOP_BUILD_DIR}/lib/SignOn
INCLUDEPATH    += $${TOP_SRC_DIR}/lib

#DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += SIGNON_TRACE
#TODO comment this to restrict plugins to run under signon user
DEFINES += NO_SIGNON_USER

# Default directory for signond extensions
DEFINES += SIGNON_EXTENSIONS_DIR=\\\"/usr/lib/signon/extensions\\\"
# End of File


# QtSsh
HEADERS += \
    $$PWD/qtssh/sshtunnelout.h \
    $$PWD/qtssh/sshtunnelin.h \
    $$PWD/qtssh/sshprocess.h \
    $$PWD/qtssh/sshchannel.h \
    $$PWD/qtssh/sshclient.h \
    $$PWD/qtssh/sshtunneloutsrv.h \
    $$PWD/qtssh/sshscpsend.h \
    $$PWD/qtssh/sshscpget.h \
    $$PWD/qtssh/sshsftp.h \
    $$PWD/qtssh/sshfilesystemmodel.h \
    $$PWD/qtssh/sshfilesystemnode.h \
    $$PWD/qtssh/async_libssh2.h \
    $$PWD/qtssh/sshkey.h

SOURCES += \
    $$PWD/qtssh/sshtunnelout.cpp \
    $$PWD/qtssh/sshtunnelin.cpp \
    $$PWD/qtssh/sshprocess.cpp \
    $$PWD/qtssh/sshchannel.cpp \
    $$PWD/qtssh/sshclient.cpp \
    $$PWD/qtssh/sshtunneloutsrv.cpp \
    $$PWD/qtssh/sshscpsend.cpp \
    $$PWD/qtssh/sshscpget.cpp \
    $$PWD/qtssh/sshsftp.cpp \
    $$PWD/qtssh/sshfilesystemmodel.cpp \
    $$PWD/qtssh/sshfilesystemnode.cpp \
    $$PWD/qtssh/sshkey.cpp

INCLUDEPATH += $$PWD/qtssh

Add Qt config in pri

# QtSsh
QT             += core network

HEADERS += \
    $$PWD/qtssh/sshtunnelout.h \
    $$PWD/qtssh/sshtunnelin.h \
    $$PWD/qtssh/sshprocess.h \
    $$PWD/qtssh/sshchannel.h \
    $$PWD/qtssh/sshclient.h \
    $$PWD/qtssh/sshtunneloutsrv.h \
    $$PWD/qtssh/sshscpsend.h \
    $$PWD/qtssh/sshscpget.h \
    $$PWD/qtssh/sshsftp.h \
    $$PWD/qtssh/sshfilesystemmodel.h \
    $$PWD/qtssh/sshfilesystemnode.h \
    $$PWD/qtssh/async_libssh2.h \
    $$PWD/qtssh/sshkey.h

SOURCES += \
    $$PWD/qtssh/sshtunnelout.cpp \
    $$PWD/qtssh/sshtunnelin.cpp \
    $$PWD/qtssh/sshprocess.cpp \
    $$PWD/qtssh/sshchannel.cpp \
    $$PWD/qtssh/sshclient.cpp \
    $$PWD/qtssh/sshtunneloutsrv.cpp \
    $$PWD/qtssh/sshscpsend.cpp \
    $$PWD/qtssh/sshscpget.cpp \
    $$PWD/qtssh/sshsftp.cpp \
    $$PWD/qtssh/sshfilesystemmodel.cpp \
    $$PWD/qtssh/sshfilesystemnode.cpp \
    $$PWD/qtssh/sshkey.cpp

INCLUDEPATH += $$PWD/qtssh


QT.compositor.VERSION = 5.0.0
QT.compositor.MAJOR_VERSION = 5
QT.compositor.MINOR_VERSION = 0
QT.compositor.PATCH_VERSION = 0

QT.compositor.name = QtCompositor
QT.compositor.bins = $$QT_MODULE_BIN_BASE
QT.compositor.includes = $$QT_MODULE_INCLUDE_BASE/QtCompositor
QT.compositor.private_includes = $$QT_MODULE_INCLUDE_BASE/QtCompositor/$$QT.compositor.VERSION
QT.compositor.sources = $$QT_MODULE_BASE/src/compositor
QT.compositor.libs = $$QT_MODULE_LIB_BASE
QT.compositor.plugins = $$QT_MODULE_PLUGIN_BASE
QT.compositor.imports = $$QT_MODULE_IMPORT_BASE
QT.compositor.depends = gui
contains(QT_CONFIG, opengl) {
    QT.compositor.DEFINES = QT_COMPOSITOR_WAYLAND_GL
}

QT_CONFIG += compositor

Fix so that includes like <QtCompositor/WaylandXXX> work

QT.compositor.VERSION = 5.0.0
QT.compositor.MAJOR_VERSION = 5
QT.compositor.MINOR_VERSION = 0
QT.compositor.PATCH_VERSION = 0

QT.compositor.name = QtCompositor
QT.compositor.bins = $$QT_MODULE_BIN_BASE
QT.compositor.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtCompositor
QT.compositor.private_includes = $$QT_MODULE_INCLUDE_BASE/QtCompositor/$$QT.compositor.VERSION
QT.compositor.sources = $$QT_MODULE_BASE/src/compositor
QT.compositor.libs = $$QT_MODULE_LIB_BASE
QT.compositor.plugins = $$QT_MODULE_PLUGIN_BASE
QT.compositor.imports = $$QT_MODULE_IMPORT_BASE
QT.compositor.depends = gui
contains(QT_CONFIG, opengl) {
    QT.compositor.DEFINES = QT_COMPOSITOR_WAYLAND_GL
}

QT_CONFIG += compositor


!cross_compile {
    TRY_INCLUDEPATHS = /include /usr/include /usr/local/include $$QMAKE_INCDIR $$INCLUDEPATH
    # LSB doesn't allow using headers from /include or /usr/include
    linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$INCLUDEPATH
    for(p, TRY_INCLUDEPATHS) {
        pp = $$join(p, "", "", "/openssl")
        exists($$pp):INCLUDEPATH *= $$p
    }
}

Fix compilation on AIX: -I/usr/include cannot be used.

# Empty file since Qt 4.6
# I'm too lazy to find all places where this file is included


QT.serviceframework.VERSION = 5.0.0
QT.serviceframework.MAJOR_VERSION = 5
QT.serviceframework.MINOR_VERSION = 0
QT.serviceframework.PATCH_VERSION = 0

QT.serviceframework.name = QtSystemInfo
QT.serviceframework.bins = $$QT_MODULE_BIN_BASE
QT.serviceframework.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtServiceFramework
QT.serviceframework.private_includes = $$QT_MODULE_INCLUDE_BASE/QtServiceFramework/$$QT.serviceframework.VERSION
QT.serviceframework.sources = $$QT_MODULE_BASE/src/serviceframework
QT.serviceframework.libs = $$QT_MODULE_LIB_BASE
QT.serviceframework.plugins = $$QT_MODULE_PLUGIN_BASE
QT.serviceframework.imports = $$QT_MODULE_IMPORT_BASE
QT.serviceframework.depends = core gui network

QT_CONFIG += serviceframework

Fix the naming for serviceframework.

QT.serviceframework.VERSION = 5.0.0
QT.serviceframework.MAJOR_VERSION = 5
QT.serviceframework.MINOR_VERSION = 0
QT.serviceframework.PATCH_VERSION = 0

QT.serviceframework.name = QtServiceFramework
QT.serviceframework.bins = $$QT_MODULE_BIN_BASE
QT.serviceframework.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtServiceFramework
QT.serviceframework.private_includes = $$QT_MODULE_INCLUDE_BASE/QtServiceFramework/$$QT.serviceframework.VERSION
QT.serviceframework.sources = $$QT_MODULE_BASE/src/serviceframework
QT.serviceframework.libs = $$QT_MODULE_LIB_BASE
QT.serviceframework.plugins = $$QT_MODULE_PLUGIN_BASE
QT.serviceframework.imports = $$QT_MODULE_IMPORT_BASE
QT.serviceframework.depends = core gui network

QT_CONFIG += serviceframework


defineReplace(rpmquery) {
  return($$system("rpmspec -q --srpm --queryformat '\"%{$$1}\"' $$2"))
}
defineReplace(rpmquery_appspec) {
  return($$rpmquery("$$1", "$$top_srcdir/rpm/harbour-communi.spec"))
}

Check if specfile exists in $RPM_SOURCE_DIR first

specfile = "harbour-communi.spec"
RPM_SOURCE_DIR = $$system("echo $RPM_SOURCE_DIR")

exists("$$RPM_SOURCE_DIR/$$specfile") {
  specfile = "$$RPM_SOURCE_DIR/$$specfile"
} else {
  specfile = "$$top_srcdir/rpm/$$specfile"
}

defineReplace(rpmquery) {
  return($$system("rpmspec -q --srpm --queryformat '\"%{$$1}\"' $$2"))
}
defineReplace(rpmquery_appspec) {
  return($$rpmquery("$$1", $$specfile))
}


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

DEPENDPATH += $$PWD/../../shared/qmljs $$PWD/../../shared/qmljs/parser
LIBS *= -l$$qtLibraryTarget(QmlJS)

Fix compile for namespaced Qt.

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

DEPENDPATH += $$PWD/../../shared/qmljs $$PWD/../../shared/qmljs/parser
LIBS *= -l$$qtLibraryTarget(QmlJS)
DEFINES += QT_CREATOR


ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++11 -pedantic-errors -Werror -Wextra -O2 -g -fno-omit-frame-pointer

QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\''          # Used so that the main executable can link link to core
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/qt\''       # Used so that the main executable can link to custom built Qt
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/..\''       # Used so that plugins can link to core
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/../qt\''    # Used so that plugins can link to custom built Qt

win32:QMAKE_LFLAGS += '-Wl,--export-all-symbols' #Export all symbols in Windows to save a hassle

INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header debug_and_release
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h

Add automatic header file dependency for all projects.

ENVISION_ROOT_DIR = $$PWD/..
CONFIG(release, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/ReleaseBuild
CONFIG(debug, debug|release):BUILD_DIR = $${ENVISION_ROOT_DIR}/DebugBuild
PLUGINS_DIR = $${BUILD_DIR}/plugins
CONFIG(debug, debug|release):DEFINES += DEBUG
QMAKE_CXXFLAGS += -std=c++11 -pedantic-errors -Werror -Wextra -O2 -g -fno-omit-frame-pointer

QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\''          # Used so that the main executable can link link to core
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/qt\''       # Used so that the main executable can link to custom built Qt
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/..\''       # Used so that plugins can link to core
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN/../qt\''    # Used so that plugins can link to custom built Qt

win32:QMAKE_LFLAGS += '-Wl,--export-all-symbols' #Export all symbols in Windows to save a hassle

INCLUDEPATH += ./src ./test $${ENVISION_ROOT_DIR}
CONFIG += qt warn_on thread precompile_header debug_and_release depend_includepath
QT = core gui
PRECOMPILED_HEADER = src/precompiled.h


QT_DECLARATIVE_VERSION = $$QT_VERSION
QT_DECLARATIVE_MAJOR_VERSION = $$QT_MAJOR_VERSION
QT_DECLARATIVE_MINOR_VERSION = $$QT_MINOR_VERSION
QT_DECLARATIVE_PATCH_VERSION = $$QT_PATCH_VERSION

QT.declarative.name = QtDeclarative
QT.declarative.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtDeclarative
QT.declarative.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDeclarative/private
QT.declarative.sources = $$QT_MODULE_BASE/src/declarative
QT.declarative.libs = $$QT_MODULE_LIB_BASE
QT.declarative.depends = gui script network
QT.declarative.DEFINES = QT_DECLARATIVE_LIB

QT_CONFIG += declarative

Make each module refer to its own bin/

QT_DECLARATIVE_VERSION = $$QT_VERSION
QT_DECLARATIVE_MAJOR_VERSION = $$QT_MAJOR_VERSION
QT_DECLARATIVE_MINOR_VERSION = $$QT_MINOR_VERSION
QT_DECLARATIVE_PATCH_VERSION = $$QT_PATCH_VERSION

QT.declarative.name = QtDeclarative
QT.declarative.bins = $$QT_MODULE_BIN_BASE
QT.declarative.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtDeclarative
QT.declarative.private_includes = $$QT_MODULE_INCLUDE_BASE/QtDeclarative/private
QT.declarative.sources = $$QT_MODULE_BASE/src/declarative
QT.declarative.libs = $$QT_MODULE_LIB_BASE
QT.declarative.depends = gui script network
QT.declarative.DEFINES = QT_DECLARATIVE_LIB

QT_CONFIG += declarative


MALIIT_PLUGINS = meego-im-plugins
MALIIT_SERVER = meego-im-uiserver
MALIIT_PLUGINS_LIB = meegoimframework
MALIIT_PLUGINS_HEADER = meegoimframework
MALIIT_PLUGINS_QUICK_LIB = meegoimquick
MALIIT_PLUGINS_QUICK_HEADER = meegoimquick
MALIIT_TEST_SUITE = meego-im-framework-tests
MALIIT_PACKAGENAME = meego-im-framework
MALIIT_PACKAGE_BRIEF = Meego Touch Input Method Framework
MALIIT_ATTRIBUTE_EXTENSIONS = meegoimframework/imtoolbars
MALIIT_CONFIG_ROOT = /meegotouch/inputmethods/
MALIIT_INPUTCONTEXT_NAME = MInputContext
MALIIT_INPUTCONTEXT_TARGETNAME = minputcontext

Add MALIIT_PLUGINS_QUICK_FACTORY to legacy defines, too

MALIIT_PLUGINS = meego-im-plugins
MALIIT_SERVER = meego-im-uiserver
MALIIT_PLUGINS_LIB = meegoimframework
MALIIT_PLUGINS_HEADER = meegoimframework
MALIIT_PLUGINS_QUICK_LIB = meegoimquick
MALIIT_PLUGINS_QUICK_HEADER = meegoimquick
MALIIT_PLUGINS_QUICK_FACTORY = meegoimquickfactory-$${MALIIT_PLUGINS_QUICK_INTERFACE_VERSION}
MALIIT_TEST_SUITE = meego-im-framework-tests
MALIIT_PACKAGENAME = meego-im-framework
MALIIT_PACKAGE_BRIEF = Meego Touch Input Method Framework
MALIIT_ATTRIBUTE_EXTENSIONS = meegoimframework/imtoolbars
MALIIT_CONFIG_ROOT = /meegotouch/inputmethods/
MALIIT_INPUTCONTEXT_NAME = MInputContext
MALIIT_INPUTCONTEXT_TARGETNAME = minputcontext


win32 { LIBS += -lwinmm }
linux-g++ { LIBS += -lasound }
haiku-g++ { LIBS += -lbe -lmidi -lmidi2 }

INCLUDEPATH += $$PWD

SOURCES += $$PWD/QMidiOut.cpp \
	$$PWD/QMidiFile.cpp

HEADERS += $$PWD/QMidiOut.h \
	$$PWD/QMidiFile.h

Fix build on non-G++ and non-X86 systems.

win32 { LIBS += -lwinmm }
linux* { LIBS += -lasound }
haiku* { LIBS += -lbe -lmidi -lmidi2 }

INCLUDEPATH += $$PWD

SOURCES += $$PWD/QMidiOut.cpp \
	$$PWD/QMidiFile.cpp

HEADERS += $$PWD/QMidiOut.h \
	$$PWD/QMidiFile.h


######################################################################
# Communi: qtdocktile.pri
######################################################################

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

HEADERS += $$PWD/qtdocktile.h
HEADERS += $$PWD/qtdocktile_p.h

SOURCES += $$PWD/qtdocktile.cpp

mac {
    LIBS += -framework AppKit
    OBJECTIVE_SOURCES += $$PWD/qtdocktile_mac.mm
}

unix:!mac {
    QT += dbus
    SOURCES += $$PWD/qtdocktile_unity.cpp
}

win32 {
    LIBS += -lole32
    HEADERS += $$PWD/winutils.h
    SOURCES += $$PWD/qtdocktile_win.cpp
}

Fix linking error on MinGW 4.8

######################################################################
# Communi: qtdocktile.pri
######################################################################

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

HEADERS += $$PWD/qtdocktile.h
HEADERS += $$PWD/qtdocktile_p.h

SOURCES += $$PWD/qtdocktile.cpp

mac {
    LIBS += -framework AppKit
    OBJECTIVE_SOURCES += $$PWD/qtdocktile_mac.mm
}

unix:!mac {
    QT += dbus
    SOURCES += $$PWD/qtdocktile_unity.cpp
}

win32 {
    LIBS += -lole32 -luuid
    HEADERS += $$PWD/winutils.h
    SOURCES += $$PWD/qtdocktile_win.cpp
}


QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../../maliit:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += *.gcno *.gcda

Clean gcov files from right subdir

QMAKE_EXTRA_TARGETS += check
check.target = check
check.commands = TESTING_IN_SANDBOX=1 TESTPLUGIN_PATH=../plugins LD_LIBRARY_PATH=../../src:../../input-context/:../../passthroughserver/:../../maliit:../plugins:$(LD_LIBRARY_PATH) ./$$TARGET
check.depends += $$TARGET

QMAKE_EXTRA_TARGETS += check-xml
check-xml.target = check-xml
check-xml.commands = ../rt.sh $$TARGET
check-xml.depends += $$TARGET

# coverage flags are off per default, but can be turned on via qmake COV_OPTION=on
for(OPTION,$$list($$lower($$COV_OPTION))){
    isEqual(OPTION, on){
        QMAKE_CXXFLAGS += -ftest-coverage -fprofile-arcs
        LIBS += -lgcov
    }
}
QMAKE_CLEAN += $$OBJECTS_DIR/*.gcno $$OBJECTS_DIR/*.gcda


linux:QMAKE_CXXFLAGS += -isystem$${PWD}/thirdparty/rapidjson/include/
INCLUDEPATH += $${PWD}/thirdparty/rapidjson/include/

CONFIG(debug, debug|release) {
    OUTPUT_DIR = ../Output/Debug
} else {
    OUTPUT_DIR = ../Output/Release
}

OBJECTS_DIR = $${OUTPUT_DIR}/Obj
DESTDIR = $${OUTPUT_DIR}

QMAKE_CLEAN += Makefile*

QMAKE_CXXFLAGS += -std=c++11

Fix release build from QtCreator.

linux:QMAKE_CXXFLAGS += -isystem$${PWD}/thirdparty/rapidjson/include/
INCLUDEPATH += $${PWD}/thirdparty/rapidjson/include/

CONFIG(release, debug|release) {
    OUTPUT_DIR = ../Output/Release
} else {
    OUTPUT_DIR = ../Output/Debug
}

OBJECTS_DIR = $${OUTPUT_DIR}/Obj
DESTDIR = $${OUTPUT_DIR}

QMAKE_CLEAN += Makefile*

QMAKE_CXXFLAGS += -std=c++11