2023-11-08 13:02:26 +01:00
|
|
|
CONFIG += plugin
|
|
|
|
QT -= gui
|
2024-03-02 12:15:15 +01:00
|
|
|
QT += serialport
|
2023-11-08 13:02:26 +01:00
|
|
|
|
2023-11-08 16:22:39 +01:00
|
|
|
|
2023-11-08 13:02:26 +01:00
|
|
|
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}
|
2023-11-21 10:11:18 +01:00
|
|
|
DESTDIR=$${_PRO_FILE_PWD_}/build
|
2023-11-08 13:02:26 +01:00
|
|
|
|
|
|
|
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]
|
2023-11-08 16:22:39 +01:00
|
|
|
QMAKE_CXXFLAGS += -O2 -O
|
2023-11-08 13:02:26 +01:00
|
|
|
QMAKE_CXXFLAGS += -g
|
|
|
|
QMAKE_CXXFLAGS += -Wno-deprecated-copy
|
|
|
|
|
2023-11-08 16:22:39 +01:00
|
|
|
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 \
|
2023-11-08 16:59:52 +01:00
|
|
|
-I$$(QTDIR)/../include
|
2023-11-08 16:22:39 +01:00
|
|
|
|
|
|
|
QMAKE_EXTRA_COMPILERS += gccmain
|
|
|
|
SOURCES_MAIN += $$PWD/src/main.cpp
|
|
|
|
|
2023-11-08 13:02:26 +01:00
|
|
|
# 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/datei.h \
|
|
|
|
$${PWD}/include/runProc.h \
|
|
|
|
$${PWD}/include/controlBus.h \
|
|
|
|
$${PWD}/include/dcBL.h \
|
|
|
|
$${PWD}/include/hwapi.h \
|
|
|
|
$${PWD}/include/interfaces.h \
|
|
|
|
$${PWD}/include/sendWRcmd.h \
|
|
|
|
$${PWD}/include/storeINdata.h \
|
|
|
|
$${PWD}/include/tslib.h \
|
2024-02-22 08:44:34 +01:00
|
|
|
$${PWD}/include/shared_mem_buffer.h \
|
|
|
|
$${PWD}/include/reporting_thread.h \
|
|
|
|
$${PWD}/include/download_thread.h
|
2023-11-08 13:02:26 +01:00
|
|
|
|
|
|
|
SOURCES += \
|
2023-11-08 16:22:39 +01:00
|
|
|
$${PWD}/src/datei.cpp \
|
|
|
|
$${PWD}/src/runProc.cpp \
|
2023-11-08 13:02:26 +01:00
|
|
|
$${PWD}/src/controlBus.cpp \
|
|
|
|
$${PWD}/src/dcBL.cpp \
|
|
|
|
$${PWD}/src/hwapi.cpp \
|
|
|
|
$${PWD}/src/sendWRcmd.cpp \
|
|
|
|
$${PWD}/src/storeINdata.cpp \
|
|
|
|
$${PWD}/src/tslib.cpp \
|
2024-02-22 08:44:34 +01:00
|
|
|
$${PWD}/src/shared_mem_buffer.cpp \
|
|
|
|
$${PWD}/src/reporting_thread.cpp \
|
|
|
|
$${PWD}/src/download_thread.cpp
|
2023-11-08 13:02:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
# 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
|