Commit 0abfe1f6 authored by Michael Ott's avatar Michael Ott
Browse files

Add version information to libdcdb, CollectAgent and all tools

parent b1567e2c
include ../config.mk
CXXFLAGS = -O2 -g --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I../include/ -I../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/asio/asio/include -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/cxxopts/src -DASIO_HEADER_ONLY -DBOOST_TEST_DYN_LINK -DBOOST_LOG_DYN_LINK
CXXFLAGS = -O2 -g --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I../include/ -I../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DBOOST_LOG_DYN_LINK -I$(DCDBDEPSPATH)/cpp-netlib-0.12.0-final/deps/asio/asio/include -DVERSION=\"$(VERSION)\"
OBJS = collectagent.o \
configuration.o \
......
......@@ -38,6 +38,7 @@
#include <dcdb/connection.h>
#include <dcdb/sensordatastore.h>
#include <dcdb/sensorconfig.h>
#include <dcdb/version.h>
#include "configuration.h"
#include "simplemqttserver.h"
......@@ -259,6 +260,7 @@ void usage() {
}
int main(int argc, char* const argv[]) {
cout << "CollectAgent " << VERSION << " (libdcdb " << DCDB::Version::getVersion() << ")" << endl << endl;
try{
......
DCDBBASEPATH ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST)))/..)
DCDBDEPSPATH ?= $(DCDBBASEPATH)/deps
DCDBDEPLOYPATH ?= $(DCDBBASEPATH)/install
VERSION = $(shell git describe --tags|sed 's/-\([0-9]*\)/.\1/')
......@@ -5,7 +5,7 @@ CXXFLAGS = -O2 -ggdb -Wall -Werror \
-fPIC --std=c++11 -I./include -I./include_internal -I$(DCDBDEPLOYPATH)/include \
-I../include/ -fmessage-length=0 -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG \
-Wno-unused-local-typedef -Wno-unknown-warning-option -Wno-unknown-warning \
-Wno-deprecated-declarations
-Wno-deprecated-declarations -DVERSION=\"$(VERSION)\"
# List of object files to build and the derived list of corresponding source files
OBJS = src/connection.o \
......@@ -17,7 +17,8 @@ OBJS = src/connection.o \
src/unitconv.o \
src/virtualsensor.o \
src/c_api.o \
src/sensoroperations.o
src/sensoroperations.o \
src/version.o
# List of public header files necessary to use this libray
PUBHEADERS = $(shell find include -type f -iname "*.h")
......
#ifndef DCDB_VERSION_H
#define DCDB_VERSION_H
#include <string>
namespace DCDB {
class Version
{
public:
static std::string getVersion();
};
}
#endif
//
// version.cpp
// dcdb2
//
// Created by Ott, Michael on 19.12.18.
// Copyright © 2018 LRZ. All rights reserved.
//
#include "dcdb/version.h"
using namespace DCDB;
std::string Version::getVersion() {
return std::string(VERSION);
}
include ../../config.mk
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I../../lib/include -I$(DCDBDEPLOYPATH)/include
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I../../include/ -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DVERSION=\"$(VERSION)\"
OBJS = dcdbconfig.o sensoraction.o dbaction.o useraction.o
LIBS = -L$(DCDBDEPLOYPATH)/lib -L../../lib -ldcdb -lcassandra -luv -lboost_random -lboost_system -lboost_date_time -lboost_regex -lssl -lcrypto
# GCC 4.8 is broken
......
......@@ -29,8 +29,8 @@
#include <unistd.h>
#include "dcdb/version.h"
#include "cassandra.h"
#include "useraction.h"
......@@ -46,6 +46,8 @@ void usage(int argc, char* argv[])
int main(int argc, char* argv[])
{
std::cout << "dcdbconfig " << VERSION << " (libdcdb " << DCDB::Version::getVersion() << ")" << std::endl << std::endl;
/* Check if run from command line */
int argcReal;
char **argvReal;
......
include ../../config.mk
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-unknown-warning-option -fmessage-length=0 -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-unknown-warning-option -fmessage-length=0 -I../../include/ -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DVERSION=\"$(VERSION)\"
OBJS = dcdbcsvimport.o
LIBS = -L$(DCDBDEPLOYPATH)/lib -L../../lib -ldcdb -lcassandra -luv -lboost_random -lboost_system -lboost_date_time -lboost_regex -lssl -lcrypto -lpthread
TARGET = dcdbcsvimport
......
......@@ -48,6 +48,7 @@
#include <dcdb/sensorid.h>
#include <dcdb/timestamp.h>
#include <dcdb/c_api.h>
#include "dcdb/version.h"
typedef struct {
std::string name;
......@@ -67,6 +68,7 @@ void usage(int argc, char* argv[])
int main(int argc, char** argv)
{
std::cout << "dcdbcsvimport " << VERSION << " (libdcdb " << DCDB::Version::getVersion() << ")" << std::endl << std::endl;
/* Check command line parameters */
if (argc < 3) {
usage(argc, argv);
......
include ../../config.mk
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I../../include -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-unknown-warning-option -fmessage-length=0 -I../../include/ -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DVERSION=\"$(VERSION)\"
OBJS = dcdbquery.o query.o
LIBS = -L$(DCDBDEPLOYPATH)/lib -L../../lib -ldcdb -lcassandra -luv -lboost_random -lboost_system -lboost_date_time -lboost_regex -lssl -lcrypto
TARGET = dcdbquery
......
......@@ -35,6 +35,7 @@
/* Custom headers */
#include "dcdb/timestamp.h"
#include "dcdb/version.h"
#include "query.h"
void usage(void)
......@@ -66,6 +67,8 @@ void usage(void)
int main(int argc, char * const argv[])
{
std::cout << "dcdbquery " << VERSION << " (libdcdb " << DCDB::Version::getVersion() << ")" << std::endl << std::endl;
/* Check if run from command line */
int argcReal;
char **argvReal;
......
include ../../config.mk
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-unknown-warning-option -Wno-unknown-warning -fmessage-length=0 -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-unknown-warning-option -Wno-unknown-warning -fmessage-length=0 -I../../include/ -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DVERSION=\"$(VERSION)\"
OBJS = dcdbquerysum.o
LIBS = -L$(DCDBDEPLOYPATH)/lib -L../../lib -ldcdb -lcassandra -luv -lboost_random -lboost_system -lboost_date_time -lboost_regex -lssl -lcrypto
TARGET = dcdbquerysum
......
......@@ -38,6 +38,8 @@
/* Custom headers */
#include "dcdb/timestamp.h"
#include "dcdb/c_api.h"
#include "dcdb/version.h"
void usage() {
std::cout
......@@ -52,6 +54,7 @@ void usage() {
}
int main(int argc, char* argv[]) {
std::cout << "dcdbquerysum " << VERSION << " (libdcdb " << DCDB::Version::getVersion() << ")" << std::endl << std::endl;
/* Check command line arguments */
if (argc <= 3) {
......
include ../../config.mk
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-unknown-warning-option -fmessage-length=0 -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
CXXFLAGS = -O2 -ggdb --std=c++11 -Wall -Wno-unused-local-typedefs -Wno-unknown-warning-option -fmessage-length=0 -I../../include/ -I../../lib/include -I$(DCDBDEPLOYPATH)/include -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG -DVERSION=\"$(VERSION)\"
OBJS = dcdbunitconv.o
LIBS = -L$(DCDBDEPLOYPATH)/lib -L../../lib -ldcdb -lcassandra -luv -lboost_random -lboost_system -lboost_date_time -lboost_regex -lssl -lcrypto
TARGET = dcdbunitconv
......
......@@ -34,6 +34,7 @@
/* Custom headers */
#include "dcdb/unitconv.h"
#include "dcdb/version.h"
void usage()
{
......@@ -47,6 +48,8 @@ void usage()
int main(int argc, const char* argv[])
{
std::cout << "dcdbunitconv " << VERSION << " (libdcdb " << DCDB::Version::getVersion() << ")" << std::endl << std::endl;
/* Check command line */
if (argc < 4) {
usage();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment