forked from GerhardHoffmann/DCLibraries
135 lines
3.6 KiB
Plaintext
135 lines
3.6 KiB
Plaintext
CONFIG += plugin
|
|
QT -= gui
|
|
QT += widgets serialport
|
|
|
|
|
|
win32 {
|
|
BUILD_DATE=$$system("date /t")
|
|
BUILD_TIME=$$system("time /t")
|
|
} else {
|
|
BUILD_DATE=$$system("date +%d-%m-%y")
|
|
BUILD_TIME=$$system("date +%H:%M:%S")
|
|
}
|
|
|
|
GIT_COMMIT=$$system("git log -1 --format=oneline | cut -d' ' -f1")
|
|
|
|
EXTENDED_VERSION="$${VERSION}-$${GIT_COMMIT}"
|
|
|
|
INCLUDEPATH += $${PWD}/include
|
|
|
|
DEPENDPATH += $${PWD}
|
|
DESTDIR=$${_PRO_FILE_PWD_}/build
|
|
|
|
CONFIG += c++11
|
|
|
|
DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
|
|
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
|
|
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
|
|
DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
|
|
|
|
# keep comments, as /* fall through */
|
|
QMAKE_CXXFLAGS += -C
|
|
# _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
|
|
QMAKE_CXXFLAGS += -O2 -O
|
|
QMAKE_CXXFLAGS += -g
|
|
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
|
|
|
QMAKE_LFLAGS += -Wl,-e,main
|
|
|
|
gccmain.input = SOURCES_MAIN
|
|
gccmain.output = main.o
|
|
gccmain.commands = \
|
|
$$QMAKE_CXX -c $$PWD/src/main.cpp -o main.o -fPIC -O0 -DAPP_VERSION=\\\"$$VERSION\\\" \
|
|
-DAPP_BUILD_DATE=\\\"$$BUILD_DATE\\\" \
|
|
-DAPP_BUILD_TIME=\\\"$$BUILD_TIME\\\" \
|
|
-DAPP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\" \
|
|
-I. \
|
|
-I../../DCLibraries/include \
|
|
-I$$(QTDIR)/../include
|
|
|
|
QMAKE_EXTRA_COMPILERS += gccmain
|
|
SOURCES_MAIN += $$PWD/src/main.cpp
|
|
|
|
# default
|
|
ARCH = PTU5
|
|
CONFIG += PTU5
|
|
|
|
contains( CONFIG, DesktopLinux ) {
|
|
# QMAKE_CC = ccache $$QMAKE_CC
|
|
# QMAKE_CXX = ccache $$QMAKE_CXX
|
|
QMAKE_CXXFLAGS += -std=c++17
|
|
# QMAKE_CXXFLAGS += -Wno-deprecated-ctor
|
|
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
|
ARCH = DesktopLinux
|
|
}
|
|
|
|
contains( CONFIG, PTU5 ) {
|
|
# QMAKE_CC = ccache $$QMAKE_CC
|
|
# QMAKE_CXX = ccache $$QMAKE_CXX
|
|
QMAKE_CXXFLAGS += -std=c++17
|
|
linux-clang { QMAKE_CXXFLAGS += -Qunused-arguments }
|
|
CONFIG += link_pkgconfig
|
|
ARCH = PTU5
|
|
}
|
|
|
|
contains( CONFIG, PTU5_YOCTO ) {
|
|
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
|
PTU5BASEPATH = /opt/devel/ptu5
|
|
ARCH = PTU5
|
|
# add qmqtt lib
|
|
#LIBS += -lQt5Qmqtt
|
|
}
|
|
|
|
HEADERS += \
|
|
$${PWD}/include/com.h \
|
|
$${PWD}/include/datei.h \
|
|
$${PWD}/include/runProc.h \
|
|
$${PWD}/include/controlBus.h \
|
|
$${PWD}/include/datIf.h \
|
|
$${PWD}/include/dcBL.h \
|
|
$${PWD}/include/hwapi.h \
|
|
$${PWD}/include/interfaces.h \
|
|
$${PWD}/include/prot.h \
|
|
$${PWD}/include/sendWRcmd.h \
|
|
$${PWD}/include/storeINdata.h \
|
|
$${PWD}/include/tslib.h \
|
|
$${PWD}/include/shared_mem_buffer.h
|
|
|
|
SOURCES += \
|
|
$${PWD}/src/com.cpp \
|
|
$${PWD}/src/datei.cpp \
|
|
$${PWD}/src/runProc.cpp \
|
|
$${PWD}/src/controlBus.cpp \
|
|
$${PWD}/src/datIf.cpp \
|
|
$${PWD}/src/dcBL.cpp \
|
|
$${PWD}/src/hwapi.cpp \
|
|
$${PWD}/src/prot.cpp \
|
|
$${PWD}/src/sendWRcmd.cpp \
|
|
$${PWD}/src/storeINdata.cpp \
|
|
$${PWD}/src/tslib.cpp \
|
|
$${PWD}/src/shared_mem_buffer.cpp
|
|
|
|
|
|
# INTERFACE = DeviceController
|
|
# INTERFACE_DEFINITION = $${PWD}/include/ATBAPP/DeviceControllerInterface.h
|
|
#
|
|
# DISTFILES += \
|
|
# generate-version.sh
|
|
|
|
|
|
# Define how to create version.h
|
|
# VERSION_H = $$PWD/include/version.h
|
|
# version.output = $$PWD/include/version.h
|
|
# version.commands = $$PWD/generate-version.sh $${ARCH} $${TARGET} $${INTERFACE} $${INTERFACE_DEFINITION} $${VERSION_H}
|
|
# version.depends = FORCE
|
|
# version.input = VERSION_H
|
|
# version.variable_out = HEADERS
|
|
# QMAKE_EXTRA_COMPILERS += version
|
|
# QMAKE_CLEAN += $${PWD}/include/version.h
|
|
|
|
|
|
# Default rules for deployment.
|
|
qnx: target.path = /tmp/$${TARGET}/bin
|
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
|
!isEmpty(target.path): INSTALLS += target
|