From: vsr Date: Wed, 2 Apr 2014 05:19:47 +0000 (+0400) Subject: Modify a way OCCT dev version is detected according to changed OCCT versioning policy X-Git-Tag: V7_4_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ce9e3f747427027b676ead4b0f9f4f5b6e326bb;p=modules%2Fkernel.git Modify a way OCCT dev version is detected according to changed OCCT versioning policy --- diff --git a/salome_adm/cmake_files/FindCAS.cmake b/salome_adm/cmake_files/FindCAS.cmake index 0677962cf..9ffea50c4 100644 --- a/salome_adm/cmake_files/FindCAS.cmake +++ b/salome_adm/cmake_files/FindCAS.cmake @@ -28,24 +28,19 @@ FIND_PATH(CAS_INCLUDE_DIRS ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES inc) FIND_FILE(CAS_VERSION_FILE ${_CAS_VERSION_FILE_NAME} PATH_SUFFIXES inc) MARK_AS_ADVANCED(CAS_VERSION_FILE) -# Is this a development version: SET(CAS_VERSION_DEVELOPMENT 0) IF(CAS_VERSION_FILE) + # Check if this is a development version: FILE(STRINGS ${CAS_VERSION_FILE} CAS_VERSION_DEVELOPMENT_STR - REGEX "^ *#define OCC_VERSION_DEVELOPMENT *\"dev\".*$") + REGEX "^ *#define OCC_VERSION_DEVELOPMENT") IF(CAS_VERSION_DEVELOPMENT_STR) SET(CAS_VERSION_DEVELOPMENT 1) ENDIF(CAS_VERSION_DEVELOPMENT_STR) - # Extract normal version: + # Extract actual version number: FILE(STRINGS ${CAS_VERSION_FILE} _tmp REGEX "^ *#define OCC_VERSION_COMPLETE *\"[^\"]*\".*$") STRING(REGEX REPLACE ".*\"([^\"]*)\".*" "\\1" CAS_VERSION_STR "${_tmp}") - -ENDIF() - -IF(CAS_VERSION_DEVELOPMENT AND (NOT CAS_FIND_QUIETLY)) - MESSAGE(STATUS "OpenCascade: development version is being used!") ENDIF() # Win specific stuff: @@ -73,10 +68,6 @@ IF(CMAKE_SIZEOF_VOID_P STREQUAL 8) SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -D_OCC64") ENDIF() -IF(CAS_VERSION_DEVELOPMENT STREQUAL 1) - SET(CAS_DEFINITIONS "${CAS_DEFINITIONS} -DCAS_VERSION_DEVELOPMENT") -ENDIF() - # Find Xmu library (X11 widgets?) IF(NOT WIN32) FIND_LIBRARY(CAS_Xmu Xmu) @@ -238,7 +229,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CAS ) IF(CAS_FOUND AND NOT CAS_FIND_QUIETLY) - MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR}") + IF(CAS_VERSION_DEVELOPMENT) + MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR} (development)") + ELSE(CAS_VERSION_DEVELOPMENT) + MESSAGE(STATUS "Found OpenCascade version: ${CAS_VERSION_STR}") + ENDIF(CAS_VERSION_DEVELOPMENT) ENDIF() - - diff --git a/src/Basics/Basics_OCCTVersion.hxx b/src/Basics/Basics_OCCTVersion.hxx index 02aad077c..a1182bc8d 100644 --- a/src/Basics/Basics_OCCTVersion.hxx +++ b/src/Basics/Basics_OCCTVersion.hxx @@ -29,15 +29,20 @@ #include // -// NOTE: CAS_VERSION_DEVELOPMENT macro is defined via command line in contrast to OCC_VERSION_DEVELOPMENT -// which is specified in the Standard_Version.hxx +// NOTE: Since version 6.7.0 OCC_VERSION_DEVELOPMENT macro in the Standard_Version.hxx +// points to the development status of the OCCT version: for example "dev", "alpha", +// "beta", "rc1", etc. +// OCC_VERSION_MAJOR, OCC_VERSION_MINOR and OCC_VERSION_MAINTENANCE macros +// specify actual (final) version number; for development version it is a future +// target version number (i.e. version number is incremented immediately after +// releasing of the stable version). // #ifdef OCC_VERSION_SERVICEPACK # define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK) #else -# ifdef CAS_VERSION_DEVELOPMENT -# define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | 1) +# ifdef OCC_VERSION_DEVELOPMENT +# define OCC_VERSION_LARGE ((OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)-1) # else # define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8) # endif