--- /dev/null
+name: Build Documentation
+description: 'Build OCCT documentation using doxygen'
+
+runs:
+ using: composite
+ steps:
+ - name: Install dependencies
+ run: |
+ choco install -y graphviz
+ choco install -y doxygen.install
+ shell: pwsh
+
+ - name: Build refman documentation
+ run: |
+ set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
+ cd adm
+ bash gendoc -refman
+ shell: cmd
+
+ - name: Upload refman documentation
+ uses: actions/upload-artifact@v4.4.3
+ with:
+ name: refman-doc
+ path: doc/refman
+ retention-days: 90
+
+ - name: Upload generation log
+ uses: actions/upload-artifact@v4.4.3
+ with:
+ name: doxygen.log
+ path: doc/html_doxygen_err.log
+ retention-days: 90
+
+ - name: Build documentation Overview
+ run: |
+ set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
+ cd adm
+ bash gendoc -overview
+ shell: cmd
+
+ - name: Upload overview documentation
+ uses: actions/upload-artifact@v4.4.3
+ with:
+ name: overview-doc
+ path: doc/overview
+ retention-days: 90
with:
base-ref: ${{ github.event.pull_request.base.ref || 'master' }}
+ documentation:
+ name: Build Documentation
+ runs-on: windows-2022
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4.2.1
+
+ - name: Build documentation
+ uses: ./.github/actions/build-docs
+
prepare-and-build-windows-x64:
name: Prepare and Build on Windows with MSVC (x64)
runs-on: windows-2022
+++ /dev/null
-# This workflow builds the OCCT reference manual and overview documentations.
-# It is triggered on pushes to the 'master' branch.
-# The workflow includes steps to checkout the repository, install dependencies, build the documentation, and upload the generated documentation and logs as artifacts.
-
-name: Build Documentation
-
-on:
- push:
- branches:
- - 'master'
-
-jobs:
- build:
- name: Build Refman Documentation
- runs-on: windows-2022
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4.2.1
-
- - name: Install dependencies
- run: |
- choco install -y graphviz
- choco install -y doxygen.install
-
- - name: Build refman documentation
- run: |
- set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
- cd adm
- bash gendoc -refman
- shell: cmd
-
- - name: Upload refman documentation
- uses: actions/upload-artifact@v4.4.3
- with:
- name: refman-doc
- path: doc/refman
- retention-days: 90
-
- - name: Upload generation log
- uses: actions/upload-artifact@v4.4.3
- with:
- name: doxygen.log
- path: doc/html_doxygen_err.log
- retention-days: 90
-
- - name: Build documentation Overview
- run: |
- set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
- cd adm
- bash gendoc -overview
- shell: cmd
-
- - name: Upload overview documentation
- uses: actions/upload-artifact@v4.4.3
- with:
- name: overview-doc
- path: doc/overview
- retention-days: 90
# Returns OCCT version string from version.cmake (if available)
proc OCCDoc_DetectCasVersion {} {
+ # Default version in case the file is not found or readable
set occt_ver "7.8.0"
set occt_ver_add ""
- 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 {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 }
+
+ # Construct path to version.cmake relative to script location
+ set filename "[file normalize [file dirname [info script]]/cmake/version.cmake]"
+
+ if { [file exists $filename] && [file readable $filename] } {
+ if {[catch {
+ set fh [open $filename "r"]
+ set fh_loaded [read $fh]
+ close $fh
+
+ # Use more robust regular expressions
+ regexp {OCC_VERSION_MAJOR\s+(\d+)} $fh_loaded -> major
+ regexp {OCC_VERSION_MINOR\s+(\d+)} $fh_loaded -> minor
+ regexp {OCC_VERSION_MAINTENANCE\s+(\d+)} $fh_loaded -> maint
+ regexp {OCC_VERSION_DEVELOPMENT\s+\"([^\"]+)\"} $fh_loaded -> occt_ver_add
+
+ if {[info exists major] && [info exists minor] && [info exists maint]} {
+ puts "Info: Open CASCADE Technology version $major.$minor.$maint"
+ set occt_ver "$major.$minor.$maint"
+ if { [info exists occt_ver_add] && $occt_ver_add != "" } {
+ set occt_ver ${occt_ver}.$occt_ver_add
+ }
+ }
+ } err]} {
+ puts "Warning: Error reading version from $filename: $err"
+ }
+ } else {
+ puts "Warning: Version file $filename not found or not readable"
}
+
return $occt_ver
}