diff --git a/CMakeLists.txt b/CMakeLists.txt index 41054648..6ae31fb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,6 @@ add_library(tinycbor src/cborpretty.c src/cborvalidation.c src/cbor.h - src/tinycbor-version.h ) if(WITH_FREESTANDING) target_compile_options(tinycbor PUBLIC @@ -123,6 +122,9 @@ generate_export_header(tinycbor EXPORT_FILE_NAME "tinycbor-export.h" ) +# Generate version header +configure_file(src/tinycbor-version.h.in tinycbor-version.h) + # Check for open_memstream and store the result in HAVE_OPEN_MEMSTREAM check_symbol_exists(open_memstream stdio.h HAVE_OPEN_MEMSTREAM) check_symbol_exists(funopen stdio.h HAVE_OPEN_FUNOPEN) diff --git a/src/cbor.h b/src/cbor.h index 765a0ce8..d5570265 100644 --- a/src/cbor.h +++ b/src/cbor.h @@ -38,8 +38,8 @@ #include "cbor_cfg.h" #endif -#include "tinycbor-version.h" #include "tinycbor-export.h" +#include "tinycbor-version.h" #define TINYCBOR_VERSION ((TINYCBOR_VERSION_MAJOR << 16) | (TINYCBOR_VERSION_MINOR << 8) | TINYCBOR_VERSION_PATCH) diff --git a/src/tinycbor-version.h b/src/tinycbor-version.h deleted file mode 100644 index a5ea9c38..00000000 --- a/src/tinycbor-version.h +++ /dev/null @@ -1,3 +0,0 @@ -#define TINYCBOR_VERSION_MAJOR 7 -#define TINYCBOR_VERSION_MINOR 0 -#define TINYCBOR_VERSION_PATCH 0 diff --git a/src/tinycbor-version.h.in b/src/tinycbor-version.h.in new file mode 100644 index 00000000..5ea04e64 --- /dev/null +++ b/src/tinycbor-version.h.in @@ -0,0 +1,7 @@ +/* Copyright (C) 2025 Intel Corporation + * SPDX-License-Identifier: MIT + */ +/* This is a generated file */ +#define TINYCBOR_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define TINYCBOR_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define TINYCBOR_VERSION_PATCH 0