2015-07-10 11:49:37 +02:00
|
|
|
|
#-------------------------------------------------
|
|
|
|
|
#
|
|
|
|
|
# Project created by QtCreator 2015-07-07T14:35:12
|
|
|
|
|
#
|
|
|
|
|
#-------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# File with common stuff for whole project
|
|
|
|
|
include(../../../common.pri)
|
|
|
|
|
|
2015-07-10 13:14:55 +02:00
|
|
|
|
QT += core gui widgets network
|
2015-07-10 11:49:37 +02:00
|
|
|
|
|
|
|
|
|
# Name of binary file
|
|
|
|
|
TARGET = tape
|
|
|
|
|
|
|
|
|
|
# We want create executable file
|
|
|
|
|
TEMPLATE = app
|
|
|
|
|
|
|
|
|
|
# Use out-of-source builds (shadow builds)
|
|
|
|
|
CONFIG -= debug_and_release debug_and_release_target
|
|
|
|
|
|
|
|
|
|
# We use C++11 standard
|
|
|
|
|
CONFIG += c++11
|
|
|
|
|
|
|
|
|
|
# Since Qt 5.4.0 the source code location is recorded only in debug builds.
|
|
|
|
|
# We need this information also in release builds. For this need define QT_MESSAGELOGCONTEXT.
|
|
|
|
|
DEFINES += QT_MESSAGELOGCONTEXT
|
|
|
|
|
|
|
|
|
|
# Directory for executable file
|
|
|
|
|
DESTDIR = bin
|
|
|
|
|
|
|
|
|
|
# Directory for files created moc
|
|
|
|
|
MOC_DIR = moc
|
|
|
|
|
|
|
|
|
|
# Directory for objecs files
|
|
|
|
|
OBJECTS_DIR = obj
|
|
|
|
|
|
|
|
|
|
# Directory for files created rcc
|
|
|
|
|
RCC_DIR = rcc
|
|
|
|
|
|
|
|
|
|
# Directory for files created uic
|
|
|
|
|
UI_DIR = uic
|
|
|
|
|
|
|
|
|
|
# Suport subdirectories. Just better project code tree.
|
|
|
|
|
include(tape.pri)
|
|
|
|
|
|
2015-07-12 16:19:53 +02:00
|
|
|
|
RESOURCES += \
|
|
|
|
|
share/resources/tapeicon.qrc
|
|
|
|
|
|
2015-07-10 13:14:55 +02:00
|
|
|
|
# Compilation will fail without this files after we added them to this section.
|
|
|
|
|
OTHER_FILES += \
|
|
|
|
|
share/resources/tape.rc \ # For Windows system.
|
|
|
|
|
share/resources/icon/64x64/logo.ico # Tape's logo.
|
|
|
|
|
|
2015-07-10 11:49:37 +02:00
|
|
|
|
# Set using ccache. Function enable_ccache() defined in common.pri.
|
|
|
|
|
macx {
|
|
|
|
|
CONFIG(debug, debug|release){
|
|
|
|
|
$$enable_ccache()# Use only in debug mode on Mac
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$$enable_ccache()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Set precompiled headers. Function set_PCH() defined in common.pri.
|
|
|
|
|
$$set_PCH()
|
|
|
|
|
|
|
|
|
|
CONFIG(debug, debug|release){
|
|
|
|
|
# Debug mode
|
|
|
|
|
unix {
|
|
|
|
|
#Turn on compilers warnings.
|
|
|
|
|
*-g++{
|
|
|
|
|
QMAKE_CXXFLAGS += \
|
|
|
|
|
# Key -isystem disable checking errors in system headers.
|
|
|
|
|
-isystem "$${OUT_PWD}/$${UI_DIR}" \
|
|
|
|
|
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
|
|
|
|
|
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
|
|
|
|
|
$$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
|
|
|
|
|
|
|
|
|
|
noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer
|
|
|
|
|
# do nothing
|
|
|
|
|
} else {
|
|
|
|
|
#gcc’s 4.8.0 Address Sanitizer
|
|
|
|
|
#http://blog.qt.digia.com/blog/2013/04/17/using-gccs-4-8-0-address-sanitizer-with-qt/
|
|
|
|
|
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
|
|
|
|
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
|
|
|
|
QMAKE_LFLAGS += -fsanitize=address
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
clang*{
|
|
|
|
|
QMAKE_CXXFLAGS += \
|
|
|
|
|
# Key -isystem disable checking errors in system headers.
|
|
|
|
|
-isystem "$${OUT_PWD}/$${UI_DIR}" \
|
|
|
|
|
-isystem "$${OUT_PWD}/$${MOC_DIR}" \
|
|
|
|
|
-isystem "$${OUT_PWD}/$${RCC_DIR}" \
|
|
|
|
|
$$CLANG_DEBUG_CXXFLAGS # See common.pri for more details.
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
*-g++{
|
|
|
|
|
QMAKE_CXXFLAGS += $$GCC_DEBUG_CXXFLAGS # See common.pri for more details.
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-07-12 19:38:30 +02:00
|
|
|
|
DEFINES += "BUILD_REVISION=\\\"unknown\\\""
|
2015-07-10 11:49:37 +02:00
|
|
|
|
}else{
|
|
|
|
|
# Release mode
|
|
|
|
|
DEFINES += V_NO_ASSERT
|
|
|
|
|
!unix:*-g++{
|
|
|
|
|
QMAKE_CXXFLAGS += -fno-omit-frame-pointer # Need for exchndl.dll
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
|
|
|
|
|
# do nothing
|
|
|
|
|
} else {
|
|
|
|
|
# Turn on debug symbols in release mode on Unix systems.
|
|
|
|
|
# On Mac OS X temporarily disabled. Need find way how to strip binary file.
|
|
|
|
|
!macx:!win32-msvc*{
|
|
|
|
|
QMAKE_CXXFLAGS_RELEASE += -g -gdwarf-3
|
|
|
|
|
QMAKE_CFLAGS_RELEASE += -g -gdwarf-3
|
|
|
|
|
QMAKE_LFLAGS_RELEASE =
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-07-12 19:38:30 +02:00
|
|
|
|
|
|
|
|
|
macx{
|
|
|
|
|
HG = /usr/local/bin/hg # Can't defeat PATH variable on Mac OS.
|
|
|
|
|
}else {
|
|
|
|
|
HG = hg # All other platforms all OK.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#build revision number for using in version
|
|
|
|
|
unix {
|
|
|
|
|
HG_HESH=$$system("$${HG} log -r. --template '{node|short}'")
|
|
|
|
|
} else {
|
|
|
|
|
# Use escape character before "|" on Windows
|
|
|
|
|
HG_HESH=$$system($${HG} log -r. --template "{node^|short}")
|
|
|
|
|
}
|
|
|
|
|
isEmpty(HG_HESH){
|
|
|
|
|
HG_HESH = "unknown" # if we can't find build revision left unknown.
|
|
|
|
|
}
|
|
|
|
|
message("Build revision:" $${HG_HESH})
|
|
|
|
|
DEFINES += "BUILD_REVISION=\\\"$${HG_HESH}\\\"" # Make available build revision number in sources.
|
2015-07-10 13:14:55 +02:00
|
|
|
|
}
|
2015-07-10 11:49:37 +02:00
|
|
|
|
|
2015-07-10 13:14:55 +02:00
|
|
|
|
# Path to recource file.
|
|
|
|
|
win32:RC_FILE = share/resources/tape.rc
|
2015-07-10 11:49:37 +02:00
|
|
|
|
|
2015-07-13 12:48:29 +02:00
|
|
|
|
#VWidgets static library
|
|
|
|
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/ -lvwidgets
|
|
|
|
|
|
|
|
|
|
INCLUDEPATH += $$PWD/../../libs/vwidgets
|
|
|
|
|
DEPENDPATH += $$PWD/../../libs/vwidgets
|
|
|
|
|
|
|
|
|
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/vwidgets.lib
|
|
|
|
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vwidgets/$${DESTDIR}/libvwidgets.a
|
|
|
|
|
|
2015-07-14 19:22:31 +02:00
|
|
|
|
# VFormat static library (depend on VPatternDB)
|
|
|
|
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vformat/$${DESTDIR}/ -lvformat
|
|
|
|
|
|
|
|
|
|
INCLUDEPATH += $$PWD/../../libs/vformat
|
|
|
|
|
DEPENDPATH += $$PWD/../../libs/vformat
|
|
|
|
|
|
|
|
|
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vformat/$${DESTDIR}/vformat.lib
|
|
|
|
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vformat/$${DESTDIR}/libvformat.a
|
|
|
|
|
|
2015-07-13 12:48:29 +02:00
|
|
|
|
#VPatternDB static library (depend on vgeometry, vmisc)
|
|
|
|
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vpatterndb/$${DESTDIR} -lvpatterndb
|
|
|
|
|
|
|
|
|
|
INCLUDEPATH += $$PWD/../../libs/vpatterndb
|
|
|
|
|
DEPENDPATH += $$PWD/../../libs/vpatterndb
|
|
|
|
|
|
|
|
|
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/vpatterndb.lib
|
|
|
|
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vpatterndb/$${DESTDIR}/libvpatterndb.a
|
|
|
|
|
|
2015-07-10 13:14:55 +02:00
|
|
|
|
#VMisc static library
|
|
|
|
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vmisc/$${DESTDIR}/ -lvmisc
|
|
|
|
|
|
|
|
|
|
INCLUDEPATH += $$PWD/../../libs/vmisc
|
|
|
|
|
DEPENDPATH += $$PWD/../../libs/vmisc
|
|
|
|
|
|
|
|
|
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/vmisc.lib
|
|
|
|
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vmisc/$${DESTDIR}/libvmisc.a
|
|
|
|
|
|
2015-07-13 12:48:29 +02:00
|
|
|
|
# VGeometry static library (depend on ifc)
|
|
|
|
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/ -lvgeometry
|
2015-07-10 13:14:55 +02:00
|
|
|
|
|
2015-07-13 12:48:29 +02:00
|
|
|
|
INCLUDEPATH += $$PWD/../../libs/vgeometry
|
|
|
|
|
DEPENDPATH += $$PWD/../../libs/vgeometry
|
2015-07-10 13:14:55 +02:00
|
|
|
|
|
2015-07-13 12:48:29 +02:00
|
|
|
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/vgeometry.lib
|
|
|
|
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/vgeometry/$${DESTDIR}/libvgeometry.a
|
|
|
|
|
|
|
|
|
|
# IFC static library
|
|
|
|
|
unix|win32: LIBS += -L$$OUT_PWD/../../libs/ifc/$${DESTDIR}/ -lifc
|
|
|
|
|
|
|
|
|
|
INCLUDEPATH += $$PWD/../../libs/ifc
|
|
|
|
|
DEPENDPATH += $$PWD/../../libs/ifc
|
|
|
|
|
|
|
|
|
|
win32:!win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/ifc.lib
|
|
|
|
|
else:unix|win32-g++: PRE_TARGETDEPS += $$OUT_PWD/../../libs/ifc/$${DESTDIR}/libifc.a
|
2015-07-10 11:49:37 +02:00
|
|
|
|
|
|
|
|
|
noDebugSymbols{ # For enable run qmake with CONFIG+=noDebugSymbols
|
|
|
|
|
# do nothing
|
|
|
|
|
} else {
|
|
|
|
|
noStripDebugSymbols { # For enable run qmake with CONFIG+=noStripDebugSymbols
|
|
|
|
|
# do nothing
|
|
|
|
|
} else {
|
|
|
|
|
# Strip after you link all libaries.
|
|
|
|
|
CONFIG(release, debug|release){
|
|
|
|
|
win32:!win32-msvc*{
|
|
|
|
|
# Strip debug symbols.
|
|
|
|
|
QMAKE_POST_LINK += objcopy --only-keep-debug bin/${TARGET} bin/${TARGET}.dbg &&
|
|
|
|
|
QMAKE_POST_LINK += objcopy --strip-debug bin/${TARGET} &&
|
|
|
|
|
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="bin/${TARGET}.dbg" bin/${TARGET}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unix:!macx{
|
|
|
|
|
# Strip debug symbols.
|
|
|
|
|
QMAKE_POST_LINK += objcopy --only-keep-debug ${TARGET} ${TARGET}.dbg &&
|
|
|
|
|
QMAKE_POST_LINK += objcopy --strip-debug ${TARGET} &&
|
|
|
|
|
QMAKE_POST_LINK += objcopy --add-gnu-debuglink="${TARGET}.dbg" ${TARGET}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|