TEMPLATE = lib
TARGET = CAmaster
VERSION="1.0.1"

HEADERS += \
    ../include/com.h \
    ../include/datIf.h \
    ../include/prot.h

SOURCES += \
    ../src/com.cpp \
    ../src/datIf.cpp \
    ../src/prot.cpp

include(../DCLibraries.pri)

win32 {
    BUILD_DATE=$$system("date /t")
    BUILD_TIME=$$system("time /t")
    GIT_COMMIT=""
    EXTENDED_VERSION=""
    EXTENDED_VERSION_LIB=""
} 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_LIB="libCAmaster-$${VERSION}-$${GIT_COMMIT}"
}

DEFINES+=APP_VERSION=\\\"$$VERSION\\\"
DEFINES+=APP_BUILD_DATE=\\\"$$BUILD_DATE\\\"
DEFINES+=APP_BUILD_TIME=\\\"$$BUILD_TIME\\\"
DEFINES+=APP_EXTENDED_VERSION=\\\"$$EXTENDED_VERSION\\\"
DEFINES+=APP_EXTENDED_VERSION_LIB=\\\"$$EXTENDED_VERSION_LIB\\\"

DEFINES+=THIS_IS_CA_MASTER
DESTDIR=$${_PRO_FILE_PWD_}/../build

unix {
    system("mkdir -p $${DESTDIR}")
    system("cp ../include/interfaces.h $${DESTDIR}")
}

DISTFILES += \
    ../include/dump.txt