From: Bastian Dehn Date: Fri, 27 Aug 2021 07:56:15 +0000 (+0200) Subject: add: configure file with version number X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=f110eaee339006c70e33a2f61c31ddda482fac3e;p=discspan.git add: configure file with version number --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bcad09..e5fe538 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/libs/spandisc/CMakeLists.txt b/libs/spandisc/CMakeLists.txt index c9aad11..f0d3ee6 100644 --- a/libs/spandisc/CMakeLists.txt +++ b/libs/spandisc/CMakeLists.txt @@ -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 index 33ec557..0000000 --- a/libs/spandisc/include/config.h.in +++ /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 index 0000000..e4f5209 --- /dev/null +++ b/libs/spandisc/include/config_spandisc.h.in @@ -0,0 +1,6 @@ +#ifndef CONFIG_SPANDISC_IN_H +#define CONFIG_SPANDISC_IN_H + +#define SPANDISC_VERSION "@PROJECT_VERSION@" + +#endif diff --git a/libs/spandisc/src/logic.c b/libs/spandisc/src/logic.c index 98ca8b5..4eef415 100644 --- a/libs/spandisc/src/logic.c +++ b/libs/spandisc/src/logic.c @@ -2,7 +2,7 @@ #include #include -#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 index 27aefe8..0000000 --- a/src/config.h.in +++ /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 index 0000000..de92501 --- /dev/null +++ b/src/config_discspan.h.in @@ -0,0 +1,6 @@ +#ifndef CONFIG_DISCSPAN_IN_H +#define CONFIG_DISCSPAN_IN_H + +#define DISCSPAN_VERSION "@PROJECT_VERSION@" + +#endif diff --git a/src/discspan.c b/src/discspan.c index 0b4dd27..4d5d8bd 100644 --- a/src/discspan.c +++ b/src/discspan.c @@ -2,7 +2,7 @@ #include #include -#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()); }