Fixed variable reference.

Fixed variable reference.

#####################################################################
# Qt documentation build
#####################################################################

DOCS_GENERATION_DEFINES =
GENERATOR = $$QT_BUILD_TREE/bin/qhelpgenerator
MODULE = qtdoc

win32:!win32-g++* {
    unixstyle = false
} else :win32-g++*:isEmpty(QMAKE_SH) {
    unixstyle = false
} else {
    unixstyle = true
}

$$unixstyle {
    QDOC = cd doc/config && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/bin/qdoc3 $$DOCS_GENERATION_DEFINES
} else {
    QDOC = cd doc/config && set QT_BUILD_TREE=$$QT_BUILD_TREE && set QT_SOURCE_TREE=$$QT_SOURCE_TREE && $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES
    QDOC = $$replace(QDOC, "/", "\\")
}

QT_ONLINE_DOCUMENTATION = ($$QDOC $${MODULE}-online.qdocconf)

QT_DOCUMENTATION = ($$QDOC $${MODULE}.qdocconf) && \
               (cd $$QT_BUILD_TREE && \
                $$GENERATOR doc/html/qt.qhp -o doc/qch/qt.qch)

#QT_ZH_CN_DOCUMENTATION = ($$QDOC qt-api-only_zh_CN.qdocconf) && \
#               (cd $$QT_BUILD_TREE && \
#                    $$GENERATOR doc-build/html-qt_zh_CN/qt.qhp -o doc/qch/qt_zh_CN.qch \
#               )

#QT_JA_JP_DOCUMENTATION = ($$QDOC qt-api-only_ja_JP.qdocconf) && \
#               (cd $$QT_BUILD_TREE && \
#                    $$GENERATOR doc-build/html-qt_ja_JP/qt.qhp -o doc/qch/qt_ja_JP.qch \
#               )

win32-g++*:isEmpty(QMAKE_SH) {
	QT_DOCUMENTATION = $$replace(QT_DOCUMENTATION, "/", "\\\\")
#	QT_ZH_CN_DOCUMENTATION = $$replace(QT_ZH_CN_DOCUMENTATION, "/", "\\\\")
#	QT_JA_JP_DOCUMENTATION = $$replace(QT_JA_JP_DOCUMENTATION, "/", "\\\\")
}

# Build rules:
online_docs.commands = $$QT_ONLINE_DOCUMENTATION
online_docs.depends += sub-qdoc3 # qdoc3
qch_docs.commands = $$QT_DOCUMENTATION
qch_docs.depends += sub-qdoc3

docs.depends = sub-qdoc3 online_docs qch_docs

#docs_zh_CN.depends = docs
#docs_zh_CN.commands = $$QT_ZH_CN_DOCUMENTATION

#docs_ja_JP.depends = docs
#docs_ja_JP.commands = $$QT_JA_JP_DOCUMENTATION

# Install rules
htmldocs.files = $$QT_BUILD_TREE/doc/html
htmldocs.path = $$[QT_INSTALL_DOCS]
htmldocs.CONFIG += no_check_exist directory

qchdocs.files= $$QT_BUILD_TREE/doc/qch
qchdocs.path = $$[QT_INSTALL_DOCS]
qchdocs.CONFIG += no_check_exist directory

docimages.files = $$QT_BUILD_TREE/doc/src/images
docimages.path = $$[QT_INSTALL_DOCS]/src

#sub-qdoc3.depends = sub-corelib sub-xml
sub-qdoc3.commands += (cd tools/qdoc3 && $(MAKE))

QMAKE_EXTRA_TARGETS += sub-qdoc3 online_docs qch_docs docs # docs_zh_CN docs_ja_JP
INSTALLS += htmldocs qchdocs docimages

#####################################################################
# Qt documentation build
#####################################################################

DOCS_GENERATION_DEFINES =
GENERATOR = $$QT_BUILD_TREE/bin/qhelpgenerator
MODULE = qtdoc

win32:!win32-g++* {
    unixstyle = false
} else :win32-g++*:isEmpty(QMAKE_SH) {
    unixstyle = false
} else {
    unixstyle = true
}

$$unixstyle {
    QDOC = cd doc/config && QT_BUILD_TREE=$$QT_BUILD_TREE QT_SOURCE_TREE=$$QT_SOURCE_TREE $$QT_BUILD_TREE/bin/qdoc3 $$DOCS_GENERATION_DEFINES
} else {
    QDOC = cd doc/config && set QT_BUILD_TREE=$$QT_BUILD_TREE && set QT_SOURCE_TREE=$$QT_SOURCE_TREE && $$QT_BUILD_TREE/bin/qdoc3.exe $$DOCS_GENERATION_DEFINES
    QDOC = $$replace(QDOC, "/", "\\")
}

QT_ONLINE_DOCUMENTATION = ($$QDOC $$MODULE-online.qdocconf)

QT_DOCUMENTATION = ($$QDOC $$MODULE.qdocconf) && \
               (cd $$QT_BUILD_TREE && \
                $$GENERATOR doc/html/qt.qhp -o doc/qch/qt.qch)

#QT_ZH_CN_DOCUMENTATION = ($$QDOC qt-api-only_zh_CN.qdocconf) && \
#               (cd $$QT_BUILD_TREE && \
#                    $$GENERATOR doc-build/html-qt_zh_CN/qt.qhp -o doc/qch/qt_zh_CN.qch \
#               )

#QT_JA_JP_DOCUMENTATION = ($$QDOC qt-api-only_ja_JP.qdocconf) && \
#               (cd $$QT_BUILD_TREE && \
#                    $$GENERATOR doc-build/html-qt_ja_JP/qt.qhp -o doc/qch/qt_ja_JP.qch \
#               )

win32-g++*:isEmpty(QMAKE_SH) {
	QT_DOCUMENTATION = $$replace(QT_DOCUMENTATION, "/", "\\\\")
#	QT_ZH_CN_DOCUMENTATION = $$replace(QT_ZH_CN_DOCUMENTATION, "/", "\\\\")
#	QT_JA_JP_DOCUMENTATION = $$replace(QT_JA_JP_DOCUMENTATION, "/", "\\\\")
}

# Build rules:
online_docs.commands = $$QT_ONLINE_DOCUMENTATION
online_docs.depends += sub-qdoc3 # qdoc3
qch_docs.commands = $$QT_DOCUMENTATION
qch_docs.depends += sub-qdoc3

docs.depends = sub-qdoc3 online_docs qch_docs

#docs_zh_CN.depends = docs
#docs_zh_CN.commands = $$QT_ZH_CN_DOCUMENTATION

#docs_ja_JP.depends = docs
#docs_ja_JP.commands = $$QT_JA_JP_DOCUMENTATION

# Install rules
htmldocs.files = $$QT_BUILD_TREE/doc/html
htmldocs.path = $$[QT_INSTALL_DOCS]
htmldocs.CONFIG += no_check_exist directory

qchdocs.files= $$QT_BUILD_TREE/doc/qch
qchdocs.path = $$[QT_INSTALL_DOCS]
qchdocs.CONFIG += no_check_exist directory

docimages.files = $$QT_BUILD_TREE/doc/src/images
docimages.path = $$[QT_INSTALL_DOCS]/src

#sub-qdoc3.depends = sub-corelib sub-xml
sub-qdoc3.commands += (cd tools/qdoc3 && $(MAKE))

QMAKE_EXTRA_TARGETS += sub-qdoc3 online_docs qch_docs docs # docs_zh_CN docs_ja_JP
INSTALLS += htmldocs qchdocs docimages


build against installed lib

build against installed lib

svn path=/trunk/kdesupport/qca/; revision=258012

# change/remove these entries, depending on the installation prefix
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib

# link
LIBS += -lqca

QCA_CPP = ../../src

INCLUDEPATH += $$QCA_CPP
HEADERS += $$QCA_CPP/qca.h $$QCA_CPP/qcaprovider.h
SOURCES += $$QCA_CPP/qca.cpp


Update building comments, use homebrew for berkeleyDB instead compiling from source

# 1. Before using autotools & make, make sure to set the macOS target platform in the shell:
# export MACOSX_DEPLOYMENT_TARGET=10.10

# 2. Install all libraries with homebrew:
# brew install autoconf automake libtool pkg-config openssl@1.1 libevent boost gcc wget

# (2a optional) Fix for xCode to stop complaining about not finding the string.h file
# https://stackoverflow.com/questions/48839127/qmake-derived-clang-in-osx-10-13-cannot-find-string-h
# INCLUDEPATH += /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include

ICON = $$PWD/../spectre.icns

    # to build tor with autotools, call in subfolder tor:
    # ./autogen.sh && ./configure --with-ssl-dir=/usr/local/Cellar/openssl@1.1/1.1.0i --disable-asciidoc --disable-lzma
    LIBS += -L$$PWD/../tor/src/or -ltor \
    -L$$PWD/../tor/src/common -lor \
    -L$$PWD/../tor/src/common -lor-ctime \
    -L$$PWD/../tor/src/common -lor-crypto \
    -L$$PWD/../tor/src/common -lor-event \
    -L$$PWD/../tor/src/trunnel -lor-trunnel \
    -L$$PWD/../tor/src/common -lcurve25519_donna \
    -L$$PWD/../tor/src/ext/ed25519/donna -led25519_donna \
    -L$$PWD/../tor/src/ext/ed25519/ref10 -led25519_ref10 \
    -L$$PWD/../tor/src/ext/keccak-tiny -lkeccak-tiny \

    INCLUDEPATH += $$PWD/../tor/src/or $$PWD/../tor/src/common $$PWD/../tor/src/trunnel $$PWD/../tor/src/ext/ed25519/donna $$PWD/../tor/src/ext/ed25519/ref10 $$PWD/../tor/src/ext/keccak-tiny
    DEPENDPATH += $$PWD/../tor/src/or $$PWD/../tor/src/common $$PWD/../tor/src/trunnel $$PWD/../tor/src/ext/ed25519/donna $$PWD/../tor/src/ext/ed25519/ref10 $$PWD/../tor/src/ext/keccak-tiny

    PRE_TARGETDEPS += $$PWD/../tor/src/or/libtor.a \
    $$PWD/../tor/src/common/libor.a \
    $$PWD/../tor/src/common/libor-ctime.a \
    $$PWD/../tor/src/common/libor-crypto.a \
    $$PWD/../tor/src/common/libor-event.a \
    $$PWD/../tor/src/trunnel/libor-trunnel.a \
    $$PWD/../tor/src/common/libcurve25519_donna.a \
    $$PWD/../tor/src/ext/ed25519/donna/libed25519_donna.a \
    $$PWD/../tor/src/ext/ed25519/ref10/libed25519_ref10.a \
    $$PWD/../tor/src/ext/keccak-tiny/libkeccak-tiny.a \

    # brew install zlib
    _ZLIB_PATH = /usr/local/opt/zlib
    INCLUDEPATH += "$${_ZLIB_PATH}/include/"
    LIBS += -L$${_ZLIB_PATH}/lib
    #Shblis-MacBook-Pro:src Shbli$ find /usr/local/Cellar/libevent/2.1.8/lib/ -name *a
    LIBS += -lz

    # brew install berkeley-db4
    _BERKELEY_PATH = /usr/local/Cellar/berkeley-db@4/4.8.30
    LIBS += -L$${_BERKELEY_PATH}/lib -ldb_cxx \   # use dynamic libraries
    -L$${_BERKELEY_PATH}/lib -ldb
    #LIBS += $${_BERKELEY_PATH}/lib/libdb_cxx.a \ # link static
    #$${_BERKELEY_PATH}/lib/libdb.a

    DEPENDPATH += $${_BERKELEY_PATH}/lib
    INCLUDEPATH += $${_BERKELEY_PATH}/include

    # to build leveldb call in subfolder leveldb:
    # ./build_detect_platform build_config.mk ./ && make
    LIBS += -L$$PWD/../leveldb/out-static -lleveldb \
    -L$$PWD/../leveldb/out-static -lmemenv

    INCLUDEPATH += $$PWD/../leveldb/out-static
    DEPENDPATH += $$PWD/../leveldb/out-static
    INCLUDEPATH += $$PWD/../leveldb/include
    DEPENDPATH += $$PWD/../leveldb/include
    INCLUDEPATH += $$PWD/../leveldb/helpers
    DEPENDPATH += $$PWD/../leveldb/helpers

    PRE_TARGETDEPS += $$PWD/../leveldb/out-static/libleveldb.a \
    $$PWD/../leveldb/out-static/libmemenv.a

HEADERS +=              $$PWD/qt/macdockiconhandler.h \
                        $$PWD/qt/macnotificationhandler.h \

OBJECTIVE_SOURCES +=    $$PWD/qt/macdockiconhandler.mm \
                        $$PWD/qt/macnotificationhandler.mm \

DEFINES += FORTIFY_SOURCE=1

QMAKE_LFLAGS += -fstack-protector
QMAKE_CXXFLAGS += -pthread -fPIC -fstack-protector -O2 -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wno-ignored-qualifiers -Woverloaded-virtual -Wformat -Wformat-security -Wno-unused-parameter

DEFINES += MAC_OSX
# Mac: compile for maximum compatibility (10.0 Yosemite, 32-bit)
QMAKE_CXXFLAGS += -std=c++14 -mmacosx-version-min=10.10 -isysroot

    # https://www.reddit.com/r/cpp/comments/334s4r/how_to_enable_c14_in_qt_creator_on_a_mac/
    # Turns out, there's a glitch in the Mac version where the standard library isn't correctly included when using the C++14 config flag. Adding this additional line to the .pro file fixes the problem:
    QMAKE_CXXFLAGS += -stdlib=libc++

    #add in core foundation framework
    QMAKE_LFLAGS += -F /System/Library/Frameworks/CoreFoundation.framework/
    LIBS += -framework CoreFoundation

    QMAKE_LFLAGS += -F /System/Library/Frameworks/AppKit.framework/
    LIBS += -framework AppKit

    QMAKE_LFLAGS += -F /System/Library/Frameworks/ApplicationServices.framework/
    LIBS += -framework ApplicationServices

    #brew install boost
    _BOOST_PATH = /usr/local/Cellar/boost/1.67.0_1
    INCLUDEPATH += "$${_BOOST_PATH}/include/"
    LIBS += -L$${_BOOST_PATH}/lib
    LIBS += -lboost_system-mt -lboost_chrono-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_unit_test_framework-mt -lboost_timer-mt # using dynamic lib (not sure if you need that "-mt" at the end or not)
    DEFINES += BOOST_ASIO_ENABLE_OLD_SERVICES BOOST_SPIRIT_THREADSAFE BOOST_THREAD_USE_LIB BOOST_THREAD_POSIX BOOST_HAS_THREADS
    #LIBS += $${_BOOST_PATH}/lib/libboost_chrono-mt.a # using static lib

    #brew install openssl@1.1
    _OPENSSL_PATH = /usr/local/Cellar/openssl@1.1/1.1.0i
    INCLUDEPATH += "$${_OPENSSL_PATH}/include/"
    LIBS += -L$${_OPENSSL_PATH}/lib
    LIBS += -lssl -lcrypto # using dynamic lib (not sure if you need that "-mt" at the end or not)

    #libevent-2.1.6.dylib
    #brew install libevent
    _LIBEVENT_PATH = /usr/local/Cellar/libevent/2.1.8
    INCLUDEPATH += "$${_LIBEVENT_PATH}/include/"
    LIBS += -L$${_LIBEVENT_PATH}/lib
    #Shblis-MacBook-Pro:src Shbli$ find /usr/local/Cellar/libevent/2.1.8/lib/ -name *a
    LIBS += -levent_extra -levent -levent_core -levent_openssl -levent_pthreads

#TOR LIBS, to build tor use autotools/autoconfig in tor subfolder, make sure to pass -with-openssl 1.1 and pass the directory there
#Note, to compile the tor pojrect use the following command
#./configure --enable-static-tor --with-openssl-dir=/usr/local/Cellar/openssl@1.1/1.1.0h --with-libevent-dir=/usr/local/var/homebrew/linked/libevent --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11
#Use homebrew to install openssl1.1 such as
    #brew install openssl@1.1

#Fix for xCode to stop complaining about not finding the string.h file
# https://stackoverflow.com/questions/48839127/qmake-derived-clang-in-osx-10-13-cannot-find-string-h
#INCLUDEPATH += /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include

ICON = $$PWD/../spectre.icns

    #to build tor use ./configure --with-ssl-dir=/usr/local/Cellar/openssl@1.1/ command in the subfolder of berklydb
    LIBS += -L$$PWD/../tor/src/or -ltor \
    -L$$PWD/../tor/src/common -lor \
    -L$$PWD/../tor/src/common -lor-ctime \
    -L$$PWD/../tor/src/common -lor-crypto \
    -L$$PWD/../tor/src/common -lor-event \
    -L$$PWD/../tor/src/trunnel -lor-trunnel \
    -L$$PWD/../tor/src/common -lcurve25519_donna \
    -L$$PWD/../tor/src/ext/ed25519/donna -led25519_donna \
    -L$$PWD/../tor/src/ext/ed25519/ref10 -led25519_ref10 \
    -L$$PWD/../tor/src/ext/keccak-tiny -lkeccak-tiny \

    INCLUDEPATH += $$PWD/../tor/src/or $$PWD/../tor/src/common $$PWD/../tor/src/trunnel $$PWD/../tor/src/ext/ed25519/donna $$PWD/../tor/src/ext/ed25519/ref10 $$PWD/../tor/src/ext/keccak-tiny
    DEPENDPATH += $$PWD/../tor/src/or $$PWD/../tor/src/common $$PWD/../tor/src/trunnel $$PWD/../tor/src/ext/ed25519/donna $$PWD/../tor/src/ext/ed25519/ref10 $$PWD/../tor/src/ext/keccak-tiny

    PRE_TARGETDEPS += $$PWD/../tor/src/or/libtor.a \
    $$PWD/../tor/src/common/libor.a \
    $$PWD/../tor/src/common/libor-ctime.a \
    $$PWD/../tor/src/common/libor-crypto.a \
    $$PWD/../tor/src/common/libor-event.a \
    $$PWD/../tor/src/trunnel/libor-trunnel.a \
    $$PWD/../tor/src/common/libcurve25519_donna.a \
    $$PWD/../tor/src/ext/ed25519/donna/libed25519_donna.a \
    $$PWD/../tor/src/ext/ed25519/ref10/libed25519_ref10.a \
    $$PWD/../tor/src/ext/keccak-tiny/libkeccak-tiny.a \

#    #brew install zlib
    _ZLIB_PATH = /usr/local/opt/zlib
    INCLUDEPATH += "$${_ZLIB_PATH}/include/"
    LIBS += -L$${_ZLIB_PATH}/lib
    #Shblis-MacBook-Pro:src Shbli$ find /usr/local/Cellar/libevent/2.1.8/lib/ -name *a
    LIBS += -lz

#to build berkly db use ./configure command in the subfolder of berklydb
    LIBS += -L$$PWD/../db4.8/build_unix -ldb_cxx \
    -L$$PWD/../db4.8/build_unix -ldb

    INCLUDEPATH += $$PWD/../db4.8/build_unix
    DEPENDPATH += $$PWD/../db4.8/build_unix

    PRE_TARGETDEPS += $$PWD/../db4.8/build_unix/libdb_cxx.a \
    $$PWD/../db4.8/build_unix/libdb.a

#to build leveldb use ./configure command in the subfolder of leveldb
    LIBS += -L$$PWD/../leveldb/out-static -lleveldb \
    -L$$PWD/../leveldb/out-static -lmemenv

    INCLUDEPATH += $$PWD/../leveldb/out-static
    DEPENDPATH += $$PWD/../leveldb/out-static
    INCLUDEPATH += $$PWD/../leveldb/include
    DEPENDPATH += $$PWD/../leveldb/include
    INCLUDEPATH += $$PWD/../leveldb/helpers
    DEPENDPATH += $$PWD/../leveldb/helpers

    PRE_TARGETDEPS += $$PWD/../leveldb/out-static/libleveldb.a \
    $$PWD/../leveldb/out-static/libmemenv.a

HEADERS +=              $$PWD/qt/macdockiconhandler.h \
                        $$PWD/qt/macnotificationhandler.h \

OBJECTIVE_SOURCES +=    $$PWD/qt/macdockiconhandler.mm \
                        $$PWD/qt/macnotificationhandler.mm \

DEFINES += FORTIFY_SOURCE=1

QMAKE_LFLAGS += -fstack-protector
QMAKE_CXXFLAGS += -pthread -fPIC -fstack-protector -O2 -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wno-ignored-qualifiers -Woverloaded-virtual -Wformat -Wformat-security -Wno-unused-parameter

DEFINES += MAC_OSX
# Mac: compile for maximum compatibility (10.0, 32-bit)
QMAKE_CXXFLAGS += -std=c++14 -mmacosx-version-min=10.10 -isysroot

    # https://www.reddit.com/r/cpp/comments/334s4r/how_to_enable_c14_in_qt_creator_on_a_mac/
    # Turns out, there's a glitch in the Mac version where the standard library isn't correctly included when using the C++14 config flag. Adding this additional line to the .pro file fixes the problem:
    QMAKE_CXXFLAGS += -stdlib=libc++

    #add in core foundation framework
    QMAKE_LFLAGS += -F /System/Library/Frameworks/CoreFoundation.framework/
    LIBS += -framework CoreFoundation

    QMAKE_LFLAGS += -F /System/Library/Frameworks/AppKit.framework/
    LIBS += -framework AppKit

    QMAKE_LFLAGS += -F /System/Library/Frameworks/ApplicationServices.framework/
    LIBS += -framework ApplicationServices

    #brew install boost
    _BOOST_PATH = /usr/local/Cellar/boost/1.67.0_1
    INCLUDEPATH += "$${_BOOST_PATH}/include/"
    LIBS += -L$${_BOOST_PATH}/lib
    LIBS += -lboost_system-mt -lboost_chrono-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_unit_test_framework-mt -lboost_timer-mt # using dynamic lib (not sure if you need that "-mt" at the end or not)
    DEFINES += BOOST_ASIO_ENABLE_OLD_SERVICES BOOST_SPIRIT_THREADSAFE BOOST_THREAD_USE_LIB BOOST_THREAD_POSIX BOOST_HAS_THREADS
    #LIBS += $${_BOOST_PATH}/lib/libboost_chrono-mt.a # using static lib

    #brew install openssl@1.1
    _OPENSSL_PATH = /usr/local/Cellar/openssl@1.1/1.1.0i
    INCLUDEPATH += "$${_OPENSSL_PATH}/include/"
    LIBS += -L$${_OPENSSL_PATH}/lib
    LIBS += -lssl -lcrypto # using dynamic lib (not sure if you need that "-mt" at the end or not)

    #libevent-2.1.6.dylib
    #brew install libevent
    _LIBEVENT_PATH = /usr/local/Cellar/libevent/2.1.8
    INCLUDEPATH += "$${_LIBEVENT_PATH}/include/"
    LIBS += -L$${_LIBEVENT_PATH}/lib
    #Shblis-MacBook-Pro:src Shbli$ find /usr/local/Cellar/libevent/2.1.8/lib/ -name *a
    LIBS += -levent_extra -levent -levent_core -levent_openssl -levent_pthreads


Fix windows build, define _WINSOCKAPI_

Fix windows build, define _WINSOCKAPI_

#Include libs the windows way, for visual studio 64 bit compiler
#static for VS
#Compile Qt from source
#Refrences for MSVC
# http://amin-ahmadi.com/2016/09/22/how-to-build-qt-5-7-statically-using-msvc14-microsoft-visual-studio-2015/
# https://stackoverflow.com/questions/32735678/how-to-build-qt-5-5-qtwebengine-on-windows-msvc-2015
# configure -prefix "C:\D\QtSDK\5.10.1\msvc2017_64_static" -platform win64-msvc2017 -developer-build -opensource -confirm-license -nomake examples -nomake tests -opengl desktop -debug-and-release -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -sql-sqlite -sql-odbc -make libs
# nmake
# nmake install
CONFIG += static
QMAKE_LFLAGS += -static
QMAKE_CXXFLAGS += /MT
QMAKE_CFLAGS += -O2 -MT
QMAKE_CXXFLAGS += -O2 -MT

DEFINES -= NDEBUG
DEFINES += _WINSOCKAPI_

CONFIG(release, debug|release) {
    message( "release" )
    LIBSPATH = $$PWD/../packages64bit/lib
}
CONFIG(debug, debug|release) {
    message( "debug" )
    LIBSPATH = $$PWD/../packages64bit/debug/lib
}

HEADERS += $$PWD/win/unistd.h
INCLUDEPATH += $$PWD/win

#Command to install dependencies (Static)
#vcpkg.exe install boost:x64-windows-static berkeleydb:x64-windows-static leveldb:x64-windows-static libevent:x64-windows-static lua:x64-windows-static openssl:x64-windows-static zlib:x64-windows-static
#Command to install dependencies (Dynamic)
#vcpkg.exe install boost:x64-windows berkeleydb:x64-windows leveldb:x64-windows libevent:x64-windows lua:x64-windows openssl:x64-windows zlib:x64-windows
DEFINES += BOOST_ASIO_ENABLE_OLD_SERVICES BOOST_SPIRIT_THREADSAFE BOOST_THREAD_USE_LIB
#DEFINES += BOOST_DISABLE_CURRENT_FUNCTION

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

LIBS += -L$${LIBSPATH}/ -llua
PRE_TARGETDEPS += $${LIBSPATH}/lua.lib
LIBS += -L$${LIBSPATH} -lboost_chrono-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_chrono-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_filesystem-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_filesystem-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_program_options-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_program_options-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_system-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_system-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_thread-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_thread-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_unit_test_framework-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_unit_test_framework-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lzlib
PRE_TARGETDEPS += $${LIBSPATH}/zlib.lib
LIBS += -L$${LIBSPATH}/ -llibcryptoMD
PRE_TARGETDEPS += $${LIBSPATH}/libcryptoMD.lib
LIBS += -L$${LIBSPATH}/ -llibsslMD
PRE_TARGETDEPS += $${LIBSPATH}/libsslMD.lib
LIBS += -L$${LIBSPATH}/ -levent
PRE_TARGETDEPS += $${LIBSPATH}/event.lib
LIBS += -L$${LIBSPATH}/ -levent_core
PRE_TARGETDEPS += $${LIBSPATH}/event_core.lib
LIBS += -L$${LIBSPATH}/ -levent_extra
PRE_TARGETDEPS += $${LIBSPATH}/event_extra.lib
LIBS += -L$${LIBSPATH}/ -lWS2_32
PRE_TARGETDEPS += $${LIBSPATH}/WS2_32.lib
LIBS += -L$${LIBSPATH}/ -lAdvAPI32
PRE_TARGETDEPS += $${LIBSPATH}/AdvAPI32.lib
LIBS += -L$${LIBSPATH}/ -lshell32
PRE_TARGETDEPS += $${LIBSPATH}/shell32.lib
LIBS += -L$${LIBSPATH}/ -lUser32
PRE_TARGETDEPS += $${LIBSPATH}/User32.lib
LIBS += -L$${LIBSPATH}/ -lCrypt32
PRE_TARGETDEPS += $${LIBSPATH}/Crypt32.lib
#ShLwApi
LIBS += -L$${LIBSPATH}/ -lShLwApi
PRE_TARGETDEPS += $${LIBSPATH}/ShLwApi.lib

#LevelDB from VCPKG
LIBS += -L$${LIBSPATH}/ -llibleveldb
PRE_TARGETDEPS += $${LIBSPATH}/libleveldb.lib
#BerklyDB4.8 from our project repo (VCPKG version is not supported)
LIBS += -L$${LIBSPATH}/ -llibdb48
PRE_TARGETDEPS += $${LIBSPATH}/libdb48.lib
#libdb_stl48.lib (We need both libdb and libdbstl (Standered library)
LIBS += -L$${LIBSPATH}/ -llibdb_stl48
PRE_TARGETDEPS += $${LIBSPATH}/libdb_stl48.lib

#LIBS += -L$$PWD/../tor/ -ltorlib
#PRE_TARGETDEPS += $$PWD/../tor/torlib.lib
LIBS += -L$$PWD/../leveldb/ -lleveldblib
PRE_TARGETDEPS += $$PWD/../leveldb/leveldblib.lib
#LIBS += -L$$PWD/../db4.8/ -lberkeleydblib
#PRE_TARGETDEPS += $$PWD/../db4.8/berkeleydblib.lib

QMAKE_CFLAGS_WARN_ON -= -W3
QMAKE_CFLAGS_WARN_ON += -W2

QMAKE_CXXFLAGS_WARN_ON -= -W3
QMAKE_CXXFLAGS_WARN_ON += -W2

QMAKE_CXXFLAGS += -O2 -D_FORTIFY_SOURCE=1
QMAKE_CFLAGS += /std:c++17
QMAKE_CXXFLAGS += /std:c++17

#Include libs the windows way, for visual studio 64 bit compiler
#static for VS
#Compile Qt from source
#Refrences for MSVC
# http://amin-ahmadi.com/2016/09/22/how-to-build-qt-5-7-statically-using-msvc14-microsoft-visual-studio-2015/
# https://stackoverflow.com/questions/32735678/how-to-build-qt-5-5-qtwebengine-on-windows-msvc-2015
# configure -prefix "C:\D\QtSDK\5.10.1\msvc2017_64_static" -platform win64-msvc2017 -developer-build -opensource -confirm-license -nomake examples -nomake tests -opengl desktop -debug-and-release -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -sql-sqlite -sql-odbc -make libs
# nmake
# nmake install
CONFIG += static
QMAKE_LFLAGS += -static
QMAKE_CXXFLAGS += /MT
QMAKE_CFLAGS += -O2 -MT
QMAKE_CXXFLAGS += -O2 -MT

DEFINES -= NDEBUG

CONFIG(release, debug|release) {
    message( "release" )
    LIBSPATH = $$PWD/../packages64bit/lib
}
CONFIG(debug, debug|release) {
    message( "debug" )
    LIBSPATH = $$PWD/../packages64bit/debug/lib
}

HEADERS += $$PWD/win/unistd.h
INCLUDEPATH += $$PWD/win

#Command to install dependencies (Static)
#vcpkg.exe install boost:x64-windows-static berkeleydb:x64-windows-static leveldb:x64-windows-static libevent:x64-windows-static lua:x64-windows-static openssl:x64-windows-static zlib:x64-windows-static
#Command to install dependencies (Dynamic)
#vcpkg.exe install boost:x64-windows berkeleydb:x64-windows leveldb:x64-windows libevent:x64-windows lua:x64-windows openssl:x64-windows zlib:x64-windows
DEFINES += BOOST_ASIO_ENABLE_OLD_SERVICES BOOST_SPIRIT_THREADSAFE BOOST_THREAD_USE_LIB
#DEFINES += BOOST_DISABLE_CURRENT_FUNCTION

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

LIBS += -L$${LIBSPATH}/ -llua
PRE_TARGETDEPS += $${LIBSPATH}/lua.lib
LIBS += -L$${LIBSPATH} -lboost_chrono-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_chrono-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_filesystem-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_filesystem-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_program_options-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_program_options-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_system-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_system-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_thread-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_thread-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lboost_unit_test_framework-vc140-mt
PRE_TARGETDEPS += $${LIBSPATH}/boost_unit_test_framework-vc140-mt.lib
LIBS += -L$${LIBSPATH}/ -lzlib
PRE_TARGETDEPS += $${LIBSPATH}/zlib.lib
LIBS += -L$${LIBSPATH}/ -llibcryptoMD
PRE_TARGETDEPS += $${LIBSPATH}/libcryptoMD.lib
LIBS += -L$${LIBSPATH}/ -llibsslMD
PRE_TARGETDEPS += $${LIBSPATH}/libsslMD.lib
LIBS += -L$${LIBSPATH}/ -levent
PRE_TARGETDEPS += $${LIBSPATH}/event.lib
LIBS += -L$${LIBSPATH}/ -levent_core
PRE_TARGETDEPS += $${LIBSPATH}/event_core.lib
LIBS += -L$${LIBSPATH}/ -levent_extra
PRE_TARGETDEPS += $${LIBSPATH}/event_extra.lib
LIBS += -L$${LIBSPATH}/ -lWS2_32
PRE_TARGETDEPS += $${LIBSPATH}/WS2_32.lib
LIBS += -L$${LIBSPATH}/ -lAdvAPI32
PRE_TARGETDEPS += $${LIBSPATH}/AdvAPI32.lib
LIBS += -L$${LIBSPATH}/ -lshell32
PRE_TARGETDEPS += $${LIBSPATH}/shell32.lib
LIBS += -L$${LIBSPATH}/ -lUser32
PRE_TARGETDEPS += $${LIBSPATH}/User32.lib
LIBS += -L$${LIBSPATH}/ -lCrypt32
PRE_TARGETDEPS += $${LIBSPATH}/Crypt32.lib
#ShLwApi
LIBS += -L$${LIBSPATH}/ -lShLwApi
PRE_TARGETDEPS += $${LIBSPATH}/ShLwApi.lib

#LevelDB from VCPKG
LIBS += -L$${LIBSPATH}/ -llibleveldb
PRE_TARGETDEPS += $${LIBSPATH}/libleveldb.lib
#BerklyDB4.8 from our project repo (VCPKG version is not supported)
LIBS += -L$${LIBSPATH}/ -llibdb48
PRE_TARGETDEPS += $${LIBSPATH}/libdb48.lib
#libdb_stl48.lib (We need both libdb and libdbstl (Standered library)
LIBS += -L$${LIBSPATH}/ -llibdb_stl48
PRE_TARGETDEPS += $${LIBSPATH}/libdb_stl48.lib

#LIBS += -L$$PWD/../tor/ -ltorlib
#PRE_TARGETDEPS += $$PWD/../tor/torlib.lib
LIBS += -L$$PWD/../leveldb/ -lleveldblib
PRE_TARGETDEPS += $$PWD/../leveldb/leveldblib.lib
#LIBS += -L$$PWD/../db4.8/ -lberkeleydblib
#PRE_TARGETDEPS += $$PWD/../db4.8/berkeleydblib.lib

QMAKE_CFLAGS_WARN_ON -= -W3
QMAKE_CFLAGS_WARN_ON += -W2

QMAKE_CXXFLAGS_WARN_ON -= -W3
QMAKE_CXXFLAGS_WARN_ON += -W2

QMAKE_CXXFLAGS += -O2 -D_FORTIFY_SOURCE=1
QMAKE_CFLAGS += /std:c++17
QMAKE_CXXFLAGS += /std:c++17


Fixed problem with /usr/lib being first in link dirs by using QMAKE_LIBDIR to specify projects lib dir.

# This file assumes it's being included by first level subdir .pro

EDITORLIBDIR = ../libtdrivereditor
EDITOR_LIB = tdrivereditor

UTILLIBDIR = ../libtdriverutil
UTIL_LIB = tdriverutil

EDITOR_PROTO_DIR=../editor_proto

DESTDIR = ../bin
QMAKE_LIBDIR = $$DESTDIR $$QMAKE_LIBDIR

# This file assumes it's being included by first level subdir .pro

EDITORLIBDIR = ../libtdrivereditor
EDITOR_LIB = tdrivereditor

UTILLIBDIR = ../libtdriverutil
UTIL_LIB = tdriverutil

EDITOR_PROTO_DIR=../editor_proto

DESTDIR = ../bin
LIBS += -L$$DESTDIR


Add Rope files

Add Rope files

# Box2D sources
INCLUDEPATH += $$PWD
SOURCES = \
        $$PWD/Collision/*.cpp \
        $$PWD/Collision/Shapes/*.cpp \
        $$PWD/Common/*.cpp \
        $$PWD/Dynamics/*.cpp \
        $$PWD/Dynamics/Contacts/*.cpp \
        $$PWD/Dynamics/Joints/*.cpp \
        $$PWD/Rope/*.cpp

HEADERS = \
	$$PWD/Box2D.h \
        $$PWD/Collision/*.h \
        $$PWD/Collision/Shapes/*.h \
        $$PWD/Common/*.h \
        $$PWD/Dynamics/*.h \
        $$PWD/Dynamics/Contacts/*.h \
        $$PWD/Dynamics/Joints/*.h \
        $$PWD/Rope/*.h

# Box2D sources
INCLUDEPATH += $$PWD
SOURCES = \
        $$PWD/Collision/*.cpp \
        $$PWD/Collision/Shapes/*.cpp \
        $$PWD/Common/*.cpp \
        $$PWD/Dynamics/*.cpp \
        $$PWD/Dynamics/Contacts/*.cpp \
        $$PWD/Dynamics/Joints/*.cpp

HEADERS = \
	$$PWD/Box2D.h \
        $$PWD/Collision/*.h \
        $$PWD/Collision/Shapes/*.h \
        $$PWD/Common/*.h \
        $$PWD/Dynamics/*.h \
        $$PWD/Dynamics/Contacts/*.h \
        $$PWD/Dynamics/Joints/*.h


Correct paths for .pri file.

Correct paths for .pri file.

# Copyright c1997-2005 Trygve Isaacson. All rights reserved.
# This file is part of the Code Vault version 2.3.2
# http://www.bombaydigital.com/

#
# This is a qmake include file -- to be included from a .pro file.
#
# Because paths are relative to the main file (not this one), this
# file relies on the main file defining the variable $${BASE} so
# that this file can specify paths correctly.
#

win32:LIBS += wsock32.lib

debug {
DEFINES += V_DEBUG
}

macx {
CONFIG += = vault_mac
} else:unix {
CONFIG += = vault_unix
} else:win32 {
CONFIG += = vault_win32
}

vault_mac {
DEPENDPATH += $${BASE}/source/vtypes/_mac
DEPENDPATH += $${BASE}/source/threads/_unix
DEPENDPATH += $${BASE}/source/sockets/_unix

INCLUDEPATH += $${BASE}/source/vtypes/_mac
INCLUDEPATH += $${BASE}/source/threads/_unix
INCLUDEPATH += $${BASE}/source/sockets/_unix

HEADERS += $${BASE}/source/vtypes/_mac/vtypes_platform.h
SOURCES += $${BASE}/source/vtypes/_mac/vtypes_platform.cpp
SOURCES += $${BASE}/source/containers/_unix/vinstant_platform.cpp
HEADERS += $${BASE}/source/threads/_unix/vthread_platform.h
SOURCES += $${BASE}/source/threads/_unix/vthread_platform.cpp
HEADERS += $${BASE}/source/sockets/_unix/vsocket.h
SOURCES += $${BASE}/source/sockets/_unix/vsocket.cpp
}

vault_unix {
DEPENDPATH += $${BASE}/source/vtypes/_unix
DEPENDPATH += $${BASE}/source/threads/_unix
DEPENDPATH += $${BASE}/source/sockets/_unix

INCLUDEPATH += $${BASE}/source/vtypes/_unix
INCLUDEPATH += $${BASE}/source/threads/_unix
INCLUDEPATH += $${BASE}/source/sockets/_unix

HEADERS += $${BASE}/source/vtypes/_unix/vtypes_platform.h
SOURCES += $${BASE}/source/vtypes/_unix/vtypes_platform.cpp
SOURCES += $${BASE}/source/containers/_unix/vinstant_platform.cpp
HEADERS += $${BASE}/source/threads/_unix/vthread_platform.h
SOURCES += $${BASE}/source/threads/_unix/vthread_platform.cpp
HEADERS += $${BASE}/source/sockets/_unix/vsocket.h
SOURCES += $${BASE}/source/sockets/_unix/vsocket.cpp
}

vault_win32 {
DEPENDPATH += $${BASE}/source/vtypes/_win
DEPENDPATH += $${BASE}/source/threads/_win
DEPENDPATH += $${BASE}/source/sockets/_win

INCLUDEPATH += $${BASE}/source/vtypes/_win
INCLUDEPATH += $${BASE}/source/threads/_win
INCLUDEPATH += $${BASE}/source/sockets/_win

HEADERS += $${BASE}/source/vtypes/_win/vtypes_platform.h
SOURCES += $${BASE}/source/vtypes/_win/vtypes_platform.cpp
SOURCES += $${BASE}/source/containers/_win/vinstant_platform.cpp
HEADERS += $${BASE}/source/threads/_win/vthread_platform.h
SOURCES += $${BASE}/source/threads/_win/vthread_platform.cpp
HEADERS += $${BASE}/source/sockets/_win/vsocket.h
SOURCES += $${BASE}/source/sockets/_win/vsocket.cpp
}

DEPENDPATH += $${BASE}/source
DEPENDPATH += $${BASE}/source/containers
DEPENDPATH += $${BASE}/source/files
DEPENDPATH += $${BASE}/source/server
DEPENDPATH += $${BASE}/source/sockets
DEPENDPATH += $${BASE}/source/streams
DEPENDPATH += $${BASE}/source/threads
DEPENDPATH += $${BASE}/source/toolbox
DEPENDPATH += $${BASE}/source/unittest
DEPENDPATH += $${BASE}/source/vtypes

INCLUDEPATH += $${BASE}/source
INCLUDEPATH += $${BASE}/source/containers
INCLUDEPATH += $${BASE}/source/files
INCLUDEPATH += $${BASE}/source/server
INCLUDEPATH += $${BASE}/source/sockets
INCLUDEPATH += $${BASE}/source/streams
INCLUDEPATH += $${BASE}/source/threads
INCLUDEPATH += $${BASE}/source/toolbox
INCLUDEPATH += $${BASE}/source/unittest
INCLUDEPATH += $${BASE}/source/vtypes

HEADERS += $${BASE}/source/vault.h
HEADERS += $${BASE}/source/vtypes/vtypes.h
SOURCES += $${BASE}/source/vtypes/vtypes.cpp
HEADERS += $${BASE}/source/containers/vbento.h
SOURCES += $${BASE}/source/containers/vbento.cpp
HEADERS += $${BASE}/source/containers/vchar.h
SOURCES += $${BASE}/source/containers/vchar.cpp
HEADERS += $${BASE}/source/containers/vexception.h
SOURCES += $${BASE}/source/containers/vexception.cpp
HEADERS += $${BASE}/source/containers/vinstant.h
SOURCES += $${BASE}/source/containers/vinstant.cpp
HEADERS += $${BASE}/source/containers/vstring.h
SOURCES += $${BASE}/source/containers/vstring.cpp
HEADERS += $${BASE}/source/files/vbufferedfilestream.h
SOURCES += $${BASE}/source/files/vbufferedfilestream.cpp
HEADERS += $${BASE}/source/files/vfilestream.h
SOURCES += $${BASE}/source/files/vfilestream.cpp
HEADERS += $${BASE}/source/files/vfsnode.h
SOURCES += $${BASE}/source/files/vfsnode.cpp
HEADERS += $${BASE}/source/server/vlistenersocket.h
SOURCES += $${BASE}/source/server/vlistenersocket.cpp
HEADERS += $${BASE}/source/server/vlistenerthread.h
SOURCES += $${BASE}/source/server/vlistenerthread.cpp
HEADERS += $${BASE}/source/server/vmanagementinterface.h
HEADERS += $${BASE}/source/sockets/vsocketbase.h
SOURCES += $${BASE}/source/sockets/vsocketbase.cpp
HEADERS += $${BASE}/source/sockets/vsocketfactory.h
SOURCES += $${BASE}/source/sockets/vsocketfactory.cpp
HEADERS += $${BASE}/source/sockets/vsocketstream.h
SOURCES += $${BASE}/source/sockets/vsocketstream.cpp
HEADERS += $${BASE}/source/sockets/vsocketthread.h
SOURCES += $${BASE}/source/sockets/vsocketthread.cpp
HEADERS += $${BASE}/source/sockets/vsocketthreadfactory.h
HEADERS += $${BASE}/source/streams/vbinaryiostream.h
SOURCES += $${BASE}/source/streams/vbinaryiostream.cpp
HEADERS += $${BASE}/source/streams/viostream.h
SOURCES += $${BASE}/source/streams/viostream.cpp
HEADERS += $${BASE}/source/streams/vmemorystream.h
SOURCES += $${BASE}/source/streams/vmemorystream.cpp
HEADERS += $${BASE}/source/streams/vstream.h
SOURCES += $${BASE}/source/streams/vstream.cpp
HEADERS += $${BASE}/source/streams/vstreamcopier.h
SOURCES += $${BASE}/source/streams/vstreamcopier.cpp
HEADERS += $${BASE}/source/streams/vtextiostream.h
SOURCES += $${BASE}/source/streams/vtextiostream.cpp
HEADERS += $${BASE}/source/streams/vwritebufferedstream.h
SOURCES += $${BASE}/source/streams/vwritebufferedstream.cpp
HEADERS += $${BASE}/source/threads/vmutex.h
SOURCES += $${BASE}/source/threads/vmutex.cpp
HEADERS += $${BASE}/source/threads/vmutexlocker.h
SOURCES += $${BASE}/source/threads/vmutexlocker.cpp
HEADERS += $${BASE}/source/threads/vsemaphore.h
SOURCES += $${BASE}/source/threads/vsemaphore.cpp
HEADERS += $${BASE}/source/threads/vthread.h
SOURCES += $${BASE}/source/threads/vthread.cpp
HEADERS += $${BASE}/source/toolbox/vclassregistry.h
SOURCES += $${BASE}/source/toolbox/vclassregistry.cpp
HEADERS += $${BASE}/source/toolbox/vhex.h
SOURCES += $${BASE}/source/toolbox/vhex.cpp
HEADERS += $${BASE}/source/toolbox/vlogger.h
SOURCES += $${BASE}/source/toolbox/vlogger.cpp
HEADERS += $${BASE}/source/toolbox/vsettings.h
SOURCES += $${BASE}/source/toolbox/vsettings.cpp
HEADERS += $${BASE}/source/toolbox/vshutdownregistry.h
SOURCES += $${BASE}/source/toolbox/vshutdownregistry.cpp
HEADERS += $${BASE}/source/toolbox/vsingleton.h
HEADERS += $${BASE}/source/unittest/vbentounit.h
SOURCES += $${BASE}/source/unittest/vbentounit.cpp
HEADERS += $${BASE}/source/unittest/vbinaryiounit.h
SOURCES += $${BASE}/source/unittest/vbinaryiounit.cpp
HEADERS += $${BASE}/source/unittest/vcharunit.h
SOURCES += $${BASE}/source/unittest/vcharunit.cpp
HEADERS += $${BASE}/source/unittest/vclassregistryunit.h
SOURCES += $${BASE}/source/unittest/vclassregistryunit.cpp
HEADERS += $${BASE}/source/unittest/vexceptionunit.h
SOURCES += $${BASE}/source/unittest/vexceptionunit.cpp
HEADERS += $${BASE}/source/unittest/vfsnodeunit.h
SOURCES += $${BASE}/source/unittest/vfsnodeunit.cpp
HEADERS += $${BASE}/source/unittest/vhexunit.h
SOURCES += $${BASE}/source/unittest/vhexunit.cpp
HEADERS += $${BASE}/source/unittest/vinstantunit.h
SOURCES += $${BASE}/source/unittest/vinstantunit.cpp
HEADERS += $${BASE}/source/unittest/vstreamsunit.h
SOURCES += $${BASE}/source/unittest/vstreamsunit.cpp
HEADERS += $${BASE}/source/unittest/vstringunit.h
SOURCES += $${BASE}/source/unittest/vstringunit.cpp
HEADERS += $${BASE}/source/unittest/vthreadsunit.h
SOURCES += $${BASE}/source/unittest/vthreadsunit.cpp
HEADERS += $${BASE}/source/unittest/vunit.h
SOURCES += $${BASE}/source/unittest/vunit.cpp
HEADERS += $${BASE}/source/unittest/vunitrunall.h
SOURCES += $${BASE}/source/unittest/vunitrunall.cpp

# Copyright c1997-2005 Trygve Isaacson. All rights reserved.
# This file is part of the Code Vault version 2.3.2
# http://www.bombaydigital.com/

#
# This is a qmake include file -- to be included from a .pro file.
#
# Because paths are relative to the main file (not this one), this
# file relies on the main file defining the variable $${BASE} so
# that this file can specify paths correctly.
#

win32:LIBS += wsock32.lib

debug {
DEFINES += V_DEBUG
}

macx {
CONFIG += = vault_mac
} else:unix {
CONFIG += = vault_unix
} else:win32 {
CONFIG += = vault_win32
}

vault_mac {
DEPENDPATH += $${BASE}/common/lib/vault/source/vtypes/_mac
DEPENDPATH += $${BASE}/common/lib/vault/source/threads/_unix
DEPENDPATH += $${BASE}/common/lib/vault/source/sockets/_unix

INCLUDEPATH += $${BASE}/common/lib/vault/source/vtypes/_mac
INCLUDEPATH += $${BASE}/common/lib/vault/source/threads/_unix
INCLUDEPATH += $${BASE}/common/lib/vault/source/sockets/_unix

HEADERS += $${BASE}/common/lib/vault/source/vtypes/_mac/vtypes_platform.h
SOURCES += $${BASE}/common/lib/vault/source/vtypes/_mac/vtypes_platform.cpp
SOURCES += $${BASE}/common/lib/vault/source/containers/_unix/vinstant_platform.cpp
HEADERS += $${BASE}/common/lib/vault/source/threads/_unix/vthread_platform.h
SOURCES += $${BASE}/common/lib/vault/source/threads/_unix/vthread_platform.cpp
HEADERS += $${BASE}/common/lib/vault/source/sockets/_unix/vsocket.h
SOURCES += $${BASE}/common/lib/vault/source/sockets/_unix/vsocket.cpp
}

vault_unix {
DEPENDPATH += $${BASE}/common/lib/vault/source/vtypes/_unix
DEPENDPATH += $${BASE}/common/lib/vault/source/threads/_unix
DEPENDPATH += $${BASE}/common/lib/vault/source/sockets/_unix

INCLUDEPATH += $${BASE}/common/lib/vault/source/vtypes/_unix
INCLUDEPATH += $${BASE}/common/lib/vault/source/threads/_unix
INCLUDEPATH += $${BASE}/common/lib/vault/source/sockets/_unix

HEADERS += $${BASE}/common/lib/vault/source/vtypes/_unix/vtypes_platform.h
SOURCES += $${BASE}/common/lib/vault/source/vtypes/_unix/vtypes_platform.cpp
SOURCES += $${BASE}/common/lib/vault/source/containers/_unix/vinstant_platform.cpp
HEADERS += $${BASE}/common/lib/vault/source/threads/_unix/vthread_platform.h
SOURCES += $${BASE}/common/lib/vault/source/threads/_unix/vthread_platform.cpp
HEADERS += $${BASE}/common/lib/vault/source/sockets/_unix/vsocket.h
SOURCES += $${BASE}/common/lib/vault/source/sockets/_unix/vsocket.cpp
}

vault_win32 {
DEPENDPATH += $${BASE}/common/lib/vault/source/vtypes/_win
DEPENDPATH += $${BASE}/common/lib/vault/source/threads/_win
DEPENDPATH += $${BASE}/common/lib/vault/source/sockets/_win

INCLUDEPATH += $${BASE}/common/lib/vault/source/vtypes/_win
INCLUDEPATH += $${BASE}/common/lib/vault/source/threads/_win
INCLUDEPATH += $${BASE}/common/lib/vault/source/sockets/_win

HEADERS += $${BASE}/common/lib/vault/source/vtypes/_win/vtypes_platform.h
SOURCES += $${BASE}/common/lib/vault/source/vtypes/_win/vtypes_platform.cpp
SOURCES += $${BASE}/common/lib/vault/source/containers/_win/vinstant_platform.cpp
HEADERS += $${BASE}/common/lib/vault/source/threads/_win/vthread_platform.h
SOURCES += $${BASE}/common/lib/vault/source/threads/_win/vthread_platform.cpp
HEADERS += $${BASE}/common/lib/vault/source/sockets/_win/vsocket.h
SOURCES += $${BASE}/common/lib/vault/source/sockets/_win/vsocket.cpp
}

DEPENDPATH += $${BASE}/common/lib/vault/source
DEPENDPATH += $${BASE}/common/lib/vault/source/containers
DEPENDPATH += $${BASE}/common/lib/vault/source/files
DEPENDPATH += $${BASE}/common/lib/vault/source/server
DEPENDPATH += $${BASE}/common/lib/vault/source/sockets
DEPENDPATH += $${BASE}/common/lib/vault/source/streams
DEPENDPATH += $${BASE}/common/lib/vault/source/threads
DEPENDPATH += $${BASE}/common/lib/vault/source/toolbox
DEPENDPATH += $${BASE}/common/lib/vault/source/unittest
DEPENDPATH += $${BASE}/common/lib/vault/source/vtypes

INCLUDEPATH += $${BASE}/common/lib/vault/source
INCLUDEPATH += $${BASE}/common/lib/vault/source/containers
INCLUDEPATH += $${BASE}/common/lib/vault/source/files
INCLUDEPATH += $${BASE}/common/lib/vault/source/server
INCLUDEPATH += $${BASE}/common/lib/vault/source/sockets
INCLUDEPATH += $${BASE}/common/lib/vault/source/streams
INCLUDEPATH += $${BASE}/common/lib/vault/source/threads
INCLUDEPATH += $${BASE}/common/lib/vault/source/toolbox
INCLUDEPATH += $${BASE}/common/lib/vault/source/unittest
INCLUDEPATH += $${BASE}/common/lib/vault/source/vtypes

HEADERS += $${BASE}/common/lib/vault/source/vault.h
HEADERS += $${BASE}/common/lib/vault/source/vtypes/vtypes.h
SOURCES += $${BASE}/common/lib/vault/source/vtypes/vtypes.cpp
HEADERS += $${BASE}/common/lib/vault/source/containers/vbento.h
SOURCES += $${BASE}/common/lib/vault/source/containers/vbento.cpp
HEADERS += $${BASE}/common/lib/vault/source/containers/vchar.h
SOURCES += $${BASE}/common/lib/vault/source/containers/vchar.cpp
HEADERS += $${BASE}/common/lib/vault/source/containers/vexception.h
SOURCES += $${BASE}/common/lib/vault/source/containers/vexception.cpp
HEADERS += $${BASE}/common/lib/vault/source/containers/vinstant.h
SOURCES += $${BASE}/common/lib/vault/source/containers/vinstant.cpp
HEADERS += $${BASE}/common/lib/vault/source/containers/vstring.h
SOURCES += $${BASE}/common/lib/vault/source/containers/vstring.cpp
HEADERS += $${BASE}/common/lib/vault/source/files/vbufferedfilestream.h
SOURCES += $${BASE}/common/lib/vault/source/files/vbufferedfilestream.cpp
HEADERS += $${BASE}/common/lib/vault/source/files/vfilestream.h
SOURCES += $${BASE}/common/lib/vault/source/files/vfilestream.cpp
HEADERS += $${BASE}/common/lib/vault/source/files/vfsnode.h
SOURCES += $${BASE}/common/lib/vault/source/files/vfsnode.cpp
HEADERS += $${BASE}/common/lib/vault/source/server/vlistenersocket.h
SOURCES += $${BASE}/common/lib/vault/source/server/vlistenersocket.cpp
HEADERS += $${BASE}/common/lib/vault/source/server/vlistenerthread.h
SOURCES += $${BASE}/common/lib/vault/source/server/vlistenerthread.cpp
HEADERS += $${BASE}/common/lib/vault/source/server/vmanagementinterface.h
HEADERS += $${BASE}/common/lib/vault/source/sockets/vsocketbase.h
SOURCES += $${BASE}/common/lib/vault/source/sockets/vsocketbase.cpp
HEADERS += $${BASE}/common/lib/vault/source/sockets/vsocketfactory.h
SOURCES += $${BASE}/common/lib/vault/source/sockets/vsocketfactory.cpp
HEADERS += $${BASE}/common/lib/vault/source/sockets/vsocketstream.h
SOURCES += $${BASE}/common/lib/vault/source/sockets/vsocketstream.cpp
HEADERS += $${BASE}/common/lib/vault/source/sockets/vsocketthread.h
SOURCES += $${BASE}/common/lib/vault/source/sockets/vsocketthread.cpp
HEADERS += $${BASE}/common/lib/vault/source/sockets/vsocketthreadfactory.h
HEADERS += $${BASE}/common/lib/vault/source/streams/vbinaryiostream.h
SOURCES += $${BASE}/common/lib/vault/source/streams/vbinaryiostream.cpp
HEADERS += $${BASE}/common/lib/vault/source/streams/viostream.h
SOURCES += $${BASE}/common/lib/vault/source/streams/viostream.cpp
HEADERS += $${BASE}/common/lib/vault/source/streams/vmemorystream.h
SOURCES += $${BASE}/common/lib/vault/source/streams/vmemorystream.cpp
HEADERS += $${BASE}/common/lib/vault/source/streams/vstream.h
SOURCES += $${BASE}/common/lib/vault/source/streams/vstream.cpp
HEADERS += $${BASE}/common/lib/vault/source/streams/vstreamcopier.h
SOURCES += $${BASE}/common/lib/vault/source/streams/vstreamcopier.cpp
HEADERS += $${BASE}/common/lib/vault/source/streams/vtextiostream.h
SOURCES += $${BASE}/common/lib/vault/source/streams/vtextiostream.cpp
HEADERS += $${BASE}/common/lib/vault/source/streams/vwritebufferedstream.h
SOURCES += $${BASE}/common/lib/vault/source/streams/vwritebufferedstream.cpp
HEADERS += $${BASE}/common/lib/vault/source/threads/vmutex.h
SOURCES += $${BASE}/common/lib/vault/source/threads/vmutex.cpp
HEADERS += $${BASE}/common/lib/vault/source/threads/vmutexlocker.h
SOURCES += $${BASE}/common/lib/vault/source/threads/vmutexlocker.cpp
HEADERS += $${BASE}/common/lib/vault/source/threads/vsemaphore.h
SOURCES += $${BASE}/common/lib/vault/source/threads/vsemaphore.cpp
HEADERS += $${BASE}/common/lib/vault/source/threads/vthread.h
SOURCES += $${BASE}/common/lib/vault/source/threads/vthread.cpp
HEADERS += $${BASE}/common/lib/vault/source/toolbox/vclassregistry.h
SOURCES += $${BASE}/common/lib/vault/source/toolbox/vclassregistry.cpp
HEADERS += $${BASE}/common/lib/vault/source/toolbox/vhex.h
SOURCES += $${BASE}/common/lib/vault/source/toolbox/vhex.cpp
HEADERS += $${BASE}/common/lib/vault/source/toolbox/vlogger.h
SOURCES += $${BASE}/common/lib/vault/source/toolbox/vlogger.cpp
HEADERS += $${BASE}/common/lib/vault/source/toolbox/vsettings.h
SOURCES += $${BASE}/common/lib/vault/source/toolbox/vsettings.cpp
HEADERS += $${BASE}/common/lib/vault/source/toolbox/vshutdownregistry.h
SOURCES += $${BASE}/common/lib/vault/source/toolbox/vshutdownregistry.cpp
HEADERS += $${BASE}/common/lib/vault/source/toolbox/vsingleton.h
HEADERS += $${BASE}/common/lib/vault/source/unittest/vbentounit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vbentounit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vbinaryiounit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vbinaryiounit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vcharunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vcharunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vclassregistryunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vclassregistryunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vexceptionunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vexceptionunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vfsnodeunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vfsnodeunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vhexunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vhexunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vinstantunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vinstantunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vstreamsunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vstreamsunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vstringunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vstringunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vthreadsunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vthreadsunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vunit.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vunit.cpp
HEADERS += $${BASE}/common/lib/vault/source/unittest/vunitrunall.h
SOURCES += $${BASE}/common/lib/vault/source/unittest/vunitrunall.cpp


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

QT       += testlib
QT       -= gui

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

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

QT       += testlib
QT       -= gui

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

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


Fix ios build

Fix ios build

core_mac:CONFIG += apple_platform
core_ios:CONFIG += apple_platform

apple_platform {
	CONFIG += socketrocket
} else {
	CONFIG += ixwebsocket
}

HEADERS += \
	$$PWD/include/websocket.h \
	$$PWD/src/websocketbase.h

SOURCES += $$PWD/src/managerwebsocket.cpp

ixwebsocket {

    DEFINES += USE_IXWEBSOCKET
    include($$PWD/../../3dParty/ixwebsocket/ixwebsocket.pri)

    HEADERS += $$PWD/src/ixwebsocket/ixwebsocket_internal.h
    SOURCES += $$PWD/src/ixwebsocket/ixwebsocket_internal.cpp

    CONFIG += use_zlib

}

use_zlib {
    ZLIB_SOURCES = $$PWD/../../../OfficeUtils/src/zlib-1.2.11
    INCLUDEPATH += $$ZLIB_SOURCES
    SOURCES += \
        $$ZLIB_SOURCES/adler32.c \
        $$ZLIB_SOURCES/compress.c \
        $$ZLIB_SOURCES/crc32.c \
        $$ZLIB_SOURCES/deflate.c \
        $$ZLIB_SOURCES/gzclose.c \
        $$ZLIB_SOURCES/gzlib.c \
        $$ZLIB_SOURCES/gzread.c \
        $$ZLIB_SOURCES/gzwrite.c \
        $$ZLIB_SOURCES/infback.c \
        $$ZLIB_SOURCES/inffast.c \
        $$ZLIB_SOURCES/inflate.c \
        $$ZLIB_SOURCES/inftrees.c \
        $$ZLIB_SOURCES/trees.c \
        $$ZLIB_SOURCES/uncompr.c \
        $$ZLIB_SOURCES/zutil.c
}

socketrocket {

    DEFINES += USE_SOCKETROCKET
    include($$PWD/../../3dParty/socketrocket/socketrocket.pri)

    HEADERS += \
        $$PWD/src/socketrocket/socketRocket_objc.h \
        $$PWD/src/socketrocket/socketRocket_internal.h \

    OBJECTIVE_SOURCES += \
        $$PWD/src/socketrocket/socketRocket_objc.mm \
        $$PWD/src/socketrocket/socketRocket_internal.mm

}

CONFIG += ixwebsocket
core_mac:CONFIG += socketrocket
core_ios:CONFIG += socketrocket

HEADERS += \
	$$PWD/include/websocket.h \
	$$PWD/src/websocketbase.h

SOURCES += $$PWD/src/managerwebsocket.cpp

ixwebsocket {

    DEFINES += USE_IXWEBSOCKET
    include($$PWD/../../3dParty/ixwebsocket/ixwebsocket.pri)

    HEADERS += $$PWD/src/ixwebsocket/ixwebsocket_internal.h
    SOURCES += $$PWD/src/ixwebsocket/ixwebsocket_internal.cpp

    CONFIG += use_zlib

}

use_zlib {
    ZLIB_SOURCES = $$PWD/../../../OfficeUtils/src/zlib-1.2.11
    INCLUDEPATH += $$ZLIB_SOURCES
    SOURCES += \
        $$ZLIB_SOURCES/adler32.c \
        $$ZLIB_SOURCES/compress.c \
        $$ZLIB_SOURCES/crc32.c \
        $$ZLIB_SOURCES/deflate.c \
        $$ZLIB_SOURCES/gzclose.c \
        $$ZLIB_SOURCES/gzlib.c \
        $$ZLIB_SOURCES/gzread.c \
        $$ZLIB_SOURCES/gzwrite.c \
        $$ZLIB_SOURCES/infback.c \
        $$ZLIB_SOURCES/inffast.c \
        $$ZLIB_SOURCES/inflate.c \
        $$ZLIB_SOURCES/inftrees.c \
        $$ZLIB_SOURCES/trees.c \
        $$ZLIB_SOURCES/uncompr.c \
        $$ZLIB_SOURCES/zutil.c
}

socketrocket {

    DEFINES += USE_SOCKETROCKET
    include($$PWD/../../3dParty/socketrocket/socketrocket.pri)

    HEADERS += \
        $$PWD/src/socketrocket/socketRocket_objc.h \
        $$PWD/src/socketrocket/socketRocket_internal.h \

    OBJECTIVE_SOURCES += \
        $$PWD/src/socketrocket/socketRocket_objc.mm \
        $$PWD/src/socketrocket/socketRocket_internal.mm

}


Update binary artifacts branch

Update binary artifacts branch

Change-Id: Iea998510555e3762e6a8457bb6e998c3533c2dee
Reviewed-by: David Schulz <f07954e8cc0c222cd136162588d217f330598215@digia.com>

!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
QTCREATOR_PRI_INCLUDED = 1

QTCREATOR_VERSION = 3.0.81
QTCREATOR_COMPAT_VERSION = 3.0.81
BINARY_ARTIFACTS_BRANCH = 3.1

# enable c++11 on everything but mac/release (breaks 10.6)
!macx|CONFIG(debug, debug|release): CONFIG += c++11

isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
    return($$clean_path($$1))
}

defineReplace(targetPath) {
    return($$shell_path($$1))
}

} else { # qt5

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) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

} # qt5

defineReplace(qtLibraryName) {
   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)
}

defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
    return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

# 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($$_PRO_FILE_PWD_/)||$$i_flag
    return($$out)
}

} # qt5

!isEmpty(BUILD_TESTS):TEST = 1

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

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

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
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
    copydata = 1
    !isEqual(QT_MAJOR_VERSION, 5) {
        # we use @rpath which is 10.5+
        # Qt5 doesn't support 10.5, and will set the minimum version to 10.6 or 10.7.
        QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
        QMAKE_LFLAGS *= -mmacosx-version-min=10.5
    }
} else {
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
    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
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
    IDE_BIN_PATH     = $$IDE_APP_PATH
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

QTC_PLUGIN_DIRS = $$(QTC_PLUGIN_DIRS)
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
for(dir, QTC_PLUGIN_DIRS) {
    INCLUDEPATH += $$dir
}

CONFIG += depend_includepath

LIBS += -L$$IDE_LIBRARY_PATH

!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS 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
}

win32-msvc* {
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
    # Speed up startup time when debugging with cdb
    QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
}

qt:greaterThan(QT_MAJOR_VERSION, 4) {
    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}

QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
exists($$QBSFILE):OTHER_FILES += $$QBSFILE

# recursively resolve plugin deps
done_plugins =
for(ever) {
    isEmpty(QTC_PLUGIN_DEPENDS): \
        break()
    done_plugins += $$QTC_PLUGIN_DEPENDS
    for(dep, QTC_PLUGIN_DEPENDS) {
        dependencies_file =
        for(dir, QTC_PLUGIN_DIRS) {
            exists($$dir/$$dep/$${dep}_dependencies.pri) {
                dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
                break()
            }
        }
        isEmpty(dependencies_file): \
            error("Plugin dependency $$dep not found")
        include($$dependencies_file)
        LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
    }
    QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
    QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}

# recursively resolve library deps
done_libs =
for(ever) {
    isEmpty(QTC_LIB_DEPENDS): \
        break()
    done_libs += $$QTC_LIB_DEPENDS
    for(dep, QTC_LIB_DEPENDS) {
        include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
    }
    QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
    QTC_LIB_DEPENDS -= $$unique(done_libs)
}

!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
QTCREATOR_PRI_INCLUDED = 1

QTCREATOR_VERSION = 3.0.81
QTCREATOR_COMPAT_VERSION = 3.0.81
BINARY_ARTIFACTS_BRANCH = master

# enable c++11 on everything but mac/release (breaks 10.6)
!macx|CONFIG(debug, debug|release): CONFIG += c++11

isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
    return($$clean_path($$1))
}

defineReplace(targetPath) {
    return($$shell_path($$1))
}

} else { # qt5

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) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

} # qt5

defineReplace(qtLibraryName) {
   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)
}

defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
    return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

# 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($$_PRO_FILE_PWD_/)||$$i_flag
    return($$out)
}

} # qt5

!isEmpty(BUILD_TESTS):TEST = 1

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

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

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
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
    copydata = 1
    !isEqual(QT_MAJOR_VERSION, 5) {
        # we use @rpath which is 10.5+
        # Qt5 doesn't support 10.5, and will set the minimum version to 10.6 or 10.7.
        QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
        QMAKE_LFLAGS *= -mmacosx-version-min=10.5
    }
} else {
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
    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
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
    IDE_BIN_PATH     = $$IDE_APP_PATH
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

QTC_PLUGIN_DIRS = $$(QTC_PLUGIN_DIRS)
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
for(dir, QTC_PLUGIN_DIRS) {
    INCLUDEPATH += $$dir
}

CONFIG += depend_includepath

LIBS += -L$$IDE_LIBRARY_PATH

!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS 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
}

win32-msvc* {
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
    # Speed up startup time when debugging with cdb
    QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
}

qt:greaterThan(QT_MAJOR_VERSION, 4) {
    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}

QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
exists($$QBSFILE):OTHER_FILES += $$QBSFILE

# recursively resolve plugin deps
done_plugins =
for(ever) {
    isEmpty(QTC_PLUGIN_DEPENDS): \
        break()
    done_plugins += $$QTC_PLUGIN_DEPENDS
    for(dep, QTC_PLUGIN_DEPENDS) {
        dependencies_file =
        for(dir, QTC_PLUGIN_DIRS) {
            exists($$dir/$$dep/$${dep}_dependencies.pri) {
                dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
                break()
            }
        }
        isEmpty(dependencies_file): \
            error("Plugin dependency $$dep not found")
        include($$dependencies_file)
        LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
    }
    QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
    QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}

# recursively resolve library deps
done_libs =
for(ever) {
    isEmpty(QTC_LIB_DEPENDS): \
        break()
    done_libs += $$QTC_LIB_DEPENDS
    for(dep, QTC_LIB_DEPENDS) {
        include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
    }
    QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
    QTC_LIB_DEPENDS -= $$unique(done_libs)
}


Make C++11 unconditional

Make C++11 unconditional

Change-Id: I88d6f99a1fa714386337589e1edda66b66091151
Reviewed-by: hjk <f81b91af79013637d070c18d38a75b90eaae8ba3@nokiamail.com>
Reviewed-by: Daniel Teske <d8a411aec9a206efedb4d45b75fe8d13f1e2b628@digia.com>

!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
QTCREATOR_PRI_INCLUDED = 1

QTCREATOR_VERSION = 3.1.81
QTCREATOR_COMPAT_VERSION = 3.1.81
BINARY_ARTIFACTS_BRANCH = master

# enable c++11
isEqual(QT_MAJOR_VERSION, 5) {
    CONFIG += c++11
} else {
    macx {
        !macx-clang-libc++: error("You need to use the macx-clang-libc++ mkspec to compile Qt Creator (call qmake with '-spec unsupported/macx-clang-libc++')")
    } else:linux-g++* {
        QMAKE_CXXFLAGS += -std=c++0x
    } else:linux-icc* {
        QMAKE_CXXFLAGS += -std=c++11
    } else:linux-clang* {
        QMAKE_CXXFLAGS += -std=c++11
        QMAKE_LFLAGS += -stdlib=libc++ -lc++abi
    } else:win32-g++* {
        QMAKE_CXXFLAGS += -std=c++0x
    }
    # nothing to do for MSVC10+
}

isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
    return($$clean_path($$1))
}

defineReplace(targetPath) {
    return($$shell_path($$1))
}

} else { # qt5

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) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

} # qt5

defineReplace(qtLibraryName) {
   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)
}

defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
    return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

# 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($$_PRO_FILE_PWD_/)||$$i_flag
    return($$out)
}

} # qt5

!isEmpty(BUILD_TESTS):TEST = 1

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

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

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
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
    copydata = 1
} else {
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
    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
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
    IDE_BIN_PATH     = $$IDE_APP_PATH
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

QTC_PLUGIN_DIRS = $$(QTC_PLUGIN_DIRS)
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
for(dir, QTC_PLUGIN_DIRS) {
    INCLUDEPATH += $$dir
}

CONFIG += depend_includepath

LIBS += -L$$IDE_LIBRARY_PATH

!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS 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
}

win32-msvc* {
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
    # Speed up startup time when debugging with cdb
    QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
}

qt:greaterThan(QT_MAJOR_VERSION, 4) {
    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}

QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
exists($$QBSFILE):OTHER_FILES += $$QBSFILE

# recursively resolve plugin deps
done_plugins =
for(ever) {
    isEmpty(QTC_PLUGIN_DEPENDS): \
        break()
    done_plugins += $$QTC_PLUGIN_DEPENDS
    for(dep, QTC_PLUGIN_DEPENDS) {
        dependencies_file =
        for(dir, QTC_PLUGIN_DIRS) {
            exists($$dir/$$dep/$${dep}_dependencies.pri) {
                dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
                break()
            }
        }
        isEmpty(dependencies_file): \
            error("Plugin dependency $$dep not found")
        include($$dependencies_file)
        LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
    }
    QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
    QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}

# recursively resolve library deps
done_libs =
for(ever) {
    isEmpty(QTC_LIB_DEPENDS): \
        break()
    done_libs += $$QTC_LIB_DEPENDS
    for(dep, QTC_LIB_DEPENDS) {
        include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
    }
    QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
    QTC_LIB_DEPENDS -= $$unique(done_libs)
}

!isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included")
QTCREATOR_PRI_INCLUDED = 1

QTCREATOR_VERSION = 3.1.81
QTCREATOR_COMPAT_VERSION = 3.1.81
BINARY_ARTIFACTS_BRANCH = master

# enable c++11 on everything but mac/release (breaks 10.6)
!macx|CONFIG(debug, debug|release): CONFIG += c++11

isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
    return($$clean_path($$1))
}

defineReplace(targetPath) {
    return($$shell_path($$1))
}

} else { # qt5

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) {
    return($$replace(1, /, $$QMAKE_DIR_SEP))
}

} # qt5

defineReplace(qtLibraryName) {
   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)
}

defineTest(minQtVersion) {
    maj = $$1
    min = $$2
    patch = $$3
    isEqual(QT_MAJOR_VERSION, $$maj) {
        isEqual(QT_MINOR_VERSION, $$min) {
            isEqual(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
            greaterThan(QT_PATCH_VERSION, $$patch) {
                return(true)
            }
        }
        greaterThan(QT_MINOR_VERSION, $$min) {
            return(true)
        }
    }
    greaterThan(QT_MAJOR_VERSION, $$maj) {
        return(true)
    }
    return(false)
}

isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
    return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

# 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($$_PRO_FILE_PWD_/)||$$i_flag
    return($$out)
}

} # qt5

!isEmpty(BUILD_TESTS):TEST = 1

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

isEmpty(IDE_LIBRARY_BASENAME) {
    IDE_LIBRARY_BASENAME = lib
}

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
    IDE_DOC_PATH     = $$IDE_DATA_PATH/doc
    IDE_BIN_PATH     = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
    copydata = 1
    !isEqual(QT_MAJOR_VERSION, 5) {
        # we use @rpath which is 10.5+
        # Qt5 doesn't support 10.5, and will set the minimum version to 10.6 or 10.7.
        QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
        QMAKE_LFLAGS *= -mmacosx-version-min=10.5
    }
} else {
    contains(TEMPLATE, vc.*):vcproj = 1
    IDE_APP_TARGET   = qtcreator
    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
    IDE_DOC_PATH     = $$IDE_BUILD_TREE/share/doc/qtcreator
    IDE_BIN_PATH     = $$IDE_APP_PATH
    !isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
    $$IDE_BUILD_TREE/src \ # for <app/app_version.h>
    $$IDE_SOURCE_TREE/src/libs \
    $$IDE_SOURCE_TREE/tools

QTC_PLUGIN_DIRS = $$(QTC_PLUGIN_DIRS)
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
for(dir, QTC_PLUGIN_DIRS) {
    INCLUDEPATH += $$dir
}

CONFIG += depend_includepath

LIBS += -L$$IDE_LIBRARY_PATH

!isEmpty(vcproj) {
    DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
} else {
    DEFINES += IDE_LIBRARY_BASENAME=\\\"$$IDE_LIBRARY_BASENAME\\\"
}

DEFINES += QT_CREATOR QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS 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
}

win32-msvc* {
    #Don't warn about sprintf, fopen etc being 'unsafe'
    DEFINES += _CRT_SECURE_NO_WARNINGS
    # Speed up startup time when debugging with cdb
    QMAKE_LFLAGS_DEBUG += /INCREMENTAL:NO
}

qt:greaterThan(QT_MAJOR_VERSION, 4) {
    contains(QT, core): QT += concurrent
    contains(QT, gui): QT += widgets
    DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}

QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
exists($$QBSFILE):OTHER_FILES += $$QBSFILE

# recursively resolve plugin deps
done_plugins =
for(ever) {
    isEmpty(QTC_PLUGIN_DEPENDS): \
        break()
    done_plugins += $$QTC_PLUGIN_DEPENDS
    for(dep, QTC_PLUGIN_DEPENDS) {
        dependencies_file =
        for(dir, QTC_PLUGIN_DIRS) {
            exists($$dir/$$dep/$${dep}_dependencies.pri) {
                dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
                break()
            }
        }
        isEmpty(dependencies_file): \
            error("Plugin dependency $$dep not found")
        include($$dependencies_file)
        LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
    }
    QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
    QTC_PLUGIN_DEPENDS -= $$unique(done_plugins)
}

# recursively resolve library deps
done_libs =
for(ever) {
    isEmpty(QTC_LIB_DEPENDS): \
        break()
    done_libs += $$QTC_LIB_DEPENDS
    for(dep, QTC_LIB_DEPENDS) {
        include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri)
        LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
    }
    QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)
    QTC_LIB_DEPENDS -= $$unique(done_libs)
}


update version

update version


Typo in win32 build file

Typo in win32 build file

message("Win32 settings...")

# define supported windows version (windows 7 and up)
DEFINES += "_WIN32_WINNT=0x0601"

# embed the manifest on windows (visual studio 2005 and up)
CONFIG += embed_manifest_exe

# qjson
CONFIG(debug, debug|release) {
  LIBS += qjson.lib
} else {
  LIBS += qjson.lib
}

# boost
CONFIG(debug, debug|release) {
  win32-msvc2013 {
    LIBS += libboost_system-vc120-mt-gd-1_55.lib \
            libboost_thread-vc120-mt-gd-1_55.lib \
            libboost_date_time-vc120-mt-gd-1_55.lib
  }
} else {
  win32-msvc2013 {
    LIBS += libboost_system-vc120-mt-1_55.lib \
            libboost_thread-vc120-mt-1_55.lib \
            libboost_date_time-vc120-mt-1_55.lib
  }
}

# curl
CONFIG(debug, debug|release) {
  LIBS += curllib.lib
} else {
  LIBS += curllib.lib
}

message("win32 settings...")

# define supported windows version (windows 7 and up)
DEFINES += "_WIN32_WINNT=0x0601"

# embed the manifest on windows (visual studio 2005 and up)
CONFIG += embed_manifest_exe

# qjson
CONFIG(debug, debug|release) {
  LIBS += qjson.lib
} else {
  LIBS += qjson.lib
}

# boost
CONFIG(debug, debug|release) {
  win32-msvc2013 {
    LIBS += libboost_system-vc120-mt-gd-1_55.lib \
            libboost_thread-vc120-mt-gd-1_55.lib \
            libboost_date_time-vc120-mt-gd-1_55.lib
  }
} else {
  win32-msvc2013 {
    LIBS += libboost_system-vc120-mt-1_55.lib \
            libboost_thread-vc120-mt-1_55.lib \
            libboost_date_time-vc120-mt-1_55.lib
  }
}

# curl
CONFIG(debug, debug|release) {
  LIBS += curllib.lib
} else {
  LIBS += curllib.lib
}


Back to QLC+ 4 debug

Back to QLC+ 4 debug

#############################################################################
# Application name & version
#############################################################################

APPNAME    = Q Light Controller Plus
FXEDNAME   = Fixture Definition Editor
APPVERSION = 4.12.0 GIT

# Disable these if you don't want to see GIT short hash in the About Box
#unix:REVISION = $$system(git log --pretty=format:'%h' -n 1)
#unix:APPVERSION = $$APPVERSION-r$$REVISION

#############################################################################
# Compiler & linker configuration
#############################################################################

# Treat all compiler warnings as errors
QMAKE_CXXFLAGS += -Werror

CONFIG         += warn_on

# Mobile platforms are QML only
android|ios: CONFIG += qmlui

# Build everything in the order specified in .pro files
CONFIG         += ordered

qmlui {
    DEFINES+=QMLUI
}

contains(FORCECONFIG, release) {
  message("Forcing a release build")
  CONFIG += release
  CONFIG -= debug
  #DEFINES += QT_NO_DEBUG_OUTPUT
} else {
  # Enable the following 2 lines when making a release
  CONFIG         -= release
#  DEFINES        += QT_NO_DEBUG_OUTPUT

  # Disable this when making a release
  CONFIG         += debug
}

!macx:!ios: {
 system( g++ --version | grep -e "4.6.[0-9]" ) {
   #message("g++ version 4.6 found")
   QMAKE_CXXFLAGS += -Wno-error=strict-overflow
 }
 else {
   QMAKE_CXXFLAGS += -Wno-unused-local-typedefs # Fix to build with GCC 4.8
 }
}

unix:OLA_GIT    = /usr/src/ola    # OLA directories

#macx:CONFIG   += x86 ppc  # Build universal binaries (Leopard only)
macx:CONFIG    -= app_bundle # Let QLC+ construct the .app bundle
macx:QMAKE_STRIP = strip -x
# Qt 5.5 and above
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
  macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}

# Produce build targets to the source directory
win32:DESTDIR  = ./

# Don't whine about some imports
win32:QMAKE_LFLAGS += -Wl,--enable-auto-import

# Enable unit test coverage measurement ('qmake CONFIG+=coverage' works, too)
#CONFIG        += coverage

#############################################################################
# Installation paths
#############################################################################

# Install root
win32:INSTALLROOT       = $$(SystemDrive)/qlcplus
macx:INSTALLROOT        = ~/QLC+.app/Contents
unix:!macx:INSTALLROOT += /usr
android:INSTALLROOT     = /
ios:INSTALLROOT         = /

# Binaries
win32:BINDIR      =
unix:!macx:BINDIR = bin
macx:BINDIR       = MacOS
android:BINDIR    = bin
ios:BINDIR        =

# Libraries
win32:LIBSDIR      =
unix:!macx:LIBSDIR = lib
macx:LIBSDIR       = Frameworks
android:LIBSDIR    = /libs/armeabi-v7a
ios:LIBSDIR        = lib

# Data
win32:DATADIR      =
unix:!macx:DATADIR = share/qlcplus
macx:DATADIR       = Resources
android:DATADIR    = /assets
ios:DATADIR        =
appimage: DATADIR  = ../share/qlcplus

# User Data
win32:USERDATADIR      = QLC+
unix:!macx:USERDATADIR = .qlcplus
macx:USERDATADIR       = "Library/Application Support/QLC+"
android:USERDATADIR    = .qlcplus
ios:USERDATADIR        = .qlcplus

# Documentation
win32:DOCSDIR      = Documents
unix:!macx:DOCSDIR = $$DATADIR/documents
macx:DOCSDIR       = $$DATADIR/Documents
android:DOCSDIR    = $$DATADIR/documents
ios:DOCSDIR        = Documents

# Input profiles
win32:INPUTPROFILEDIR      = InputProfiles
unix:!macx:INPUTPROFILEDIR = $$DATADIR/inputprofiles
macx:INPUTPROFILEDIR       = $$DATADIR/InputProfiles
android:INPUTPROFILEDIR    = $$DATADIR/inputprofiles
ios:INPUTPROFILEDIR        = InputProfiles

# User input profiles
win32:USERINPUTPROFILEDIR      = $$USERDATADIR/InputProfiles
unix:!macx:USERINPUTPROFILEDIR = $$USERDATADIR/inputprofiles
macx:USERINPUTPROFILEDIR       = $$USERDATADIR/InputProfiles
android:USERINPUTPROFILEDIR    = $$USERDATADIR/inputprofiles
ios:USERINPUTPROFILEDIR        = $$USERDATADIR/InputProfiles

# Midi templates
win32:MIDITEMPLATEDIR      = MidiTemplates
unix:!macx:MIDITEMPLATEDIR = $$DATADIR/miditemplates
macx:MIDITEMPLATEDIR       = $$DATADIR/MidiTemplates
android:MIDITEMPLATEDIR    = $$DATADIR/miditemplates
ios:MIDITEMPLATEDIR        = MidiTemplates

# User midi templates
win32:USERMIDITEMPLATEDIR      = $$USERDATADIR/MidiTemplates
unix:!macx:USERMIDITEMPLATEDIR = $$USERDATADIR/miditemplates
macx:USERMIDITEMPLATEDIR       = $$USERDATADIR/MidiTemplates
android:USERMIDITEMPLATEDIR    = $$USERDATADIR/miditemplates
ios:USERMIDITEMPLATEDIR        = $$USERDATADIR/MidiTemplates

# Channel modifiers templates
win32:MODIFIERSTEMPLATEDIR      = ModifiersTemplates
unix:!macx:MODIFIERSTEMPLATEDIR = $$DATADIR/modifierstemplates
macx:MODIFIERSTEMPLATEDIR       = $$DATADIR/ModifiersTemplates
android:MODIFIERSTEMPLATEDIR    = $$DATADIR/modifierstemplates
ios:MODIFIERSTEMPLATEDIR        = ModifiersTemplates

# User midi templates
win32:USERMODIFIERSTEMPLATEDIR      = $$USERDATADIR/ModifiersTemplates
unix:!macx:USERMODIFIERSTEMPLATEDIR = $$USERDATADIR/modifierstemplates
macx:USERMODIFIERSTEMPLATEDIR       = $$USERDATADIR/ModifiersTemplates
android:USERMODIFIERSTEMPLATEDIR    = $$USERDATADIR/modifierstemplates
ios:USERMODIFIERSTEMPLATEDIR        = $$USERDATADIR/ModifiersTemplates

# Fixtures
win32:FIXTUREDIR      = Fixtures
unix:!macx:FIXTUREDIR = $$DATADIR/fixtures
macx:FIXTUREDIR       = $$DATADIR/Fixtures
android:FIXTUREDIR    = $$DATADIR/fixtures
ios:FIXTUREDIR        = Fixtures

# Gobos
win32:GOBODIR      = Gobos
unix:!macx:GOBODIR = $$DATADIR/gobos
macx:GOBODIR       = $$DATADIR/Gobos
android:GOBODIR    = $$DATADIR/gobos
ios:GOBODIR        = Gobos

# User fixtures
win32:USERFIXTUREDIR      = $$USERDATADIR/Fixtures
unix:!macx:USERFIXTUREDIR = $$USERDATADIR/fixtures
macx:USERFIXTUREDIR       = $$USERDATADIR/Fixtures
android:USERFIXTUREDIR    = $$USERDATADIR/fixtures
ios:USERFIXTUREDIR        = $$USERDATADIR/Fixtures

# Plugins
win32:PLUGINDIR      = Plugins
unix:!macx:PLUGINDIR = $$LIBSDIR/qt4/plugins/qlcplus
macx:PLUGINDIR       = PlugIns
android:PLUGINDIR    = Plugins
ios:PLUGINDIR        = Plugins
appimage:PLUGINDIR   = ../lib/qt4/plugins/qlcplus

# Audio Plugins
win32:AUDIOPLUGINDIR      = $$PLUGINDIR/Audio
unix:!macx:AUDIOPLUGINDIR = $$PLUGINDIR/audio
macx:AUDIOPLUGINDIR       = $$PLUGINDIR/Audio
android:AUDIOPLUGINDIR    = $$PLUGINDIR/Audio
ios:AUDIOPLUGINDIR        = $$PLUGINDIR/Audio

# Translations
win32:TRANSLATIONDIR      =
unix:!macx:TRANSLATIONDIR = $$DATADIR/translations
macx:TRANSLATIONDIR       = $$DATADIR/Translations
android:TRANSLATIONDIR    = $$DATADIR/translations
ios:TRANSLATIONDIR        =

# RGB Scripts
win32:RGBSCRIPTDIR      = RGBScripts
unix:!macx:RGBSCRIPTDIR = $$DATADIR/rgbscripts
macx:RGBSCRIPTDIR       = $$DATADIR/RGBScripts
android:RGBSCRIPTDIR    = $$DATADIR/rgbscripts
ios:RGBSCRIPTDIR        = RGBScripts

# User RGB Scripts
win32:USERRGBSCRIPTDIR      = $$USERDATADIR/RGBScripts
unix:!macx:USERRGBSCRIPTDIR = $$USERDATADIR/rgbscripts
macx:USERRGBSCRIPTDIR       = $$USERDATADIR/RGBScripts
android:USERRGBSCRIPTDIR    = $$USERDATADIR/rgbscripts
ios:USERRGBSCRIPTDIR        = $$USERDATADIR/RGBScripts

# RGB Scripts
win32:WEBFILESDIR      = Web
unix:!macx:WEBFILESDIR = $$DATADIR/web
macx:WEBFILESDIR       = $$DATADIR/Web
android:WEBFILESDIR    = $$DATADIR/web
ios:WEBFILESDIR        = Web

# Samples
win32:SAMPLESDIR       = $$INSTALLROOT
unix:!macx:SAMPLESDIR  = $$INSTALLROOT/$$DATADIR
macx:SAMPLESDIR        = $$INSTALLROOT/$$DATADIR
android:SAMPLESDIR     = $$INSTALLROOT/$$DATADIR
ios:SAMPLESDIR         = $$INSTALLROOT/$$DATADIR

# 3D Meshes
win32:MESHESDIR      = Meshes
unix:!macx:MESHESDIR = $$DATADIR/meshes
macx:MESHESDIR       = $$DATADIR/Meshes
android:MESHESDIR    = $$DATADIR/meshes
ios:MESHESDIR        = Meshes

# Color filters
win32:COLORFILTERSDIR      = ColorFilters
unix:!macx:COLORFILTERSDIR = $$DATADIR/colorfilters
macx:COLORFILTERSDIR       = $$DATADIR/ColorFilters
android:COLORFILTERSDIR    = $$DATADIR/colorfilters
ios:COLORFILTERSDIR        = ColorFilters

# User Color filters
win32:USERCOLORFILTERSDIR      = $$USERDATADIR/ColorFilters
unix:!macx:USERCOLORFILTERSDIR = $$USERDATADIR/colorfilters
macx:USERCOLORFILTERSDIR       = $$USERDATADIR/ColorFilters
android:USERCOLORFILTERSDIR    = $$USERDATADIR/colorfilters
ios:USERCOLORFILTERSDIR        = $$USERDATADIR/ColorFilters

# udev rules
unix:!macx:UDEVRULESDIR = /etc/udev/rules.d

# man
unix:!macx:MANDIR = share/man/man1/

unix:!macx: {
  QTPREFIX = $$[QT_INSTALL_PREFIX]
  IN_USR = $$find(QTPREFIX, "/usr")
  count(IN_USR, 1) {
    QTLIBSDIR = $$[QT_INSTALL_LIBS]
    QTPLUGINSDIR = $$[QT_INSTALL_PLUGINS]
    LIBSDIR = $$replace(QTLIBSDIR, "/usr/", "")
    PLUGINDIR = $$replace(QTPLUGINSDIR, "/usr/", "")/qlcplus
    AUDIOPLUGINDIR = $$PLUGINDIR/audio
  }
  #message("Qt install prefix: "$$[QT_INSTALL_PREFIX])
  #message("Qt install libs: "$$[QT_INSTALL_LIBS])
  #message("Linux libs dir: " $$INSTALLROOT/$$LIBSDIR)
  #message("Linux plugins dir: " $$INSTALLROOT/$$PLUGINDIR)
}

#############################################################################
# Application name & version
#############################################################################

APPNAME    = Q Light Controller Plus
FXEDNAME   = Fixture Definition Editor
APPVERSION = 5.0.0 Alpha3

# Disable these if you don't want to see GIT short hash in the About Box
#unix:REVISION = $$system(git log --pretty=format:'%h' -n 1)
#unix:APPVERSION = $$APPVERSION-r$$REVISION

#############################################################################
# Compiler & linker configuration
#############################################################################

# Treat all compiler warnings as errors
QMAKE_CXXFLAGS += -Werror

CONFIG         += warn_on

# Mobile platforms are QML only
android|ios: CONFIG += qmlui

# Build everything in the order specified in .pro files
CONFIG         += ordered

qmlui {
    DEFINES+=QMLUI
}

contains(FORCECONFIG, release) {
  message("Forcing a release build")
  CONFIG += release
  CONFIG -= debug
  #DEFINES += QT_NO_DEBUG_OUTPUT
} else {
  # Enable the following 2 lines when making a release
  CONFIG         += release
#  DEFINES        += QT_NO_DEBUG_OUTPUT

  # Disable this when making a release
  CONFIG         -= debug
}

!macx:!ios: {
 system( g++ --version | grep -e "4.6.[0-9]" ) {
   #message("g++ version 4.6 found")
   QMAKE_CXXFLAGS += -Wno-error=strict-overflow
 }
 else {
   QMAKE_CXXFLAGS += -Wno-unused-local-typedefs # Fix to build with GCC 4.8
 }
}

unix:OLA_GIT    = /usr/src/ola    # OLA directories

#macx:CONFIG   += x86 ppc  # Build universal binaries (Leopard only)
macx:CONFIG    -= app_bundle # Let QLC+ construct the .app bundle
macx:QMAKE_STRIP = strip -x
# Qt 5.5 and above
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
  macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}

# Produce build targets to the source directory
win32:DESTDIR  = ./

# Don't whine about some imports
win32:QMAKE_LFLAGS += -Wl,--enable-auto-import

# Enable unit test coverage measurement ('qmake CONFIG+=coverage' works, too)
#CONFIG        += coverage

#############################################################################
# Installation paths
#############################################################################

# Install root
win32:INSTALLROOT       = $$(SystemDrive)/qlcplus
macx:INSTALLROOT        = ~/QLC+.app/Contents
unix:!macx:INSTALLROOT += /usr
android:INSTALLROOT     = /
ios:INSTALLROOT         = /

# Binaries
win32:BINDIR      =
unix:!macx:BINDIR = bin
macx:BINDIR       = MacOS
android:BINDIR    = bin
ios:BINDIR        =

# Libraries
win32:LIBSDIR      =
unix:!macx:LIBSDIR = lib
macx:LIBSDIR       = Frameworks
android:LIBSDIR    = /libs/armeabi-v7a
ios:LIBSDIR        = lib

# Data
win32:DATADIR      =
unix:!macx:DATADIR = share/qlcplus
macx:DATADIR       = Resources
android:DATADIR    = /assets
ios:DATADIR        =
appimage: DATADIR  = ../share/qlcplus

# User Data
win32:USERDATADIR      = QLC+
unix:!macx:USERDATADIR = .qlcplus
macx:USERDATADIR       = "Library/Application Support/QLC+"
android:USERDATADIR    = .qlcplus
ios:USERDATADIR        = .qlcplus

# Documentation
win32:DOCSDIR      = Documents
unix:!macx:DOCSDIR = $$DATADIR/documents
macx:DOCSDIR       = $$DATADIR/Documents
android:DOCSDIR    = $$DATADIR/documents
ios:DOCSDIR        = Documents

# Input profiles
win32:INPUTPROFILEDIR      = InputProfiles
unix:!macx:INPUTPROFILEDIR = $$DATADIR/inputprofiles
macx:INPUTPROFILEDIR       = $$DATADIR/InputProfiles
android:INPUTPROFILEDIR    = $$DATADIR/inputprofiles
ios:INPUTPROFILEDIR        = InputProfiles

# User input profiles
win32:USERINPUTPROFILEDIR      = $$USERDATADIR/InputProfiles
unix:!macx:USERINPUTPROFILEDIR = $$USERDATADIR/inputprofiles
macx:USERINPUTPROFILEDIR       = $$USERDATADIR/InputProfiles
android:USERINPUTPROFILEDIR    = $$USERDATADIR/inputprofiles
ios:USERINPUTPROFILEDIR        = $$USERDATADIR/InputProfiles

# Midi templates
win32:MIDITEMPLATEDIR      = MidiTemplates
unix:!macx:MIDITEMPLATEDIR = $$DATADIR/miditemplates
macx:MIDITEMPLATEDIR       = $$DATADIR/MidiTemplates
android:MIDITEMPLATEDIR    = $$DATADIR/miditemplates
ios:MIDITEMPLATEDIR        = MidiTemplates

# User midi templates
win32:USERMIDITEMPLATEDIR      = $$USERDATADIR/MidiTemplates
unix:!macx:USERMIDITEMPLATEDIR = $$USERDATADIR/miditemplates
macx:USERMIDITEMPLATEDIR       = $$USERDATADIR/MidiTemplates
android:USERMIDITEMPLATEDIR    = $$USERDATADIR/miditemplates
ios:USERMIDITEMPLATEDIR        = $$USERDATADIR/MidiTemplates

# Channel modifiers templates
win32:MODIFIERSTEMPLATEDIR      = ModifiersTemplates
unix:!macx:MODIFIERSTEMPLATEDIR = $$DATADIR/modifierstemplates
macx:MODIFIERSTEMPLATEDIR       = $$DATADIR/ModifiersTemplates
android:MODIFIERSTEMPLATEDIR    = $$DATADIR/modifierstemplates
ios:MODIFIERSTEMPLATEDIR        = ModifiersTemplates

# User midi templates
win32:USERMODIFIERSTEMPLATEDIR      = $$USERDATADIR/ModifiersTemplates
unix:!macx:USERMODIFIERSTEMPLATEDIR = $$USERDATADIR/modifierstemplates
macx:USERMODIFIERSTEMPLATEDIR       = $$USERDATADIR/ModifiersTemplates
android:USERMODIFIERSTEMPLATEDIR    = $$USERDATADIR/modifierstemplates
ios:USERMODIFIERSTEMPLATEDIR        = $$USERDATADIR/ModifiersTemplates

# Fixtures
win32:FIXTUREDIR      = Fixtures
unix:!macx:FIXTUREDIR = $$DATADIR/fixtures
macx:FIXTUREDIR       = $$DATADIR/Fixtures
android:FIXTUREDIR    = $$DATADIR/fixtures
ios:FIXTUREDIR        = Fixtures

# Gobos
win32:GOBODIR      = Gobos
unix:!macx:GOBODIR = $$DATADIR/gobos
macx:GOBODIR       = $$DATADIR/Gobos
android:GOBODIR    = $$DATADIR/gobos
ios:GOBODIR        = Gobos

# User fixtures
win32:USERFIXTUREDIR      = $$USERDATADIR/Fixtures
unix:!macx:USERFIXTUREDIR = $$USERDATADIR/fixtures
macx:USERFIXTUREDIR       = $$USERDATADIR/Fixtures
android:USERFIXTUREDIR    = $$USERDATADIR/fixtures
ios:USERFIXTUREDIR        = $$USERDATADIR/Fixtures

# Plugins
win32:PLUGINDIR      = Plugins
unix:!macx:PLUGINDIR = $$LIBSDIR/qt4/plugins/qlcplus
macx:PLUGINDIR       = PlugIns
android:PLUGINDIR    = Plugins
ios:PLUGINDIR        = Plugins
appimage:PLUGINDIR   = ../lib/qt4/plugins/qlcplus

# Audio Plugins
win32:AUDIOPLUGINDIR      = $$PLUGINDIR/Audio
unix:!macx:AUDIOPLUGINDIR = $$PLUGINDIR/audio
macx:AUDIOPLUGINDIR       = $$PLUGINDIR/Audio
android:AUDIOPLUGINDIR    = $$PLUGINDIR/Audio
ios:AUDIOPLUGINDIR        = $$PLUGINDIR/Audio

# Translations
win32:TRANSLATIONDIR      =
unix:!macx:TRANSLATIONDIR = $$DATADIR/translations
macx:TRANSLATIONDIR       = $$DATADIR/Translations
android:TRANSLATIONDIR    = $$DATADIR/translations
ios:TRANSLATIONDIR        =

# RGB Scripts
win32:RGBSCRIPTDIR      = RGBScripts
unix:!macx:RGBSCRIPTDIR = $$DATADIR/rgbscripts
macx:RGBSCRIPTDIR       = $$DATADIR/RGBScripts
android:RGBSCRIPTDIR    = $$DATADIR/rgbscripts
ios:RGBSCRIPTDIR        = RGBScripts

# User RGB Scripts
win32:USERRGBSCRIPTDIR      = $$USERDATADIR/RGBScripts
unix:!macx:USERRGBSCRIPTDIR = $$USERDATADIR/rgbscripts
macx:USERRGBSCRIPTDIR       = $$USERDATADIR/RGBScripts
android:USERRGBSCRIPTDIR    = $$USERDATADIR/rgbscripts
ios:USERRGBSCRIPTDIR        = $$USERDATADIR/RGBScripts

# RGB Scripts
win32:WEBFILESDIR      = Web
unix:!macx:WEBFILESDIR = $$DATADIR/web
macx:WEBFILESDIR       = $$DATADIR/Web
android:WEBFILESDIR    = $$DATADIR/web
ios:WEBFILESDIR        = Web

# Samples
win32:SAMPLESDIR       = $$INSTALLROOT
unix:!macx:SAMPLESDIR  = $$INSTALLROOT/$$DATADIR
macx:SAMPLESDIR        = $$INSTALLROOT/$$DATADIR
android:SAMPLESDIR     = $$INSTALLROOT/$$DATADIR
ios:SAMPLESDIR         = $$INSTALLROOT/$$DATADIR

# 3D Meshes
win32:MESHESDIR      = Meshes
unix:!macx:MESHESDIR = $$DATADIR/meshes
macx:MESHESDIR       = $$DATADIR/Meshes
android:MESHESDIR    = $$DATADIR/meshes
ios:MESHESDIR        = Meshes

# Color filters
win32:COLORFILTERSDIR      = ColorFilters
unix:!macx:COLORFILTERSDIR = $$DATADIR/colorfilters
macx:COLORFILTERSDIR       = $$DATADIR/ColorFilters
android:COLORFILTERSDIR    = $$DATADIR/colorfilters
ios:COLORFILTERSDIR        = ColorFilters

# User Color filters
win32:USERCOLORFILTERSDIR      = $$USERDATADIR/ColorFilters
unix:!macx:USERCOLORFILTERSDIR = $$USERDATADIR/colorfilters
macx:USERCOLORFILTERSDIR       = $$USERDATADIR/ColorFilters
android:USERCOLORFILTERSDIR    = $$USERDATADIR/colorfilters
ios:USERCOLORFILTERSDIR        = $$USERDATADIR/ColorFilters

# udev rules
unix:!macx:UDEVRULESDIR = /etc/udev/rules.d

# man
unix:!macx:MANDIR = share/man/man1/

unix:!macx: {
  QTPREFIX = $$[QT_INSTALL_PREFIX]
  IN_USR = $$find(QTPREFIX, "/usr")
  count(IN_USR, 1) {
    QTLIBSDIR = $$[QT_INSTALL_LIBS]
    QTPLUGINSDIR = $$[QT_INSTALL_PLUGINS]
    LIBSDIR = $$replace(QTLIBSDIR, "/usr/", "")
    PLUGINDIR = $$replace(QTPLUGINSDIR, "/usr/", "")/qlcplus
    AUDIOPLUGINDIR = $$PLUGINDIR/audio
  }
  #message("Qt install prefix: "$$[QT_INSTALL_PREFIX])
  #message("Qt install libs: "$$[QT_INSTALL_LIBS])
  #message("Linux libs dir: " $$INSTALLROOT/$$LIBSDIR)
  #message("Linux plugins dir: " $$INSTALLROOT/$$PLUGINDIR)
}