summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrimio <vasi.vilvoiu@gmail.com>2018-03-04 23:15:23 +0200
committerrimio <vasi.vilvoiu@gmail.com>2018-03-04 23:15:23 +0200
commitf8b56be188fa5ea9706f91ec7ca513740850af02 (patch)
tree7096470b3c4275707133136643904214b3ce7286
parent00d1b9ef4ac0ab4b22b5630fcfb85d0fdd1d8566 (diff)
Added versioning
-rw-r--r--CMakeLists.txt13
-rw-r--r--include/.gitignore1
-rw-r--r--include/ecbor.h.in (renamed from include/ecbor.h)9
3 files changed, 22 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db2b684..a828b66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 3.1)
project (ecbor LANGUAGES C)
+# Version
+set (VERSION_MAJOR 0)
+set (VERSION_MINOR 1)
+set (VERSION_PATCH 0)
+
# Options
option (BUILD_DESCRIBE_TOOL "build ecbor-describe" ON)
@@ -21,9 +26,15 @@ set (INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
include_directories (${INCLUDE_DIR} ${SOURCE_DIR})
+# Configurations
+configure_file (
+ "${INCLUDE_DIR}/ecbor.h.in"
+ "${INCLUDE_DIR}/ecbor.h"
+)
+
# Source setup
set (LIB_INCLUDES
- "${PROJECT_SOURCE_DIR}/include/ecbor.h"
+ "${INCLUDE_DIR}/ecbor.h"
)
set (LIB_SOURCES
diff --git a/include/.gitignore b/include/.gitignore
new file mode 100644
index 0000000..768880b
--- /dev/null
+++ b/include/.gitignore
@@ -0,0 +1 @@
+ecbor.h
diff --git a/include/ecbor.h b/include/ecbor.h.in
index 62ae4b5..0379b93 100644
--- a/include/ecbor.h
+++ b/include/ecbor.h.in
@@ -12,6 +12,15 @@
#include <stddef.h>
/*
+ * Version
+ */
+#define ECBOR_VERSION_MAJOR @VERSION_MAJOR@
+#define ECBOR_VERSION_MINOR @VERSION_MINOR@
+#define ECBOR_VERSION_PATCH @VERSION_PATCH@
+
+#define ECBOR_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
+
+/*
* Error codes
*/
typedef enum {