revert "Fix the Qt build on Mac OS X/Cocoa 64-bit"

It actually broke the build on Mac; another cherry-pick
missing maybe. Reverted for now.

# JavaScriptCore - Qt4 build info
VPATH += $$PWD

CONFIG(standalone_package) {
    isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated
} else {
    isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = generated
}

CONFIG(debug, debug|release) {
    OBJECTS_DIR = obj/debug
} else { # Release
    OBJECTS_DIR = obj/release
}

symbian: {
    # Need to guarantee this comes before system includes of /epoc32/include
    MMP_RULES += "USERINCLUDE ../JavaScriptCore/profiler"
}

INCLUDEPATH = \
    $$PWD \
    $$PWD/.. \
    $$PWD/assembler \
    $$PWD/bytecode \
    $$PWD/bytecompiler \
    $$PWD/debugger \
    $$PWD/interpreter \
    $$PWD/jit \
    $$PWD/parser \
    $$PWD/pcre \
    $$PWD/profiler \
    $$PWD/runtime \
    $$PWD/wrec \
    $$PWD/wtf \
    $$PWD/wtf/unicode \
    $$PWD/yarr \
    $$PWD/API \
    $$PWD/ForwardingHeaders \
    $$JSC_GENERATED_SOURCES_DIR \
    $$INCLUDEPATH

DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF

win32-* {
    LIBS += -lwinmm
}
contains(JAVASCRIPTCORE_JIT,yes) {
    DEFINES+=ENABLE_JIT=1
    DEFINES+=ENABLE_YARR_JIT=1
    DEFINES+=ENABLE_YARR=1
}
contains(JAVASCRIPTCORE_JIT,no) {
    DEFINES+=ENABLE_JIT=0
    DEFINES+=ENABLE_YARR_JIT=0
    DEFINES+=ENABLE_YARR=0
}

# Rules when JIT enabled (not disabled)
!contains(DEFINES, ENABLE_JIT=0) {
    linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
        QMAKE_CXXFLAGS += -fno-stack-protector
        QMAKE_CFLAGS += -fno-stack-protector
    }
}

wince* {
    INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat
    SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.c
    DEFINES += WINCEBASIC
}

include(pcre/pcre.pri)

SOURCES += \
    API/JSBase.cpp \
    API/JSCallbackConstructor.cpp \
    API/JSCallbackFunction.cpp \
    API/JSCallbackObject.cpp \
    API/JSClassRef.cpp \
    API/JSContextRef.cpp \
    API/JSObjectRef.cpp \
    API/JSStringRef.cpp \
    API/JSValueRef.cpp \
    API/OpaqueJSString.cpp \
    assembler/ARMAssembler.cpp \
    assembler/MacroAssemblerARM.cpp \
    bytecode/CodeBlock.cpp \
    bytecode/JumpTable.cpp \
    bytecode/Opcode.cpp \
    bytecode/SamplingTool.cpp \
    bytecode/StructureStubInfo.cpp \
    bytecompiler/BytecodeGenerator.cpp \
    bytecompiler/NodesCodegen.cpp \
    debugger/DebuggerActivation.cpp \
    debugger/DebuggerCallFrame.cpp \
    debugger/Debugger.cpp \
    interpreter/CallFrame.cpp \
    interpreter/Interpreter.cpp \
    interpreter/RegisterFile.cpp \
    jit/ExecutableAllocatorPosix.cpp \
    jit/ExecutableAllocatorSymbian.cpp \
    jit/ExecutableAllocatorWin.cpp \
    jit/ExecutableAllocator.cpp \
    jit/JITArithmetic.cpp \
    jit/JITCall.cpp \
    jit/JIT.cpp \
    jit/JITOpcodes.cpp \
    jit/JITPropertyAccess.cpp \
    jit/JITStubs.cpp \
    parser/Lexer.cpp \
    parser/Nodes.cpp \
    parser/ParserArena.cpp \
    parser/Parser.cpp \
    profiler/Profile.cpp \
    profiler/ProfileGenerator.cpp \
    profiler/ProfileNode.cpp \
    profiler/Profiler.cpp \
    runtime/ArgList.cpp \
    runtime/Arguments.cpp \
    runtime/ArrayConstructor.cpp \
    runtime/ArrayPrototype.cpp \
    runtime/BooleanConstructor.cpp \
    runtime/BooleanObject.cpp \
    runtime/BooleanPrototype.cpp \
    runtime/CallData.cpp \
    runtime/Collector.cpp \
    runtime/CommonIdentifiers.cpp \
    runtime/Completion.cpp \
    runtime/ConstructData.cpp \
    runtime/DateConstructor.cpp \
    runtime/DateConversion.cpp \
    runtime/DateInstance.cpp \
    runtime/DatePrototype.cpp \
    runtime/ErrorConstructor.cpp \
    runtime/Error.cpp \
    runtime/ErrorInstance.cpp \
    runtime/ErrorPrototype.cpp \
    runtime/ExceptionHelpers.cpp \
    runtime/Executable.cpp \
    runtime/FunctionConstructor.cpp \
    runtime/FunctionPrototype.cpp \
    runtime/GetterSetter.cpp \
    runtime/GlobalEvalFunction.cpp \
    runtime/Identifier.cpp \
    runtime/InitializeThreading.cpp \
    runtime/InternalFunction.cpp \
    runtime/JSActivation.cpp \
    runtime/JSAPIValueWrapper.cpp \
    runtime/JSArray.cpp \
    runtime/JSByteArray.cpp \
    runtime/JSCell.cpp \
    runtime/JSFunction.cpp \
    runtime/JSGlobalData.cpp \
    runtime/JSGlobalObject.cpp \
    runtime/JSGlobalObjectFunctions.cpp \
    runtime/JSImmediate.cpp \
    runtime/JSLock.cpp \
    runtime/JSNotAnObject.cpp \
    runtime/JSNumberCell.cpp \
    runtime/JSObject.cpp \
    runtime/JSONObject.cpp \
    runtime/JSPropertyNameIterator.cpp \
    runtime/JSStaticScopeObject.cpp \
    runtime/JSString.cpp \
    runtime/JSValue.cpp \
    runtime/JSVariableObject.cpp \
    runtime/JSWrapperObject.cpp \
    runtime/LiteralParser.cpp \
    runtime/Lookup.cpp \
    runtime/MarkStackPosix.cpp \
    runtime/MarkStackSymbian.cpp \
    runtime/MarkStackWin.cpp \
    runtime/MarkStack.cpp \
    runtime/MathObject.cpp \
    runtime/NativeErrorConstructor.cpp \
    runtime/NativeErrorPrototype.cpp \
    runtime/NumberConstructor.cpp \
    runtime/NumberObject.cpp \
    runtime/NumberPrototype.cpp \
    runtime/ObjectConstructor.cpp \
    runtime/ObjectPrototype.cpp \
    runtime/Operations.cpp \
    runtime/PropertyDescriptor.cpp \
    runtime/PropertyNameArray.cpp \
    runtime/PropertySlot.cpp \
    runtime/PrototypeFunction.cpp \
    runtime/RegExpConstructor.cpp \
    runtime/RegExp.cpp \
    runtime/RegExpObject.cpp \
    runtime/RegExpPrototype.cpp \
    runtime/ScopeChain.cpp \
    runtime/SmallStrings.cpp \
    runtime/StringConstructor.cpp \
    runtime/StringObject.cpp \
    runtime/StringPrototype.cpp \
    runtime/StructureChain.cpp \
    runtime/Structure.cpp \
    runtime/TimeoutChecker.cpp \
    runtime/UString.cpp \
    runtime/UStringImpl.cpp \
    wtf/Assertions.cpp \
    wtf/ByteArray.cpp \
    wtf/CurrentTime.cpp \
    wtf/DateMath.cpp \
    wtf/dtoa.cpp \
    wtf/FastMalloc.cpp \
    wtf/HashTable.cpp \
    wtf/MainThread.cpp \
    wtf/qt/MainThreadQt.cpp \
    wtf/qt/ThreadingQt.cpp \
    wtf/RandomNumber.cpp \
    wtf/RefCountedLeakCounter.cpp \
    wtf/ThreadingNone.cpp \
    wtf/Threading.cpp \
    wtf/TypeTraits.cpp \
    wtf/unicode/CollatorDefault.cpp \
    wtf/unicode/icu/CollatorICU.cpp \
    wtf/unicode/UTF8.cpp \
    yarr/RegexCompiler.cpp \
    yarr/RegexInterpreter.cpp \
    yarr/RegexJIT.cpp

# Generated files, simply list them for JavaScriptCore
SOURCES += \
    $${JSC_GENERATED_SOURCES_DIR}/Grammar.cpp

!contains(DEFINES, USE_SYSTEM_MALLOC) {
    SOURCES += wtf/TCSystemAlloc.cpp
}

# JavaScriptCore - Qt4 build info
VPATH += $$PWD

CONFIG(standalone_package) {
    isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated
} else {
    isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = generated
}

CONFIG(debug, debug|release) {
    OBJECTS_DIR = obj/debug
} else { # Release
    OBJECTS_DIR = obj/release
}

symbian: {
    # Need to guarantee this comes before system includes of /epoc32/include
    MMP_RULES += "USERINCLUDE ../JavaScriptCore/profiler"
}

INCLUDEPATH = \
    $$PWD \
    $$PWD/.. \
    $$PWD/assembler \
    $$PWD/bytecode \
    $$PWD/bytecompiler \
    $$PWD/debugger \
    $$PWD/interpreter \
    $$PWD/jit \
    $$PWD/parser \
    $$PWD/pcre \
    $$PWD/profiler \
    $$PWD/runtime \
    $$PWD/wrec \
    $$PWD/wtf \
    $$PWD/wtf/unicode \
    $$PWD/yarr \
    $$PWD/API \
    $$PWD/ForwardingHeaders \
    $$JSC_GENERATED_SOURCES_DIR \
    $$INCLUDEPATH

DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF

win32-* {
    LIBS += -lwinmm
}
contains(JAVASCRIPTCORE_JIT,yes) {
    DEFINES+=ENABLE_JIT=1
    DEFINES+=ENABLE_YARR_JIT=1
    DEFINES+=ENABLE_YARR=1
}
contains(JAVASCRIPTCORE_JIT,no) {
    DEFINES+=ENABLE_JIT=0
    DEFINES+=ENABLE_YARR_JIT=0
    DEFINES+=ENABLE_YARR=0
}

# Rules when JIT enabled (not disabled)
!contains(DEFINES, ENABLE_JIT=0) {
    linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) {
        QMAKE_CXXFLAGS += -fno-stack-protector
        QMAKE_CFLAGS += -fno-stack-protector
    }
}

wince* {
    INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat
    SOURCES += $$QT_SOURCE_TREE/src/3rdparty/ce-compat/ce_time.c
    DEFINES += WINCEBASIC
}

include(pcre/pcre.pri)

SOURCES += \
    API/JSBase.cpp \
    API/JSCallbackConstructor.cpp \
    API/JSCallbackFunction.cpp \
    API/JSCallbackObject.cpp \
    API/JSClassRef.cpp \
    API/JSContextRef.cpp \
    API/JSObjectRef.cpp \
    API/JSStringRef.cpp \
    API/JSValueRef.cpp \
    API/OpaqueJSString.cpp \
    assembler/ARMAssembler.cpp \
    assembler/MacroAssemblerARM.cpp \
    bytecode/CodeBlock.cpp \
    bytecode/JumpTable.cpp \
    bytecode/Opcode.cpp \
    bytecode/SamplingTool.cpp \
    bytecode/StructureStubInfo.cpp \
    bytecompiler/BytecodeGenerator.cpp \
    bytecompiler/NodesCodegen.cpp \
    debugger/DebuggerActivation.cpp \
    debugger/DebuggerCallFrame.cpp \
    debugger/Debugger.cpp \
    interpreter/CallFrame.cpp \
    interpreter/Interpreter.cpp \
    interpreter/RegisterFile.cpp \
    jit/ExecutableAllocatorFixedVMPool.cpp \
    jit/ExecutableAllocatorPosix.cpp \
    jit/ExecutableAllocatorSymbian.cpp \
    jit/ExecutableAllocatorWin.cpp \
    jit/ExecutableAllocator.cpp \
    jit/JITArithmetic.cpp \
    jit/JITCall.cpp \
    jit/JIT.cpp \
    jit/JITOpcodes.cpp \
    jit/JITPropertyAccess.cpp \
    jit/JITStubs.cpp \
    parser/Lexer.cpp \
    parser/Nodes.cpp \
    parser/ParserArena.cpp \
    parser/Parser.cpp \
    profiler/Profile.cpp \
    profiler/ProfileGenerator.cpp \
    profiler/ProfileNode.cpp \
    profiler/Profiler.cpp \
    runtime/ArgList.cpp \
    runtime/Arguments.cpp \
    runtime/ArrayConstructor.cpp \
    runtime/ArrayPrototype.cpp \
    runtime/BooleanConstructor.cpp \
    runtime/BooleanObject.cpp \
    runtime/BooleanPrototype.cpp \
    runtime/CallData.cpp \
    runtime/Collector.cpp \
    runtime/CommonIdentifiers.cpp \
    runtime/Completion.cpp \
    runtime/ConstructData.cpp \
    runtime/DateConstructor.cpp \
    runtime/DateConversion.cpp \
    runtime/DateInstance.cpp \
    runtime/DatePrototype.cpp \
    runtime/ErrorConstructor.cpp \
    runtime/Error.cpp \
    runtime/ErrorInstance.cpp \
    runtime/ErrorPrototype.cpp \
    runtime/ExceptionHelpers.cpp \
    runtime/Executable.cpp \
    runtime/FunctionConstructor.cpp \
    runtime/FunctionPrototype.cpp \
    runtime/GetterSetter.cpp \
    runtime/GlobalEvalFunction.cpp \
    runtime/Identifier.cpp \
    runtime/InitializeThreading.cpp \
    runtime/InternalFunction.cpp \
    runtime/JSActivation.cpp \
    runtime/JSAPIValueWrapper.cpp \
    runtime/JSArray.cpp \
    runtime/JSByteArray.cpp \
    runtime/JSCell.cpp \
    runtime/JSFunction.cpp \
    runtime/JSGlobalData.cpp \
    runtime/JSGlobalObject.cpp \
    runtime/JSGlobalObjectFunctions.cpp \
    runtime/JSImmediate.cpp \
    runtime/JSLock.cpp \
    runtime/JSNotAnObject.cpp \
    runtime/JSNumberCell.cpp \
    runtime/JSObject.cpp \
    runtime/JSONObject.cpp \
    runtime/JSPropertyNameIterator.cpp \
    runtime/JSStaticScopeObject.cpp \
    runtime/JSString.cpp \
    runtime/JSValue.cpp \
    runtime/JSVariableObject.cpp \
    runtime/JSWrapperObject.cpp \
    runtime/LiteralParser.cpp \
    runtime/Lookup.cpp \
    runtime/MarkStackPosix.cpp \
    runtime/MarkStackSymbian.cpp \
    runtime/MarkStackWin.cpp \
    runtime/MarkStack.cpp \
    runtime/MathObject.cpp \
    runtime/NativeErrorConstructor.cpp \
    runtime/NativeErrorPrototype.cpp \
    runtime/NumberConstructor.cpp \
    runtime/NumberObject.cpp \
    runtime/NumberPrototype.cpp \
    runtime/ObjectConstructor.cpp \
    runtime/ObjectPrototype.cpp \
    runtime/Operations.cpp \
    runtime/PropertyDescriptor.cpp \
    runtime/PropertyNameArray.cpp \
    runtime/PropertySlot.cpp \
    runtime/PrototypeFunction.cpp \
    runtime/RegExpConstructor.cpp \
    runtime/RegExp.cpp \
    runtime/RegExpObject.cpp \
    runtime/RegExpPrototype.cpp \
    runtime/ScopeChain.cpp \
    runtime/SmallStrings.cpp \
    runtime/StringConstructor.cpp \
    runtime/StringObject.cpp \
    runtime/StringPrototype.cpp \
    runtime/StructureChain.cpp \
    runtime/Structure.cpp \
    runtime/TimeoutChecker.cpp \
    runtime/UString.cpp \
    runtime/UStringImpl.cpp \
    wtf/Assertions.cpp \
    wtf/ByteArray.cpp \
    wtf/CurrentTime.cpp \
    wtf/DateMath.cpp \
    wtf/dtoa.cpp \
    wtf/FastMalloc.cpp \
    wtf/HashTable.cpp \
    wtf/MainThread.cpp \
    wtf/qt/MainThreadQt.cpp \
    wtf/qt/ThreadingQt.cpp \
    wtf/RandomNumber.cpp \
    wtf/RefCountedLeakCounter.cpp \
    wtf/ThreadingNone.cpp \
    wtf/Threading.cpp \
    wtf/TypeTraits.cpp \
    wtf/unicode/CollatorDefault.cpp \
    wtf/unicode/icu/CollatorICU.cpp \
    wtf/unicode/UTF8.cpp \
    yarr/RegexCompiler.cpp \
    yarr/RegexInterpreter.cpp \
    yarr/RegexJIT.cpp

# Generated files, simply list them for JavaScriptCore
SOURCES += \
    $${JSC_GENERATED_SOURCES_DIR}/Grammar.cpp

!contains(DEFINES, USE_SYSTEM_MALLOC) {
    SOURCES += wtf/TCSystemAlloc.cpp
}


Fix out-of-tree build of ut_mimonscreenplugins.

RevBy: TrustMe

Added build tree /src directory to include paths, because
ut_mimonscreenplugins includes config.h which is generated and put
into build tree, not source tree.

# 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})

# 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})


Disable webm support for now to prevent huge dependencies on webkit

PDIR = $${_PRO_FILE_PWD_}/..

# Options
CONFIG += use_ssl
Release {
    CONFIG += use_breakpad
}

# Travis settings
@
T = $$(TRAVIS)
!isEmpty(T) {
    CONFIG -= use_breakpad use_qscintilla webm_support
}
@

# Global
APP_VERSION = \\\"4.5.0\\\"

# General
TEMPLATE = app
DEPENDPATH += . .. $${PDIR}/includes $${PDIR}/languages $${PDIR}/source $${PDIR}/vendor
INCLUDEPATH += . .. $${PDIR}/includes $${PDIR}/source $${PDIR}/vendor
DEFINES += VERSION=$$APP_VERSION
QT += core network xml sql script

# Windows specials
win32 {
        QT += winextras
}

# Webm
webm_support {
    DEFINES += USE_WEBKIT=1
    QT += webkit webkitwidgets
}

# Additionnal
CONFIG += plugin c++11
RESOURCES += $${PDIR}/resources.qrc
RC_FILE = ../icon.rc
CODECFORTR = UTF-8
TRANSLATIONS += $${PDIR}/languages/English.ts $${PDIR}/languages/Français.ts $${PDIR}/languages/Russian.ts

# Target WinXP
Release:win32 {
    QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
    QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
    DEFINES += _ATL_XP_TARGETING
    QMAKE_CFLAGS += /D _USING_V110_SDK71
    QMAKE_CXXFLAGS += /D _USING_V110_SDK71
    LIBS *= -L"%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Lib"
    INCLUDEPATH += "%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Include"
}

# SSL
use_ssl {
    win32 {
        LIBS += -L"C:/OpenSSL-Win32/lib" -llibeay32
        INCLUDEPATH += C:/OpenSSL-Win32/include
    }
    unix {
        PKGCONFIG += openssl
    }
}

# Google-Breakpad
use_breakpad {
    DEFINES += USE_BREAKPAD=1
    win32 {
        QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /DEBUG
        QMAKE_CFLAGS_RELEASE = -O2 -MD -zi
                BREAKPAD = D:/bin/google-breakpad
                Debug:LIBS	+= $${BREAKPAD}/src/client/windows/Debug/lib/common.lib \
                                   $${BREAKPAD}/src/client/windows/Debug/lib/crash_generation_client.lib \
                                   $${BREAKPAD}/src/client/windows/Debug/lib/exception_handler.lib
        Release:LIBS	+= $${BREAKPAD}/src/client/windows/Release/lib/common.lib \
                                   $${BREAKPAD}/src/client/windows/Release/lib/crash_generation_client.lib \
                                   $${BREAKPAD}/src/client/windows/Release/lib/exception_handler.lib
    }
    unix {
        QMAKE_CXXFLAGS += -fpermissive
        BREAKPAD = ~/Programmation/google-breakpad
        LIBS += $${BREAKPAD}/src/client/linux/libbreakpad_client.a
    }
    INCLUDEPATH += $${BREAKPAD}/src
}

OTHER_FILES += \
    $${PDIR}/Grabber.pri \
    $${PDIR}/icon.rc \
    $${PDIR}/.gitignore

DISTFILES += \
    $${PDIR}/README.md \
    $${PDIR}/LICENSE \
    $${PDIR}/NOTICE

PDIR = $${_PRO_FILE_PWD_}/..

# Options
CONFIG += use_ssl webm_support
Release {
    CONFIG += use_breakpad
}

# Travis settings
@
T = $$(TRAVIS)
!isEmpty(T) {
    CONFIG -= use_breakpad use_qscintilla webm_support
}
@

# Global
APP_VERSION = \\\"4.5.0\\\"

# General
TEMPLATE = app
DEPENDPATH += . .. $${PDIR}/includes $${PDIR}/languages $${PDIR}/source $${PDIR}/vendor
INCLUDEPATH += . .. $${PDIR}/includes $${PDIR}/source $${PDIR}/vendor
DEFINES += VERSION=$$APP_VERSION
QT += core network xml sql script

# Windows specials
win32 {
        QT += winextras
}

# Webm
webm_support {
    DEFINES += USE_WEBKIT=1
    QT += webkit webkitwidgets
}

# Additionnal
CONFIG += plugin c++11
RESOURCES += $${PDIR}/resources.qrc
RC_FILE = ../icon.rc
CODECFORTR = UTF-8
TRANSLATIONS += $${PDIR}/languages/English.ts $${PDIR}/languages/Français.ts $${PDIR}/languages/Russian.ts

# Target WinXP
Release:win32 {
    QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
    QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
    DEFINES += _ATL_XP_TARGETING
    QMAKE_CFLAGS += /D _USING_V110_SDK71
    QMAKE_CXXFLAGS += /D _USING_V110_SDK71
    LIBS *= -L"%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Lib"
    INCLUDEPATH += "%ProgramFiles(x86)%/Microsoft SDKs/Windows/7.1A/Include"
}

# SSL
use_ssl {
    win32 {
        LIBS += -L"C:/OpenSSL-Win32/lib" -llibeay32
        INCLUDEPATH += C:/OpenSSL-Win32/include
    }
    unix {
        PKGCONFIG += openssl
    }
}

# Google-Breakpad
use_breakpad {
    DEFINES += USE_BREAKPAD=1
    win32 {
        QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /DEBUG
        QMAKE_CFLAGS_RELEASE = -O2 -MD -zi
                BREAKPAD = D:/bin/google-breakpad
                Debug:LIBS	+= $${BREAKPAD}/src/client/windows/Debug/lib/common.lib \
                                   $${BREAKPAD}/src/client/windows/Debug/lib/crash_generation_client.lib \
                                   $${BREAKPAD}/src/client/windows/Debug/lib/exception_handler.lib
        Release:LIBS	+= $${BREAKPAD}/src/client/windows/Release/lib/common.lib \
                                   $${BREAKPAD}/src/client/windows/Release/lib/crash_generation_client.lib \
                                   $${BREAKPAD}/src/client/windows/Release/lib/exception_handler.lib
    }
    unix {
        QMAKE_CXXFLAGS += -fpermissive
        BREAKPAD = ~/Programmation/google-breakpad
        LIBS += $${BREAKPAD}/src/client/linux/libbreakpad_client.a
    }
    INCLUDEPATH += $${BREAKPAD}/src
}

OTHER_FILES += \
    $${PDIR}/Grabber.pri \
    $${PDIR}/icon.rc \
    $${PDIR}/.gitignore

DISTFILES += \
    $${PDIR}/README.md \
    $${PDIR}/LICENSE \
    $${PDIR}/NOTICE


set rpath for sailfish

set rpath for sailfish

DEPENDPATH += sailfish .
INCLUDEPATH += sailfish .

PKGCONFIG += Qt5SystemInfo Qt5Location

HEADERS += sailfish/soundvolumecontrol.h \
           sailfish/deviceinfo.h \
           sailfish/geocode.h \
           sailfish/displaystate.h \
           sailfish/fsmonitor.h \
           sailfish/compass.h \
           sailfish/orientation.h \
           sailfish/batteryinfo.h \
           sailfish/devicekeys.h \
           sailfish/phoneprofile.h

SOURCES += sailfish/soundvolumecontrol.cpp \
           sailfish/deviceinfo.cpp \
           sailfish/geocode.cpp \
           sailfish/displaystate.cpp \
           sailfish/fsmonitor.cpp \
           sailfish/compass.cpp \
           sailfish/orientation.cpp \
           sailfish/batteryinfo.cpp \
           sailfish/devicekeys.cpp \
           sailfish/phoneprofile.cpp

LIBS += -Wl,-rpath=/usr/share/harbour-cameraplus/lib/


Always force lib extension to be .lib on windows #5

# Load this from any subproject to link shared libs properly and easy.
#
# Takes a list of paths of shared libs (customLibs). The used list must
# contain 'path/to/lib/name's with path/to/lib relative to the caller.
#
# Example:
# - customLibs = ../path/to/lib/mylib ../other/path/to/otherlib
# - include(loadlibs.pri)
#
# Make sure to provide all libname.pri to set INCLUDEPATH & DEPENDPATH!
#
# Note: include(loadlibs.pri) will setup all given custom libs ->
# -> INCLUDEPATH, DEPENDPATH, LIBS, PRE_TARGETDEPS & QMAKE_LFLAGS.

QMAKE_PROJECT_DEPTH = 0 # Forces absolute paths

for(lib, customLibs) {
    !isEmpty(lib) {
        LIBDIR = $$dirname(lib)
        LIBNAME = $$basename(lib)
        #message("$${TARGET} is loading $$LIBNAME -> from: $$LIBDIR")

        # Load lib.pri to set INCLUDEPATH & DEPENDPATH
        exists($$_PRO_FILE_PWD_/$$LIBDIR/$$LIBNAME.pri) {
            include($$_PRO_FILE_PWD_/$$LIBDIR/$${LIBNAME}.pri)
        }
        #message($${INCLUDEPATH})

        LIB_EXTENSION = $$QMAKE_EXTENSION_SHLIB
        isEmpty(LIB_EXTENSION) {
            macx:  LIB_EXTENSION = dylib
            else:  LIB_EXTENSION = so
        }
        win32: LIB_EXTENSION = lib
        #message($${LIB_EXTENSION})

        # Get library's binary directory
        OUTDIR = $$clean_path($$OUT_PWD/$${LIBDIR})

        macx {
            frameworks += $$files($${OUTDIR}/$${LIBNAME}.framework)
            LIBS += -F$${OUTDIR}/ -framework $${LIBNAME}
            PRE_TARGETDEPS += $${OUTDIR}/$${LIBNAME}.framework
            INCLUDEPATH += -F$${LIBDIR}
        }
        win32 {
            LIBS += $${OUTDIR}/release/$${LIBNAME}.$${LIB_EXTENSION}
            PRE_TARGETDEPS += $${OUTDIR}/release/$${LIBNAME}.$${LIB_EXTENSION}
        }
        else {
            LIBS += -L$${OUTDIR}/ -l$${LIBNAME}
            PRE_TARGETDEPS += $${OUTDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
            QMAKE_LFLAGS += "-Wl,-rpath,\'$$OUTDIR\'"
        }
    }
}

macx { # Deploy all linked frameworks to target bundle
    APP_LIB_FILES.files = $$frameworks
    APP_LIB_FILES.path = Contents/Frameworks/
    QMAKE_BUNDLE_DATA += APP_LIB_FILES
}

# Load this from any subproject to link shared libs properly and easy.
#
# Takes a list of paths of shared libs (customLibs). The used list must
# contain 'path/to/lib/name's with path/to/lib relative to the caller.
#
# Example:
# - customLibs = ../path/to/lib/mylib ../other/path/to/otherlib
# - include(loadlibs.pri)
#
# Make sure to provide all libname.pri to set INCLUDEPATH & DEPENDPATH!
#
# Note: include(loadlibs.pri) will setup all given custom libs ->
# -> INCLUDEPATH, DEPENDPATH, LIBS, PRE_TARGETDEPS & QMAKE_LFLAGS.

QMAKE_PROJECT_DEPTH = 0 # Forces absolute paths

for(lib, customLibs) {
    !isEmpty(lib) {
        LIBDIR = $$dirname(lib)
        LIBNAME = $$basename(lib)
        #message("$${TARGET} is loading $$LIBNAME -> from: $$LIBDIR")

        # Load lib.pri to set INCLUDEPATH & DEPENDPATH
        exists($$_PRO_FILE_PWD_/$$LIBDIR/$$LIBNAME.pri) {
            include($$_PRO_FILE_PWD_/$$LIBDIR/$${LIBNAME}.pri)
        }
        #message($${INCLUDEPATH})

        LIB_EXTENSION = $$QMAKE_EXTENSION_SHLIB
        isEmpty(LIB_EXTENSION) {
            win32: LIB_EXTENSION = lib
            macx:  LIB_EXTENSION = dylib
            else:  LIB_EXTENSION = so
        }
        message($${LIB_EXTENSION})

        # Get library's binary directory
        OUTDIR = $$clean_path($$OUT_PWD/$${LIBDIR})

        macx {
            frameworks += $$files($${OUTDIR}/$${LIBNAME}.framework)
            LIBS += -F$${OUTDIR}/ -framework $${LIBNAME}
            PRE_TARGETDEPS += $${OUTDIR}/$${LIBNAME}.framework
            INCLUDEPATH += -F$${LIBDIR}
        }
        win32 {
            LIBS += $${OUTDIR}/release/$${LIBNAME}.$${LIB_EXTENSION}
            PRE_TARGETDEPS += $${OUTDIR}/release/$${LIBNAME}.$${LIB_EXTENSION}
        }
        else {
            LIBS += -L$${OUTDIR}/ -l$${LIBNAME}
            PRE_TARGETDEPS += $${OUTDIR}/lib$${LIBNAME}.$${LIB_EXTENSION}
            QMAKE_LFLAGS += "-Wl,-rpath,\'$$OUTDIR\'"
        }
    }
}

macx { # Deploy all linked frameworks to target bundle
    APP_LIB_FILES.files = $$frameworks
    APP_LIB_FILES.path = Contents/Frameworks/
    QMAKE_BUNDLE_DATA += APP_LIB_FILES
}


Fix xp build

Fix xp build

VERSION = $$cat(version.txt)

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

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

DEFINES += INTVER=$$VERSION

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

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

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

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

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

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

#PLATFORM
win32 {
    CONFIG += core_windows

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

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

DEFINES += INTERNAL_USE_ARRAY_AS_VECTOR

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

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

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

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

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

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

core_linux {
    DEFINES += LINUX _LINUX
}

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

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

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

core_linux {
    equals(TEMPLATE, app) {
        QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
        QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN/system\'"
        QMAKE_LFLAGS += -Wl,--disable-new-dtags
    }
}

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

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

        QMAKE_IOS_DEPLOYMENT_TARGET = 10.0
        CONFIG += core_ios_main_arch

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

        core_ios_main_arch {
            QMAKE_APPLE_DEVICE_ARCHS = arm64
            core_ios_no_simulator_arch : QMAKE_APPLE_SIMULATOR_ARCHS=

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

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

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

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

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

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

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

# COMPILER
CONFIG += c++11

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

    TARGET_EXT = .so
}
}

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

core_windows {
plugin {
    TARGET_EXT = .dll
}
}

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

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

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

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

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

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

DEFINES += CRYPTOPP_DISABLE_ASM
}

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

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

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

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

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

            VERSION = $$VERSION_CORRECT
        }
    }
}

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

VERSION = $$cat(version.txt)

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

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

DEFINES += INTVER=$$VERSION

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

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

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

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

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

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

#PLATFORM
win32 {
    CONFIG += core_windows

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

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

DEFINES += INTERNAL_USE_ARRAY_AS_VECTOR

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

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

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

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

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

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

core_linux {
    DEFINES += LINUX _LINUX
}

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

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

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

core_linux {
    equals(TEMPLATE, app) {
        QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
        QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN/system\'"
        QMAKE_LFLAGS += -Wl,--disable-new-dtags
    }
}

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

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

        QMAKE_IOS_DEPLOYMENT_TARGET = 10.0
        CONFIG += core_ios_main_arch

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

        core_ios_main_arch {
            QMAKE_APPLE_DEVICE_ARCHS = arm64
            core_ios_no_simulator_arch : QMAKE_APPLE_SIMULATOR_ARCHS=

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

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

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

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

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

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

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

# COMPILER
CONFIG += c++11

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

    TARGET_EXT = .so
}
}

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

core_windows {
plugin {
    TARGET_EXT = .dll
}
}

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

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

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

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

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

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

DEFINES += CRYPTOPP_DISABLE_ASM
}

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

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

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

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

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

            VERSION = $$VERSION_CORRECT
        }
    }
}

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


Fix OS X library lookup by setting @rpath

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

win32 {
	PLATFORM = windows
}

unix:!macx {
	PLATFORM = linux
}

macx {
	PLATFORM = mac
}

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

DESTDIR = $$PWD/bin/$$CONFIGURATION

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

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

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

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

unix:!CONFIG(nosanitizers) {

	# seems like we want USan always, but are afraid of ....
	!CONFIG(sanitize_address):!CONFIG(sanitize_thread):!CONFIG(sanitize_memory):!CONFIG(sanitize_kernel_address) {
		# Ubsan is turned on by default
		CONFIG += sanitizer sanitize_undefined
	}

	CONFIG(debug, debug | release):!CONFIG(sanitize_address):!macx-clang { CONFIG += sanitize_leak }

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

	CONFIG(sanitize_undefined):macx-clang {
		# sometimes runtime is missing in clang. this hack allows to avoid runtime dependency.
		QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fsanitize-trap=undefined
		QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fsanitize-trap=undefined
		QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fsanitize-trap=undefined
	}

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

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

}

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

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

LIBS += -L$$DESTDIR

CONFIG += c++11
QMAKE_CXXFLAGS += -pedantic-errors -Werror=pedantic -ansi -std=c++11
#I whant -Werror to be turned on, but Qt has problems
QMAKE_CXXFLAGS += -Wextra -Wcast-qual -Wwrite-strings -Wredundant-decls -Wunreachable-code -Wnon-virtual-dtor -Woverloaded-virtual -Wuninitialized -Winit-self
#-Wold-style-cast -Wmissing-declarations

GLOBAL_PWD = $$PWD

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

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

				FILE ~= s,/$,,g

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

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

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

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

	export(QMAKE_POST_LINK)
}

defineTest(includes) {
	PROJECTS = $$1

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

	export(INCLUDEPATH)
}

defineTest(links) {
	PROJECTS = $$1

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

	export(LIBS)
}

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

win32 {
	PLATFORM = windows
}

unix:!macx {
	PLATFORM = linux
}

macx {
	PLATFORM = mac
}

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

DESTDIR = $$PWD/bin/$$CONFIGURATION

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

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

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

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

unix:!CONFIG(nosanitizers) {

	# seems like we want USan always, but are afraid of ....
	!CONFIG(sanitize_address):!CONFIG(sanitize_thread):!CONFIG(sanitize_memory):!CONFIG(sanitize_kernel_address) {
		# Ubsan is turned on by default
		CONFIG += sanitizer sanitize_undefined
	}

	CONFIG(debug, debug | release):!CONFIG(sanitize_address):!macx-clang { CONFIG += sanitize_leak }

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

	CONFIG(sanitize_undefined):macx-clang {
		# sometimes runtime is missing in clang. this hack allows to avoid runtime dependency.
		QMAKE_SANITIZE_UNDEFINED_CFLAGS += -fsanitize-trap=undefined
		QMAKE_SANITIZE_UNDEFINED_CXXFLAGS += -fsanitize-trap=undefined
		QMAKE_SANITIZE_UNDEFINED_LFLAGS += -fsanitize-trap=undefined
	}

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

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

}

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

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

LIBS += -L$$DESTDIR

CONFIG += c++11
QMAKE_CXXFLAGS += -pedantic-errors -Werror=pedantic -ansi -std=c++11
#I whant -Werror to be turned on, but Qt has problems
QMAKE_CXXFLAGS += -Wextra -Wcast-qual -Wwrite-strings -Wredundant-decls -Wunreachable-code -Wnon-virtual-dtor -Woverloaded-virtual -Wuninitialized -Winit-self
#-Wold-style-cast -Wmissing-declarations

GLOBAL_PWD = $$PWD

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

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

				FILE ~= s,/$,,g

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

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

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

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

	export(QMAKE_POST_LINK)
}

defineTest(includes) {
	PROJECTS = $$1

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

	export(INCLUDEPATH)
}

defineTest(links) {
	PROJECTS = $$1

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

	export(LIBS)
}


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

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


svn2git

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

exists($$PWD/../gams-cpp.pro) {
    DESTDIR = ../../bin
    unix : LIBS += -ldl -L../../bin -lgamscpp
    win32: LIBS += -L../../bin/ -lgamscpp
    INCLUDEPATH += ../../src/
} else {
    unix : LIBS += -ldl -L$$PWD/lib -lgamscpp
    win32: LIBS += -L$$PWD/lib/$$VSVERSION -lgamscpp
    INCLUDEPATH += $$PWD/api
}

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

exists($$PWD/../gams-cpp.pro) {
    DESTDIR = ../../bin
    unix : LIBS += -ldl -L../../bin -lgamscpp
    win32: LIBS += -L../../bin/ -lgamscpp
    INCLUDEPATH += ../../src/
} else {
    unix : LIBS += -ldl -L../lib -lgamscpp
    win32: LIBS += -L../lib/$$VSVERSION -lgamscpp
    INCLUDEPATH += ../api
}


Fixed linking on windows for qmljsdebugger

QT += declarative script
INCLUDEPATH += $$PWD $$PWD/include editor
DEPENDPATH += $$PWD $$PWD/include editor

contains(CONFIG, dll) {
    DEFINES += BUILD_QMLJSDEBUGGER_LIB
} else {
    DEFINES += BUILD_QMLJSDEBUGGER_STATIC_LIB
}

## Once is not enough
include($$PWD/../../private_headers.pri)
include($$PWD/../../private_headers.pri)

include($$PWD/editor/editor.pri)

## Input
HEADERS += \
    include/jsdebuggeragent.h \
    include/qdeclarativedesignview.h \
    include/qdeclarativedesigndebugserver.h \
    include/crumblepath.h \
    include/qmlviewerconstants.h \
    include/qmljsdebugger_global.h \
    qdeclarativedesignview_p.h

SOURCES += \
    jsdebuggeragent.cpp \
    qdeclarativedesignview.cpp \
    qdeclarativedesigndebugserver.cpp

OTHER_FILES += qmljsdebugger.pri

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

contains(CONFIG, dll) {
    DEFINES += BUILD_QMLJSDEBUGGER_LIB
} else {
    DEFINES += BUILD_QMLJSDEBUGGER_STATIC_LIB
}

## Once is not enough
include($$PWD/../../private_headers.pri)
include($$PWD/../../private_headers.pri)

include($$PWD/editor/editor.pri)

## Input
HEADERS += \
    include/jsdebuggeragent.h \
    include/qdeclarativedesignview.h \
    include/qdeclarativedesigndebugserver.h \
    include/crumblepath.h \
    include/qmlviewerconstants.h \
    include/qmljsdebugger_global.h \
    qdeclarativedesignview_p.h

SOURCES += \
    jsdebuggeragent.cpp \
    qdeclarativedesignview.cpp \
    qdeclarativedesigndebugserver.cpp

OTHER_FILES += qmljsdebugger.pri


Version 0.31

Version 0.31


Version 0.6

Version 0.6


Version 8.1

Version 8.1


Version 7.8

Version 7.8


Include mobility global src directory in symbian tsrc includepath

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

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

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

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

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

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

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

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


Version 0.14

Version 0.14


Version 2.15

Version 2.15


Version 8.56

Version 8.56


Version 0.34

Version 0.34


Delete deployment.pri

Delete deployment.pri

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)


fix whitespace

fix whitespace

git-svn-id: 2cc691a92423afb73d43abf86552d58822d2fb7e@299 ac7a513c-5e3a-0410-af42-968c3ac6e7dc

HEADERS += $$PWD/deviceenum.h

windows: {
	SOURCES += $$PWD/deviceenum_win.cpp
}
unix:!mac: {
	SOURCES += $$PWD/deviceenum_unix.cpp
}
mac: {
	SOURCES += $$PWD/deviceenum_mac.cpp
	LIBS += -framework CoreAudio
}


Remove the last sql dependency in declarative

Change-Id: Ib2410e1b32e2cc5216d5fc9659bc45fb46a1da61
Reviewed-by: Lars Knoll <a812617a4072dcbeb80684eca0f369f0083af109@nokia.com>

SOURCES += \
    $$PWD/qdeclarativeapplication.cpp \
    $$PWD/qdeclarativeinstruction.cpp \
    $$PWD/qdeclarativelistmodel.cpp \
    $$PWD/qdeclarativelistmodelworkeragent.cpp \
    $$PWD/qdeclarativeopenmetaobject.cpp \
    $$PWD/qdeclarativevmemetaobject.cpp \
    $$PWD/qdeclarativeengine.cpp \
    $$PWD/qdeclarativeexpression.cpp \
    $$PWD/qdeclarativebinding.cpp \
    $$PWD/qdeclarativeproperty.cpp \
    $$PWD/qdeclarativecomponent.cpp \
    $$PWD/qdeclarativeincubator.cpp \
    $$PWD/qdeclarativecontext.cpp \
    $$PWD/qdeclarativecustomparser.cpp \
    $$PWD/qdeclarativepropertyvaluesource.cpp \
    $$PWD/qdeclarativepropertyvalueinterceptor.cpp \
    $$PWD/qdeclarativeproxymetaobject.cpp \
    $$PWD/qdeclarativevme.cpp \
    $$PWD/qdeclarativecompiler.cpp \
    $$PWD/qdeclarativecompileddata.cpp \
    $$PWD/qdeclarativeboundsignal.cpp \
    $$PWD/qdeclarativemetatype.cpp \
    $$PWD/qdeclarativestringconverters.cpp \
    $$PWD/qdeclarativeparserstatus.cpp \
    $$PWD/qdeclarativetypeloader.cpp \
    $$PWD/qdeclarativeinfo.cpp \
    $$PWD/qdeclarativeerror.cpp \
    $$PWD/qdeclarativescript.cpp \
    $$PWD/qdeclarativerewrite.cpp \
    $$PWD/qdeclarativevaluetype.cpp \
    $$PWD/qdeclarativeaccessors.cpp \
    $$PWD/qdeclarativexmlhttprequest.cpp \
    $$PWD/qdeclarativewatcher.cpp \
    $$PWD/qdeclarativecleanup.cpp \
    $$PWD/qdeclarativepropertycache.cpp \
    $$PWD/qdeclarativenotifier.cpp \
    $$PWD/qdeclarativeintegercache.cpp \
    $$PWD/qdeclarativetypenotavailable.cpp \
    $$PWD/qdeclarativetypenamecache.cpp \
    $$PWD/qdeclarativescriptstring.cpp \
    $$PWD/qdeclarativeworkerscript.cpp \
    $$PWD/qdeclarativeimageprovider.cpp \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \
    $$PWD/qdeclarativedirparser.cpp \
    $$PWD/qdeclarativeextensionplugin.cpp \
    $$PWD/qdeclarativeimport.cpp \
    $$PWD/qdeclarativelist.cpp \
    $$PWD/qdeclarativelocale.cpp \
    $$PWD/qlistmodelinterface.cpp

HEADERS += \
    $$PWD/qdeclarativeglobal_p.h \
    $$PWD/qdeclarativeinstruction_p.h \
    $$PWD/qdeclarativelistmodel_p.h\
    $$PWD/qdeclarativelistmodel_p_p.h\
    $$PWD/qdeclarativelistmodelworkeragent_p.h \
    $$PWD/qdeclarativeopenmetaobject_p.h \
    $$PWD/qdeclarativevmemetaobject_p.h \
    $$PWD/qdeclarative.h \
    $$PWD/qdeclarativeapplication_p.h \
    $$PWD/qdeclarativebinding_p.h \
    $$PWD/qdeclarativebinding_p_p.h \
    $$PWD/qdeclarativeproperty.h \
    $$PWD/qdeclarativecomponent.h \
    $$PWD/qdeclarativecomponent_p.h \
    $$PWD/qdeclarativeincubator.h \
    $$PWD/qdeclarativeincubator_p.h \
    $$PWD/qdeclarativecustomparser_p.h \
    $$PWD/qdeclarativecustomparser_p_p.h \
    $$PWD/qdeclarativepropertyvaluesource.h \
    $$PWD/qdeclarativepropertyvalueinterceptor_p.h \
    $$PWD/qdeclarativeboundsignal_p.h \
    $$PWD/qdeclarativeparserstatus.h \
    $$PWD/qdeclarativeproxymetaobject_p.h \
    $$PWD/qdeclarativevme_p.h \
    $$PWD/qdeclarativecompiler_p.h \
    $$PWD/qdeclarativeengine_p.h \
    $$PWD/qdeclarativeexpression_p.h \
    $$PWD/qdeclarativeprivate.h \
    $$PWD/qdeclarativemetatype_p.h \
    $$PWD/qdeclarativeengine.h \
    $$PWD/qdeclarativecontext.h \
    $$PWD/qdeclarativeexpression.h \
    $$PWD/qdeclarativestringconverters_p.h \
    $$PWD/qdeclarativeinfo.h \
    $$PWD/qdeclarativeproperty_p.h \
    $$PWD/qdeclarativecontext_p.h \
    $$PWD/qdeclarativetypeloader_p.h \
    $$PWD/qdeclarativelist.h \
    $$PWD/qdeclarativelist_p.h \
    $$PWD/qdeclarativedata_p.h \
    $$PWD/qdeclarativeerror.h \
    $$PWD/qdeclarativescript_p.h \
    $$PWD/qdeclarativerewrite_p.h \
    $$PWD/qdeclarativevaluetype_p.h \
    $$PWD/qdeclarativeaccessors_p.h \
    $$PWD/qdeclarativexmlhttprequest_p.h \
    $$PWD/qdeclarativewatcher_p.h \
    $$PWD/qdeclarativecleanup_p.h \
    $$PWD/qdeclarativepropertycache_p.h \
    $$PWD/qdeclarativenotifier_p.h \
    $$PWD/qdeclarativeintegercache_p.h \
    $$PWD/qdeclarativetypenotavailable_p.h \
    $$PWD/qdeclarativetypenamecache_p.h \
    $$PWD/qdeclarativescriptstring.h \
    $$PWD/qdeclarativeworkerscript_p.h \
    $$PWD/qdeclarativeguard_p.h \
    $$PWD/qdeclarativeimageprovider.h \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.h \
    $$PWD/qdeclarativedirparser_p.h \
    $$PWD/qdeclarativeextensioninterface.h \
    $$PWD/qdeclarativeimport_p.h \
    $$PWD/qdeclarativeextensionplugin.h \
    $$PWD/qdeclarativenullablevalue_p_p.h \
    $$PWD/qdeclarativescriptstring_p.h \
    $$PWD/qdeclarativelocale_p.h \
    $$PWD/qlistmodelinterface_p.h \
    $$PWD/qdeclarativecomponentattached_p.h

include(parser/parser.pri)
include(rewriter/rewriter.pri)
include(ftw/ftw.pri)
include(v4/v4.pri)
include(v8/v8.pri)

SOURCES += \
    $$PWD/qdeclarativeapplication.cpp \
    $$PWD/qdeclarativeinstruction.cpp \
    $$PWD/qdeclarativelistmodel.cpp \
    $$PWD/qdeclarativelistmodelworkeragent.cpp \
    $$PWD/qdeclarativeopenmetaobject.cpp \
    $$PWD/qdeclarativevmemetaobject.cpp \
    $$PWD/qdeclarativeengine.cpp \
    $$PWD/qdeclarativeexpression.cpp \
    $$PWD/qdeclarativebinding.cpp \
    $$PWD/qdeclarativeproperty.cpp \
    $$PWD/qdeclarativecomponent.cpp \
    $$PWD/qdeclarativeincubator.cpp \
    $$PWD/qdeclarativecontext.cpp \
    $$PWD/qdeclarativecustomparser.cpp \
    $$PWD/qdeclarativepropertyvaluesource.cpp \
    $$PWD/qdeclarativepropertyvalueinterceptor.cpp \
    $$PWD/qdeclarativeproxymetaobject.cpp \
    $$PWD/qdeclarativevme.cpp \
    $$PWD/qdeclarativecompiler.cpp \
    $$PWD/qdeclarativecompileddata.cpp \
    $$PWD/qdeclarativeboundsignal.cpp \
    $$PWD/qdeclarativemetatype.cpp \
    $$PWD/qdeclarativestringconverters.cpp \
    $$PWD/qdeclarativeparserstatus.cpp \
    $$PWD/qdeclarativetypeloader.cpp \
    $$PWD/qdeclarativeinfo.cpp \
    $$PWD/qdeclarativeerror.cpp \
    $$PWD/qdeclarativescript.cpp \
    $$PWD/qdeclarativerewrite.cpp \
    $$PWD/qdeclarativevaluetype.cpp \
    $$PWD/qdeclarativeaccessors.cpp \
    $$PWD/qdeclarativexmlhttprequest.cpp \
    $$PWD/qdeclarativewatcher.cpp \
    $$PWD/qdeclarativecleanup.cpp \
    $$PWD/qdeclarativepropertycache.cpp \
    $$PWD/qdeclarativenotifier.cpp \
    $$PWD/qdeclarativeintegercache.cpp \
    $$PWD/qdeclarativetypenotavailable.cpp \
    $$PWD/qdeclarativetypenamecache.cpp \
    $$PWD/qdeclarativescriptstring.cpp \
    $$PWD/qdeclarativeworkerscript.cpp \
    $$PWD/qdeclarativeimageprovider.cpp \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.cpp \
    $$PWD/qdeclarativedirparser.cpp \
    $$PWD/qdeclarativeextensionplugin.cpp \
    $$PWD/qdeclarativeimport.cpp \
    $$PWD/qdeclarativelist.cpp \
    $$PWD/qdeclarativelocale.cpp \
    $$PWD/qlistmodelinterface.cpp

HEADERS += \
    $$PWD/qdeclarativeglobal_p.h \
    $$PWD/qdeclarativeinstruction_p.h \
    $$PWD/qdeclarativelistmodel_p.h\
    $$PWD/qdeclarativelistmodel_p_p.h\
    $$PWD/qdeclarativelistmodelworkeragent_p.h \
    $$PWD/qdeclarativeopenmetaobject_p.h \
    $$PWD/qdeclarativevmemetaobject_p.h \
    $$PWD/qdeclarative.h \
    $$PWD/qdeclarativeapplication_p.h \
    $$PWD/qdeclarativebinding_p.h \
    $$PWD/qdeclarativebinding_p_p.h \
    $$PWD/qdeclarativeproperty.h \
    $$PWD/qdeclarativecomponent.h \
    $$PWD/qdeclarativecomponent_p.h \
    $$PWD/qdeclarativeincubator.h \
    $$PWD/qdeclarativeincubator_p.h \
    $$PWD/qdeclarativecustomparser_p.h \
    $$PWD/qdeclarativecustomparser_p_p.h \
    $$PWD/qdeclarativepropertyvaluesource.h \
    $$PWD/qdeclarativepropertyvalueinterceptor_p.h \
    $$PWD/qdeclarativeboundsignal_p.h \
    $$PWD/qdeclarativeparserstatus.h \
    $$PWD/qdeclarativeproxymetaobject_p.h \
    $$PWD/qdeclarativevme_p.h \
    $$PWD/qdeclarativecompiler_p.h \
    $$PWD/qdeclarativeengine_p.h \
    $$PWD/qdeclarativeexpression_p.h \
    $$PWD/qdeclarativeprivate.h \
    $$PWD/qdeclarativemetatype_p.h \
    $$PWD/qdeclarativeengine.h \
    $$PWD/qdeclarativecontext.h \
    $$PWD/qdeclarativeexpression.h \
    $$PWD/qdeclarativestringconverters_p.h \
    $$PWD/qdeclarativeinfo.h \
    $$PWD/qdeclarativeproperty_p.h \
    $$PWD/qdeclarativecontext_p.h \
    $$PWD/qdeclarativetypeloader_p.h \
    $$PWD/qdeclarativelist.h \
    $$PWD/qdeclarativelist_p.h \
    $$PWD/qdeclarativedata_p.h \
    $$PWD/qdeclarativeerror.h \
    $$PWD/qdeclarativescript_p.h \
    $$PWD/qdeclarativerewrite_p.h \
    $$PWD/qdeclarativevaluetype_p.h \
    $$PWD/qdeclarativeaccessors_p.h \
    $$PWD/qdeclarativexmlhttprequest_p.h \
    $$PWD/qdeclarativewatcher_p.h \
    $$PWD/qdeclarativecleanup_p.h \
    $$PWD/qdeclarativepropertycache_p.h \
    $$PWD/qdeclarativenotifier_p.h \
    $$PWD/qdeclarativeintegercache_p.h \
    $$PWD/qdeclarativetypenotavailable_p.h \
    $$PWD/qdeclarativetypenamecache_p.h \
    $$PWD/qdeclarativescriptstring.h \
    $$PWD/qdeclarativeworkerscript_p.h \
    $$PWD/qdeclarativeguard_p.h \
    $$PWD/qdeclarativeimageprovider.h \
    $$PWD/qdeclarativenetworkaccessmanagerfactory.h \
    $$PWD/qdeclarativedirparser_p.h \
    $$PWD/qdeclarativeextensioninterface.h \
    $$PWD/qdeclarativeimport_p.h \
    $$PWD/qdeclarativeextensionplugin.h \
    $$PWD/qdeclarativenullablevalue_p_p.h \
    $$PWD/qdeclarativescriptstring_p.h \
    $$PWD/qdeclarativelocale_p.h \
    $$PWD/qlistmodelinterface_p.h \
    $$PWD/qdeclarativecomponentattached_p.h

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


Templates: Set correct settings for qnx target

Task-number: QTCREATORBUG-12013

Change-Id: I6b8fa2409b2a6530267717879d82713313ae6672
Reviewed-by: Kai Koehne <077bc265216106fb22408e62f2d97925ede69d10@digia.com>
Reviewed-by: Vladimir Minenko <04613582abbac7386b65db00a422c2463ccae146@blackberry.com>
Reviewed-by: Eike Ziller <c142da16c73a95a82d35191bcc55b22835617128@digia.com>

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)

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)


Remove reference to removed file.

Remove reference to removed file.

Change-Id: Ia2433b26d8c209d0d5e4de4cff0f3d978f54ab47
Reviewed-by: Leena Miettinen <885fda02d52616fec24ed5fed9b3f0568fce3ead@theqtcompany.com>

defineReplace(targetPath) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
QDOC_MAINFILE = $$PWD/qbs.qdocconf
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)

VERSION_TAG = $$replace(QBS_VERSION, "[-.]", )

HTML_DOC_PATH=$$OUT_PWD/doc/html
equals(QMAKE_DIR_SEP, /) {   # unix, mingw+msys
    QDOC = SRCDIR=$$PWD OUTDIR=$$HTML_DOC_PATH QBS_VERSION=$$QBS_VERSION QBS_VERSION_TAG=$$VERSION_TAG QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$QDOC_BIN
} else:win32-g++* {   # just mingw
    # The lack of spaces in front of the && is necessary!
    QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$HTML_DOC_PATH&& set QBS_VERSION=$$QBS_VERSION&& set QBS_VERSION_TAG=$$VERSION_TAG&& set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS]&& $$QDOC_BIN
} else {   # nmake
    QDOC = set SRCDIR=$$PWD $$escape_expand(\\n\\t) \
           set OUTDIR=$$HTML_DOC_PATH $$escape_expand(\\n\\t) \
           set QBS_VERSION=$$QBS_VERSION $$escape_expand(\\n\\t) \
           set QBS_VERSION_TAG=$$VERSION_TAG $$escape_expand(\\n\\t) \
           set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$escape_expand(\\n\\t) \
           $$QDOC_BIN
}

QHP_FILE = $$HTML_DOC_PATH/qbs.qhp
QCH_FILE = $$OUT_PWD/doc/qbs.qch

HELP_DEP_FILES = $$PWD/qbs.qdoc \
                 $$PWD/config/macros.qdocconf \
                 $$PWD/config/qt-html-templates.qdocconf \
                 $$PWD/config/qt-html-default-styles.qdocconf \
                 $$QDOC_MAINFILE

html_docs.commands = $$QDOC $$PWD/qbs.qdocconf
html_docs.depends += $$HELP_DEP_FILES

html_docs_online.commands = $$QDOC $$PWD/qbs-online.qdocconf
html_docs_online.files = $$QHP_FILE

qch_docs.commands = $$HELPGENERATOR -o $$shell_quote($$QCH_FILE) $$QHP_FILE
qch_docs.depends += html_docs

docs_online.depends = html_docs_online
QMAKE_EXTRA_TARGETS += html_docs_online docs_online

inst_qch_docs.files = $$QCH_FILE
inst_qch_docs.path = $${QBS_INSTALL_PREFIX}/share/doc/qbs
inst_qch_docs.CONFIG += no_check_exist no_default_install
INSTALLS += inst_qch_docs

inst_html_docs.files = $$HTML_DOC_PATH
inst_html_docs.path = $$inst_qch_docs.path
inst_html_docs.CONFIG += no_check_exist no_default_install directory
INSTALLS += inst_html_docs

install_docs.depends = install_inst_qch_docs install_inst_html_docs
QMAKE_EXTRA_TARGETS += install_docs

docs.depends = qch_docs
QMAKE_EXTRA_TARGETS += html_docs qch_docs docs

fixnavi.commands = \
    cd $$targetPath($$PWD) && \
    perl fixnavi.pl -Dqcmanual -Dqtquick \
        qbs.qdoc
QMAKE_EXTRA_TARGETS += fixnavi

defineReplace(targetPath) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
QDOC_MAINFILE = $$PWD/qbs.qdocconf
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)

VERSION_TAG = $$replace(QBS_VERSION, "[-.]", )

HTML_DOC_PATH=$$OUT_PWD/doc/html
equals(QMAKE_DIR_SEP, /) {   # unix, mingw+msys
    QDOC = SRCDIR=$$PWD OUTDIR=$$HTML_DOC_PATH QBS_VERSION=$$QBS_VERSION QBS_VERSION_TAG=$$VERSION_TAG QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$QDOC_BIN
} else:win32-g++* {   # just mingw
    # The lack of spaces in front of the && is necessary!
    QDOC = set SRCDIR=$$PWD&& set OUTDIR=$$HTML_DOC_PATH&& set QBS_VERSION=$$QBS_VERSION&& set QBS_VERSION_TAG=$$VERSION_TAG&& set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS]&& $$QDOC_BIN
} else {   # nmake
    QDOC = set SRCDIR=$$PWD $$escape_expand(\\n\\t) \
           set OUTDIR=$$HTML_DOC_PATH $$escape_expand(\\n\\t) \
           set QBS_VERSION=$$QBS_VERSION $$escape_expand(\\n\\t) \
           set QBS_VERSION_TAG=$$VERSION_TAG $$escape_expand(\\n\\t) \
           set QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS] $$escape_expand(\\n\\t) \
           $$QDOC_BIN
}

QHP_FILE = $$HTML_DOC_PATH/qbs.qhp
QCH_FILE = $$OUT_PWD/doc/qbs.qch

HELP_DEP_FILES = $$PWD/qbs.qdoc \
                 $$PWD/config/macros.qdocconf \
                 $$PWD/config/qt-cpp-ignore.qdocconf \
                 $$PWD/config/qt-html-templates.qdocconf \
                 $$PWD/config/qt-html-default-styles.qdocconf \
                 $$QDOC_MAINFILE

html_docs.commands = $$QDOC $$PWD/qbs.qdocconf
html_docs.depends += $$HELP_DEP_FILES

html_docs_online.commands = $$QDOC $$PWD/qbs-online.qdocconf
html_docs_online.files = $$QHP_FILE

qch_docs.commands = $$HELPGENERATOR -o $$shell_quote($$QCH_FILE) $$QHP_FILE
qch_docs.depends += html_docs

docs_online.depends = html_docs_online
QMAKE_EXTRA_TARGETS += html_docs_online docs_online

inst_qch_docs.files = $$QCH_FILE
inst_qch_docs.path = $${QBS_INSTALL_PREFIX}/share/doc/qbs
inst_qch_docs.CONFIG += no_check_exist no_default_install
INSTALLS += inst_qch_docs

inst_html_docs.files = $$HTML_DOC_PATH
inst_html_docs.path = $$inst_qch_docs.path
inst_html_docs.CONFIG += no_check_exist no_default_install directory
INSTALLS += inst_html_docs

install_docs.depends = install_inst_qch_docs install_inst_html_docs
QMAKE_EXTRA_TARGETS += install_docs

docs.depends = qch_docs
QMAKE_EXTRA_TARGETS += html_docs qch_docs docs

fixnavi.commands = \
    cd $$targetPath($$PWD) && \
    perl fixnavi.pl -Dqcmanual -Dqtquick \
        qbs.qdoc
QMAKE_EXTRA_TARGETS += fixnavi


fix isEmpty check

fix isEmpty check

Task-number: QBS-620
Change-Id: I86d220d10b6158db63e2f81d92feaeada0dc86a0
Reviewed-by: Jake Petroules <2d627e1cecd5435752fa500bacbe05f7cc90c369@petroules.com>


QMake Options: Enable server build

QMake Options: Enable server build

#options = developer-build
#options += static-lib
options += beta-build
options += server

# Installation directories
isEmpty(INSTALL_PREFIX) {
    unix {
        INSTALL_PREFIX = /usr/local
    } else {
        INSTALL_PREFIX = $$[QT_INSTALL_PREFIX]
    }
}

isEmpty(INSTALL_LIB_DIR) {
    INSTALL_LIB_DIR = $$INSTALL_PREFIX/lib
}

isEmpty(INSTALL_INCLUDE_DIR) {
    INSTALL_INCLUDE_DIR = $$INSTALL_PREFIX/include
}

isEmpty(INSTALL_DATA_DIR) {
    INSTALL_DATA_DIR = $$INSTALL_PREFIX/share
}

isEmpty(INSTALL_DOC_DIR) {
    INSTALL_DOC_DIR = $$INSTALL_DATA_DIR/doc
}

isEmpty(INSTALL_QML_IMPORT_DIR) {
    INSTALL_QML_IMPORT_DIR = $$[QT_INSTALL_QML]
}

#options = developer-build
#options += static-lib
options += beta-build
#options += server

# Installation directories
isEmpty(INSTALL_PREFIX) {
    unix {
        INSTALL_PREFIX = /usr/local
    } else {
        INSTALL_PREFIX = $$[QT_INSTALL_PREFIX]
    }
}

isEmpty(INSTALL_LIB_DIR) {
    INSTALL_LIB_DIR = $$INSTALL_PREFIX/lib
}

isEmpty(INSTALL_INCLUDE_DIR) {
    INSTALL_INCLUDE_DIR = $$INSTALL_PREFIX/include
}

isEmpty(INSTALL_DATA_DIR) {
    INSTALL_DATA_DIR = $$INSTALL_PREFIX/share
}

isEmpty(INSTALL_DOC_DIR) {
    INSTALL_DOC_DIR = $$INSTALL_DATA_DIR/doc
}

isEmpty(INSTALL_QML_IMPORT_DIR) {
    INSTALL_QML_IMPORT_DIR = $$[QT_INSTALL_QML]
}


Adjust the Linux/Fedora build options a bit: Now Linux systems will use /usr for the PREFIX by default, (except Fedora: /usr/local there)

# =============================================
#  Subroutine for project files to detect which OS is compiling the project
#  Generic variables it sets for internal use: OS, LINUX_DISTRO (if OS=="Linux")
# =============================================
#  Main Build Variables (generally for finding existing files):
# 	PREFIX: 		Base install directory (${PREFIX}/[bin/share/etc/include] will be used)
#	LIBPREFIX: 	Base install directory for libraries (usually ${PREFIX}/lib)
#  Detailed Build Variables for installing files:
#	L_BINDIR:		Directory to install binaries
#	L_LIBDIR:		Directory to install Libraries
#	L_ETCDIR:		Directory to install/use global configs
#	L_SHAREDIR:	Directory to install the general Lumina files
#	L_INCLUDEDIR:	Directory to install include files
#	L_SESSDIR:	Directory to place *.desktop file for starting the Lumina session
#	LRELEASE:	binary path to the Qt lrelease utility (usually auto-set)
# =============================================
# Note: Make sure the OS variable matches the name of a libLumina/LuminaOS-<OS>.cpp file
# =============================================
!defined(OS){
  message("Build OS Info: $${QMAKE_HOST.os}, $${QMAKE_HOST.arch}, $${QMAKE_HOST.version_string}")

  #Load the initial library search locations (more can be added in the OS-specific sections below)
  LIBS = -L$${PWD}/libLumina -L$$[QT_INSTALL_LIBS]

  #Setup the default values for build settings (if not explicitly set previously)
  !defined(PREFIX){ PREFIX=/usr/local }
  !defined(LIBPREFIX){ LIBPREFIX=$${PREFIX}/lib }

  #Now go through and setup any known OS build settings
  #  which are different from the defaults
  equals(QMAKE_HOST.os, "DragonFly"){
    #Note: DragonFly BSD gets detected as FreeBSD with compiler flags ?
    OS = DragonFly
    LIBS += -L/usr/local/lib -L/usr/lib

  }else : freebsd-*{
    OS = FreeBSD
    LIBS += -L/usr/local/lib -L/usr/lib
     #Use the defaults for everything else

  }else : openbsd-*{
    OS = OpenBSD
    LIBS += -L/usr/local/lib -L/usr/lib
    #Use the defaults for everything else

  }else : netbsd-*{
    OS = NetBSD
    LIBS += -L/usr/local/lib -L/usr/lib
    PREFIX=/usr/local
    LIBPREFIX=/usr/local/lib
    #Use the defaults for everything else

  }else : linux-*{
    L_SESSDIR=/usr/share/xsessions
    OS=Linux
    LIBS += -L/usr/local/lib -L/usr/lib -L/lib
    PREFIX = /usr

    exists(/bin/lsb_release){
      LINUX_DISTRO = $$system(lsb_release -si)
    } else:exists(/usr/bin/lsb_release){
      LINUX_DISTRO = $$system(lsb_release -si)
    }

    #Now switch through known Linux distro templates
    equals(LINUX_DISTRO, "Fedora"){
      PREFIX=/usr/local
      equals($${QMAKE_HOST.arch},"amd64"){ L_LIBDIR=/lib64 }
      else{ L_LIBDIR=/lib }
    }

  }else{
    OS="Unknown";
  }

  MSG="Build Settings Loaded: $${OS}"
  equals(OS,"Linux"){ MSG+="-$${LINUX_DISTRO}" }
  message( $$MSG )

  # Setup the dirs needed to find/load libraries
  QMAKE_LIBDIR =  $$[QT_INSTALL_LIBS] $$LIBPREFIX/qt5 $$LIBPREFIX
  INCLUDEPATH = $${PWD}/libLumina $$PREFIX/include

  # If the detailed install variables are not set - create them from the general vars
  !defined(L_BINDIR){ L_BINDIR = $${PREFIX}/bin }
  !defined(L_LIBDIR){ L_LIBDIR = $${PREFIX}/lib }
  !defined(L_ETCDIR){ L_ETCDIR = $${PREFIX}/etc }
  !defined(L_SHAREDIR){ L_SHAREDIR = $${PREFIX}/share }
  !defined(L_INCLUDEDIR){ L_INCLUDEDIR = $${PREFIX}/include }
  !defined(L_SESSDIR){ L_SESSDIR = $${L_SHAREDIR}/xsessions }
  !defined(LRELEASE){ LRELEASE = $$[QT_INSTALL_BINS]/lrelease }

  !exists(LRELEASE){ NO_I18N=true } #translations unavailable
  #Now convert any of these path variables into defines for C++ usage
  DEFINES += PREFIX="QString\\\(\\\"$${PREFIX}\\\"\\\)"
  DEFINES += L_ETCDIR="QString\\\(\\\"$${L_ETCDIR}\\\"\\\)"
  DEFINES += L_SHAREDIR="QString\\\(\\\"$${L_SHAREDIR}\\\"\\\)"
}

# =============================================
#  Subroutine for project files to detect which OS is compiling the project
#  Generic variables it sets for internal use: OS, LINUX_DISTRO (if OS=="Linux")
# =============================================
#  Main Build Variables (generally for finding existing files):
# 	PREFIX: 		Base install directory (${PREFIX}/[bin/share/etc/include] will be used)
#	LIBPREFIX: 	Base install directory for libraries (usually ${PREFIX}/lib)
#  Detailed Build Variables for installing files:
#	L_BINDIR:		Directory to install binaries
#	L_LIBDIR:		Directory to install Libraries
#	L_ETCDIR:		Directory to install/use global configs
#	L_SHAREDIR:	Directory to install the general Lumina files
#	L_INCLUDEDIR:	Directory to install include files
#	L_SESSDIR:	Directory to place *.desktop file for starting the Lumina session
#	LRELEASE:	binary path to the Qt lrelease utility (usually auto-set)
# =============================================
# Note: Make sure the OS variable matches the name of a libLumina/LuminaOS-<OS>.cpp file
# =============================================
!defined(OS){
  message("Build OS Info: $${QMAKE_HOST.os}, $${QMAKE_HOST.arch}, $${QMAKE_HOST.version_string}")

  #Load the initial library search locations (more can be added in the OS-specific sections below)
  LIBS = -L$${PWD}/libLumina -L$$[QT_INSTALL_LIBS]

  #Setup the default values for build settings (if not explicitly set previously)
  !defined(PREFIX){ PREFIX=/usr/local }
  !defined(LIBPREFIX){ LIBPREFIX=$${PREFIX}/lib }

  #Now go through and setup any known OS build settings
  #  which are different from the defaults
  equals(QMAKE_HOST.os, "DragonFly"){
    #Note: DragonFly BSD gets detected as FreeBSD with compiler flags ?
    OS = DragonFly
    LIBS += -L/usr/local/lib -L/usr/lib

  }else : freebsd-*{
    OS = FreeBSD
    LIBS += -L/usr/local/lib -L/usr/lib
     #Use the defaults for everything else

  }else : openbsd-*{
    OS = OpenBSD
    LIBS += -L/usr/local/lib -L/usr/lib
    #Use the defaults for everything else

  }else : netbsd-*{
    OS = NetBSD
    LIBS += -L/usr/local/lib -L/usr/lib
    PREFIX=/usr/local
    LIBPREFIX=/usr/local/lib
    #Use the defaults for everything else

  }else : linux-*{
    L_SESSDIR=/usr/share/xsessions
    OS=Linux
    LIBS += -L/usr/local/lib -L/usr/lib -L/lib
    exists(/bin/lsb_release){
      LINUX_DISTRO = $$system(lsb_release -si)
    } else:exists(/usr/bin/lsb_release){
      LINUX_DISTRO = $$system(lsb_release -si)
    }

    #Now switch through known Linux distro templates
    equals(LINUX_DISTRO, "Fedora"){
      PREFIX=/usr/local
      L_LIBDIR=/lib64
    }

  }else{
    OS="Unknown";
  }
  MSG="Build Settings Loaded: $${OS}"
  equals(OS,"Linux"){ MSG+="-$${LINUX_DISTRO}" }
  message( $$MSG )

  # Setup the dirs needed to find/load libraries
  QMAKE_LIBDIR =  $$[QT_INSTALL_LIBS] $$LIBPREFIX/qt5 $$LIBPREFIX
  INCLUDEPATH = $${PWD}/libLumina $$PREFIX/include

  # If the detailed install variables are not set - create them from the general vars
  !defined(L_BINDIR){ L_BINDIR = $${PREFIX}/bin }
  !defined(L_LIBDIR){ L_LIBDIR = $${PREFIX}/lib }
  !defined(L_ETCDIR){ L_ETCDIR = $${PREFIX}/etc }
  !defined(L_SHAREDIR){ L_SHAREDIR = $${PREFIX}/share }
  !defined(L_INCLUDEDIR){ L_INCLUDEDIR = $${PREFIX}/include }
  !defined(L_SESSDIR){ L_SESSDIR = $${L_SHAREDIR}/xsessions }
  !defined(LRELEASE){ LRELEASE = $$[QT_INSTALL_BINS]/lrelease }

  !exists(LRELEASE){ NO_I18N=true } #translations unavailable
  #Now convert any of these path variables into defines for C++ usage
  DEFINES += PREFIX="QString\\\(\\\"$${PREFIX}\\\"\\\)"
  DEFINES += L_ETCDIR="QString\\\(\\\"$${L_ETCDIR}\\\"\\\)"
  DEFINES += L_SHAREDIR="QString\\\(\\\"$${L_SHAREDIR}\\\"\\\)"
}