Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration - TCL OCCT version extraction issue #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
# 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
description: 'Build OCCT documentation using doxygen'

on:
push:
branches:
- 'master'

jobs:
build:
name: Build Refman Documentation
runs-on: windows-2022

steps:
- name: Checkout repository
uses: actions/checkout@v4.2.1

runs:
using: composite
steps:
- name: Install dependencies
run: |
choco install -y graphviz
choco install -y doxygen.install
shell: pwsh

- name: Build refman documentation
run: |
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/build-and-test-multiplatform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ jobs:
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
Expand Down
41 changes: 30 additions & 11 deletions adm/occaux.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,39 @@ proc OCCDoc_GetRelPath {thePathFrom thePathTo} {

# 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
}

Expand Down