plugins types FEATURE fixed size values

Refs #1552

Signed-off-by: Christian Hopps <chopps@labn.net>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef4085a..35b8621 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,9 +85,6 @@
 
 include_directories(${PROJECT_BINARY_DIR}/src ${PROJECT_SOURCE_DIR}/src)
 
-configure_file(${PROJECT_SOURCE_DIR}/src/config.h.in ${PROJECT_BINARY_DIR}/src/config.h @ONLY)
-configure_file(${PROJECT_SOURCE_DIR}/src/version.h.in ${PROJECT_BINARY_DIR}/src/version.h @ONLY)
-
 # type plugins are separate because they have their documentation generated
 set(type_plugins
     src/plugins_types/binary.c
@@ -210,6 +207,10 @@
 option(ENABLE_COVERAGE "Build code coverage report from tests" OFF)
 option(ENABLE_FUZZ_TARGETS "Build target programs suitable for fuzzing with AFL" OFF)
 
+set(LYD_VALUE_SIZE "24" CACHE STRING "Maximum size in bytes of data node values that do not need to be allocated dynamically, minimum is 8")
+if(NOT LYD_VALUE_SIZE GREATER_EQUAL 8)
+    message(FATAL_ERROR "Data node value size \"${LYD_VALUE_SIZE}\" is not valid.")
+endif()
 set(PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libyang" CACHE STRING "Directory with libyang plugins (extensions and user types)")
 set(PLUGINS_DIR_EXTENSIONS "${PLUGINS_DIR}/extensions" CACHE STRING "Directory with libyang user extensions plugins")
 set(PLUGINS_DIR_TYPES "${PLUGINS_DIR}/types" CACHE STRING "Directory with libyang user types plugins")
@@ -251,6 +252,10 @@
 # static build requires static libpcre2 library
 option(ENABLE_STATIC "Build static (.a) library" OFF)
 
+# generate files
+configure_file(${PROJECT_SOURCE_DIR}/src/config.h.in ${PROJECT_BINARY_DIR}/src/config.h @ONLY)
+configure_file(${PROJECT_SOURCE_DIR}/src/version.h.in ${PROJECT_BINARY_DIR}/src/version.h @ONLY)
+
 #
 # targets
 #