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:
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)
)
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()
-
-
#include <Standard_Version.hxx>
//
-// 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