]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
bos #26458 Versioning of sources via git commit id (sha1)
authorvsr <vsr@opencascade.com>
Mon, 4 Oct 2021 11:08:13 +0000 (14:08 +0300)
committervsr <vsr@opencascade.com>
Mon, 4 Oct 2021 11:08:13 +0000 (14:08 +0300)
CMakeLists.txt
src/PyWrapping/CMakeLists.txt
src/PyWrapping/medcoupling.i

index ea2c09cea1c19ff859959924f2d802c173e95100..5acc55c7ce6fbec3f2ff88cfcad5c77ce479e7ac 100644 (file)
 #
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
-#INCLUDE(CMakeDependentOption)
+
+# Project name
+# ============
+# original
 PROJECT(MEDCoupling C CXX)
+# upper case
+STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 
 IF (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.3)
@@ -33,17 +38,6 @@ IF (${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.3)
 ENDIF()
 
 
-# Versioning
-# ===========
-# Project name, 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})
-
 # Common CMake macros
 SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake files")
 IF(EXISTS ${CONFIGURATION_ROOT_DIR})
@@ -53,6 +47,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)
+MESSAGE(STATUS "Building ${PROJECT_NAME_UC} ${${PROJECT_NAME_UC}_VERSION} from \"${${PROJECT_NAME_UC}_GIT_SHA1}\"")
+
 # Platform setup
 # ==============
 INCLUDE(SalomeSetupPlatform)
@@ -262,7 +261,6 @@ MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_PYTHON MEDCOUPLING_INSTALL_PYTHON_SHARED ME
 
 # Header configuration
 # ====================
-SALOME_XVERSION(${PROJECT_NAME})
 SALOME_CONFIGURE_FILE(MEDCoupling_version.h.in MEDCoupling_version.h INSTALL ${MEDCOUPLING_INSTALL_HEADERS})
 
 # Accumulate environment variables for MED module
index e406b1d0852eb0806937e146ddf1d622838e4ac4..4ddf50cc2166aa5c431d7bc45ab628e9e36e4d6d 100644 (file)
@@ -21,7 +21,7 @@
 FIND_PACKAGE(SWIG REQUIRED)
 INCLUDE(${SWIG_USE_FILE})
 
-ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
+ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS} -DMEDCOUPLING_GIT_SHA1=\"${MEDCOUPLING_GIT_SHA1}\")
 
 SET_SOURCE_FILES_PROPERTIES(medcoupling.i PROPERTIES CPLUSPLUS ON)
 IF(WIN32)
index 3c7a0e6d1d0f11000c1c0bb572d5cb6703c19a32..08f56b79eed625e953623535c9f4ebf7e4c3da2c 100644 (file)
@@ -48,6 +48,8 @@
 %include "ParaMEDMEMCommon.i"
 #endif
 
+%constant const char __version__[]=MEDCOUPLING_GIT_SHA1;
+
 %{
   static const char SEQ_INTERPOL_EXT[]="Sequential interpolator";
   static const char MEDFILEIO_EXT[]="MED file I/O";