From f9f0748c9686b85d2ad56e81529dc2e42dcdfe60 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Thu, 7 Sep 2023 12:47:44 +0200 Subject: [PATCH] cmake: Zephyr kernel version.h and app_version.h creation Change the creation of version.h and app_version.h to apply the KERNEL_VERSION_CUSTOMIZATION APP_VERSION_CUSTOMIZATION values as target properties instead of CMake variables. This allows more freedom for users / Zephyr modules to adjust the value of KERNEL_VERSION_CUSTOMIZATION and APP_VERSION_CUSTOMIZATION values and thereby make use of the functionality introduced with #61635. Signed-off-by: Torsten Rasmussen --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7aae816c4b..666c9079c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -555,10 +555,11 @@ add_custom_command( -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/version.h -DVERSION_TYPE=KERNEL -DVERSION_FILE=${ZEPHYR_BASE}/VERSION - -DKERNEL_VERSION_CUSTOMIZATION="${KERNEL_VERSION_CUSTOMIZATION}" + -DKERNEL_VERSION_CUSTOMIZATION="$" ${build_version_argument} -P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake DEPENDS ${ZEPHYR_BASE}/VERSION ${git_dependency} + COMMAND_EXPAND_LISTS ) add_custom_target(version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/version.h) @@ -569,10 +570,11 @@ if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION) -DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/app_version.h -DVERSION_TYPE=APP -DVERSION_FILE=${APPLICATION_SOURCE_DIR}/VERSION - -DAPP_VERSION_CUSTOMIZATION="${APP_VERSION_CUSTOMIZATION}" + -DAPP_VERSION_CUSTOMIZATION="$" ${build_version_argument} -P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake DEPENDS ${APPLICATION_SOURCE_DIR}/VERSION ${git_dependency} + COMMAND_EXPAND_LISTS ) add_custom_target(app_version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/app_version.h) add_dependencies(zephyr_interface app_version_h)