From ea7d82ba41c99cf2f0af90e844eb3ae478ba17e4 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 8 Sep 2022 17:26:27 +0300 Subject: [PATCH] Support of OCCT service pack version --- cmake/FindSalomeOpenCASCADE.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 -- 2.39.2