From: jfa Date: Thu, 8 Sep 2022 14:26:27 +0000 (+0300) Subject: Support of OCCT service pack version X-Git-Tag: V9_10_0a1~4^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ea7d82ba41c99cf2f0af90e844eb3ae478ba17e4;p=tools%2Fconfiguration.git Support of OCCT service pack version --- diff --git a/cmake/FindSalomeOpenCASCADE.cmake b/cmake/FindSalomeOpenCASCADE.cmake index 68caad8..28811dd 100644 --- a/cmake/FindSalomeOpenCASCADE.cmake +++ b/cmake/FindSalomeOpenCASCADE.cmake @@ -31,10 +31,25 @@ ELSE() SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OpenCASCADE OpenCASCADE_INCLUDE_DIR 2) ENDIF() +SET(OpenCASCADE_SP_VERSION 0) IF(OpenCASCADE_FOUND) + + FIND_FILE(CAS_VERSION_FILE Standard_Version.hxx PATHS ${OpenCASCADE_INCLUDE_DIR}) + FILE(STRINGS ${CAS_VERSION_FILE} _tmp REGEX "^ *#define OCC_VERSION_SERVICEPACK") + IF(_tmp) + STRING(REGEX MATCHALL "[0-9]+" _spComponents "${_tmp}") + LIST(LENGTH _spComponents _len) + IF(${_len} GREATER 0) + LIST(GET _spComponents 0 OpenCASCADE_SP_VERSION) + ENDIF() + ENDIF(_tmp) IF(NOT CAS_FIND_QUIETLY) - MESSAGE(STATUS "Found OpenCASCADE version: ${OpenCASCADE_VERSION}") + IF(${OpenCASCADE_SP_VERSION}) + MESSAGE(STATUS "Found OpenCASCADE version: ${OpenCASCADE_VERSION}p${OpenCASCADE_SP_VERSION}") + ELSE() + MESSAGE(STATUS "Found OpenCASCADE version: ${OpenCASCADE_VERSION}") + ENDIF() ENDIF() # OPENCASCADE definitions