]> gitweb.hhaalo.de Git - discspan.git/commitdiff
add: configure file with version number
authorBastian Dehn <hhaalo@arcor.de>
Fri, 27 Aug 2021 07:56:15 +0000 (09:56 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 27 Aug 2021 07:56:25 +0000 (09:56 +0200)
CMakeLists.txt
libs/spandisc/CMakeLists.txt
libs/spandisc/include/config.h.in [deleted file]
libs/spandisc/include/config_spandisc.h.in [new file with mode: 0644]
libs/spandisc/src/logic.c
src/config.h.in [deleted file]
src/config_discspan.h.in [new file with mode: 0644]
src/discspan.c

index 3bcad09ea4f31ded05cd2d3c7e1e09a584b06348..e5fe538641ba2ee0582fb0094f156e7071324fb2 100644 (file)
@@ -13,7 +13,7 @@ set(PROJECT_VERSION_PATCH 0)
 set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
 
 file(GLOB SOURCES src/*.c)
-configure_file(src/config.h.in src/config.h)
+configure_file(src/config_discspan.h.in src/config_discspan.h)
 include_directories(${CMAKE_CURRENT_BINARY_DIR}/src)
 
 include_directories(libs/spandisc/include)
index c9aad11423bda6c52235e2e338b262e172955c78..f0d3ee6d1e314f5d9bda58fad42ccccf3c90c44e 100644 (file)
@@ -12,12 +12,11 @@ set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT
 
 option(BUILD_SHARED_LIBS "build shared libs" ON)
 
-configure_file(include/config.h.in include/config.h)
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
+configure_file(include/config_spandisc.h.in include/config_spandisc.h)
 
 file(GLOB SOURCES src/*.c)
 file(GLOB PUBLIC_HEADER include/*.h)
-include_directories(include)
+include_directories(include ${CMAKE_CURRENT_BINARY_DIR}/include)
 
 if(BUILD_SHARED_LIBS)
        add_library(spandisc SHARED ${SOURCES})
diff --git a/libs/spandisc/include/config.h.in b/libs/spandisc/include/config.h.in
deleted file mode 100644 (file)
index 33ec557..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef SPANDISC_CONFIG_IN_H
-#define SPANDISC_CONFIG_IN_H
-
-#define VERSION "@PROJECT_VERSION@"
-
-#endif
diff --git a/libs/spandisc/include/config_spandisc.h.in b/libs/spandisc/include/config_spandisc.h.in
new file mode 100644 (file)
index 0000000..e4f5209
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef CONFIG_SPANDISC_IN_H
+#define CONFIG_SPANDISC_IN_H
+
+#define SPANDISC_VERSION "@PROJECT_VERSION@"
+
+#endif
index 98ca8b5eb960b0249f5044eeff245f2077ef5dda..4eef415e2f22a9b109eeaad0af9b0afce22c024a 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "config.h"
+#include "config_spandisc.h"
 #include "spandisc.h"
 #include "logic.h"
 #include "splitter.h"
@@ -12,7 +12,7 @@ status_print_t status_print = NULL;
 
 const char * get_version()
 {
-       return VERSION;
+       return SPANDISC_VERSION;
 }
 
 void on_status_print(const char *output, medium_t disc)
diff --git a/src/config.h.in b/src/config.h.in
deleted file mode 100644 (file)
index 27aefe8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef DISCSPAN_CONFIG_IN_H
-#define DISCSPAN_CONFIG_IN_H
-
-#define VERSION "@PROJECT_VERSION@"
-
-#endif
diff --git a/src/config_discspan.h.in b/src/config_discspan.h.in
new file mode 100644 (file)
index 0000000..de92501
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef CONFIG_DISCSPAN_IN_H
+#define CONFIG_DISCSPAN_IN_H
+
+#define DISCSPAN_VERSION "@PROJECT_VERSION@"
+
+#endif
index 0b4dd27c537e07d7182120ac3eaa42d1fde2a001..4d5d8bdcd0b09a7bf0be62f0ff8a92cffb2b6d21 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "config.h"
+#include "config_discspan.h"
 #include "spandisc.h"
 #include "logic.h"
 #include "help.h"
@@ -15,7 +15,7 @@ typedef struct {
 
 void show_version()
 {
-       printf("discspan %s\n", VERSION);
+       printf("discspan %s\n", DISCSPAN_VERSION);
        printf("libspandisc %s\n", get_version());
 }