From 661a8005733fcde96f98496dfec9ba6e28b9fa5b Mon Sep 17 00:00:00 2001 From: Marius Brehler Date: Fri, 8 Nov 2024 17:10:25 +0100 Subject: [PATCH] [shortfin] Get the version number from file (#454) --- shortfin/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shortfin/CMakeLists.txt b/shortfin/CMakeLists.txt index 5e38bd8cb..80d1cd61a 100644 --- a/shortfin/CMakeLists.txt +++ b/shortfin/CMakeLists.txt @@ -13,9 +13,14 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) ) endif() +# Get version number from file +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version_info.json VERSION_JSON_STRING) +string(JSON PACKAGE_VERSION GET ${VERSION_JSON_STRING} package-version) +string(REGEX MATCH "(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*" BASE_VERSION ${PACKAGE_VERSION}) + project( "libshortfin" - VERSION 0.9 + VERSION ${BASE_VERSION} LANGUAGES C CXX) include(CMakeDependentOption)