Commit 6cdf0295 by Christophe Geuzaine

better handling of unknown opencascade versions (it is checked at compile-time anyway)

parent b0465702
Pipeline #163 passed with stage
in 9 minutes 35 seconds
Showing with 12 additions and 10 deletions
......@@ -1090,7 +1090,6 @@ if(HAVE_SOLVER)
endif(HAVE_SOLVER)
if(ENABLE_OCC)
set(OCC_VERSION "")
set(OCC_MINIMAL_VERSION "6.9.1")
if(WIN32 OR CYGWIN)
if(HAVE_64BIT_SIZE_T)
......@@ -1106,21 +1105,23 @@ if(ENABLE_OCC)
if(OCC_INC)
file(STRINGS ${OCC_INC}/Standard_Version.hxx
OCC_MAJOR REGEX "#define OCC_VERSION_MAJOR.*")
string(REGEX MATCH "[0-9]+" OCC_MAJOR ${OCC_MAJOR})
file(STRINGS ${OCC_INC}/Standard_Version.hxx
OCC_MINOR REGEX "#define OCC_VERSION_MINOR.*")
string(REGEX MATCH "[0-9]+" OCC_MINOR ${OCC_MINOR})
file(STRINGS ${OCC_INC}/Standard_Version.hxx
OCC_MAINT REGEX "#define OCC_VERSION_MAINTENANCE.*")
string(REGEX MATCH "[0-9]+" OCC_MAINT ${OCC_MAINT})
set(OCC_VERSION "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
message(STATUS "Found OpenCASCADE version ${OCC_VERSION} in ${OCC_INC}")
if(OCC_MAJOR AND OCC_MINOR AND OCC_MAINT)
string(REGEX MATCH "[0-9]+" OCC_MAJOR "${OCC_MAJOR}")
string(REGEX MATCH "[0-9]+" OCC_MINOR "${OCC_MINOR}")
string(REGEX MATCH "[0-9]+" OCC_MAINT "${OCC_MAINT}")
set(OCC_VERSION "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
message(STATUS "Found OpenCASCADE version ${OCC_VERSION} in ${OCC_INC}")
endif(OCC_MAJOR AND OCC_MINOR AND OCC_MAINT)
endif(OCC_INC)
if(OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
if(OCC_VERSION AND OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
message(WARNING "Gmsh requires OpenCASCADE >= ${OCC_MINIMAL_VERSION}")
message(WARNING "Use CMAKE_PREFIX_PATH or the CASROOT environment variable "
"to explicitely specify the installation path of OpenCASCADE")
else (OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
else(OCC_VERSION AND OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
set(OCC_LIBS_REQUIRED
# subset of DataExchange
TKSTEP TKSTEP209 TKSTEPAttr TKSTEPBase TKIGES TKXSBase
......@@ -1139,7 +1140,8 @@ if(ENABLE_OCC)
else(OCC_LIBS)
set(OCC_LIBS)
foreach(OCC ${OCC_LIBS_REQUIRED})
find_library(OCC_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib)
find_library(OCC_LIB ${OCC} HINTS ENV CASROOT PATH_SUFFIXES
lib ${OCC_SYS_NAME}/lib ${OCC_SYS_NAME}/vc8/lib)
if(OCC_LIB)
list(APPEND OCC_LIBS ${OCC_LIB})
else(OCC_LIB)
......@@ -1163,7 +1165,7 @@ if(ENABLE_OCC)
add_definitions(-DWNT)
endif(CYGWIN)
endif(NUM_OCC_LIBS EQUAL NUM_OCC_LIBS_REQUIRED)
endif(OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
endif(OCC_VERSION AND OCC_VERSION STRLESS ${OCC_MINIMAL_VERSION})
endif(ENABLE_OCC)
if(ENABLE_ACIS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment