From d22606dc078bbd618d2563a552a62cd4f46ac682 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 10 Jan 2018 16:06:18 +0100 Subject: include: Add version header This moves the version definition for Ouroboros into its own header file, which is generated by CMake and installed on the system. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/ouroboros/CMakeLists.txt | 7 ++++++- include/ouroboros/version.h.in | 30 ++++++++++++++++++++++++++++++ include/ouroboros/wrap/ouroboros.i | 2 ++ src/irmd/config.h.in | 4 ---- src/irmd/main.c | 1 + 5 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 include/ouroboros/version.h.in diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt index e94d5c6c..d3b6e847 100644 --- a/include/ouroboros/CMakeLists.txt +++ b/include/ouroboros/CMakeLists.txt @@ -1,3 +1,6 @@ +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/version.h" @ONLY) + set(HEADER_FILES cacep.h cdefs.h @@ -8,7 +11,9 @@ set(HEADER_FILES ipcp.h irm.h proto.h - qos.h) + qos.h + ${CMAKE_CURRENT_BINARY_DIR}/version.h + ) install(FILES ${HEADER_FILES} DESTINATION usr/include/ouroboros) diff --git a/include/ouroboros/version.h.in b/include/ouroboros/version.h.in new file mode 100644 index 00000000..28c4bd92 --- /dev/null +++ b/include/ouroboros/version.h.in @@ -0,0 +1,30 @@ +/* + * Ouroboros - Copyright (C) 2016 - 2017 + * + * Ouroboros version + * + * Dimitri Staessens + * Sander Vrijders + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., http://www.fsf.org/about/contact/. + */ + +#ifndef OUROBOROS_VERSION_H +#define OUROBOROS_VERSION_H + +#define OUROBOROS_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@ +#define OUROBOROS_VERSION_MINOR @PACKAGE_VERSION_MINOR@ +#define OUROBOROS_VERSION_PATCH @PACKAGE_VERSION_PATCH@ + +#endif /* OUROBOROS_VERSION_H */ diff --git a/include/ouroboros/wrap/ouroboros.i b/include/ouroboros/wrap/ouroboros.i index 25aa846e..a34c45ec 100644 --- a/include/ouroboros/wrap/ouroboros.i +++ b/include/ouroboros/wrap/ouroboros.i @@ -31,6 +31,7 @@ #include "ouroboros/irm.h" #include "ouroboros/ipcp.h" #include "ouroboros/qos.h" +#include "ouroboros/version.h" %} typedef int pid_t; @@ -44,3 +45,4 @@ typedef int pid_t; %include "ouroboros/irm.h" %include "ouroboros/ipcp.h" %include "ouroboros/qos.h" +%include "ouroboros/version.h" diff --git a/src/irmd/config.h.in b/src/irmd/config.h.in index 2a1a6d6a..923a6ef5 100644 --- a/src/irmd/config.h.in +++ b/src/irmd/config.h.in @@ -28,10 +28,6 @@ #define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" -#define OUROBOROS_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@ -#define OUROBOROS_VERSION_MINOR @PACKAGE_VERSION_MINOR@ -#define OUROBOROS_VERSION_PATCH @PACKAGE_VERSION_PATCH@ - #define PTHREAD_COND_CLOCK @PTHREAD_COND_CLOCK@ #define SOCKET_TIMEOUT @SOCKET_TIMEOUT@ diff --git a/src/irmd/main.c b/src/irmd/main.c index f109d5e2..1e794139 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "utils.h" #include "registry.h" -- cgit v1.2.3