option(BUILD_SHARED_LIBS "build shared libs" ON)
+configure_file(include/config.h.in include/config.h)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
+
file(GLOB SOURCES src/*.c)
file(GLOB PUBLIC_HEADER include/*.h)
include_directories(include)
--- /dev/null
+#ifndef SPANDISC_CONFIG_IN_H
+#define SPANDISC_CONFIG_IN_H
+
+#define VERSION "@PROJECT_VERSION@"
+
+#endif
#ifndef _LOGIC_H
#define _LOGIC_H
+const char *get_version();
+
/**
* Event pointer to method execute by the writing file.
* This Method is called by span
#include <stdlib.h>
#include <string.h>
+#include "config.h"
#include "spandisc.h"
#include "logic.h"
#include "splitter.h"
status_print_t status_print = NULL;
+const char * get_version()
+{
+ return VERSION;
+}
+
void on_status_print(const char *output, medium_t disc)
{
if (status_print != NULL)
void show_version()
{
printf("discspan %s\n", VERSION);
+ printf("libspandisc %s\n", get_version());
}
param_t read_argument(int argc, char *argv[])