vcpkg adjustments

vcpkg adjustments

- adjust sdk.pri to link with bzip2 and icudt when building with vcpkg

MEGASDK_BASE_PATH = $$PWD/../../

THIRDPARTY_VCPKG_PATH = $$THIRDPARTY_VCPKG_BASE_PATH/vcpkg/installed/$$VCPKG_TRIPLET
exists($$THIRDPARTY_VCPKG_PATH) {
   CONFIG += vcpkg
}
vcpkg:debug:message("Building DEBUG with VCPKG 3rdparty at $$THIRDPARTY_VCPKG_PATH")
vcpkg:release:message("Building RELEASE with VCPKG 3rdparty at $$THIRDPARTY_VCPKG_PATH")
!vcpkg:message("vcpkg not used")

debug:DEBUG_SUFFIX = "d"
else:DEBUG_SUFFIX = ""
debug:DASH_DEBUG_SUFFIX = "-d"
else:DASH_DEBUG_SUFFIX = ""
debug:UNDERSCORE_DEBUG_SUFFIX = "_d"
else:UNDERSCORE_DEBUG_SUFFIX = ""

debug:win32:DEBUG_SUFFIX_WO = "d"
else:DEBUG_SUFFIX_WO = ""

MI_DEBUG_SUFFIX = ""
debug:macx:MI_DEBUG_SUFFIX = "_debug"
debug:win32:MI_DEBUG_SUFFIX = "d"

VPATH += $$MEGASDK_BASE_PATH
SOURCES += src/attrmap.cpp \
    src/backofftimer.cpp \
    src/base64.cpp \
    src/command.cpp \
    src/commands.cpp \
    src/db.cpp \
    src/gfx.cpp \
    src/file.cpp \
    src/fileattributefetch.cpp \
    src/filefingerprint.cpp \
    src/filesystem.cpp \
    src/http.cpp \
    src/json.cpp \
    src/megaclient.cpp \
    src/node.cpp \
    src/pubkeyaction.cpp \
    src/request.cpp \
    src/serialize64.cpp \
    src/share.cpp \
    src/sharenodekeys.cpp \
    src/sync.cpp \
    src/transfer.cpp \
    src/transferslot.cpp \
    src/treeproc.cpp \
    src/user.cpp \
    src/useralerts.cpp \
    src/utils.cpp \
    src/logging.cpp \
    src/waiterbase.cpp  \
    src/proxy.cpp \
    src/pendingcontactrequest.cpp \
    src/crypto/cryptopp.cpp  \
    src/crypto/sodium.cpp  \
    src/db/sqlite.cpp  \
    src/gfx/external.cpp \
    src/mega_utf8proc.cpp \
    src/mega_ccronexpr.cpp \
    src/mega_evt_tls.cpp \
    src/mega_zxcvbn.cpp \
    src/mediafileattribute.cpp \
    src/raid.cpp \
    src/testhooks.cpp \
    src/heartbeats.cpp

CONFIG(USE_MEGAAPI) {
  SOURCES += src/megaapi.cpp src/megaapi_impl.cpp

  CONFIG(qt) {
    SOURCES += bindings/qt/QTMegaRequestListener.cpp \
        bindings/qt/QTMegaTransferListener.cpp \
        bindings/qt/QTMegaGlobalListener.cpp \
        bindings/qt/QTMegaListener.cpp \
        bindings/qt/QTMegaEvent.cpp
  }
}

CONFIG(USE_ROTATIVEPERFORMANCELOGGER) {
  SOURCES += src/rotativeperformancelogger.cpp
}

!win32 {
    QMAKE_CXXFLAGS += -std=c++11 -Wextra -Wconversion -Wno-unused-parameter

    unix:!macx {
        GCC_VERSION = $$system("g++ -dumpversion")
        !lessThan(GCC_VERSION, 5) {
            LIBS += -lstdc++fs
        }
    }
}

CONFIG(USE_AUTOCOMPLETE) {
    SOURCES += src/autocomplete.cpp
    HEADERS += include/mega/autocomplete.h
}

CONFIG(USE_POLL) {
    DEFINES += USE_POLL
}

CONFIG(USE_CONSOLE) {
    win32 {

        HEADERS += include/mega/win32/megaconsole.h
        HEADERS += include/mega/win32/megaconsolewaiter.h

        CONFIG(noreadline) {
            DEFINES += NO_READLINE
            SOURCES += src/win32/console.cpp
            SOURCES += src/win32/consolewaiter.cpp
        }
        else {
            DEFINES += USE_READLINE_STATIC
            SOURCES += src/wincurl/console.cpp
            SOURCES += src/wincurl/consolewaiter.cpp
            LIBS += -lreadline
        }
        QMAKE_CXXFLAGS+=/Zc:__cplusplus /std:c++ #this will set _cplusplus correctly in MSVC >= 2017 15.7 Preview 3
    }
    else {
        HEADERS += include/mega/posix/megaconsole.h
        HEADERS += include/mega/posix/megaconsolewaiter.h
        SOURCES += src/posix/console.cpp
        SOURCES += src/posix/consolewaiter.cpp
        LIBS += -lreadline
    }
}

CONFIG(ENABLE_CHAT) {
    CONFIG += USE_LIBUV

    !macx {
        !vcpkg:exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a -lcap
        }
        else {
            vcpkg:LIBS += $$THIRDPARTY_VCPKG_PATH/lib/libwebsockets.a -lcap
            !vcpkg:LIBS += -lwebsockets -lcap
        }
    }
    else {
        exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a
        }
        else {
        LIBS += -lwebsockets
        }
    }
}

CONFIG(USE_LIBUV) {
    SOURCES += src/mega_http_parser.cpp
    DEFINES += HAVE_LIBUV
    vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/libuv
    !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/libuv
    win32 {
        LIBS += -llibuv -lIphlpapi -lUserenv -lpsapi
    }

    unix:!macx {
       exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libuv.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libuv.a
       }
       else {
        vcpkg:LIBS += -llibuv
        else:LIBS += -luv
       }
    }

    macx {
        vcpkg:LIBS += -llibuv
        !vcpkg:LIBS += -luv
    }
}

CONFIG(USE_MEDIAINFO) {
    DEFINES += USE_MEDIAINFO UNICODE

    vcpkg:LIBS += -lmediainfo$$MI_DEBUG_SUFFIX -lzen$$MI_DEBUG_SUFFIX
    vcpkg:win32:LIBS += -lzlib$$DEBUG_SUFFIX
    vcpkg:!win32:LIBS += -lz

    !vcpkg:win32 {
        vcpkg:LIBS += -lmediainfo$$DEBUG_SUFFIX -lzen$$DEBUG_SUFFIX -lzlib$$DEBUG_SUFFIX
        else:LIBS += -lMediaInfo -lZenLib -lzlibstat
    }

    !vcpkg:macx {
        LIBS += -lmediainfo -lzen -lz
    }

    !vcpkg:unix:!macx {

       exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libmediainfo.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libmediainfo.a
       }
       else {
        LIBS += -lmediainfo
       }
       exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libzen.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libzen.a
       }
       else {
        LIBS += -lzen
       }
    }
}

CONFIG(USE_LIBRAW) {
    DEFINES += HAVE_LIBRAW

    vcpkg:LIBS += -lraw$$DEBUG_SUFFIX -ljasper$$DEBUG_SUFFIX
    vcpkg:win32:LIBS += -ljpeg$$DEBUG_SUFFIX
    vcpkg:!win32:LIBS += -ljpeg
    vcpkg:unix:!macx:LIBS += -lgomp
    vcpkg:!CONFIG(USE_PDFIUM):LIBS += -llcms2$$DEBUG_SUFFIX

    win32 {
        DEFINES += LIBRAW_NODLL
        !vcpkg:LIBS += -llibraw
    }

    !vcpkg:macx {
        LIBS += -lraw
    }

    !vcpkg:unix:!macx {
        exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libraw.a) {
            LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libraw.a -fopenmp
        }
        else {
            LIBS += -lraw -fopenmp
        }
    }
}

CONFIG(USE_PDFIUM) {

    vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/pdfium
    vcpkg:LIBS += -lpdfium -lfreetype$$DEBUG_SUFFIX -ljpeg$$DEBUG_SUFFIX_WO -lopenjp2  -llcms$$DEBUG_SUFFIX

    #make sure we get the vcpkg built icu libraries and not a system one with the same name
    vcpkg {
        win32 {
            vcpkg:LIBS += -lbz2$$DEBUG_SUFFIX_WO -licudt$$DEBUG_SUFFIX_WO
            debug: LIBS += -l$$THIRDPARTY_VCPKG_PATH/debug/lib/icuucd -l$$THIRDPARTY_VCPKG_PATH/debug/lib/icuiod
            !debug: LIBS += -l$$THIRDPARTY_VCPKG_PATH/lib/icuuc$$DEBUG_SUFFIX_WO.lib -l$$THIRDPARTY_VCPKG_PATH/lib/icuio$$DEBUG_SUFFIX_WO.lib
            #QMAKE_LFLAGS_WINDOWS += /VERBOSE
        }
        else {
            debug {
                # icu doesn't build debug libs with 'd' suffix, but check anyway
                exists($$THIRDPARTY_VCPKG_PATH/debug/lib/libicuuc$$DEBUG_SUFFIX.a) {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuuc$$DEBUG_SUFFIX.a
                }
                else {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuuc.a
                }
                exists($$THIRDPARTY_VCPKG_PATH/debug/lib/libicuio$$DEBUG_SUFFIX.a) {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuio$$DEBUG_SUFFIX.a
                }
                else {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuio.a
                }
            }
            !debug: LIBS += $$THIRDPARTY_VCPKG_PATH/lib/libicuuc.a $$THIRDPARTY_VCPKG_PATH/lib/libicuio.a
        }
    }

    vcpkg:unix:!macx:LIBS += -lpng -lharfbuzz #freetype dependencies. ideally we could use pkg-config to get these
    # is it needed? win has it, mac does not -licuin$$DEBUG_SUFFIX_WO
    vcpkg:win32:LIBS += -lGdi32  -llibpng16$$DEBUG_SUFFIX
    vcpkg:DEFINES += HAVE_PDFIUM

    !vcpkg {
        unix:!macx {
            exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libpdfium.a) {
                DEFINES += HAVE_PDFIUM
                INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium
                LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libpdfium.a
            }
            else:exists(/usr/include/fpdfview.h) {
                DEFINES += HAVE_PDFIUM
                LIBS += -lpdfium
            }
        }
        else {#win/mac
            DEFINES += HAVE_PDFIUM
            INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium
            LIBS += -lpdfium
        }
    }
}

CONFIG(USE_FFMPEG) {

    unix:!macx {
        # On Linux, vcpkg provides libavresample instead of libswresample
        vcpkg:LIBS += -lavformat -lavcodec -lavutil -lswscale -lavresample
        else {
            exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/ffmpeg):exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libavcodec.a) {
            DEFINES += HAVE_FFMPEG
                INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/ffmpeg
                FFMPEGLIBPATH = $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib
            }
            else:exists(/usr/include/ffmpeg-mega) {
                DEFINES += HAVE_FFMPEG
                INCLUDEPATH += /usr/include/ffmpeg-mega
                exists(/usr/lib64/libavcodec.a) {
                    FFMPEGLIBPATH = /usr/lib64
                }
                else:exists(/usr/lib32/libavcodec.a) {
                    FFMPEGLIBPATH = /usr/lib32
                }
                else {
                   FFMPEGLIBPATH = /usr/lib
                }
            }
            else:packagesExist(ffmpeg)|packagesExist(libavcodec) {
                DEFINES += HAVE_FFMPEG
                LIBS += -lavcodec -lavformat -lavutil -lswscale -lswresample
            }

            FFMPEGSTATICLIBS = libavformat.a libavcodec.a libavutil.a libswscale.a

            for(ffmpeglib, FFMPEGSTATICLIBS) {
                exists($$FFMPEGLIBPATH/$$ffmpeglib) {
                    LIBS += $$FFMPEGLIBPATH/$$ffmpeglib
                }
            }

            #particular distros requirements
            exists(/usr/lib64/libbz2.so*)|exists(/usr/lib/libbz2.so*) {
                LIBS += -lbz2 #required in fedora ffmpeg/arch compilation
            }

            exists(/usr/lib/liblzma.so*):exists(/etc/arch-release) {
                LIBS += -llzma #required in arch ffmpeg compilation
            }
        }
    }
    else { #win/mac
        DEFINES += HAVE_FFMPEG
        vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/ffmpeg
        else:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/ffmpeg
        LIBS += -lavcodec -lavformat -lavutil -lswscale
        vcpkg:macx:LIBS += -lswrescale -lbz2
    }
}

CONFIG(USE_WEBRTC) {

    DEFINES += ENABLE_WEBRTC V8_DEPRECATION_WARNINGS USE_OPENSSL_CERTS=1 NO_TCMALLOC DISABLE_NACL SAFE_BROWSING_DB_REMOTE \
               CHROMIUM_BUILD FIELDTRIAL_TESTING_ENABLED _FILE_OFFSET_BITS=64 __STDC_CONSTANT_MACROS __STDC_FORMAT_MACROS \
               _FORTIFY_SOURCE=2 __GNU_SOURCE=1 __compiler_offsetof=__builtin_offsetof NVALGRIND DYNAMIC_ANNOTATIONS_ENABLED=0 \
               WEBRTC_ENABLE_PROTOBUF=1 WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE EXPAT_RELATIVE_PATH HAVE_SCTP

    unix {
        DEFINES += WEBRTC_POSIX WEBRTC_LINUX WEBRTC_BUILD_LIBEVENT
    }

    INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/webrtc \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/third_party/boringssl/src/include \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/third_party/libyuv/include \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/third_party/abseil-cpp
    !macx {
    exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a -ldl -lX11
    }
    else {
        LIBS += -lwebrtc -ldl -lX11
    }
    }
    else {
        exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a -ldl
        }
        else {
        LIBS += -lwebrtc -ldl
        }
    }
}

CONFIG(USE_ROTATIVEPERFORMANCELOGGER) {
    DEFINES += USE_ROTATIVEPERFORMANCELOGGER
    DEFINES += ENABLE_LOG_PERFORMANCE
}

win32 {
    # comment this line to use WinHTTP on Windows
    CONFIG += USE_CURL

    CONFIG(USE_CURL) {
        SOURCES += src/wincurl/net.cpp  \
            src/wincurl/fs.cpp  \
            src/wincurl/waiter.cpp
        HEADERS += include/mega/wincurl/meganet.h
        DEFINES += USE_CURL USE_OPENSSL
        !vcpkg:LIBS +=  -llibcurl -lcares -llibeay32 -lssleay32
    }
    else {
        SOURCES += src/win32/net.cpp \
            src/win32/fs.cpp \
            src/win32/waiter.cpp
        HEADERS += include/mega/win32/meganet.h
    }

    # link winhttp anyway (required for automatic proxy detection)
    LIBS += -lwinhttp -ladvapi32
    DEFINES += _CRT_SECURE_NO_WARNINGS
}
else:CONFIG += USE_CURL

unix {
SOURCES += src/posix/net.cpp  \
    src/posix/fs.cpp  \
    src/posix/waiter.cpp
}

HEADERS  += include/mega.h \
            include/mega/account.h \
            include/mega/attrmap.h \
            include/mega/backofftimer.h \
            include/mega/base64.h \
            include/mega/command.h \
            include/mega/console.h \
            include/mega/db.h \
            include/mega/gfx.h \
            include/mega/file.h \
            include/mega/fileattributefetch.h \
            include/mega/filefingerprint.h \
            include/mega/filesystem.h \
            include/mega/http.h \
            include/mega/json.h \
            include/mega/megaapp.h \
            include/mega/megaclient.h \
            include/mega/node.h \
            include/mega/pubkeyaction.h \
            include/mega/request.h \
            include/mega/serialize64.h \
            include/mega/share.h \
            include/mega/sharenodekeys.h \
            include/mega/sync.h \
            include/mega/heartbeats.h \
            include/mega/transfer.h \
            include/mega/transferslot.h \
            include/mega/treeproc.h \
            include/mega/types.h \
            include/mega/user.h \
            include/mega/useralerts.h \
            include/mega/utils.h \
            include/mega/logging.h \
            include/mega/waiter.h \
            include/mega/proxy.h \
            include/mega/pendingcontactrequest.h \
            include/mega/crypto/cryptopp.h  \
            include/mega/crypto/sodium.h  \
            include/mega/db/sqlite.h  \
            include/mega/gfx/qt.h \
            include/mega/gfx/freeimage.h \
            include/mega/gfx/external.h \
            include/mega/thread.h \
            include/mega/thread/cppthread.h \
            include/mega/thread/qtthread.h \
            include/megaapi.h \
            include/megaapi_impl.h \
            include/mega/mega_utf8proc.h \
            include/mega/mega_ccronexpr.h \
            include/mega/mega_evt_tls.h \
            include/mega/mega_evt_queue.h \
            include/mega/thread/posixthread.h \
            include/mega/mega_zxcvbn.h \
            include/mega/mediafileattribute.h \
            include/mega/raid.h \
            include/mega/testhooks.h

CONFIG(USE_MEGAAPI) {
    HEADERS += bindings/qt/QTMegaRequestListener.h \
            bindings/qt/QTMegaTransferListener.h \
            bindings/qt//QTMegaGlobalListener.h \
            bindings/qt/QTMegaListener.h \
            bindings/qt/QTMegaEvent.h
}

win32 {
    HEADERS  += include/mega/win32/megasys.h  \
            include/mega/win32/megafs.h  \
            include/mega/win32/megawaiter.h

    !vcpkg:SOURCES += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/sqlite3.c
}

unix {
    !exists($$MEGASDK_BASE_PATH/include/mega/config.h) {
        error("Configuration file not found! Please re-run configure script located in the project's root directory!")
    }
    HEADERS  += include/mega/posix/meganet.h  \
            include/mega/posix/megasys.h  \
            include/mega/posix/megafs.h  \
            include/mega/posix/megawaiter.h \
            include/mega/config.h
}

CONFIG(USE_PCRE) {
  DEFINES += USE_PCRE
}

CONFIG(qt) {
  DEFINES += USE_QT MEGA_QT_LOGGING
  SOURCES += src/gfx/qt.cpp src/thread/qtthread.cpp
}
else {

    win32 {
        SOURCES += src/thread/win32thread.cpp
    }
    else {
        DEFINES += USE_PTHREAD
        SOURCES += src/thread/posixthread.cpp
        LIBS += -lpthread
    }

   !CONFIG(nofreeimage) {
        DEFINES += USE_FREEIMAGE
        SOURCES += src/gfx/freeimage.cpp

        macx {
            INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/FreeImage/Source
            LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libfreeimage.a
        }
        else {
            vcpkg:LIBS += -lfreeimage$$DEBUG_SUFFIX
            !vcpkg:LIBS += -lfreeimage
        }

        vcpkg {
            LIBS += -ljpeg$$DEBUG_SUFFIX -ltiff$$DEBUG_SUFFIX -llibpng16$$DEBUG_SUFFIX \
            -lIlmImf-2_3$$UNDERSCORE_DEBUG_SUFFIX -lIex-2_3$$UNDERSCORE_DEBUG_SUFFIX -lIlmThread-2_3$$UNDERSCORE_DEBUG_SUFFIX \
            -lIexMath-2_3$$UNDERSCORE_DEBUG_SUFFIX -lIlmImfUtil-2_3$$UNDERSCORE_DEBUG_SUFFIX -lImath-2_3$$UNDERSCORE_DEBUG_SUFFIX \
            -llibwebpmux$$DEBUG_SUFFIX -lwebpdecoder$$DEBUG_SUFFIX -lwebpdemux$$DEBUG_SUFFIX -lwebp$$DEBUG_SUFFIX \
            -ljpegxr$$DEBUG_SUFFIX -ljxrglue$$DEBUG_SUFFIX -lHalf-2_3$$UNDERSCORE_DEBUG_SUFFIX \
            -llzma$$DEBUG_SUFFIX -ljasper$$DEBUG_SUFFIX -lraw$$DEBUG_SUFFIX -lopenjp2
        }
    }
}

DEFINES += USE_SQLITE USE_CRYPTOPP ENABLE_SYNC ENABLE_CHAT
INCLUDEPATH += $$MEGASDK_BASE_PATH/include
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt
vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include
else:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include

!release {
    DEFINES += SQLITE_DEBUG DEBUG
}
else {
    DEFINES += NDEBUG
}

vcpkg {
    INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/zlib
    INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/libsodium

    CONFIG(USE_CURL) {
        INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/openssl
        INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/cares
        win32:LIBS +=  -llibcurl$$DASH_DEBUG_SUFFIX -lcares -llibcrypto -llibssl
        else:LIBS +=  -lcurl$$DASH_DEBUG_SUFFIX -lcares -lcrypto -lssl
    }

    CONFIG(USE_PCRE) {
        INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/pcre
        DEFINES += PCRE_STATIC
        LIBS += -lpcre
    }

    CONFIG(USE_PDFIUM):INCLUDEPATH += $$THIRDPARTY_VCPKG_BASE_PATH/pdfium/pdfium/public

    release:LIBS += -L"$$THIRDPARTY_VCPKG_PATH/lib"
    debug:LIBS += -L"$$THIRDPARTY_VCPKG_PATH/debug/lib"

    win32:LIBS += -llibsodium -lcryptopp-static -lzlib$$DEBUG_SUFFIX
    else:LIBS += -lsodium -lcryptopp -lz
    LIBS += -lsqlite3
}

win32 {
    !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/zlib
    !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/libsodium

    CONFIG(USE_CURL) {
        INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/wincurl
        !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/openssl
        !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/cares
    }
    else {
        INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/win32
    }

    !vcpkg:contains(CONFIG, BUILDX64) {
       release {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x64"
        }
        else {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x64d"
        }
    }

    !vcpkg:!contains(CONFIG, BUILDX64) {
        release {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x32"
        }
        else {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x32d"
        }
    }

    CONFIG(USE_PCRE) {
     INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pcre
     DEFINES += PCRE_STATIC
     LIBS += -lpcre
    }

    LIBS += -lshlwapi -lws2_32 -luser32
    !vcpkg:LIBS += -lsodium -lcryptopp -lzlibstat

    DEFINES += NOMINMAX
}

unix:!macx {
   INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/posix
   LIBS += -lsqlite3 -lrt

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcurl.a) {
    LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcurl.a
   }
   else {
    vcpkg:LIBS += -lcurl$$DASH_DEBUG_SUFFIX
    else:LIBS += -lcurl
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libz.a) {
    LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libz.a
   }
   else {
    LIBS += -lz
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libssl.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libssl.a
   }
   else {
    LIBS += -lssl
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcrypto.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcrypto.a
   }
   else {
    LIBS += -lcrypto
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcryptopp.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcryptopp.a
   }
   else {
    LIBS += -lcryptopp
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcares.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcares.a
   }
   else {
    LIBS += -lcares
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libsodium.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libsodium.a
   }
   else {
    LIBS += -lsodium
   }

   CONFIG(USE_PCRE) {
    DEFINES += PCRE_STATIC
    exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libpcre.a) {
     LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libpcre.a
    }
    else {
     LIBS += -lpcre
    }
   }
}

macx {
   INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/posix
   INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/osx

   OBJECTIVE_SOURCES += $$MEGASDK_BASE_PATH/src/osx/osxutils.mm

   !vcpkg:SOURCES += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/sqlite3.c

   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/curl
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/libsodium
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/cares
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/mediainfo
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/zenlib
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium

   !vcpkg:CONFIG(USE_PCRE) {
    INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pcre
    DEFINES += PCRE_STATIC
    LIBS += -lpcre
   }

   DEFINES += _DARWIN_FEATURE_64_BIT_INODE CRYPTOPP_DISABLE_ASM

   !vcpkg:LIBS += -L$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/ $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcares.a $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcurl.a \
                    $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libsodium.a -lcryptopp
   LIBS += -lz

   !vcpkg:CONFIG(USE_OPENSSL) {
    INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/openssl
    LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libssl.a $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcrypto.a
   }

   LIBS += -framework SystemConfiguration

   vcpkg:LIBS += -liconv -framework CoreServices -framework CoreFoundation -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework CoreMedia -framework VideoToolbox -framework ImageIO -framework CoreVideo
}

MEGASDK_BASE_PATH = $$PWD/../../

THIRDPARTY_VCPKG_PATH = $$THIRDPARTY_VCPKG_BASE_PATH/vcpkg/installed/$$VCPKG_TRIPLET
exists($$THIRDPARTY_VCPKG_PATH) {
   CONFIG += vcpkg
}
vcpkg:debug:message("Building DEBUG with VCPKG 3rdparty at $$THIRDPARTY_VCPKG_PATH")
vcpkg:release:message("Building RELEASE with VCPKG 3rdparty at $$THIRDPARTY_VCPKG_PATH")
!vcpkg:message("vcpkg not used")

debug:DEBUG_SUFFIX = "d"
else:DEBUG_SUFFIX = ""
debug:DASH_DEBUG_SUFFIX = "-d"
else:DASH_DEBUG_SUFFIX = ""
debug:UNDERSCORE_DEBUG_SUFFIX = "_d"
else:UNDERSCORE_DEBUG_SUFFIX = ""

debug:win32:DEBUG_SUFFIX_WO = "d"
else:DEBUG_SUFFIX_WO = ""

MI_DEBUG_SUFFIX = ""
debug:macx:MI_DEBUG_SUFFIX = "_debug"
debug:win32:MI_DEBUG_SUFFIX = "d"

VPATH += $$MEGASDK_BASE_PATH
SOURCES += src/attrmap.cpp \
    src/backofftimer.cpp \
    src/base64.cpp \
    src/command.cpp \
    src/commands.cpp \
    src/db.cpp \
    src/gfx.cpp \
    src/file.cpp \
    src/fileattributefetch.cpp \
    src/filefingerprint.cpp \
    src/filesystem.cpp \
    src/http.cpp \
    src/json.cpp \
    src/megaclient.cpp \
    src/node.cpp \
    src/pubkeyaction.cpp \
    src/request.cpp \
    src/serialize64.cpp \
    src/share.cpp \
    src/sharenodekeys.cpp \
    src/sync.cpp \
    src/transfer.cpp \
    src/transferslot.cpp \
    src/treeproc.cpp \
    src/user.cpp \
    src/useralerts.cpp \
    src/utils.cpp \
    src/logging.cpp \
    src/waiterbase.cpp  \
    src/proxy.cpp \
    src/pendingcontactrequest.cpp \
    src/crypto/cryptopp.cpp  \
    src/crypto/sodium.cpp  \
    src/db/sqlite.cpp  \
    src/gfx/external.cpp \
    src/mega_utf8proc.cpp \
    src/mega_ccronexpr.cpp \
    src/mega_evt_tls.cpp \
    src/mega_zxcvbn.cpp \
    src/mediafileattribute.cpp \
    src/raid.cpp \
    src/testhooks.cpp \
    src/heartbeats.cpp

CONFIG(USE_MEGAAPI) {
  SOURCES += src/megaapi.cpp src/megaapi_impl.cpp

  CONFIG(qt) {
    SOURCES += bindings/qt/QTMegaRequestListener.cpp \
        bindings/qt/QTMegaTransferListener.cpp \
        bindings/qt/QTMegaGlobalListener.cpp \
        bindings/qt/QTMegaListener.cpp \
        bindings/qt/QTMegaEvent.cpp
  }
}

CONFIG(USE_ROTATIVEPERFORMANCELOGGER) {
  SOURCES += src/rotativeperformancelogger.cpp
}

!win32 {
    QMAKE_CXXFLAGS += -std=c++11 -Wextra -Wconversion -Wno-unused-parameter

    unix:!macx {
        GCC_VERSION = $$system("g++ -dumpversion")
        !lessThan(GCC_VERSION, 5) {
            LIBS += -lstdc++fs
        }
    }
}

CONFIG(USE_AUTOCOMPLETE) {
    SOURCES += src/autocomplete.cpp
    HEADERS += include/mega/autocomplete.h
}

CONFIG(USE_POLL) {
    DEFINES += USE_POLL
}

CONFIG(USE_CONSOLE) {
    win32 {

        HEADERS += include/mega/win32/megaconsole.h
        HEADERS += include/mega/win32/megaconsolewaiter.h

        CONFIG(noreadline) {
            DEFINES += NO_READLINE
            SOURCES += src/win32/console.cpp
            SOURCES += src/win32/consolewaiter.cpp
        }
        else {
            DEFINES += USE_READLINE_STATIC
            SOURCES += src/wincurl/console.cpp
            SOURCES += src/wincurl/consolewaiter.cpp
            LIBS += -lreadline
        }
        QMAKE_CXXFLAGS+=/Zc:__cplusplus /std:c++ #this will set _cplusplus correctly in MSVC >= 2017 15.7 Preview 3
    }
    else {
        HEADERS += include/mega/posix/megaconsole.h
        HEADERS += include/mega/posix/megaconsolewaiter.h
        SOURCES += src/posix/console.cpp
        SOURCES += src/posix/consolewaiter.cpp
        LIBS += -lreadline
    }
}

CONFIG(ENABLE_CHAT) {
    CONFIG += USE_LIBUV

    !macx {
        !vcpkg:exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a -lcap
        }
        else {
            vcpkg:LIBS += $$THIRDPARTY_VCPKG_PATH/lib/libwebsockets.a -lcap
            !vcpkg:LIBS += -lwebsockets -lcap
        }
    }
    else {
        exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebsockets.a
        }
        else {
        LIBS += -lwebsockets
        }
    }
}

CONFIG(USE_LIBUV) {
    SOURCES += src/mega_http_parser.cpp
    DEFINES += HAVE_LIBUV
    vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/libuv
    !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/libuv
    win32 {
        LIBS += -llibuv -lIphlpapi -lUserenv -lpsapi
    }

    unix:!macx {
       exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libuv.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libuv.a
       }
       else {
        vcpkg:LIBS += -llibuv
        else:LIBS += -luv
       }
    }

    macx {
        vcpkg:LIBS += -llibuv
        !vcpkg:LIBS += -luv
    }
}

CONFIG(USE_MEDIAINFO) {
    DEFINES += USE_MEDIAINFO UNICODE

    vcpkg:LIBS += -lmediainfo$$MI_DEBUG_SUFFIX -lzen$$MI_DEBUG_SUFFIX
    vcpkg:win32:LIBS += -lzlib$$DEBUG_SUFFIX
    vcpkg:!win32:LIBS += -lz

    !vcpkg:win32 {
        vcpkg:LIBS += -lmediainfo$$DEBUG_SUFFIX -lzen$$DEBUG_SUFFIX -lzlib$$DEBUG_SUFFIX
        else:LIBS += -lMediaInfo -lZenLib -lzlibstat
    }

    !vcpkg:macx {
        LIBS += -lmediainfo -lzen -lz
    }

    !vcpkg:unix:!macx {

       exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libmediainfo.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libmediainfo.a
       }
       else {
        LIBS += -lmediainfo
       }
       exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libzen.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libzen.a
       }
       else {
        LIBS += -lzen
       }
    }
}

CONFIG(USE_LIBRAW) {
    DEFINES += HAVE_LIBRAW

    vcpkg:LIBS += -lraw$$DEBUG_SUFFIX -ljasper$$DEBUG_SUFFIX
    vcpkg:win32:LIBS += -ljpeg$$DEBUG_SUFFIX
    vcpkg:!win32:LIBS += -ljpeg
    vcpkg:unix:!macx:LIBS += -lgomp
    vcpkg:!CONFIG(USE_PDFIUM):LIBS += -llcms2$$DEBUG_SUFFIX

    win32 {
        DEFINES += LIBRAW_NODLL
        !vcpkg:LIBS += -llibraw
    }

    !vcpkg:macx {
        LIBS += -lraw
    }

    !vcpkg:unix:!macx {
        exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libraw.a) {
            LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libraw.a -fopenmp
        }
        else {
            LIBS += -lraw -fopenmp
        }
    }
}

CONFIG(USE_PDFIUM) {

    vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/pdfium
    vcpkg:LIBS += -lpdfium -lfreetype$$DEBUG_SUFFIX -ljpeg$$DEBUG_SUFFIX_WO -lopenjp2  -llcms$$DEBUG_SUFFIX

    #make sure we get the vcpkg built icu libraries and not a system one with the same name
    vcpkg {
        win32 {
            debug: LIBS += -l$$THIRDPARTY_VCPKG_PATH/debug/lib/icuucd -l$$THIRDPARTY_VCPKG_PATH/debug/lib/icuiod
            !debug: LIBS += -l$$THIRDPARTY_VCPKG_PATH/lib/icuuc$$DEBUG_SUFFIX_WO.lib -l$$THIRDPARTY_VCPKG_PATH/lib/icuio$$DEBUG_SUFFIX_WO.lib
            #QMAKE_LFLAGS_WINDOWS += /VERBOSE
        }
        else {
            debug {
                # icu doesn't build debug libs with 'd' suffix, but check anyway
                exists($$THIRDPARTY_VCPKG_PATH/debug/lib/libicuuc$$DEBUG_SUFFIX.a) {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuuc$$DEBUG_SUFFIX.a
                }
                else {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuuc.a
                }
                exists($$THIRDPARTY_VCPKG_PATH/debug/lib/libicuio$$DEBUG_SUFFIX.a) {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuio$$DEBUG_SUFFIX.a
                }
                else {
                    LIBS += $$THIRDPARTY_VCPKG_PATH/debug/lib/libicuio.a
                }
            }
            !debug: LIBS += $$THIRDPARTY_VCPKG_PATH/lib/libicuuc.a $$THIRDPARTY_VCPKG_PATH/lib/libicuio.a
        }
    }

    vcpkg:unix:!macx:LIBS += -lpng -lharfbuzz #freetype dependencies. ideally we could use pkg-config to get these
    # is it needed? win has it, mac does not -licuin$$DEBUG_SUFFIX_WO
    vcpkg:win32:LIBS += -lGdi32  -llibpng16$$DEBUG_SUFFIX
    vcpkg:DEFINES += HAVE_PDFIUM

    !vcpkg {
        unix:!macx {
            exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libpdfium.a) {
                DEFINES += HAVE_PDFIUM
                INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium
                LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libpdfium.a
            }
            else:exists(/usr/include/fpdfview.h) {
                DEFINES += HAVE_PDFIUM
                LIBS += -lpdfium
            }
        }
        else {#win/mac
            DEFINES += HAVE_PDFIUM
            INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium
            LIBS += -lpdfium
        }
    }
}

CONFIG(USE_FFMPEG) {

    unix:!macx {
        # On Linux, vcpkg provides libavresample instead of libswresample
        vcpkg:LIBS += -lavformat -lavcodec -lavutil -lswscale -lavresample
        else {
            exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/ffmpeg):exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib/libavcodec.a) {
            DEFINES += HAVE_FFMPEG
                INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/ffmpeg
                FFMPEGLIBPATH = $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/lib
            }
            else:exists(/usr/include/ffmpeg-mega) {
                DEFINES += HAVE_FFMPEG
                INCLUDEPATH += /usr/include/ffmpeg-mega
                exists(/usr/lib64/libavcodec.a) {
                    FFMPEGLIBPATH = /usr/lib64
                }
                else:exists(/usr/lib32/libavcodec.a) {
                    FFMPEGLIBPATH = /usr/lib32
                }
                else {
                   FFMPEGLIBPATH = /usr/lib
                }
            }
            else:packagesExist(ffmpeg)|packagesExist(libavcodec) {
                DEFINES += HAVE_FFMPEG
                LIBS += -lavcodec -lavformat -lavutil -lswscale -lswresample
            }

            FFMPEGSTATICLIBS = libavformat.a libavcodec.a libavutil.a libswscale.a

            for(ffmpeglib, FFMPEGSTATICLIBS) {
                exists($$FFMPEGLIBPATH/$$ffmpeglib) {
                    LIBS += $$FFMPEGLIBPATH/$$ffmpeglib
                }
            }

            #particular distros requirements
            exists(/usr/lib64/libbz2.so*)|exists(/usr/lib/libbz2.so*) {
                LIBS += -lbz2 #required in fedora ffmpeg/arch compilation
            }

            exists(/usr/lib/liblzma.so*):exists(/etc/arch-release) {
                LIBS += -llzma #required in arch ffmpeg compilation
            }
        }
    }
    else { #win/mac
        DEFINES += HAVE_FFMPEG
        vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/ffmpeg
        else:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/ffmpeg
        LIBS += -lavcodec -lavformat -lavutil -lswscale
        vcpkg:macx:LIBS += -lswrescale -lbz2
    }
}

CONFIG(USE_WEBRTC) {

    DEFINES += ENABLE_WEBRTC V8_DEPRECATION_WARNINGS USE_OPENSSL_CERTS=1 NO_TCMALLOC DISABLE_NACL SAFE_BROWSING_DB_REMOTE \
               CHROMIUM_BUILD FIELDTRIAL_TESTING_ENABLED _FILE_OFFSET_BITS=64 __STDC_CONSTANT_MACROS __STDC_FORMAT_MACROS \
               _FORTIFY_SOURCE=2 __GNU_SOURCE=1 __compiler_offsetof=__builtin_offsetof NVALGRIND DYNAMIC_ANNOTATIONS_ENABLED=0 \
               WEBRTC_ENABLE_PROTOBUF=1 WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE EXPAT_RELATIVE_PATH HAVE_SCTP

    unix {
        DEFINES += WEBRTC_POSIX WEBRTC_LINUX WEBRTC_BUILD_LIBEVENT
    }

    INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/webrtc \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/third_party/boringssl/src/include \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/third_party/libyuv/include \
                   $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/webrtc/include/third_party/abseil-cpp
    !macx {
    exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a -ldl -lX11
    }
    else {
        LIBS += -lwebrtc -ldl -lX11
    }
    }
    else {
        exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a) {
        LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libwebrtc.a -ldl
        }
        else {
        LIBS += -lwebrtc -ldl
        }
    }
}

CONFIG(USE_ROTATIVEPERFORMANCELOGGER) {
    DEFINES += USE_ROTATIVEPERFORMANCELOGGER
    DEFINES += ENABLE_LOG_PERFORMANCE
}

win32 {
    # comment this line to use WinHTTP on Windows
    CONFIG += USE_CURL

    CONFIG(USE_CURL) {
        SOURCES += src/wincurl/net.cpp  \
            src/wincurl/fs.cpp  \
            src/wincurl/waiter.cpp
        HEADERS += include/mega/wincurl/meganet.h
        DEFINES += USE_CURL USE_OPENSSL
        !vcpkg:LIBS +=  -llibcurl -lcares -llibeay32 -lssleay32
    }
    else {
        SOURCES += src/win32/net.cpp \
            src/win32/fs.cpp \
            src/win32/waiter.cpp
        HEADERS += include/mega/win32/meganet.h
    }

    # link winhttp anyway (required for automatic proxy detection)
    LIBS += -lwinhttp -ladvapi32
    DEFINES += _CRT_SECURE_NO_WARNINGS
}
else:CONFIG += USE_CURL

unix {
SOURCES += src/posix/net.cpp  \
    src/posix/fs.cpp  \
    src/posix/waiter.cpp
}

HEADERS  += include/mega.h \
            include/mega/account.h \
            include/mega/attrmap.h \
            include/mega/backofftimer.h \
            include/mega/base64.h \
            include/mega/command.h \
            include/mega/console.h \
            include/mega/db.h \
            include/mega/gfx.h \
            include/mega/file.h \
            include/mega/fileattributefetch.h \
            include/mega/filefingerprint.h \
            include/mega/filesystem.h \
            include/mega/http.h \
            include/mega/json.h \
            include/mega/megaapp.h \
            include/mega/megaclient.h \
            include/mega/node.h \
            include/mega/pubkeyaction.h \
            include/mega/request.h \
            include/mega/serialize64.h \
            include/mega/share.h \
            include/mega/sharenodekeys.h \
            include/mega/sync.h \
            include/mega/heartbeats.h \
            include/mega/transfer.h \
            include/mega/transferslot.h \
            include/mega/treeproc.h \
            include/mega/types.h \
            include/mega/user.h \
            include/mega/useralerts.h \
            include/mega/utils.h \
            include/mega/logging.h \
            include/mega/waiter.h \
            include/mega/proxy.h \
            include/mega/pendingcontactrequest.h \
            include/mega/crypto/cryptopp.h  \
            include/mega/crypto/sodium.h  \
            include/mega/db/sqlite.h  \
            include/mega/gfx/qt.h \
            include/mega/gfx/freeimage.h \
            include/mega/gfx/external.h \
            include/mega/thread.h \
            include/mega/thread/cppthread.h \
            include/mega/thread/qtthread.h \
            include/megaapi.h \
            include/megaapi_impl.h \
            include/mega/mega_utf8proc.h \
            include/mega/mega_ccronexpr.h \
            include/mega/mega_evt_tls.h \
            include/mega/mega_evt_queue.h \
            include/mega/thread/posixthread.h \
            include/mega/mega_zxcvbn.h \
            include/mega/mediafileattribute.h \
            include/mega/raid.h \
            include/mega/testhooks.h

CONFIG(USE_MEGAAPI) {
    HEADERS += bindings/qt/QTMegaRequestListener.h \
            bindings/qt/QTMegaTransferListener.h \
            bindings/qt//QTMegaGlobalListener.h \
            bindings/qt/QTMegaListener.h \
            bindings/qt/QTMegaEvent.h
}

win32 {
    HEADERS  += include/mega/win32/megasys.h  \
            include/mega/win32/megafs.h  \
            include/mega/win32/megawaiter.h

    !vcpkg:SOURCES += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/sqlite3.c
}

unix {
    !exists($$MEGASDK_BASE_PATH/include/mega/config.h) {
        error("Configuration file not found! Please re-run configure script located in the project's root directory!")
    }
    HEADERS  += include/mega/posix/meganet.h  \
            include/mega/posix/megasys.h  \
            include/mega/posix/megafs.h  \
            include/mega/posix/megawaiter.h \
            include/mega/config.h
}

CONFIG(USE_PCRE) {
  DEFINES += USE_PCRE
}

CONFIG(qt) {
  DEFINES += USE_QT MEGA_QT_LOGGING
  SOURCES += src/gfx/qt.cpp src/thread/qtthread.cpp
}
else {

    win32 {
        SOURCES += src/thread/win32thread.cpp
    }
    else {
        DEFINES += USE_PTHREAD
        SOURCES += src/thread/posixthread.cpp
        LIBS += -lpthread
    }

   !CONFIG(nofreeimage) {
        DEFINES += USE_FREEIMAGE
        SOURCES += src/gfx/freeimage.cpp

        macx {
            INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/FreeImage/Source
            LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libfreeimage.a
        }
        else {
            vcpkg:LIBS += -lfreeimage$$DEBUG_SUFFIX
            !vcpkg:LIBS += -lfreeimage
        }

        vcpkg {
            LIBS += -ljpeg$$DEBUG_SUFFIX -ltiff$$DEBUG_SUFFIX -llibpng16$$DEBUG_SUFFIX \
            -lIlmImf-2_3$$UNDERSCORE_DEBUG_SUFFIX -lIex-2_3$$UNDERSCORE_DEBUG_SUFFIX -lIlmThread-2_3$$UNDERSCORE_DEBUG_SUFFIX \
            -lIexMath-2_3$$UNDERSCORE_DEBUG_SUFFIX -lIlmImfUtil-2_3$$UNDERSCORE_DEBUG_SUFFIX -lImath-2_3$$UNDERSCORE_DEBUG_SUFFIX \
            -llibwebpmux$$DEBUG_SUFFIX -lwebpdecoder$$DEBUG_SUFFIX -lwebpdemux$$DEBUG_SUFFIX -lwebp$$DEBUG_SUFFIX \
            -ljpegxr$$DEBUG_SUFFIX -ljxrglue$$DEBUG_SUFFIX -lHalf-2_3$$UNDERSCORE_DEBUG_SUFFIX \
            -llzma$$DEBUG_SUFFIX -ljasper$$DEBUG_SUFFIX -lraw$$DEBUG_SUFFIX -lopenjp2
        }
    }
}

DEFINES += USE_SQLITE USE_CRYPTOPP ENABLE_SYNC ENABLE_CHAT
INCLUDEPATH += $$MEGASDK_BASE_PATH/include
INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt
vcpkg:INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include
else:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include

!release {
    DEFINES += SQLITE_DEBUG DEBUG
}
else {
    DEFINES += NDEBUG
}

vcpkg {
    INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/zlib
    INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/libsodium

    CONFIG(USE_CURL) {
        INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/openssl
        INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/cares
        win32:LIBS +=  -llibcurl$$DASH_DEBUG_SUFFIX -lcares -llibcrypto -llibssl
        else:LIBS +=  -lcurl$$DASH_DEBUG_SUFFIX -lcares -lcrypto -lssl
    }

    CONFIG(USE_PCRE) {
        INCLUDEPATH += $$THIRDPARTY_VCPKG_PATH/include/pcre
        DEFINES += PCRE_STATIC
        LIBS += -lpcre
    }

    CONFIG(USE_PDFIUM):INCLUDEPATH += $$THIRDPARTY_VCPKG_BASE_PATH/pdfium/pdfium/public

    release:LIBS += -L"$$THIRDPARTY_VCPKG_PATH/lib"
    debug:LIBS += -L"$$THIRDPARTY_VCPKG_PATH/debug/lib"

    win32:LIBS += -llibsodium -lcryptopp-static -lzlib$$DEBUG_SUFFIX
    else:LIBS += -lsodium -lcryptopp -lz
    LIBS += -lsqlite3
}

win32 {
    !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/zlib
    !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/libsodium

    CONFIG(USE_CURL) {
        INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/wincurl
        !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/openssl
        !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/cares
    }
    else {
        INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/win32
    }

    !vcpkg:contains(CONFIG, BUILDX64) {
       release {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x64"
        }
        else {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x64d"
        }
    }

    !vcpkg:!contains(CONFIG, BUILDX64) {
        release {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x32"
        }
        else {
            LIBS += -L"$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/x32d"
        }
    }

    CONFIG(USE_PCRE) {
     INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pcre
     DEFINES += PCRE_STATIC
     LIBS += -lpcre
    }

    LIBS += -lshlwapi -lws2_32 -luser32
    !vcpkg:LIBS += -lsodium -lcryptopp -lzlibstat

    DEFINES += NOMINMAX
}

unix:!macx {
   INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/posix
   LIBS += -lsqlite3 -lrt

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcurl.a) {
    LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcurl.a
   }
   else {
    vcpkg:LIBS += -lcurl$$DASH_DEBUG_SUFFIX
    else:LIBS += -lcurl
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libz.a) {
    LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libz.a
   }
   else {
    LIBS += -lz
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libssl.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libssl.a
   }
   else {
    LIBS += -lssl
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcrypto.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcrypto.a
   }
   else {
    LIBS += -lcrypto
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcryptopp.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcryptopp.a
   }
   else {
    LIBS += -lcryptopp
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcares.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcares.a
   }
   else {
    LIBS += -lcares
   }

   exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libsodium.a) {
    LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libsodium.a
   }
   else {
    LIBS += -lsodium
   }

   CONFIG(USE_PCRE) {
    DEFINES += PCRE_STATIC
    exists($$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libpcre.a) {
     LIBS +=  $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libpcre.a
    }
    else {
     LIBS += -lpcre
    }
   }
}

macx {
   INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/posix
   INCLUDEPATH += $$MEGASDK_BASE_PATH/include/mega/osx

   OBJECTIVE_SOURCES += $$MEGASDK_BASE_PATH/src/osx/osxutils.mm

   !vcpkg:SOURCES += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/sqlite3.c

   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/curl
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/libsodium
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/cares
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/mediainfo
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/zenlib
   !vcpkg:INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pdfium

   !vcpkg:CONFIG(USE_PCRE) {
    INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/pcre
    DEFINES += PCRE_STATIC
    LIBS += -lpcre
   }

   DEFINES += _DARWIN_FEATURE_64_BIT_INODE CRYPTOPP_DISABLE_ASM

   !vcpkg:LIBS += -L$$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/ $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcares.a $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcurl.a \
                    $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libsodium.a -lcryptopp
   LIBS += -lz

   !vcpkg:CONFIG(USE_OPENSSL) {
    INCLUDEPATH += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/include/openssl
    LIBS += $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libssl.a $$MEGASDK_BASE_PATH/bindings/qt/3rdparty/libs/libcrypto.a
   }

   LIBS += -framework SystemConfiguration

   vcpkg:LIBS += -liconv -framework CoreServices -framework CoreFoundation -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework CoreMedia -framework VideoToolbox -framework ImageIO -framework CoreVideo
}


icu.pri: added default ports paths

icu.pri: added default ports paths

######################################################################
# LibIrcClient-Qt
######################################################################

defineReplace(icuLibTarget) {
    unset(LIBRARY_NAME)
    LIBRARY_NAME = $$1
    CONFIG(debug, debug|release) {
        !debug_and_release|build_pass {
            mac:RET = $$member(LIBRARY_NAME, 0)_debug
            else:win32:RET = $$member(LIBRARY_NAME, 0)d
        }
    }
    isEmpty(RET):RET = $$LIBRARY_NAME
    return($$RET)
}

DEFINES += HAVE_ICU
contains(DEFINES, HAVE_ICU) {
    win32:INCLUDEPATH += C:\ICU\include
    macx:INCLUDEPATH += /opt/local/include
    win32:LIBS += -LC:\ICU\lib
    macx:LIBS += -L/opt/local/lib
    win32:LIBS += -l$$icuLibTarget(icuin)
    unix:LIBS += -licui18n -licudata
    LIBS += -l$$icuLibTarget(icuuc)
}

######################################################################
# LibIrcClient-Qt
######################################################################

defineReplace(icuLibTarget) {
    unset(LIBRARY_NAME)
    LIBRARY_NAME = $$1
    CONFIG(debug, debug|release) {
        !debug_and_release|build_pass {
            mac:RET = $$member(LIBRARY_NAME, 0)_debug
            else:win32:RET = $$member(LIBRARY_NAME, 0)d
        }
    }
    isEmpty(RET):RET = $$LIBRARY_NAME
    return($$RET)
}

DEFINES += HAVE_ICU
contains(DEFINES, HAVE_ICU) {
    win32:INCLUDEPATH += C:\ICU\include
    win32:LIBS += -LC:\ICU\lib
    win32:LIBS += -l$$icuLibTarget(icuin)
    unix:LIBS += -licui18n -licudata
    LIBS += -l$$icuLibTarget(icuuc)
}


Fix wrong scoping in qtcreator.pri

Fix wrong scoping in qtcreator.pri

Reported-By: Tasuku Suzuki

defineReplace(cleanPath) {
    win32:1 ~= s|\\\\|/|g
    contains(1, ^/.*):pfx = /
    else:pfx =
    segs = $$split(1, /)
    out =
    for(seg, segs) {
        equals(seg, ..):out = $$member(out, 0, -2)
        else:!equals(seg, .):out += $$seg
    }
    return($$join(out, /, $$pfx))
}

defineReplace(targetPath) {
    win32:1 ~= s|/|\|g
    return($$1)
}

# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
    win32 {
        !contains(1, ^.:.*):1 = $$OUT_PWD/$$1
    } else {
        !contains(1, ^/.*):1 = $$OUT_PWD/$$1
    }
    out = $$cleanPath($$1)
    out ~= s|^$$re_escape($$PWD/)||$$i_flag
    return($$out)
}

isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
        TEST = 1
    }
}

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"

equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
}

IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
    sub_dir = $$_PRO_FILE_PWD_
    sub_dir ~= s,^$$re_escape($$PWD),,
    IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
    IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
macx {
    IDE_APP_TARGET   = "Qt Creator"
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
    copydata = 1
} else {
    win32 {
        contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
        IDE_APP_TARGET   = qtcreator
    } else {
        IDE_APP_WRAPPER  = qtcreator
        IDE_APP_TARGET   = qtcreator.bin
    }
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

DEPENDPATH += \
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

LIBS += -L$$IDE_LIBRARY_PATH

# DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII
#DEFINES += QT_USE_FAST_OPERATOR_PLUS
#DEFINES += QT_USE_FAST_CONCATENATION

unix {
    CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared

    CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
    CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared

    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
}

linux-g++-* {
    # Bail out on non-selfcontained libraries. Just a security measure
    # to prevent checking in code that does not compile on other platforms.
    QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}

# Handle S60 support: default on Windows, conditionally built on other platforms.
win32:SUPPORT_QT_S60=1
else:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)

defineReplace(cleanPath) {
    win32:1 ~= s|\\\\|/|g
    contains(1, ^/.*):pfx = /
    else:pfx =
    segs = $$split(1, /)
    out =
    for(seg, segs) {
        equals(seg, ..):out = $$member(out, 0, -2)
        else:!equals(seg, .):out += $$seg
    }
    return($$join(out, /, $$pfx))
}

defineReplace(targetPath) {
    win32:1 ~= s|/|\|g
    return($$1)
}

# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
    win32 {
        !contains(1, ^.:.*):1 = $$OUT_PWD/$$1
    } else {
        !contains(1, ^/.*):1 = $$OUT_PWD/$$1
    }
    out = $$cleanPath($$1)
    out ~= s|^$$re_escape($$PWD/)||$$i_flag
    return($$out)
}

isEmpty(TEST):CONFIG(debug, debug|release) {
    !debug_and_release|build_pass {
        TEST = 1
    }
}

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"

equals(TEST, 1) {
    QT +=testlib
    DEFINES += WITH_TESTS
}

IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
    sub_dir = $$_PRO_FILE_PWD_
    sub_dir ~= s,^$$re_escape($$PWD),,
    IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
    IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
macx {
    IDE_APP_TARGET   = "Qt Creator"
    IDE_LIBRARY_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/PlugIns
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    IDE_DATA_PATH    = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
    contains(QT_CONFIG, ppc):CONFIG += ppc x86
    copydata = 1
} else {
    win32 {
        contains(TEMPLATE, vc.*)|contains(TEMPLATE_PREFIX, vc):vcproj = 1
        IDE_APP_TARGET   = qtcreator
    } else {
        IDE_APP_WRAPPER  = qtcreator
        IDE_APP_TARGET   = qtcreator.bin
    }
    IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME/qtcreator
    IDE_PLUGIN_PATH  = $$IDE_LIBRARY_PATH/plugins
    IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
    IDE_DATA_PATH    = $$IDE_BUILD_TREE/share/qtcreator
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

DEPENDPATH += \
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

LIBS += -L$$IDE_LIBRARY_PATH

# DEFINES += QT_NO_CAST_FROM_ASCII
DEFINES += QT_NO_CAST_TO_ASCII
#DEFINES += QT_USE_FAST_OPERATOR_PLUS
#DEFINES += QT_USE_FAST_CONCATENATION

unix {
    debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
    release:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared

    debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
    release:MOC_DIR = $${OUT_PWD}/.moc/release-shared

    RCC_DIR = $${OUT_PWD}/.rcc
    UI_DIR = $${OUT_PWD}/.uic
}

linux-g++-* {
    # Bail out on non-selfcontained libraries. Just a security measure
    # to prevent checking in code that does not compile on other platforms.
    QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}

# Handle S60 support: default on Windows, conditionally built on other platforms.
win32:SUPPORT_QT_S60=1
else:SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)


Fix OOT build with DBus interface definitions

$$IN_PWD gives the correct directory.

RevBy: TrustMe

Full, original commit at 938e07a43f8e9378fe27861c2d78a08ebb22b6ac in maliit-framework

DBUS_XML_DIR = $$IN_PWD

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

DBUS_XML_DIR = $$TOP_DIR/dbus_interfaces

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


Fixed build error on Ubuntu

Fixed build error on Ubuntu

# Default settings for MPI CXX include
isEmpty(MPICXX) { MPICXX = "yes" }

# Versions
MAJOR_VERSION = 0
MINOR_VERSION = 0
REVISION = 999
VERSION = $${MAJOR_VERSION}.$${MINOR_VERSION}.$${REVISION}

# Version compiler defines
DEFINES += \
    QT_DEPRECATED_WARNINGS \
    MAJOR_VERSION=$${MAJOR_VERSION} \
    MINOR_VERSION=$${MINOR_VERSION} \
    REVISION=$${REVISION}

# Basic settings
QT += core
TEMPLATE = app
QMAKE_CXX = mpic++
CONFIG += c++11

# Compiler defines
DEFINES += QT_DEPRECATED_WARNINGS

# External libraries
LIBS += -L$${PWD}/../build/libs -lkinccore -lacecore -lgsl -lgslcblas -lOpenCL -lmpi
equals(MPICXX,"yes") { LIBS += -lmpi_cxx }

# Used to ignore useless warnings with OpenCL
QMAKE_CXXFLAGS += -Wno-ignored-attributes

# Source files
SOURCES += \
    ../main.cpp \

# Resource files
RESOURCES += \
    ../opencl.qrc

# Default settings for MPI CXX include
isEmpty(MPICXX) { MPICXX = "yes" }

# Versions
MAJOR_VERSION = 0
MINOR_VERSION = 0
REVISION = 999
VERSION = $${MAJOR_VERSION}.$${MINOR_VERSION}.$${REVISION}

# Version compiler defines
DEFINES += \
    QT_DEPRECATED_WARNINGS \
    MAJOR_VERSION=$${MAJOR_VERSION} \
    MINOR_VERSION=$${MINOR_VERSION} \
    REVISION=$${REVISION}

# Basic settings
QT += core
TEMPLATE = app
QMAKE_CXX = mpic++
CONFIG += c++11

# Compiler defines
DEFINES += QT_DEPRECATED_WARNINGS

# External libraries
LIBS += -lmpi
equals(MPICXX,"yes") { LIBS += -lmpi_cxx }
LIBS += -lacecore -lOpenCL -lgsl -lgslcblas -L$${PWD}/../build/libs -lkinccore

# Used to ignore useless warnings with OpenCL
QMAKE_CXXFLAGS += -Wno-ignored-attributes

# Source files
SOURCES += \
    ../main.cpp \

# Resource files
RESOURCES += \
    ../opencl.qrc


- fixed bug in qrmc

- fixed bug in qrmc

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

QT += xml widgets
TEMPLATE = lib
CONFIG += plugin

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

isEmpty(ROOT) {
	error(Please set ROOT variable in a .pro file of your editor as a path to a root folder of QReal sources)
}

win32 {
	QRXC = $$DESTDIR/qrxc$${CONFIGURATION_SUFFIX}.exe
	QRMC = $$DESTDIR/qrmc$${CONFIGURATION_SUFFIX}.exe
}

unix:!macx {
	QRXC = $$DESTDIR/qrxc$$CONFIGURATION_SUFFIX
	QRMC = $$DESTDIR/qrmc$$CONFIGURATION_SUFFIX
}

macx {
	QRXC = $$DESTDIR/qrxc$${CONFIGURATION_SUFFIX}.app/Contents/MacOS/qrxc$$CONFIGURATION_SUFFIX
	QRMC = $$DESTDIR/qrmc$${CONFIGURATION_SUFFIX}.app/Contents/MacOS/qrmc$$CONFIGURATION_SUFFIX
}

QRXC_DIR = $$DESTDIR
QRMC_DIR = $$DESTDIR
DESTDIR = $$DESTDIR/plugins/editors/

# Needed because somehow QMake fails to create .rcc directory if RESOURCES is in extra compiler output.
RCC_DIR = .build/$$CONFIGURATION/obj

links(qrkernel)

isEmpty(QREAL_EDITOR_PATH) {
	error(Please set QREAL_EDITOR_PATH variable in a .pro file of your editor as a path to that editor .xml file relative to plugins/)
}

if (equals(QMAKE_CXX, "g++")) {
	QMAKE_LFLAGS += -Wl,-E
}

include(extraCompilers.pri)
include(extraCompilersQrmc.pri)

include(editorsSdk.pri)

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

QT += xml widgets
TEMPLATE = lib
CONFIG += plugin

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

isEmpty(ROOT) {
	error(Please set ROOT variable in a .pro file of your editor as a path to a root folder of QReal sources)
}

win32 {
	QRXC = $$DESTDIR/qrxc$${CONFIGURATION_SUFFIX}.exe
}

unix:!macx {
	QRXC = $$DESTDIR/qrxc$$CONFIGURATION_SUFFIX
}

macx {
	QRXC = $$DESTDIR/qrxc$${CONFIGURATION_SUFFIX}.app/Contents/MacOS/qrxc$$CONFIGURATION_SUFFIX
}

QRXC_DIR = $$DESTDIR
DESTDIR = $$DESTDIR/plugins/editors/

# Needed because somehow QMake fails to create .rcc directory if RESOURCES is in extra compiler output.
RCC_DIR = .build/$$CONFIGURATION/obj

links(qrkernel)

isEmpty(QREAL_EDITOR_PATH) {
	error(Please set QREAL_EDITOR_PATH variable in a .pro file of your editor as a path to that editor .xml file relative to plugins/)
}

if (equals(QMAKE_CXX, "g++")) {
	QMAKE_LFLAGS += -Wl,-E
}

include(extraCompilers.pri)

include(editorsSdk.pri)


Fix OS X Installer yet again

Fix OS X Installer yet again

# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# This file is part of the open groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------

installer {
    MacBuild {
        # We cd to release directory so we can run macdeployqt without a path to the
        # qgroundcontrol.app file. If you specify a path to the .app file the symbolic
        # links to plugins will not be created correctly.
        QMAKE_POST_LINK += && cd release
        QMAKE_POST_LINK += && $$dirname(QMAKE_QMAKE)/macdeployqt qgroundcontrol.app -verbose=2 -qmldir=../src
        QMAKE_POST_LINK += && cd ..
        QMAKE_POST_LINK += && hdiutil create -layout SPUD -srcfolder $${DESTDIR}/qgroundcontrol.app -volname QGroundControl $${DESTDIR}/qgroundcontrol.dmg
    }

    WindowsBuild {
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.exp")
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.ilk")
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.lib")
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.pdb")
        QMAKE_POST_LINK += $$escape_expand(\\n) $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\qgroundcontrol-installer-win32.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
    }
}

# -------------------------------------------------
# QGroundControl - Micro Air Vehicle Groundstation
# Please see our website at <http://qgroundcontrol.org>
# Maintainer:
# Lorenz Meier <lm@inf.ethz.ch>
# (c) 2009-2014 QGroundControl Developers
# This file is part of the open groundstation project
# QGroundControl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# QGroundControl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with QGroundControl. If not, see <http://www.gnu.org/licenses/>.
# -------------------------------------------------

installer {
    MacBuild {
        # We cd to release directory so we can run macdeployqt without a path to the
        # qgroundcontrol.app file. If you specify a path to the .app file the symbolic
        # links to plugins will not be created correctly.
        QMAKE_POST_LINK += && cd release
        QMAKE_POST_LINK += && $$dirname(QMAKE_QMAKE)/macdeployqt qgroundcontrol.app -verbose=2 -qmldir=src -dmg
        QMAKE_POST_LINK += && cd ..
    }

    WindowsBuild {
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.exp")
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.ilk")
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.lib")
		QMAKE_POST_LINK += $$escape_expand(\\n) $$quote(del /F "$$DESTDIR_WIN\\$${TARGET}.pdb")
        QMAKE_POST_LINK += $$escape_expand(\\n) $$quote("\"C:\\Program Files \(x86\)\\NSIS\\makensis.exe\"" /NOCD "\"/XOutFile $${DESTDIR_WIN}\\qgroundcontrol-installer-win32.exe\"" "$$BASEDIR_WIN\\deploy\\qgroundcontrol_installer.nsi")
    }
}


Support for MinGW 64 bit

Support for MinGW 64 bit

include (AudioStreamingLibSettings.pri)

QT += core network multimedia
CONFIG += c++11

if (contains(OPUS_ENABLED, TRUE)) CONFIG += WITH_OPUS

if (contains(OPENSSL_ENABLED, TRUE)) CONFIG += WITH_OPENSSL

WITH_OPUS:DEFINES += OPUS
WITH_OPENSSL:DEFINES += OPENSSL

#Include opus headers
WITH_OPUS {
win32:INCLUDEPATH += $$WIN_OPUS_INCLUDE
android:INCLUDEPATH += $$ANDROID_OPUS_INCLUDE
unix:!macx:!android:INCLUDEPATH += $$LINUX_OPUS_INCLUDE
macx:INCLUDEPATH += $$MACOS_OPUS_INCLUDE
}

INCLUDEPATH += $$PWD/AudioStreamingLib

contains(QT_ARCH, i386):win32-g++ { #MINGW 32 bits
message("Using settings for Windows MinGW 32 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$MINGW_OPUS_LIB

WITH_OPENSSL {
LIBS += $$MINGW_OPENSSL_SSL_LIB
LIBS += $$MINGW_OPENSSL_CRYPTO_LIB
LIBS += -lGdi32
}
} #MINGW 32 bits

contains(QT_ARCH, x86_64):win32-g++ { #MINGW 64 bits
message("Using settings for Windows MinGW 64 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$MINGW_OPUS_LIB

WITH_OPENSSL {
LIBS += $$MINGW_OPENSSL_SSL_LIB
LIBS += $$MINGW_OPENSSL_CRYPTO_LIB
LIBS += -lGdi32
}
} #MINGW 64 bits

contains(QT_ARCH, i386):win32-msvc* { #VISUAL STUDIO 32 bits
message("Using settings for Windows Visual Studio 32 bits")

CONFIG += KNOWNDEVICE

QMAKE_CXXFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CXXFLAGS += /wd4267 #Supress loss of data error
QMAKE_CFLAGS += /wd4267 #Supress loss of data error
QMAKE_CXXFLAGS += /wd4244 #Supress loss of data error
QMAKE_CFLAGS += /wd4244 #Supress loss of data error

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Debug/" -lAudioStreamingLibCore

WITH_OPUS {
LIBS += $$MSVC_32BITS_DEBUG_OPUS_LIB
LIBS += $$MSVC_32BITS_DEBUG_CELT_LIB
LIBS += $$MSVC_32BITS_DEBUG_SILK_COMMON_LIB
LIBS += $$MSVC_32BITS_DEBUG_SILK_FLOAT_LIB
}
}

CONFIG(release, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Release/" -lAudioStreamingLibCore

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

WITH_OPUS {
LIBS += $$MSVC_32BITS_RELEASE_OPUS_LIB
LIBS += $$MSVC_32BITS_RELEASE_CELT_LIB
LIBS += $$MSVC_32BITS_RELEASE_SILK_COMMON_LIB
LIBS += $$MSVC_32BITS_RELEASE_SILK_FLOAT_LIB
}
}

WITH_OPENSSL {
LIBS += $$MSVC_32BITS_OPENSSL_SSL_LIB
LIBS += $$MSVC_32BITS_OPENSSL_CRYPTO_LIB
LIBS += -lGdi32
}
} #VISUAL STUDIO 32 bits

contains(QT_ARCH, x86_64):win32-msvc* { #VISUAL STUDIO 64 bits
message("Using settings for Windows Visual Studio 64 bits")

CONFIG += KNOWNDEVICE

QMAKE_CXXFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CXXFLAGS += /wd4267 #Supress loss of data error
QMAKE_CFLAGS += /wd4267 #Supress loss of data error
QMAKE_CXXFLAGS += /wd4244 #Supress loss of data error
QMAKE_CFLAGS += /wd4244 #Supress loss of data error

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Debug/" -lAudioStreamingLibCore

WITH_OPUS {
LIBS += $$MSVC_64BITS_DEBUG_OPUS_LIB
LIBS += $$MSVC_64BITS_DEBUG_CELT_LIB
LIBS += $$MSVC_64BITS_DEBUG_SILK_COMMON_LIB
LIBS += $$MSVC_64BITS_DEBUG_SILK_FLOAT_LIB
}
}

CONFIG(release, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Release/" -lAudioStreamingLibCore

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

WITH_OPUS {
LIBS += $$MSVC_64BITS_RELEASE_OPUS_LIB
LIBS += $$MSVC_64BITS_RELEASE_CELT_LIB
LIBS += $$MSVC_64BITS_RELEASE_SILK_COMMON_LIB
LIBS += $$MSVC_64BITS_RELEASE_SILK_FLOAT_LIB
}
}

WITH_OPENSSL {
LIBS += $$MSVC_64BITS_OPENSSL_SSL_LIB
LIBS += $$MSVC_64BITS_OPENSSL_CRYPTO_LIB
LIBS += -lGdi32
}
} #VISUAL STUDIO 64 bits

contains(QT_ARCH, i386):unix:!macx:!android { #LINUX 32 bits
message("Using settings for Linux 32 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$LINUX_32BITS_OPUS_LIB
WITH_OPENSSL {
LIBS += $$LLINUX_32BITS_OPENSSL_SSL_LIB
LIBS += $$LINUX_32BITS_OPENSSL_CRYPTO_LIB
LIBS += -ldl
}
} #LINUX 32 bits

contains(QT_ARCH, x86_64):unix:!macx:!android { #LINUX 64 bits
message("Using settings for Linux 64 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$LINUX_64BITS_OPUS_LIB
WITH_OPENSSL {
LIBS += $$LINUX_64BITS_OPENSSL_SSL_LIB
LIBS += $$LINUX_64BITS_OPENSSL_CRYPTO_LIB
LIBS += -ldl
}
} #LINUX 64 bits

contains(QT_ARCH, x86_64):macx { #MACOS
message("Using settings for macOS 64 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$MACOS_OPUS_LIB

WITH_OPENSSL {
LIBS += $$MACOS_OPENSSL_SSL_LIB
LIBS += $$MACOS_OPENSSL_CRYPTO_LIB
}
} #MACOS

contains(ANDROID_TARGET_ARCH, armeabi):android { #ANDROID ARM
message("Using settings for Android ARM")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi/Release/" -lAudioStreamingLibCore

deployment.path = /libs/armeabi

WITH_OPUS {
deployment.files += $$ANDROID_ARM_OPUS_LIB
LIBS += $$ANDROID_ARM_OPUS_LIB
}
WITH_OPENSSL {
deployment.files += $$ANDROID_ARM_OPENSSL_SSL_LIB
deployment.files += $$ANDROID_ARM_OPENSSL_CRYPTO_LIB
LIBS += $$ANDROID_ARM_OPENSSL_SSL_LIB
LIBS += $$ANDROID_ARM_OPENSSL_CRYPTO_LIB
}
INSTALLS += deployment
} #ANDROID ARM

contains(ANDROID_TARGET_ARCH, armeabi-v7a):android { #ANDROID ARMV7A
message("Using settings for Android ARMV7A")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi-v7a/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi-v7a/Release/" -lAudioStreamingLibCore

deployment.path = /libs/armeabi-v7a

WITH_OPUS {
deployment.files += $$ANDROID_ARMV7A_OPUS_LIB
LIBS += $$ANDROID_ARMV7A_OPUS_LIB
}
WITH_OPENSSL {
deployment.files += $$ANDROID_ARMV7A_OPENSSL_SSL_LIB
deployment.files += $$ANDROID_ARMV7A_OPENSSL_CRYPTO_LIB
LIBS += $$ANDROID_ARMV7A_OPENSSL_SSL_LIB
LIBS += $$ANDROID_ARMV7A_OPENSSL_CRYPTO_LIB
}
INSTALLS += deployment
} #ANDROID ARMV7A

contains(ANDROID_TARGET_ARCH, x86):android { #ANDROID x86
message("Using settings for Android x86")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/x86/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/x86/Release/" -lAudioStreamingLibCore

deployment.path = /libs/x86

WITH_OPUS {
deployment.files += $$ANDROID_X86_OPUS_LIB
LIBS += $$ANDROID_X86_OPUS_LIB
}
WITH_OPENSSL {
deployment.files += $$ANDROID_X86_OPENSSL_SSL_LIB
deployment.files += $$ANDROID_X86_OPENSSL_CRYPTO_LIB
LIBS += $$ANDROID_X86_OPENSSL_SSL_LIB
LIBS += $$ANDROID_X86_OPENSSL_CRYPTO_LIB
}
} #ANDROID x86

!KNOWNDEVICE { #Unknown device
message("Using settings for Unknown Device. OpenSsl and Opus codec not supported!")

WITH_OPUS:DEFINES -= OPUS
WITH_OPENSSL:DEFINES -= OPENSSL

CONFIG -= WITH_OPUS
CONFIG -= WITH_OPENSSL

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/unknown_device/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/unknown_device/Release/" -lAudioStreamingLibCore
} #Unknown device

include (AudioStreamingLibSettings.pri)

QT += core network multimedia
CONFIG += c++11

if (contains(OPUS_ENABLED, TRUE)) CONFIG += WITH_OPUS

if (contains(OPENSSL_ENABLED, TRUE)) CONFIG += WITH_OPENSSL

WITH_OPUS:DEFINES += OPUS
WITH_OPENSSL:DEFINES += OPENSSL

#Include opus headers
WITH_OPUS {
win32:INCLUDEPATH += $$WIN_OPUS_INCLUDE
android:INCLUDEPATH += $$ANDROID_OPUS_INCLUDE
unix:!macx:!android:INCLUDEPATH += $$LINUX_OPUS_INCLUDE
macx:INCLUDEPATH += $$MACOS_OPUS_INCLUDE
}

INCLUDEPATH += $$PWD/AudioStreamingLib

win32-g++ { #MINGW
message("Using settings for Windows MinGW 32 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$MINGW_OPUS_LIB

WITH_OPENSSL {
LIBS += $$MINGW_OPENSSL_SSL_LIB
LIBS += $$MINGW_OPENSSL_CRYPTO_LIB
LIBS += -lGdi32
}
} #MINGW

contains(QT_ARCH, i386):win32-msvc* { #VISUAL STUDIO 32 bits
message("Using settings for Windows Visual Studio 32 bits")

CONFIG += KNOWNDEVICE

QMAKE_CXXFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CXXFLAGS += /wd4267 #Supress loss of data error
QMAKE_CFLAGS += /wd4267 #Supress loss of data error
QMAKE_CXXFLAGS += /wd4244 #Supress loss of data error
QMAKE_CFLAGS += /wd4244 #Supress loss of data error

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Debug/" -lAudioStreamingLibCore

WITH_OPUS {
LIBS += $$MSVC_32BITS_DEBUG_OPUS_LIB
LIBS += $$MSVC_32BITS_DEBUG_CELT_LIB
LIBS += $$MSVC_32BITS_DEBUG_SILK_COMMON_LIB
LIBS += $$MSVC_32BITS_DEBUG_SILK_FLOAT_LIB
}
}

CONFIG(release, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Release/" -lAudioStreamingLibCore

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

WITH_OPUS {
LIBS += $$MSVC_32BITS_RELEASE_OPUS_LIB
LIBS += $$MSVC_32BITS_RELEASE_CELT_LIB
LIBS += $$MSVC_32BITS_RELEASE_SILK_COMMON_LIB
LIBS += $$MSVC_32BITS_RELEASE_SILK_FLOAT_LIB
}
}

WITH_OPENSSL {
LIBS += $$MSVC_32BITS_OPENSSL_SSL_LIB
LIBS += $$MSVC_32BITS_OPENSSL_CRYPTO_LIB
LIBS += -lGdi32
}
} #VISUAL STUDIO 32 bits

contains(QT_ARCH, x86_64):win32-msvc* { #VISUAL STUDIO 64 bits
message("Using settings for Windows Visual Studio 64 bits")

CONFIG += KNOWNDEVICE

QMAKE_CXXFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CFLAGS += /wd4482 #Supress typedef enum error
QMAKE_CXXFLAGS += /wd4267 #Supress loss of data error
QMAKE_CFLAGS += /wd4267 #Supress loss of data error
QMAKE_CXXFLAGS += /wd4244 #Supress loss of data error
QMAKE_CFLAGS += /wd4244 #Supress loss of data error

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Debug/" -lAudioStreamingLibCore

WITH_OPUS {
LIBS += $$MSVC_64BITS_DEBUG_OPUS_LIB
LIBS += $$MSVC_64BITS_DEBUG_CELT_LIB
LIBS += $$MSVC_64BITS_DEBUG_SILK_COMMON_LIB
LIBS += $$MSVC_64BITS_DEBUG_SILK_FLOAT_LIB
}
}

CONFIG(release, debug|release):!AUDIOSTREAMINGLIB {
LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Release/" -lAudioStreamingLibCore

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

WITH_OPUS {
LIBS += $$MSVC_64BITS_RELEASE_OPUS_LIB
LIBS += $$MSVC_64BITS_RELEASE_CELT_LIB
LIBS += $$MSVC_64BITS_RELEASE_SILK_COMMON_LIB
LIBS += $$MSVC_64BITS_RELEASE_SILK_FLOAT_LIB
}
}

WITH_OPENSSL {
LIBS += $$MSVC_64BITS_OPENSSL_SSL_LIB
LIBS += $$MSVC_64BITS_OPENSSL_CRYPTO_LIB
LIBS += -lGdi32
}
} #VISUAL STUDIO 64 bits

contains(QT_ARCH, i386):unix:!macx:!android { #LINUX 32 bits
message("Using settings for Linux 32 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x86/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$LINUX_32BITS_OPUS_LIB
WITH_OPENSSL {
LIBS += $$LLINUX_32BITS_OPENSSL_SSL_LIB
LIBS += $$LINUX_32BITS_OPENSSL_CRYPTO_LIB
LIBS += -ldl
}
} #LINUX 32 bits

contains(QT_ARCH, x86_64):unix:!macx:!android { #LINUX 64 bits
message("Using settings for Linux 64 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$LINUX_64BITS_OPUS_LIB
WITH_OPENSSL {
LIBS += $$LINUX_64BITS_OPENSSL_SSL_LIB
LIBS += $$LINUX_64BITS_OPENSSL_CRYPTO_LIB
LIBS += -ldl
}
} #LINUX 64 bits

contains(QT_ARCH, x86_64):macx { #MACOS
message("Using settings for macOS 64 bits")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/lib/x64/Release/" -lAudioStreamingLibCore

WITH_OPUS:LIBS += $$MACOS_OPUS_LIB

WITH_OPENSSL {
LIBS += $$MACOS_OPENSSL_SSL_LIB
LIBS += $$MACOS_OPENSSL_CRYPTO_LIB
}
} #MACOS

contains(ANDROID_TARGET_ARCH, armeabi):android { #ANDROID ARM
message("Using settings for Android ARM")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi/Release/" -lAudioStreamingLibCore

deployment.path = /libs/armeabi

WITH_OPUS {
deployment.files += $$ANDROID_ARM_OPUS_LIB
LIBS += $$ANDROID_ARM_OPUS_LIB
}
WITH_OPENSSL {
deployment.files += $$ANDROID_ARM_OPENSSL_SSL_LIB
deployment.files += $$ANDROID_ARM_OPENSSL_CRYPTO_LIB
LIBS += $$ANDROID_ARM_OPENSSL_SSL_LIB
LIBS += $$ANDROID_ARM_OPENSSL_CRYPTO_LIB
}
INSTALLS += deployment
} #ANDROID ARM

contains(ANDROID_TARGET_ARCH, armeabi-v7a):android { #ANDROID ARMV7A
message("Using settings for Android ARMV7A")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi-v7a/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/armeabi-v7a/Release/" -lAudioStreamingLibCore

deployment.path = /libs/armeabi-v7a

WITH_OPUS {
deployment.files += $$ANDROID_ARMV7A_OPUS_LIB
LIBS += $$ANDROID_ARMV7A_OPUS_LIB
}
WITH_OPENSSL {
deployment.files += $$ANDROID_ARMV7A_OPENSSL_SSL_LIB
deployment.files += $$ANDROID_ARMV7A_OPENSSL_CRYPTO_LIB
LIBS += $$ANDROID_ARMV7A_OPENSSL_SSL_LIB
LIBS += $$ANDROID_ARMV7A_OPENSSL_CRYPTO_LIB
}
INSTALLS += deployment
} #ANDROID ARMV7A

contains(ANDROID_TARGET_ARCH, x86):android { #ANDROID x86
message("Using settings for Android x86")

CONFIG += KNOWNDEVICE

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/x86/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/android-lib/x86/Release/" -lAudioStreamingLibCore

deployment.path = /libs/x86

WITH_OPUS {
deployment.files += $$ANDROID_X86_OPUS_LIB
LIBS += $$ANDROID_X86_OPUS_LIB
}
WITH_OPENSSL {
deployment.files += $$ANDROID_X86_OPENSSL_SSL_LIB
deployment.files += $$ANDROID_X86_OPENSSL_CRYPTO_LIB
LIBS += $$ANDROID_X86_OPENSSL_SSL_LIB
LIBS += $$ANDROID_X86_OPENSSL_CRYPTO_LIB
}
} #ANDROID x86

!KNOWNDEVICE { #Unknown device
message("Using settings for Unknown Device. OpenSsl and Opus codec not supported!")

WITH_OPUS:DEFINES -= OPUS
WITH_OPENSSL:DEFINES -= OPENSSL

CONFIG -= WITH_OPUS
CONFIG -= WITH_OPENSSL

!AUDIOSTREAMINGLIB:INCLUDEPATH += $$PWD/AudioStreamingLibCore/include

CONFIG(debug, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/unknown_device/Debug/" -lAudioStreamingLibCore
CONFIG(release, debug|release):!AUDIOSTREAMINGLIB:LIBS += -L"$$PWD/AudioStreamingLibCore/unknown_device/Release/" -lAudioStreamingLibCore
} #Unknown device


enable outprocess applet running for default launching ways

TARGET = ../duicontrolpanel.launch
DCP_SH = ../../duicontrolpanel
APPLAUNCH_SH = ../../dcpappletlauncher
SERVICE = ../service/com.nokia.duicontrolpanel.service
APPLAUNCH_SERVICE = ../service/com.nokia.dcpappletlauncher.service
DESKTOP = duicontrolpanel.desktop
PREFIX =
POSTFIX =

# This can enable the outprocess applets by default:
POSTFIX = "-outprocess"

# this config can add that software mode gets used by default
# in case dcp gets run through shell script / dbus / its icon
SOFTWARE {
    POSTFIX += "-software"
}

# this controls whether dcp is launched with applauncherd or not:
DISABLE_LAUNCHER {
    DEFINES += DISABLE_LAUNCHER
} else {
    QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
    QMAKE_LFLAGS += -pie -rdynamic

    PREFIX += "/usr/bin/invoker --type=m "
}

# make the shell scripts:
system ( \
    cp $${DESKTOP}.1 $$DESKTOP; \
    cp duicontrolpanel.invoker $$DCP_SH; \
    cp dcpappletlauncher.invoker $$APPLAUNCH_SH; \
    cp com.nokia.duicontrolpanel.service.1 $$SERVICE; \
    cp com.nokia.dcpappletlauncher.service.1 $$APPLAUNCH_SERVICE; \
    sed -i -e \"s|PREFIX|$$PREFIX|\" \
        -e \"s|POSTFIX|$$POSTFIX|\" \
        $$DCP_SH $$APPLAUNCH_SH $$DESKTOP $$SERVICE $$APPLAUNCH_SERVICE; \
    chmod +x $$DCP_SH $$APLAUNCH_SH \
)

# configure .desktop file:
! APPEAR_IN_MENU {
    system(echo \"NotShowIn=X-DUI;X-MEEGO;X-MeeGoTouch;\" >>$$DESKTOP)
}

# create the install target:
appletlauncher.files += $$DCP_SH \
                        $$APPLAUNCH_SH \

appletlauncher.path += $$DCP_PREFIX/bin
INSTALLS += appletlauncher

# create the install target for the .desktop file:
desktop_entry.path = $$DCP_PREFIX/share/applications
desktop_entry.files = $$DESKTOP
INSTALLS += desktop_entry

TARGET = ../duicontrolpanel.launch
DCP_SH = ../../duicontrolpanel
APPLAUNCH_SH = ../../dcpappletlauncher
SERVICE = ../service/com.nokia.duicontrolpanel.service
APPLAUNCH_SERVICE = ../service/com.nokia.dcpappletlauncher.service
DESKTOP = duicontrolpanel.desktop
PREFIX =
POSTFIX =

# This can enable the outprocess applets by default:
# POSTFIX = "-outprocess"

# this config can add that software mode gets used by default
# in case dcp gets run through shell script / dbus / its icon
SOFTWARE {
    POSTFIX += "-software"
}

# this controls whether dcp is launched with applauncherd or not:
DISABLE_LAUNCHER {
    DEFINES += DISABLE_LAUNCHER
} else {
    QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
    QMAKE_LFLAGS += -pie -rdynamic

    PREFIX += "/usr/bin/invoker --type=m "
}

# make the shell scripts:
system ( \
    cp $${DESKTOP}.1 $$DESKTOP; \
    cp duicontrolpanel.invoker $$DCP_SH; \
    cp dcpappletlauncher.invoker $$APPLAUNCH_SH; \
    cp com.nokia.duicontrolpanel.service.1 $$SERVICE; \
    cp com.nokia.dcpappletlauncher.service.1 $$APPLAUNCH_SERVICE; \
    sed -i -e \"s|PREFIX|$$PREFIX|\" \
        -e \"s|POSTFIX|$$POSTFIX|\" \
        $$DCP_SH $$APPLAUNCH_SH $$DESKTOP $$SERVICE $$APPLAUNCH_SERVICE; \
    chmod +x $$DCP_SH $$APLAUNCH_SH \
)

# configure .desktop file:
! APPEAR_IN_MENU {
    system(echo \"NotShowIn=X-DUI;X-MEEGO;X-MeeGoTouch;\" >>$$DESKTOP)
}

# create the install target:
appletlauncher.files += $$DCP_SH \
                        $$APPLAUNCH_SH \

appletlauncher.path += $$DCP_PREFIX/bin
INSTALLS += appletlauncher

# create the install target for the .desktop file:
desktop_entry.path = $$DCP_PREFIX/share/applications
desktop_entry.files = $$DESKTOP
INSTALLS += desktop_entry


Code fix 6

Code fix 6

HEADERS += \
	mainwindow/mainWindow.h \
	mainwindow/propertyEditorProxyModel.h \
	mainwindow/errorReporter.h \
	mainwindow/gesturesPainterInterface.h \
	mainwindow/gesturesPainterInterface.h \
	mainwindow/buttonRefWindow.h \
	mainwindow/error.h \
	mainwindow/errorListWidget.h \
	mainwindow/mainWindowInterpretersInterface.h \
	mainwindow/helpBrowser.h \
	mainwindow/paletteTree.h

SOURCES += \
	mainwindow/mainWindow.cpp \
	mainwindow/propertyEditorProxyModel.cpp \
	mainwindow/errorReporter.cpp \
	mainwindow/buttonRefWindow.cpp \
	mainwindow/error.cpp \
	mainwindow/errorListWidget.cpp \
	mainwindow/helpBrowser.cpp \
	mainwindow/paletteTree.cpp

FORMS += \
	mainwindow/mainWindow.ui

# Shape editor
HEADERS += \
	mainwindow/shapeEdit/shapeEdit.h \
	mainwindow/shapeEdit/scene.h \
	mainwindow/shapeEdit/arch.h \
	mainwindow/shapeEdit/line.h \
	mainwindow/shapeEdit/item.h \
	mainwindow/shapeEdit/ellipse.h \
	mainwindow/shapeEdit/rectangle.h \
	mainwindow/shapeEdit/text.h \
	mainwindow/shapeEdit/pointPort.h \
	mainwindow/shapeEdit/linePort.h \
	mainwindow/shapeEdit/xmlLoader.h \
	mainwindow/shapeEdit/stylus.h \
	mainwindow/shapeEdit/colorListEditor.h \
	mainwindow/shapeEdit/curve.h \
	mainwindow/shapeEdit/view.h \
	mainwindow/shapeEdit/textPicture.h \
	mainwindow/shapeEdit/path.h \
	mainwindow/shapeEdit/image.h \

SOURCES += \
	mainwindow/shapeEdit/shapeEdit.cpp \
	mainwindow/shapeEdit/scene.cpp \
	mainwindow/shapeEdit/arch.cpp \
	mainwindow/shapeEdit/line.cpp \
	mainwindow/shapeEdit/item.cpp \
	mainwindow/shapeEdit/ellipse.cpp \
	mainwindow/shapeEdit/rectangle.cpp \
	mainwindow/shapeEdit/text.cpp \
	mainwindow/shapeEdit/pointPort.cpp \
	mainwindow/shapeEdit/linePort.cpp \
	mainwindow/shapeEdit/xmlLoader.cpp \
	mainwindow/shapeEdit/stylus.cpp \
	mainwindow/shapeEdit/colorListEditor.cpp \
	mainwindow/shapeEdit/path.cpp \
	mainwindow/shapeEdit/curve.cpp \
	mainwindow/shapeEdit/view.cpp \
	mainwindow/shapeEdit/textPicture.cpp \
	mainwindow/shapeEdit/image.cpp \

FORMS += \
	mainwindow/shapeEdit/shapeEdit.ui \


*** empty log message ***

*** empty log message ***

######################################################################
# $Revision: 1.21 $ $Author: mendes $ $Date: 2004/01/30 19:40:15 $
######################################################################

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

TARGETDEPS += Makefile
DEFINES+=XML_STATIC

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

debug {
  DEFINES += COPASI_DEBUG
}

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

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

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

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

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

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

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

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

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

DEP1.target   = depend
DEP1.depends  = qmake

QMAKE_EXTRA_UNIX_TARGETS += DEP1

######################################################################
# $Revision: 1.20 $ $Author: shoops $ $Date: 2004/01/30 19:24:48 $
######################################################################

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

TARGETDEPS += Makefile
DEFINES+=XML_STATIC

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

debug {
  DEFINES += COPASI_DEBUG
}

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

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

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

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

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

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

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

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

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

DEP1.target   = depend
DEP1.depends  = qmake

QMAKE_EXTRA_UNIX_TARGETS += DEP1