Refactor version handling to use version.cmake and update related scripts.
Created new symbols to extract information by C function
# collect all the headers to <binary dir>/inc folder
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "src" "${INSTALL_DIR_INCLUDE}")
+# Create and install Standard_Version.hxx
+CONFIGURE_AND_INSTALL_VERSION_HEADER()
+
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
## Version
-The current version of OCCT can be found in the file [`src/Standard/Standard_Version.hxx`](src/Standard/Standard_Version.hxx).
+The current version of OCCT can be found in the file [`adm/cmake/version.cmake`](adm/cmake/version.cmake).
## Development
install (FILES ${OCCT_HEADER_FILES_INSTALLATION} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
endfunction()
+# Macro to configure and install Standard_Version.hxx file
+macro (CONFIGURE_AND_INSTALL_VERSION_HEADER)
+ if (DEFINED BUILD_OCCT_VERSION_EXT AND "${BUILD_OCCT_VERSION_EXT}" STREQUAL "${OCC_VERSION_STRING_EXT}" AND EXISTS "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx")
+ install(FILES "${OCCT_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
+ else()
+ set(BUILD_OCCT_VERSION_EXT "${OCC_VERSION_STRING_EXT}" CACHE STRING "OCCT Version string. Used only for caching, can't impact on build. For modification of version, please check adm/cmake/version.cmake" FORCE)
+ mark_as_advanced(BUILD_OCCT_VERSION_EXT)
+ string(TIMESTAMP OCCT_VERSION_DATE "%Y-%m-%d" UTC)
+ OCCT_CONFIGURE_AND_INSTALL ("adm/templates/Standard_Version.hxx.in" "${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" "Standard_Version.hxx" "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
+ endif()
+endmacro()
+
function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER THE_IS_PRIVATE)
if (NOT BUILD_USE_PCH)
return()
set (${MODULE_LIST} ${${MODULE_LIST}} PARENT_SCOPE)
endfunction()
-# Returns OCC version string from file Standard_Version.hxx (if available)
-function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT)
- set (OCC_VERSION_MAJOR 7)
- set (OCC_VERSION_MINOR 0)
- set (OCC_VERSION_MAINTENANCE 0)
- set (OCC_VERSION_DEVELOPMENT dev)
- set (OCC_VERSION_COMPLETE "7.0.0")
-
- set (STANDARD_VERSION_FILE "${CMAKE_SOURCE_DIR}/src/Standard/Standard_Version.hxx")
- if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
- set (STANDARD_VERSION_FILE "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
- endif()
-
- if (EXISTS "${STANDARD_VERSION_FILE}")
- foreach (SOUGHT_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE)
- file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
- string (REGEX REPLACE ".*${SOUGHT_VERSION} .*([^ ]+).*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
- endforeach()
-
- foreach (SOUGHT_VERSION OCC_VERSION_DEVELOPMENT OCC_VERSION_COMPLETE)
- file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
- string (REGEX REPLACE ".*${SOUGHT_VERSION} .*\"([^ ]+)\".*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
- endforeach()
+# Macro to extract git hash from the source directory
+# and store it in the variable GIT_HASH
+# in case if git is not found or error occurs, GIT_HASH is set to empty string
+macro(OCCT_GET_GIT_HASH)
+ set(GIT_HASH "")
+
+ find_package(Git QUIET)
+ if(GIT_FOUND)
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE GIT_HASH
+ ERROR_VARIABLE GIT_ERROR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT GIT_ERROR)
+ # Check if working directory is clean
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} status --porcelain
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE GIT_STATUS
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(NOT "${GIT_STATUS}" STREQUAL "")
+ message(DEBUG "Git working directory is not clean. Git hash may be incorrect.")
+ endif()
+ else()
+ set(GIT_HASH "")
+ endif()
endif()
-
+endmacro()
+
+# Returns OCC version string
+function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT)
+
+ include (version)
+ set (OCC_VERSION_COMPLETE "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
+ set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}")
+
set (OCC_VERSION_MAJOR "${OCC_VERSION_MAJOR}" PARENT_SCOPE)
set (OCC_VERSION_MINOR "${OCC_VERSION_MINOR}" PARENT_SCOPE)
set (OCC_VERSION_MAINTENANCE "${OCC_VERSION_MAINTENANCE}" PARENT_SCOPE)
- set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
+ set (OCCT_ON_DEVELOPMENT OFF)
+ if (NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "" AND NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "OCC_VERSION_DEVELOPMENT")
+ set (OCCT_ON_DEVELOPMENT ON)
+ endif()
+ if (${OCCT_ON_DEVELOPMENT})
+ set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
+ endif()
- if (OCC_VERSION_DEVELOPMENT AND OCC_VERSION_COMPLETE)
- set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
- else()
- set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}" PARENT_SCOPE)
+ set (SET_OCC_VERSION_DEVELOPMENT "")
+ if (${OCCT_ON_DEVELOPMENT})
+ OCCT_GET_GIT_HASH()
+ if (NOT "${GIT_HASH}" STREQUAL "")
+ set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}-${GIT_HASH}")
+ set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
+ endif()
+ set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}")
+ set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
+ set (SET_OCC_VERSION_DEVELOPMENT "#define OCC_VERSION_DEVELOPMENT \"${OCC_VERSION_DEVELOPMENT}\"")
endif()
+ set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
endfunction()
macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME THE_VAR_TYPE THE_MESSAGE_OF_BEING_CHECKED_PATH)
--- /dev/null
+#======================================================================
+#
+# Purpose: Defines macros identifying current version of Open CASCADE
+#
+# OCC_VERSION_MAJOR : (integer) number identifying major version
+# OCC_VERSION_MINOR : (integer) number identifying minor version
+# OCC_VERSION_MAINTENANCE : (integer) number identifying maintenance version
+# OCC_VERSION_DEVELOPMENT : (string) if defined, indicates development or modified version
+# in case of release, remove the value
+#
+# Sample values of OCC_VERSION_DEVELOPMENT:
+# - "dev" for development version between releases
+# - "beta..." or "rc..." for beta releases or release candidates
+# - "project..." for version containing project-specific fixes
+#
+# For development version git commit hash can be added to the version string
+#======================================================================
+
+set (OCC_VERSION_MAJOR 7 )
+set (OCC_VERSION_MINOR 8 )
+set (OCC_VERSION_MAINTENANCE 2 )
+set (OCC_VERSION_DEVELOPMENT "dev" )
return $thePathTo
}
-# Returns OCCT version string from file Standard_Version.hxx (if available)
+# Returns OCCT version string from version.cmake (if available)
proc OCCDoc_DetectCasVersion {} {
- set occt_ver 6.7.0
+ set occt_ver "7.8.0"
set occt_ver_add ""
- set filename "[OCCDoc_GetSourceDir]/Standard/Standard_Version.hxx"
+ set filename "[OCCDoc_GetSourceDir]/../adm/cmake/version.cmake"
if { [file exists $filename] } {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
- regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
- regexp {[^/]\s*#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
+ regexp {set\s+OCC_VERSION_MAJOR\s+([0-9]+)} $fh_loaded dummy major
+ regexp {set\s+OCC_VERSION_MINOR\s+([0-9]+)} $fh_loaded dummy minor
+ regexp {set\s+OCC_VERSION_MAINTENANCE\s+([0-9]+)} $fh_loaded dummy maint
+ regexp {set\s+OCC_VERSION_DEVELOPMENT\s+\"([^\"]+)\"} $fh_loaded dummy occt_ver_add
+ set occt_ver "$major.$minor.$maint"
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
}
return $occt_ver
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
-for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
-for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
+rem Get OCCT version
+call "%~dp0build_common.bat"
+set "aGitBranch="
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
for %%s in (%anNdkAbiList%) do (
--- /dev/null
+@echo OFF
+
+rem Extract version info from version.cmake
+for /f tokens^=2^ delims^=^" %%i in ('findstr OCC_VERSION_DEVELOPMENT "%~dp0\..\cmake\version.cmake"') do ( set "anOcctVerSuffix=%%i" )
+for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAJOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAJOR=%%i" )
+for /f tokens^=3 %%i in ('findstr OCC_VERSION_MINOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MINOR=%%i" )
+for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAINTENANCE "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAINTENANCE=%%i" )
+set "anOcctVersion=%OCC_VERSION_MAJOR%.%OCC_VERSION_MINOR%.%OCC_VERSION_MAINTENANCE%"
--- /dev/null
+#!/bin/bash
+
+# Extract version info from version.cmake
+anOcctVerSuffix=`grep -e "OCC_VERSION_DEVELOPMENT" "$aScriptDir/../cmake/version.cmake" | grep -o '".*"' | tr -d '"'`
+OCC_VERSION_MAJOR=`grep -e "OCC_VERSION_MAJOR" "$aScriptDir/../cmake/version.cmake" | awk '{print $3}'`
+OCC_VERSION_MINOR=`grep -e "OCC_VERSION_MINOR" "$aScriptDir/../cmake/version.cmake" | awk '{print $3}'`
+OCC_VERSION_MAINTENANCE=`grep -e "OCC_VERSION_MAINTENANCE" "$aScriptDir/../cmake/version.cmake" | awk '{print $3}'`
+anOcctVersion="$OCC_VERSION_MAJOR.$OCC_VERSION_MINOR.$OCC_VERSION_MAINTENANCE"
source "${aScriptDir}/ios_custom.sh"
fi
-anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
-anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
+source "${aScriptDir}/build_common.sh"
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
source "${aScriptDir}/macos_custom.sh"
fi
-anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
-anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
+source "${aScriptDir}/build_common.sh"
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
+call "%~dp0build_common.bat"
set "aGitBranch="
-for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
-for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
-for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
-for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
+call "%~dp0build_common.bat"
+set "aGitBranch="
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
--- /dev/null
+// Created on: @OCCT_VERSION_DATE@
+// Copyright (c) 2002-2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+/*======================================================================
+//
+// Purpose: Defines macros identifying current version of Open CASCADE
+//
+// OCC_VERSION_MAJOR : (integer) number identifying major version
+// OCC_VERSION_MINOR : (integer) number identifying minor version
+// OCC_VERSION_MAINTENANCE : (integer) number identifying maintenance version
+// OCC_VERSION_DEVELOPMENT : (string) if defined, indicates development or modified
+version
+// OCC_VERSION : (real) complete number (major.minor)
+// OCC_VERSION_STRING : (string) short version number ("major.minor")
+// OCC_VERSION_COMPLETE : (string) complete version number
+("major.minor.maintenance")
+// OCC_VERSION_STRING_EXT : (string) extended version
+("major.minor.maintenance.development")
+// OCC_VERSION_HEX : (hex) complete number as hex, two positions per each of
+major, minor, and patch number
+//
+//======================================================================*/
+
+#ifndef _Standard_Version_HeaderFile
+#define _Standard_Version_HeaderFile
+
+// Primary definitions
+#define OCC_VERSION_MAJOR @OCC_VERSION_MAJOR@
+#define OCC_VERSION_MINOR @OCC_VERSION_MINOR@
+#define OCC_VERSION_MAINTENANCE @OCC_VERSION_MAINTENANCE@
+
+//! This macro must be commented in official release, and set to non-empty
+//! string in other situations, to identify specifics of the version, e.g.:
+//! - "dev" for development version between releases
+//! - "beta..." or "rc..." for beta releases or release candidates
+//! - "project..." for version containing project-specific fixes
+@SET_OCC_VERSION_DEVELOPMENT@
+
+// Derived (manually): version as real and string (major.minor)
+#define OCC_VERSION @OCC_VERSION_MAJOR@.@OCC_VERSION_MINOR@
+#define OCC_VERSION_STRING "@OCC_VERSION_MAJOR@.@OCC_VERSION_MINOR@"
+#define OCC_VERSION_COMPLETE "@OCC_VERSION_MAJOR@.@OCC_VERSION_MINOR@.@OCC_VERSION_MAINTENANCE@"
+
+//! Derived: extended version as string ("major.minor.maintenance.dev")
+#ifdef OCC_VERSION_DEVELOPMENT
+ #define OCC_VERSION_STRING_EXT OCC_VERSION_COMPLETE "." OCC_VERSION_DEVELOPMENT
+#else
+ #define OCC_VERSION_STRING_EXT OCC_VERSION_COMPLETE
+#endif
+
+// Derived: complete version as hex (0x0'major'0'minor'0'maintenance')
+#define OCC_VERSION_HEX (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE)
+
+#endif /* _Standard_Version_HeaderFile */
VALUE "LegalCopyright", "\251 OPEN CASCADE SAS\000"
VALUE "ProductName", "Open CASCADE Technology\000"
VALUE "ProductVersion", OCC_VERSION_STRING_EXT "\000"
- VALUE "OfficialSite", "www.opencascade.com\000"
+ VALUE "OfficialSite", "www.occt3d.com\000"
END
END
BLOCK "VarFileInfo"
Standard_TypeMismatch.hxx
Standard_Underflow.hxx
Standard_UUID.hxx
-Standard_Version.hxx
+Standard_VersionInfo.cxx
+Standard_VersionInfo.hxx
Standard_WarningsDisable.hxx
Standard_WarningsRestore.hxx
+++ /dev/null
-// Created on: 2002-07-09
-// Created by: Andrey BETENEV
-// Copyright (c) 2002-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-/*======================================================================
-//
-// Purpose: Defines macros identifying current version of Open CASCADE
-//
-// OCC_VERSION_MAJOR : (integer) number identifying major version
-// OCC_VERSION_MINOR : (integer) number identifying minor version
-// OCC_VERSION_MAINTENANCE : (integer) number identifying maintenance version
-// OCC_VERSION_DEVELOPMENT : (string) if defined, indicates development or modified
-version
-// OCC_VERSION : (real) complete number (major.minor)
-// OCC_VERSION_STRING : (string) short version number ("major.minor")
-// OCC_VERSION_COMPLETE : (string) complete version number
-("major.minor.maintenance")
-// OCC_VERSION_STRING_EXT : (string) extended version
-("major.minor.maintenance.development")
-// OCC_VERSION_HEX : (hex) complete number as hex, two positions per each of
-major, minor, and patch number
-//
-//======================================================================*/
-
-#ifndef _Standard_Version_HeaderFile
-#define _Standard_Version_HeaderFile
-
-// Primary definitions
-#define OCC_VERSION_MAJOR 7
-#define OCC_VERSION_MINOR 8
-#define OCC_VERSION_MAINTENANCE 2
-
-//! This macro must be commented in official release, and set to non-empty
-//! string in other situations, to identify specifics of the version, e.g.:
-//! - "dev" for development version between releases
-//! - "beta..." or "rc..." for beta releases or release candidates
-//! - "project..." for version containing project-specific fixes
-#define OCC_VERSION_DEVELOPMENT "dev"
-
-// Derived (manually): version as real and string (major.minor)
-#define OCC_VERSION 7.8
-#define OCC_VERSION_STRING "7.8"
-#define OCC_VERSION_COMPLETE "7.8.2"
-
-//! Derived: extended version as string ("major.minor.maintenance.dev")
-#ifdef OCC_VERSION_DEVELOPMENT
- #define OCC_VERSION_STRING_EXT OCC_VERSION_COMPLETE "." OCC_VERSION_DEVELOPMENT
-#else
- #define OCC_VERSION_STRING_EXT OCC_VERSION_COMPLETE
-#endif
-
-// Derived: complete version as hex (0x0'major'0'minor'0'maintenance')
-#define OCC_VERSION_HEX (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE)
-
-#endif /* _Standard_Version_HeaderFile */
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <Standard_VersionInfo.hxx>
+
+#include <Standard_Version.hxx>
+
+//=================================================================================================
+
+const char* OCCT_DevelopmentVersion()
+{
+#ifdef OCC_VERSION_DEVELOPMENT
+ return OCC_VERSION_DEVELOPMENT;
+#else
+ return "";
+#endif
+}
+
+//=================================================================================================
+
+double OCCT_Version_Double()
+{
+ return OCC_VERSION;
+}
+
+//=================================================================================================
+
+const char* OCCT_Version_String()
+{
+ return OCC_VERSION_STRING;
+}
+
+//=================================================================================================
+
+const char* OCCT_Version_String_Complete()
+{
+ return OCC_VERSION_COMPLETE;
+}
+
+//=================================================================================================
+
+const char* OCCT_Version_String_Extended()
+{
+ return OCC_VERSION_STRING_EXT;
+}
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _Standard_VersionInfo_HeaderFile
+#define _Standard_VersionInfo_HeaderFile
+
+#include <Standard_Macro.hxx>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+ //! Returns development version of Open CASCADE Technology.
+ //! "" - in case of official release,
+ //! "dev" - in case of development version between releases,
+ //! "beta..." or "rc..." - in case of beta releases or release candidates,
+ //! "project..." - in case of version containing project-specific fixes.
+ Standard_EXPORT const char* OCCT_DevelopmentVersion();
+
+ //! Returns version of Open CASCADE Technology as a double "major.minor"
+ Standard_EXPORT double OCCT_Version_Double();
+
+ //! Returns version of Open CASCADE Technology as a string "major.minor"
+ Standard_EXPORT const char* OCCT_Version_String();
+
+ //! Returns complete version of Open CASCADE Technology as a string "major.minor.maintenance"
+ Standard_EXPORT const char* OCCT_Version_String_Complete();
+
+ //! Returns extended version of Open CASCADE Technology as a string
+ //! "major.minor.maintenance.devext". In case if no development version is defined, returns the
+ //! same as OCCT_Version_String_Complete().
+ Standard_EXPORT const char* OCCT_Version_String_Extended();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _Standard_VersionInfo_HeaderFile */