From f452e7d5046a5dab121ba3cac1ba2640213a6cf2 Mon Sep 17 00:00:00 2001 From: vsr Date: Sat, 2 Oct 2021 15:19:54 +0300 Subject: [PATCH] bos #26458 Versioning of sources via git commit id (sha1) --- CMakeLists.txt | 21 +++++++++------------ bin/VERSION.in | 1 + src/KERNEL_PY/kernel/CMakeLists.txt | 2 +- src/KERNEL_PY/kernel/__init__.py | 1 + 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cc0b9201..4e644d97c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,20 +19,13 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) INCLUDE(CMakeDependentOption) +# Project name +# ============ +# original PROJECT(SalomeKERNEL C CXX) - -# Versioning -# =========== -# Project name, upper case +# upper case STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) -SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 7) -SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) -SET(${PROJECT_NAME_UC}_VERSION - ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) -SET(${PROJECT_NAME_UC}_VERSION_DEV 1) - # Common CMake macros # =================== SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files") @@ -43,6 +36,11 @@ ELSE() MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !") ENDIF() +# Versioning +# =========== +SALOME_SETUP_VERSION(9.7.0 DEVELOPMENT) +MESSAGE(STATUS "Building ${PROJECT_NAME_UC} ${${PROJECT_NAME_UC}_VERSION} from \"${${PROJECT_NAME_UC}_GIT_SHA1}\"") + # Platform setup # ============== INCLUDE(SalomeSetupPlatform) @@ -199,7 +197,6 @@ ENDIF() # Header configuration # ==================== -SALOME_XVERSION(${PROJECT_NAME}) SALOME_CONFIGURE_FILE(KERNEL_version.h.in KERNEL_version.h INSTALL ${SALOME_INSTALL_HEADERS}) # Configuration export diff --git a/bin/VERSION.in b/bin/VERSION.in index ab506d68d..57196a10c 100644 --- a/bin/VERSION.in +++ b/bin/VERSION.in @@ -1,2 +1,3 @@ [SALOME KERNEL] : @SALOMEKERNEL_VERSION@ [DEVELOPMENT] : @SALOMEKERNEL_VERSION_DEV@ +[SHA1] : @SALOMEKERNEL_GIT_SHA1@ diff --git a/src/KERNEL_PY/kernel/CMakeLists.txt b/src/KERNEL_PY/kernel/CMakeLists.txt index 731a78133..5f6977cdc 100644 --- a/src/KERNEL_PY/kernel/CMakeLists.txt +++ b/src/KERNEL_PY/kernel/CMakeLists.txt @@ -21,11 +21,11 @@ ADD_SUBDIRECTORY(parametric) SALOME_CONFIGURE_FILE(logconfig.py.in logconfig.py) SALOME_CONFIGURE_FILE(kernelpy_autotest.sh.in kernelpy_autotest.sh) +SALOME_CONFIGURE_FILE(__init__.py __init__.py INSTALL ${SALOME_INSTALL_PYTHON}/salome/kernel) # This first set of modules could be used in any context, you just # have to get a python environment. SET(mypkgpython_PYTHON - __init__.py deprecation.py logger.py termcolor.py diff --git a/src/KERNEL_PY/kernel/__init__.py b/src/KERNEL_PY/kernel/__init__.py index aef1fa3fe..63c523618 100644 --- a/src/KERNEL_PY/kernel/__init__.py +++ b/src/KERNEL_PY/kernel/__init__.py @@ -35,6 +35,7 @@ # \} __all__ = [ "deprecation", "logger", "termcolor", "logconfig" ] +__version__ = "@SALOMEKERNEL_GIT_SHA1@" # WARN: This file SHOULD NOT import salome stuff so that modules of the # package could be used outside of a SALOME session context when -- 2.39.2