mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
75afece22e |
95
.github/actions/ascii-check/action.yml
vendored
95
.github/actions/ascii-check/action.yml
vendored
@@ -1,95 +0,0 @@
|
||||
name: 'ASCII Code Check'
|
||||
description: 'Check for non-ASCII characters in changed code files'
|
||||
inputs:
|
||||
base-ref:
|
||||
description: 'Base reference to compare changes against'
|
||||
required: true
|
||||
default: 'master'
|
||||
file-pattern:
|
||||
description: 'Pattern to match files for ASCII check'
|
||||
required: false
|
||||
default: '^(src)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
|
||||
|
||||
outputs:
|
||||
has-non-ascii:
|
||||
description: 'Whether any files contained non-ASCII characters'
|
||||
value: ${{ steps.ascii-check.outputs.has_non_ascii }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
shell: pwsh
|
||||
run: |
|
||||
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
|
||||
Where-Object { $_ -match '${{ inputs.file-pattern }}' } |
|
||||
Where-Object { Test-Path $_ }
|
||||
|
||||
$changedFiles | Set-Content "changed_files.txt"
|
||||
if ($changedFiles.Count -gt 0) {
|
||||
echo "has_files=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
|
||||
- name: Check for non-ASCII characters
|
||||
id: ascii-check
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$hasNonAscii = $false
|
||||
$nonAsciiLogs = @()
|
||||
|
||||
$files = Get-Content "changed_files.txt" | Where-Object { Test-Path $_ }
|
||||
foreach ($file in $files) {
|
||||
Write-Output "Checking file: $file"
|
||||
$fileContent = Get-Content -Path $file -Raw
|
||||
$lineNumber = 1
|
||||
$nonAsciiInFile = $false
|
||||
|
||||
foreach ($line in ($fileContent -split "`n")) {
|
||||
# Find non-ASCII characters (char code > 127)
|
||||
$nonAsciiMatches = [regex]::Matches($line, "[^\x00-\x7F]")
|
||||
if ($nonAsciiMatches.Count -gt 0) {
|
||||
$nonAsciiInFile = $true
|
||||
$hasNonAscii = $true
|
||||
|
||||
foreach ($match in $nonAsciiMatches) {
|
||||
$charCode = [int][char]$match.Value
|
||||
$hexCode = "0x{0:X}" -f $charCode
|
||||
$positionInLine = $match.Index + 1
|
||||
|
||||
$message = "Non-ASCII character found in '$file' at line $lineNumber, position $($positionInLine): '$($match.Value)' (Unicode: $hexCode)"
|
||||
$nonAsciiLogs += $message
|
||||
Write-Output $message
|
||||
}
|
||||
}
|
||||
$lineNumber++
|
||||
}
|
||||
|
||||
if ($nonAsciiInFile) {
|
||||
Write-Output "::warning file=$file::File contains non-ASCII characters"
|
||||
}
|
||||
}
|
||||
|
||||
$nonAsciiLogs | Set-Content "non_ascii_report.txt"
|
||||
if ($hasNonAscii) {
|
||||
echo "has_non_ascii=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
|
||||
- name: Upload non-ASCII report
|
||||
if: steps.ascii-check.outputs.has_non_ascii == 'true'
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: non-ascii-report
|
||||
path: non_ascii_report.txt
|
||||
|
||||
- name: Failing step for non-ASCII issues
|
||||
if: steps.ascii-check.outputs.has_non_ascii == 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
Write-Output "::error::Files contain non-ASCII characters. See the non-ascii-report artifact for details."
|
||||
exit 1
|
||||
|
||||
branding:
|
||||
icon: 'alert-circle'
|
||||
color: 'red'
|
61
.github/actions/build-docs/action.yml
vendored
61
.github/actions/build-docs/action.yml
vendored
@@ -1,61 +0,0 @@
|
||||
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: Configure OCCT
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -T host=x64 `
|
||||
-D BUILD_USE_PCH=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D CMAKE_BUILD_TYPE=Release `
|
||||
-D BUILD_DOC_Overview=ON `
|
||||
-D BUILD_DOC_RefMan=ON `
|
||||
-D BUILD_MODULE_Draw=OFF `
|
||||
-D USE_D3D=OFF `
|
||||
-D USE_DRACO=OFF `
|
||||
-D USE_FFMPEG=OFF `
|
||||
-D USE_FREEIMAGE=OFF `
|
||||
-D USE_GLES2=OFF `
|
||||
-D USE_OPENVR=OFF `
|
||||
-D USE_VTK=OFF `
|
||||
-D USE_TBB=OFF `
|
||||
-D USE_RAPIDJSON=OFF `
|
||||
-D USE_OPENGL=OFF `
|
||||
-D USE_FREETYPE=OFF `
|
||||
-D USE_TK=OFF `
|
||||
-D USE_TCL=OFF `
|
||||
-D CMAKE_CXX_FLAGS="/W4 /WX" `
|
||||
-D CMAKE_C_FLAGS="/W4 /WX" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build documentation
|
||||
run: |
|
||||
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
|
||||
cd build
|
||||
cmake --build . --target doc --config Release
|
||||
shell: cmd
|
||||
|
||||
- name: Upload refman documentation
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: refman-doc
|
||||
path: build/doc/refman
|
||||
retention-days: 90
|
||||
|
||||
- name: Upload overview documentation
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: overview-doc
|
||||
path: build/doc/overview
|
||||
retention-days: 90
|
85
.github/actions/build-occt/action.yml
vendored
85
.github/actions/build-occt/action.yml
vendored
@@ -1,85 +0,0 @@
|
||||
name: 'Build OCCT'
|
||||
description: 'Prepare and build OCCT on a specific platform'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Platform (windows, macos, linux)'
|
||||
required: true
|
||||
compiler:
|
||||
description: 'Compiler (msvc, clang, gcc)'
|
||||
required: true
|
||||
artifact-name:
|
||||
description: 'Name of the artifact to store build results'
|
||||
required: true
|
||||
additional-cmake-flags:
|
||||
description: 'Additional CMake flags'
|
||||
required: false
|
||||
default: ''
|
||||
use-vtk:
|
||||
description: 'Enable VTK'
|
||||
required: false
|
||||
default: 'true'
|
||||
build-use-pch:
|
||||
description: 'Enable precompiled headers'
|
||||
required: false
|
||||
default: 'true'
|
||||
build-opt-profile:
|
||||
description: 'Build optimization profile'
|
||||
required: false
|
||||
default: 'Production'
|
||||
cmake-build-type:
|
||||
description: 'CMake build type (Release, Debug, etc)'
|
||||
required: false
|
||||
default: 'Release'
|
||||
github-token:
|
||||
description: 'GitHub token for vcpkg NuGet package access'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Configure OCCT
|
||||
uses: ./.github/actions/configure-occt
|
||||
with:
|
||||
platform: ${{ inputs.platform }}
|
||||
compiler: ${{ inputs.compiler }}
|
||||
additional-cmake-flags: ${{ inputs.additional-cmake-flags }}
|
||||
use-vtk: ${{ inputs.use-vtk }}
|
||||
build-use-pch: ${{ inputs.build-use-pch }}
|
||||
build-opt-profile: ${{ inputs.build-opt-profile }}
|
||||
cmake-build-type: ${{ inputs.cmake-build-type }}
|
||||
github-token: ${{ inputs.github-token }}
|
||||
|
||||
- name: Upload vcpkg cache
|
||||
uses: ./.github/actions/upload-vcpkg-cache
|
||||
with:
|
||||
artifact-name: ${{ inputs.artifact-name }}-cache
|
||||
build-directory: build
|
||||
|
||||
- name: Build OCCT (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Release
|
||||
shell: pwsh
|
||||
|
||||
- name: Build OCCT (macOS)
|
||||
if: ${{ inputs.platform == 'macos' }}
|
||||
run: |
|
||||
cd build
|
||||
make install -j$(sysctl -n hw.logicalcpu)
|
||||
shell: bash
|
||||
|
||||
- name: Build OCCT (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Release -- -j
|
||||
shell: bash
|
||||
|
||||
- name: Upload install directory
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: install
|
||||
retention-days: 7
|
57
.github/actions/build-sample-csharp/action.yml
vendored
57
.github/actions/build-sample-csharp/action.yml
vendored
@@ -1,57 +0,0 @@
|
||||
name: 'Build CSharp Sample'
|
||||
description: 'Build CSharp sample using OCCT installation'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Build platform (windows)'
|
||||
required: true
|
||||
install-artifact-name:
|
||||
description: 'OCCT installation artifact name'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download OCCT installation
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: occt-install
|
||||
|
||||
- name: Build CSharp Sample
|
||||
if: inputs.platform == 'windows'
|
||||
shell: cmd
|
||||
run: |
|
||||
REM Setup environment
|
||||
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
|
||||
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
|
||||
|
||||
cd ${{ github.workspace }}/samples/CSharp
|
||||
|
||||
REM First upgrade solutions to VS2022
|
||||
echo "Upgrading solution files to VS2022..."
|
||||
devenv.exe CSharp.sln /upgrade
|
||||
devenv.exe CSharp_D3D.sln /upgrade
|
||||
|
||||
REM Update project platform toolset
|
||||
powershell -Command "(Get-Content OCCTProxy\OCCTProxy.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy\OCCTProxy.vcxproj"
|
||||
powershell -Command "(Get-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj"
|
||||
|
||||
REM Restore NuGet packages
|
||||
echo "Upgrading solution files..."
|
||||
msbuild.exe CSharp.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_csharp.log;Verbosity=detailed
|
||||
msbuild.exe CSharp_D3D.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_d3d.log;Verbosity=detailed
|
||||
|
||||
REM Build solutions with real-time console output
|
||||
echo "Building CSharp.sln..."
|
||||
msbuild.exe CSharp.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_csharp.log;Verbosity=detailed /m
|
||||
echo "Building CSharp_D3D.sln..."
|
||||
msbuild.exe CSharp_D3D.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_d3d.log;Verbosity=detailed /m
|
||||
|
||||
- name: Upload CSharp Sample
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: csharp-sample-${{ inputs.platform }}-x64
|
||||
path: samples/CSharp
|
||||
retention-days: 7
|
54
.github/actions/build-sample-mfc/action.yml
vendored
54
.github/actions/build-sample-mfc/action.yml
vendored
@@ -1,54 +0,0 @@
|
||||
name: 'Build MFC Sample'
|
||||
description: 'Build MFC sample using OCCT installation'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Build platform (windows)'
|
||||
required: true
|
||||
install-artifact-name:
|
||||
description: 'OCCT installation artifact name'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download OCCT installation
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: occt-install
|
||||
|
||||
- name: Build MFC Sample
|
||||
if: inputs.platform == 'windows'
|
||||
shell: cmd
|
||||
run: |
|
||||
REM Setup environment
|
||||
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
|
||||
|
||||
cd ${{ github.workspace }}/samples/mfc/standard
|
||||
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
|
||||
|
||||
REM First restore the solution
|
||||
echo "Restoring solution..."
|
||||
msbuild.exe ALL-vc14.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore.log;Verbosity=detailed
|
||||
|
||||
REM Build solution with detailed logging
|
||||
echo "Building solution..."
|
||||
msbuild.exe ALL-vc14.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build.log;Verbosity=detailed /m
|
||||
|
||||
REM Display logs if build fails
|
||||
if errorlevel 1 (
|
||||
echo "Build failed. Contents of restore.log:"
|
||||
type restore.log
|
||||
echo "Contents of build.log:"
|
||||
type build.log
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
- name: Upload MFC Sample
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: mfc-sample-${{ inputs.platform }}-x64
|
||||
path: samples/mfc/
|
||||
retention-days: 7
|
125
.github/actions/build-sample-qt/action.yml
vendored
125
.github/actions/build-sample-qt/action.yml
vendored
@@ -1,125 +0,0 @@
|
||||
name: 'Build Qt Sample'
|
||||
description: 'Build Qt samples using OCCT installation'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Build platform (windows/linux)'
|
||||
required: true
|
||||
install-artifact-name:
|
||||
description: 'OCCT installation artifact name'
|
||||
required: true
|
||||
thirdparty_url:
|
||||
description: 'URL to download 3rdparty dependencies'
|
||||
required: false
|
||||
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download OCCT installation
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: occt-install
|
||||
|
||||
- name: Download vcpkg cache
|
||||
uses: ./.github/actions/download-vcpkg-cache
|
||||
with:
|
||||
artifact-name: ${{ inputs.install-artifact-name }}-cache
|
||||
|
||||
- name: Install Windows dependencies
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
|
||||
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
|
||||
Remove-Item 3rdparty-vc14-64.zip
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
|
||||
|
||||
- name: Setup MSBuild
|
||||
if: inputs.platform == 'windows'
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Build Qt Samples - Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: cmd
|
||||
run: |
|
||||
REM Setup environment
|
||||
cd ${{ github.workspace }}/occt-install/
|
||||
call env.bat vc14 win64 Release
|
||||
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
|
||||
|
||||
REM Setup Qt environment
|
||||
set "QTDIR=${{ github.workspace }}\3rdparty-vc14-64\qt5.11.2-vc14-64"
|
||||
set "PATH=%QTDIR%\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
|
||||
|
||||
cd ${{ github.workspace }}/samples/qt
|
||||
|
||||
for %%s in (IESample Tutorial FuncDemo) do (
|
||||
cd %%s
|
||||
echo "Generating project for %%s..."
|
||||
qmake -tp vc -r -o %%s.sln %%s0.pro
|
||||
|
||||
echo "Restoring %%s..."
|
||||
msbuild.exe %%s.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_restore.log;Verbosity=detailed
|
||||
|
||||
echo "Building %%s..."
|
||||
msbuild.exe %%s.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_build.log;Verbosity=detailed /m
|
||||
|
||||
REM Display logs if build fails
|
||||
if errorlevel 1 (
|
||||
echo "Build failed for %%s. Contents of restore log:"
|
||||
type %%s_restore.log
|
||||
echo "Contents of build log:"
|
||||
type %%s_build.log
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
cd ..
|
||||
)
|
||||
|
||||
- name: Build Qt Samples - Linux
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${{ github.workspace }}/occt-install/bin
|
||||
source env.sh
|
||||
|
||||
# Set library paths for vcpkg dependencies
|
||||
export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH"
|
||||
export LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LIBRARY_PATH"
|
||||
export PKG_CONFIG_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
|
||||
cd ${{ github.workspace }}/samples/qt
|
||||
|
||||
for sample in IESample Tutorial FuncDemo; do
|
||||
cd $sample
|
||||
aQMakePath=`which qmake`
|
||||
host=`uname -s`
|
||||
export STATION=$host
|
||||
export RES_DIR="${{ github.workspace }}/samples/qt/${sample}/result"
|
||||
|
||||
# Configure qmake with vcpkg paths
|
||||
qmake $sample.pro \
|
||||
"LIBS += -L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
|
||||
"LIBS += -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
|
||||
"INCLUDEPATH += ${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/include"
|
||||
|
||||
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
|
||||
make -j$aNbJobs release
|
||||
cd ..
|
||||
done
|
||||
|
||||
- name: Upload Qt Samples
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: qt-samples-${{ inputs.platform }}-x64
|
||||
path: |
|
||||
samples/qt/
|
||||
samples/qt/
|
||||
retention-days: 7
|
109
.github/actions/build-tinspector/action.yml
vendored
109
.github/actions/build-tinspector/action.yml
vendored
@@ -1,109 +0,0 @@
|
||||
name: 'Build TInspector'
|
||||
description: 'Build TInspector using OCCT installation as a separate job'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Build platform (windows/linux)'
|
||||
required: true
|
||||
install-artifact-name:
|
||||
description: 'OCCT installation artifact name'
|
||||
required: true
|
||||
thirdparty_url:
|
||||
description: 'URL to download 3rdparty dependencies'
|
||||
required: false
|
||||
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download OCCT installation
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: occt-install
|
||||
|
||||
- name: Download vcpkg cache
|
||||
uses: ./.github/actions/download-vcpkg-cache
|
||||
with:
|
||||
artifact-name: ${{ inputs.install-artifact-name }}-cache
|
||||
|
||||
- name: Install Windows dependencies
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
|
||||
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
|
||||
Remove-Item 3rdparty-vc14-64.zip
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
|
||||
|
||||
- name: Checkout TInspector
|
||||
shell: bash
|
||||
run: |
|
||||
git clone https://github.com/Open-Cascade-SAS/Inspector.git inspector
|
||||
cd inspector
|
||||
git checkout 0757c9bbe4d856a9cd26a62a453fc31879d9d054
|
||||
|
||||
- name: Configure TInspector - Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd inspector
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Visual Studio 17 2022" -A x64 `
|
||||
-D CMAKE_BUILD_TYPE=Release `
|
||||
-D BUILD_SHARED_LIBS=ON `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}//3rdparty-vc14-64 `
|
||||
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/inspector/install `
|
||||
-D CMAKE_POLICY_VERSION_MINIMUM=3.5 `
|
||||
..
|
||||
|
||||
- name: Configure TInspector - Linux
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
cd inspector
|
||||
mkdir build
|
||||
cd build
|
||||
export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH"
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_BUILD_TYPE=Release \
|
||||
-D BUILD_SHARED_LIBS=ON \
|
||||
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/inspector/install \
|
||||
-D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
||||
-D CMAKE_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
|
||||
-D CMAKE_INCLUDE_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/include" \
|
||||
-D CMAKE_EXE_LINKER_FLAGS="-L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
|
||||
-D CMAKE_SHARED_LINKER_FLAGS="-L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
|
||||
..
|
||||
|
||||
- name: Build TInspector - Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd inspector/build
|
||||
cmake --build . --config Release --target install
|
||||
|
||||
- name: Build TInspector - Linux
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
cd inspector/build
|
||||
# Set library paths for build and runtime
|
||||
export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH"
|
||||
export LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LIBRARY_PATH"
|
||||
export PKG_CONFIG_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
make install -j$(nproc)
|
||||
|
||||
- name: Upload TInspector installation
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: inspector-${{ inputs.platform }}-x64
|
||||
path: inspector/install
|
||||
retention-days: 7
|
85
.github/actions/clang-format-check/action.yml
vendored
85
.github/actions/clang-format-check/action.yml
vendored
@@ -1,85 +0,0 @@
|
||||
name: 'Clang-Format Code Check'
|
||||
description: 'Check code formatting of changed files using clang-format'
|
||||
inputs:
|
||||
base-ref:
|
||||
description: 'Base reference to compare changes against'
|
||||
required: true
|
||||
default: 'master'
|
||||
file-pattern:
|
||||
description: 'Pattern to match files for formatting check'
|
||||
required: false
|
||||
default: '^(src)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
|
||||
clang-format-version:
|
||||
description: 'Required clang-format version'
|
||||
required: false
|
||||
default: '18.1.8'
|
||||
|
||||
outputs:
|
||||
has-changes:
|
||||
description: 'Whether any files needed formatting'
|
||||
value: ${{ steps.git-check.outputs.has_changes }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Check clang-format version
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = clang-format --version
|
||||
Write-Output "Detected clang-format version: $version"
|
||||
$version | Select-String "${{ inputs.clang-format-version }}" >$null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
echo "::error::Wrong clang-format version. Expected ${{ inputs.clang-format-version }}"
|
||||
Write-Output "Error: Version mismatch - expected ${{ inputs.clang-format-version }}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
shell: pwsh
|
||||
run: |
|
||||
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
|
||||
Where-Object { $_ -match '${{ inputs.file-pattern }}' } |
|
||||
Where-Object { Test-Path $_ }
|
||||
|
||||
$changedFiles | Set-Content "changed_files.txt"
|
||||
if ($changedFiles.Count -gt 0) {
|
||||
echo "has_files=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
|
||||
- name: Check formatting
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$files = Get-Content "changed_files.txt" | Where-Object { Test-Path $_ }
|
||||
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
|
||||
clang-format -i -style=file $_
|
||||
}
|
||||
|
||||
- name: Check git status
|
||||
id: git-check
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
git diff > format.patch
|
||||
if ((Get-Item format.patch).length -gt 0) {
|
||||
echo "has_changes=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
|
||||
- name: Upload patch
|
||||
if: steps.git-check.outputs.has_changes == 'true'
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: format-patch
|
||||
path: format.patch
|
||||
|
||||
- name: Failing step for formatting issues
|
||||
if: steps.git-check.outputs.has_changes == 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
echo "::error::Files need formatting. To fix: 1. Download format.patch 2. \"git apply format.patch\" 3. Commit and push"
|
||||
exit 1
|
||||
|
||||
branding:
|
||||
icon: 'check-square'
|
||||
color: 'green'
|
83
.github/actions/cmake-build-basic/action.yml
vendored
83
.github/actions/cmake-build-basic/action.yml
vendored
@@ -1,83 +0,0 @@
|
||||
name: 'CMake Basic Build'
|
||||
description: 'Configure and build OCCT with basic configuration'
|
||||
|
||||
inputs:
|
||||
generator:
|
||||
description: 'CMake generator'
|
||||
required: true
|
||||
default: 'Ninja'
|
||||
cc:
|
||||
description: 'C compiler'
|
||||
required: true
|
||||
cxx:
|
||||
description: 'C++ compiler'
|
||||
required: true
|
||||
build-type:
|
||||
description: 'Build type (Debug, Release)'
|
||||
required: false
|
||||
default: 'Release'
|
||||
compiler-flags:
|
||||
description: 'Additional compiler flags'
|
||||
required: false
|
||||
default: ''
|
||||
thirdparty-dir:
|
||||
description: '3rd party directory'
|
||||
required: false
|
||||
default: ''
|
||||
shell-type:
|
||||
description: 'Shell type to use (powershell, msys2, bash)'
|
||||
required: false
|
||||
default: 'auto'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Configure basic build (Unix/MSYS2)
|
||||
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "${{ inputs.generator }}" \
|
||||
-D CMAKE_C_COMPILER=${{ inputs.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} \
|
||||
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} \
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} \
|
||||
${{ inputs.compiler-flags }} ..
|
||||
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
|
||||
|
||||
- name: Configure basic build (Windows PowerShell)
|
||||
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ inputs.generator }}" `
|
||||
-D CMAKE_C_COMPILER=${{ inputs.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} `
|
||||
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} `
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} `
|
||||
${{ inputs.compiler-flags }} ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build basic (Unix/MSYS2)
|
||||
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --config ${{ inputs.build-type }} -- -j 4
|
||||
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
|
||||
|
||||
- name: Build basic (Windows PowerShell)
|
||||
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --config ${{ inputs.build-type }}
|
||||
shell: pwsh
|
||||
|
||||
- name: Clean up build (Unix/MSYS2)
|
||||
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
|
||||
run: rm -rf build
|
||||
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
|
||||
|
||||
- name: Clean up build (Windows PowerShell)
|
||||
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
|
||||
run: Remove-Item -Recurse -Force build
|
||||
shell: pwsh
|
149
.github/actions/cmake-build-full/action.yml
vendored
149
.github/actions/cmake-build-full/action.yml
vendored
@@ -1,149 +0,0 @@
|
||||
name: 'CMake Full Build'
|
||||
description: 'Configure and build OCCT with full configuration (shared/static)'
|
||||
|
||||
inputs:
|
||||
generator:
|
||||
description: 'CMake generator'
|
||||
required: true
|
||||
default: 'Ninja'
|
||||
cc:
|
||||
description: 'C compiler'
|
||||
required: true
|
||||
cxx:
|
||||
description: 'C++ compiler'
|
||||
required: true
|
||||
build-type:
|
||||
description: 'Build type (Debug, Release)'
|
||||
required: false
|
||||
default: 'Release'
|
||||
library-type:
|
||||
description: 'Library type (Shared, Static)'
|
||||
required: false
|
||||
default: 'Shared'
|
||||
opt-profile:
|
||||
description: 'Optimization profile (Production, Default)'
|
||||
required: false
|
||||
default: 'Production'
|
||||
compiler-flags:
|
||||
description: 'Additional compiler flags'
|
||||
required: false
|
||||
default: ''
|
||||
thirdparty-dir:
|
||||
description: '3rd party directory'
|
||||
required: false
|
||||
default: ''
|
||||
rapidjson-dir:
|
||||
description: 'RapidJSON directory'
|
||||
required: false
|
||||
default: ''
|
||||
use-vtk:
|
||||
description: 'Enable VTK'
|
||||
required: false
|
||||
default: 'ON'
|
||||
use-tbb:
|
||||
description: 'Enable TBB'
|
||||
required: false
|
||||
default: 'ON'
|
||||
with-debug:
|
||||
description: 'Enable BUILD_WITH_DEBUG'
|
||||
required: false
|
||||
default: 'OFF'
|
||||
shell-type:
|
||||
description: 'Shell type to use (powershell, msys2, bash)'
|
||||
required: false
|
||||
default: 'auto'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Configure full build (Unix/MSYS2)
|
||||
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "${{ inputs.generator }}" \
|
||||
-D CMAKE_C_COMPILER=${{ inputs.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} \
|
||||
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} \
|
||||
${{ inputs.rapidjson-dir != '' && format('-D 3RDPARTY_RAPIDJSON_DIR={0}', inputs.rapidjson-dir) || '' }} \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=${{ inputs.opt-profile }} \
|
||||
-D BUILD_LIBRARY_TYPE=${{ inputs.library-type }} \
|
||||
${{ inputs.with-debug == 'ON' && '-D BUILD_WITH_DEBUG=ON' || '' }} \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install-${{ inputs.build-type }} \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=${{ inputs.use-vtk }} \
|
||||
-D USE_TBB=${{ inputs.use-tbb }} \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
${{ inputs.compiler-flags }} ..
|
||||
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
|
||||
|
||||
- name: Configure full build (Windows PowerShell)
|
||||
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ inputs.generator }}" `
|
||||
-D CMAKE_C_COMPILER=${{ inputs.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} `
|
||||
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} `
|
||||
${{ inputs.rapidjson-dir != '' && format('-D 3RDPARTY_RAPIDJSON_DIR={0}', inputs.rapidjson-dir) || '' }} `
|
||||
-D BUILD_USE_PCH=OFF `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D BUILD_OPT_PROFILE=${{ inputs.opt-profile }} `
|
||||
-D BUILD_LIBRARY_TYPE=${{ inputs.library-type }} `
|
||||
${{ inputs.with-debug == 'ON' && '-D BUILD_WITH_DEBUG=ON' || '' }} `
|
||||
-D USE_TK=ON `
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} `
|
||||
-D USE_MMGR_TYPE=JEMALLOC `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install-${{ inputs.build-type }} `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=OFF `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=${{ inputs.use-vtk }} `
|
||||
-D USE_TBB=${{ inputs.use-tbb }} `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
${{ inputs.compiler-flags }} ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build full (Unix/MSYS2)
|
||||
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config ${{ inputs.build-type }} -- -j 4
|
||||
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
|
||||
|
||||
- name: Build full (Windows PowerShell)
|
||||
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config ${{ inputs.build-type }}
|
||||
shell: pwsh
|
||||
|
||||
- name: Clean up build (Unix/MSYS2)
|
||||
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
|
||||
run: |
|
||||
rm -rf build
|
||||
rm -rf ${{ github.workspace }}/install-${{ inputs.build-type }}
|
||||
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
|
||||
|
||||
- name: Clean up build (Windows PowerShell)
|
||||
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ inputs.build-type }}
|
||||
shell: pwsh
|
169
.github/actions/configure-occt/action.yml
vendored
169
.github/actions/configure-occt/action.yml
vendored
@@ -1,169 +0,0 @@
|
||||
name: 'Configure OCCT'
|
||||
description: 'Setup vcpkg and configure OCCT on a specific platform without building'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Platform (windows, macos, linux)'
|
||||
required: true
|
||||
compiler:
|
||||
description: 'Compiler (msvc, clang, gcc)'
|
||||
required: true
|
||||
additional-cmake-flags:
|
||||
description: 'Additional CMake flags'
|
||||
required: false
|
||||
default: ''
|
||||
use-vtk:
|
||||
description: 'Enable VTK'
|
||||
required: false
|
||||
default: 'true'
|
||||
build-use-pch:
|
||||
description: 'Enable precompiled headers'
|
||||
required: false
|
||||
default: 'true'
|
||||
build-opt-profile:
|
||||
description: 'Build optimization profile'
|
||||
required: false
|
||||
default: 'Production'
|
||||
cmake-build-type:
|
||||
description: 'CMake build type (Release, Debug, etc)'
|
||||
required: false
|
||||
default: 'Release'
|
||||
github-token:
|
||||
description: 'GitHub token for vcpkg NuGet package access'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup vcpkg
|
||||
uses: ./.github/actions/vcpkg-setup
|
||||
with:
|
||||
github-token: ${{ inputs.github-token }}
|
||||
|
||||
- name: Download and extract Mesa3D (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
|
||||
7z x mesa3d.7z -omesa3d
|
||||
shell: pwsh
|
||||
|
||||
- name: Run system-wide deployment (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
cd mesa3d
|
||||
.\systemwidedeploy.cmd 1
|
||||
.\systemwidedeploy.cmd 5
|
||||
shell: cmd
|
||||
|
||||
- name: Install dependencies (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
run: sudo apt-get update && sudo apt-get install -y cmake ${{ inputs.compiler == 'clang' && 'clang' || 'gcc g++' }} make libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev
|
||||
shell: bash
|
||||
|
||||
- name: Install required packages (macOS)
|
||||
if: ${{ inputs.platform == 'macos' }}
|
||||
run: |
|
||||
brew update || true
|
||||
# temporary workaround for missing tcl-tk
|
||||
brew install tcl-tk || true
|
||||
# Force link any conflicting packages
|
||||
brew link --overwrite python@3.12 || true
|
||||
brew link --overwrite python@3.13 || true
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -T ${{ inputs.compiler == 'msvc' && 'host=x64' || 'ClangCL' }} `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_TK=ON `
|
||||
-D BUILD_USE_PCH=${{ inputs.build-use-pch }} `
|
||||
-D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D BUILD_USE_VCPKG=ON `
|
||||
-D VCPKG_TARGET_TRIPLET=x64-windows `
|
||||
-D USE_D3D=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=${{ inputs.use-vtk }} `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
-D BUILD_GTEST=ON `
|
||||
-D BUILD_CPP_STANDARD=C++17 `
|
||||
-D INSTALL_GTEST=ON `
|
||||
${{ inputs.additional-cmake-flags }} ..
|
||||
echo "Configuration completed successfully for Windows"
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure OCCT (macOS)
|
||||
if: ${{ inputs.platform == 'macos' }}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \
|
||||
-D BUILD_USE_PCH=${{ inputs.build-use-pch }} \
|
||||
-D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D BUILD_USE_VCPKG=ON \
|
||||
-D VCPKG_TARGET_TRIPLET=arm64-osx-dynamic \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D BUILD_GTEST=ON \
|
||||
-D BUILD_CPP_STANDARD=C++17 \
|
||||
-D INSTALL_GTEST=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
|
||||
${{ inputs.additional-cmake-flags }} ..
|
||||
echo "Configuration completed successfully for macOS"
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
# Set environment to help vcpkg find system libraries
|
||||
export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export CMAKE_PREFIX_PATH="/usr:/usr/local:$CMAKE_PREFIX_PATH"
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \
|
||||
-D BUILD_USE_PCH=${{ inputs.build-use-pch }} \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D BUILD_USE_VCPKG=ON \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D VCPKG_TARGET_TRIPLET=x64-linux-dynamic \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=ON \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=${{ inputs.use-vtk }} \
|
||||
-D USE_TBB=ON \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D BUILD_GTEST=ON \
|
||||
-D BUILD_CPP_STANDARD=C++17 \
|
||||
-D INSTALL_GTEST=ON \
|
||||
${{ inputs.additional-cmake-flags }} ..
|
||||
echo "Configuration completed successfully for Linux"
|
||||
shell: bash
|
79
.github/actions/download-vcpkg-cache/action.yml
vendored
79
.github/actions/download-vcpkg-cache/action.yml
vendored
@@ -1,79 +0,0 @@
|
||||
name: 'Download vcpkg Cache'
|
||||
description: 'Download and restore vcpkg installed packages and cache'
|
||||
|
||||
inputs:
|
||||
artifact-name:
|
||||
description: 'Name of the artifact containing vcpkg cache'
|
||||
required: true
|
||||
build-directory:
|
||||
description: 'Build directory where vcpkg_installed should be restored'
|
||||
required: false
|
||||
default: 'build'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- name: Download vcpkg tar archive
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: ${{ inputs.build-directory }}
|
||||
|
||||
- name: Extract vcpkg dependencies
|
||||
run: |
|
||||
cd ${{ inputs.build-directory }}
|
||||
tar -xzf vcpkg-dependencies.tar.gz
|
||||
rm vcpkg-dependencies.tar.gz
|
||||
shell: bash
|
||||
|
||||
- name: Copy manual-link libraries and set paths for Windows
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
$vcpkg_bin = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/bin"
|
||||
$vcpkg_lib = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/lib"
|
||||
$vcpkg_manual = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/lib/manual-link"
|
||||
|
||||
# Copy manual-link DLLs to bin directory for runtime access
|
||||
if (Test-Path $vcpkg_manual) {
|
||||
Write-Host "Copying manual-link libraries to bin directory"
|
||||
Copy-Item "$vcpkg_manual\*" "$vcpkg_bin\" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
# Set library search paths
|
||||
$current_path = $env:PATH
|
||||
echo "PATH=$vcpkg_bin;$vcpkg_lib;$vcpkg_manual;$current_path" >> $env:GITHUB_ENV
|
||||
shell: pwsh
|
||||
|
||||
- name: Copy manual-link libraries and set paths for Linux
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
vcpkg_lib="${{ inputs.build-directory }}/vcpkg_installed/x64-linux-dynamic/lib"
|
||||
vcpkg_manual="${{ inputs.build-directory }}/vcpkg_installed/x64-linux-dynamic/lib/manual-link"
|
||||
|
||||
# Copy manual-link libraries to main lib directory for runtime access
|
||||
if [ -d "$vcpkg_manual" ]; then
|
||||
echo "Copying manual-link libraries to main lib directory"
|
||||
cp -f "$vcpkg_manual"/* "$vcpkg_lib/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Set library search paths
|
||||
echo "LD_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$LD_LIBRARY_PATH" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Copy manual-link libraries and set paths for macOS
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
vcpkg_lib="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/lib"
|
||||
vcpkg_manual="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/lib/manual-link"
|
||||
|
||||
# Copy manual-link libraries to main lib directory for runtime access
|
||||
if [ -d "$vcpkg_manual" ]; then
|
||||
echo "Copying manual-link libraries to main lib directory"
|
||||
cp -f "$vcpkg_manual"/* "$vcpkg_lib/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Set library search paths
|
||||
echo "DYLD_FALLBACK_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_FALLBACK_LIBRARY_PATH" >> $GITHUB_ENV
|
||||
echo "DYLD_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
|
||||
shell: bash
|
319
.github/actions/retest-failures/action.yml
vendored
319
.github/actions/retest-failures/action.yml
vendored
@@ -1,319 +0,0 @@
|
||||
name: 'Retest Failures'
|
||||
description: 'Rerun failed tests and update test results'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Platform (windows, macos, linux)'
|
||||
required: true
|
||||
compiler:
|
||||
description: 'Compiler (msvc, clang, gcc)'
|
||||
required: true
|
||||
install-artifact-name:
|
||||
description: 'Name of the artifact containing the install directory'
|
||||
required: true
|
||||
results-artifact-name:
|
||||
description: 'Name of the artifact containing the test results'
|
||||
required: true
|
||||
test-directory-name:
|
||||
description: 'Name of the directory containing test results'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download previous test results (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.results-artifact-name }}
|
||||
path: install/results
|
||||
|
||||
- name: Download previous test results (macOS/Linux)
|
||||
if: ${{ inputs.platform != 'windows' }}
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.results-artifact-name }}
|
||||
path: install/bin/results
|
||||
|
||||
- name: Check for test failures (Windows)
|
||||
id: check_failures_windows
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
$failedCount = 0
|
||||
if (Test-Path "install/results/${{ inputs.test-directory-name }}/tests.log") {
|
||||
$content = Get-Content "install/results/${{ inputs.test-directory-name }}/tests.log"
|
||||
$totalLine = $content | Select-String "Total cases:"
|
||||
if ($totalLine) {
|
||||
if ($totalLine -match "FAILED") {
|
||||
$failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
|
||||
}
|
||||
}
|
||||
echo "failed_count=$failedCount" >> $env:GITHUB_OUTPUT
|
||||
if ($failedCount -gt 0) {
|
||||
echo "Tests failed count: $failedCount"
|
||||
}
|
||||
}
|
||||
|
||||
- name: Check for test failures (macOS/Linux)
|
||||
id: check_failures_unix
|
||||
if: ${{ inputs.platform != 'windows' }}
|
||||
shell: bash
|
||||
run: |
|
||||
failed_count=0
|
||||
if [ -f "install/bin/results/${{ inputs.test-directory-name }}/tests.log" ]; then
|
||||
total_line=$(grep "Total cases:" install/bin/results/${{ inputs.test-directory-name }}/tests.log)
|
||||
if [ ! -z "$total_line" ]; then
|
||||
if [[ $total_line =~ "FAILED" ]]; then
|
||||
failed_count=$(echo "$total_line" | grep -o "[0-9]* FAILED" | awk '{print $1}')
|
||||
fi
|
||||
fi
|
||||
echo "failed_count=$failed_count" >> $GITHUB_OUTPUT
|
||||
if [ "$failed_count" -gt 0 ]; then
|
||||
echo "Tests failed count: $failed_count"
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Set failed count
|
||||
id: check_failures
|
||||
shell: ${{ inputs.platform == 'windows' && 'pwsh' || 'bash' }}
|
||||
run: |
|
||||
${{ inputs.platform == 'windows' && format('
|
||||
echo "failed_count={0}" >> $env:GITHUB_OUTPUT
|
||||
', steps.check_failures_windows.outputs.failed_count) || format('
|
||||
echo "failed_count={0}" >> $GITHUB_OUTPUT
|
||||
', steps.check_failures_unix.outputs.failed_count) }}
|
||||
|
||||
- name: Download vcpkg cache
|
||||
if: steps.check_failures.outputs.failed_count > 0
|
||||
uses: ./.github/actions/download-vcpkg-cache
|
||||
with:
|
||||
artifact-name: ${{ inputs.install-artifact-name }}-cache
|
||||
|
||||
- name: Install dependencies (Linux)
|
||||
if: ${{ inputs.platform == 'linux' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: bash
|
||||
run: sudo apt-get update && sudo apt-get install -y cmake ${{ inputs.compiler == 'clang' && 'clang' || 'gcc g++' }} make libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev fonts-noto-cjk fonts-liberation fonts-ubuntu fonts-liberation fonts-ubuntu fonts-noto-cjk fonts-ipafont-gothic fonts-ipafont-mincho fonts-unfonts-core
|
||||
|
||||
- name: Setup Xvfb and Mesa (Linux)
|
||||
if: ${{ inputs.platform == 'linux' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
uses: ./.github/actions/setup-xvfb-mesa
|
||||
|
||||
- name: Download test data (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd data
|
||||
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
|
||||
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
|
||||
Remove-Item opencascade-dataset-7.9.0.zip
|
||||
|
||||
- name: Download test data (macOS/Linux)
|
||||
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd data
|
||||
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.${{ inputs.platform == 'macos' && 'tar.xz' || 'tar.xz' }}
|
||||
tar -xf opencascade-dataset-7.9.0.tar.xz
|
||||
|
||||
- name: Download and extract install directory
|
||||
if: steps.check_failures.outputs.failed_count > 0
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: install
|
||||
|
||||
- name: Download and extract Mesa3D (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
|
||||
7z x mesa3d.7z -omesa3d
|
||||
|
||||
- name: Run system-wide deployment (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: cmd
|
||||
run: |
|
||||
cd mesa3d
|
||||
.\systemwidedeploy.cmd 1
|
||||
.\systemwidedeploy.cmd 5
|
||||
|
||||
- name: Install CJK Fonts (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
Invoke-WebRequest -Uri https://noto-website-2.storage.googleapis.com/pkgs/Noto-hinted.zip -OutFile Noto-hinted.zip
|
||||
Expand-Archive -Path Noto-hinted.zip -DestinationPath $env:windir\Fonts
|
||||
Remove-Item Noto-hinted.zip
|
||||
|
||||
- name: Set execute permissions on DRAWEXE (macOS/Linux)
|
||||
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: bash
|
||||
run: chmod +x install/${{ inputs.platform == 'macos' && 'bin' || 'bin' }}/DRAWEXE
|
||||
|
||||
- name: Run regression tests (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: cmd
|
||||
run: |
|
||||
cd install
|
||||
call env.bat vc14 win64 release
|
||||
DRAWEXE.exe -v -c testgrid -regress results/${{ inputs.test-directory-name }} -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0
|
||||
env:
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Run regression tests (macOS/Linux)
|
||||
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd install
|
||||
cd bin
|
||||
source env.sh
|
||||
./DRAWEXE -v -c testgrid -regress results/${{ inputs.test-directory-name }} -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0
|
||||
env:
|
||||
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Repeating failed tests (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20 }}
|
||||
shell: cmd
|
||||
run: |
|
||||
cd install
|
||||
call env.bat vc14 win64 release
|
||||
# Repeat failed tests for 10 times
|
||||
for /l %%i in (1,1,10) do (
|
||||
DRAWEXE.exe -v -c testgrid -regress results/${{ inputs.test-directory-name }}-retest -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0 -overwrite
|
||||
DRAWEXE.exe -v -c "testsummarize results/${{ inputs.test-directory-name }}-retest"
|
||||
)
|
||||
env:
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Repeating failed tests (macOS/Linux)
|
||||
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20 }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd install
|
||||
cd bin
|
||||
source env.sh
|
||||
# Repeat failed tests for 10 times
|
||||
for i in {1..10}; do
|
||||
./DRAWEXE -v -c testgrid -regress results/${{ inputs.test-directory-name }}-retest -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0 -overwrite
|
||||
./DRAWEXE -v -c "testsummarize results/${{ inputs.test-directory-name }}-retest"
|
||||
done
|
||||
env:
|
||||
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Upload regression test results (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ inputs.results-artifact-name }}-retest
|
||||
path: install/results/${{ inputs.test-directory-name }}-retest
|
||||
retention-days: 15
|
||||
overwrite: true
|
||||
|
||||
- name: Upload regression test results (macOS/Linux)
|
||||
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ inputs.results-artifact-name }}-retest
|
||||
path: install/bin/results/${{ inputs.test-directory-name }}-retest
|
||||
retention-days: 15
|
||||
overwrite: true
|
||||
|
||||
- name: Copy retest results back to original location (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: cmd
|
||||
run: |
|
||||
cd install\results\${{ inputs.test-directory-name }}-retest
|
||||
if exist "*" (
|
||||
xcopy /s /y /i . "..\${{ inputs.test-directory-name }}"
|
||||
cd ..\..
|
||||
call env.bat vc14 win64 release
|
||||
DRAWEXE.exe -v -c "testsummarize results/${{ inputs.test-directory-name }}"
|
||||
) else (
|
||||
echo No retest results to copy - directory is empty
|
||||
)
|
||||
|
||||
- name: Copy retest results back to original location (macOS/Linux)
|
||||
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd install/bin/results/${{ inputs.test-directory-name }}-retest
|
||||
if [ "$(ls -A)" ]; then
|
||||
cp -rf * ../${{ inputs.test-directory-name }}/
|
||||
|
||||
cd ../../
|
||||
source env.sh
|
||||
./DRAWEXE -v -c testsummarize results/${{ inputs.test-directory-name }}
|
||||
else
|
||||
echo "No retest results to copy - directory is empty"
|
||||
fi
|
||||
|
||||
- name: Upload updated test results (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ inputs.results-artifact-name }}
|
||||
path: install/results/${{ inputs.test-directory-name }}*
|
||||
retention-days: 15
|
||||
overwrite: true
|
||||
|
||||
- name: Upload updated test results (macOS/Linux)
|
||||
if : ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ inputs.results-artifact-name }}
|
||||
path: install/bin/results/${{ inputs.test-directory-name }}*
|
||||
retention-days: 15
|
||||
overwrite: true
|
||||
|
||||
- name: Check test failures (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd install/results/${{ inputs.test-directory-name }}-retest
|
||||
$failedCount = 0
|
||||
if (Test-Path tests.log) {
|
||||
$content = Get-Content tests.log
|
||||
$totalLine = $content | Select-String "Total cases:"
|
||||
if ($totalLine) {
|
||||
if ($totalLine -match "FAILED") {
|
||||
$failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
|
||||
}
|
||||
}
|
||||
if ($failedCount -gt 0) {
|
||||
Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of 0"
|
||||
echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV
|
||||
exit 1
|
||||
}
|
||||
Write-Output "Found $failedCount FAILED tests"
|
||||
}
|
||||
|
||||
- name: Check test failures (macOS/Linux)
|
||||
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd install/bin/results/${{ inputs.test-directory-name }}-retest
|
||||
if [ -f tests.log ]; then
|
||||
TOTAL_LINE=$(grep "Total cases:" tests.log | tail -n1)
|
||||
echo "Total line: $TOTAL_LINE"
|
||||
if [[ $TOTAL_LINE =~ ([0-9]+)[[:space:]]FAILED ]]; then
|
||||
FAILED_COUNT="${BASH_REMATCH[1]}"
|
||||
if [ $FAILED_COUNT -gt 0 ]; then
|
||||
echo "Number of FAILED tests ($FAILED_COUNT) exceeds threshold of 0"
|
||||
echo "::error::Number of FAILED tests ($FAILED_COUNT) exceeds threshold of 0"
|
||||
echo "FAILED_COUNT=$FAILED_COUNT" >> $GITHUB_ENV
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "Found 0 FAILED tests"
|
||||
fi
|
132
.github/actions/run-gtest/action.yml
vendored
132
.github/actions/run-gtest/action.yml
vendored
@@ -1,132 +0,0 @@
|
||||
name: 'Run GTest Validation'
|
||||
description: 'Execute GTest suite and validate results'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Platform (windows, macos, linux)'
|
||||
required: true
|
||||
compiler:
|
||||
description: 'Compiler (msvc, clang, gcc)'
|
||||
required: true
|
||||
install-artifact-name:
|
||||
description: 'Name of the artifact containing the installed files'
|
||||
required: true
|
||||
artifact-suffix:
|
||||
description: 'Suffix for the GTest results artifact name'
|
||||
required: true
|
||||
default: 'x64'
|
||||
|
||||
outputs:
|
||||
has-failures:
|
||||
description: 'Whether any tests failed'
|
||||
value: ${{ steps.check-failures.outputs.has_failures }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download and extract install directory
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: install
|
||||
|
||||
- name: Download vcpkg cache
|
||||
uses: ./.github/actions/download-vcpkg-cache
|
||||
with:
|
||||
artifact-name: ${{ inputs.install-artifact-name }}-cache
|
||||
|
||||
- name: Install Linux dependencies
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
|
||||
|
||||
- name: Setup Xvfb and Mesa for Linux
|
||||
if: inputs.platform == 'linux'
|
||||
uses: ./.github/actions/setup-xvfb-mesa
|
||||
|
||||
- name: Set execute permissions on Unix platforms
|
||||
if: inputs.platform != 'windows'
|
||||
shell: bash
|
||||
run: |
|
||||
chmod +x install/bin/OpenCascadeGTest
|
||||
|
||||
- name: Run OpenCascadeGTest on Windows
|
||||
if: inputs.platform == 'windows'
|
||||
id: run-gtest-windows
|
||||
shell: cmd
|
||||
run: |
|
||||
cd install
|
||||
call env.bat vc14 win64 release
|
||||
set GTEST_OUTPUT=""
|
||||
OpenCascadeGTest.exe --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
|
||||
type gtest_output.log
|
||||
exit /b 0
|
||||
|
||||
- name: Run OpenCascadeGTest on Unix platforms
|
||||
if: inputs.platform != 'windows'
|
||||
id: run-gtest-unix
|
||||
shell: bash
|
||||
env:
|
||||
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
run: |
|
||||
cd install/bin
|
||||
source env.sh
|
||||
./OpenCascadeGTest --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1 || true
|
||||
cat gtest_output.log
|
||||
|
||||
- name: Upload GTest results
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: gtest-results-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.artifact-suffix }}
|
||||
path: |
|
||||
install/**/gtest_results.xml
|
||||
install/**/gtest_output.log
|
||||
retention-days: 15
|
||||
|
||||
- name: Check for test failures on Windows
|
||||
if: inputs.platform == 'windows'
|
||||
id: check-failures-windows
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd install
|
||||
$log = Get-Content "gtest_output.log" -Raw
|
||||
if ($log -match "\[\s+FAILED\s+\]") {
|
||||
Write-Error "GTest failures detected in the output."
|
||||
echo "has_failures=true" >> $env:GITHUB_OUTPUT
|
||||
} else {
|
||||
Write-Output "No GTest failures detected."
|
||||
echo "has_failures=false" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
|
||||
- name: Check for test failures on Unix
|
||||
if: inputs.platform != 'windows'
|
||||
id: check-failures-unix
|
||||
shell: bash
|
||||
run: |
|
||||
cd install/bin
|
||||
if grep -q "\[ FAILED \]" gtest_output.log; then
|
||||
echo "::error::GTest failures detected in the output."
|
||||
echo "has_failures=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "No GTest failures detected."
|
||||
echo "has_failures=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Set combined output
|
||||
id: check-failures
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ inputs.platform }}" == "windows" ]; then
|
||||
echo "has_failures=${{ steps.check-failures-windows.outputs.has_failures }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_failures=${{ steps.check-failures-unix.outputs.has_failures }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Fail job if tests failed
|
||||
if: steps.check-failures.outputs.has_failures == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::error::GTest failures detected"
|
||||
exit 1
|
166
.github/actions/run-tests/action.yml
vendored
166
.github/actions/run-tests/action.yml
vendored
@@ -1,166 +0,0 @@
|
||||
name: 'Run Tests'
|
||||
description: 'Run OCCT tests on a specific platform'
|
||||
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Platform (windows, macos, linux)'
|
||||
required: true
|
||||
compiler:
|
||||
description: 'Compiler (msvc, clang, gcc)'
|
||||
required: true
|
||||
install-artifact-name:
|
||||
description: 'Name of the artifact containing the install directory'
|
||||
required: true
|
||||
test-directory-name:
|
||||
description: 'Name of the directory to store test results'
|
||||
required: true
|
||||
test-script:
|
||||
description: 'The test script to run'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download vcpkg cache
|
||||
uses: ./.github/actions/download-vcpkg-cache
|
||||
with:
|
||||
artifact-name: ${{ inputs.install-artifact-name }}-cache
|
||||
|
||||
- name: Install dependencies (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
run: sudo apt-get update && sudo apt-get install -y cmake ${{ inputs.compiler == 'gcc' && 'gcc g++' || 'clang' }} make libglu1-mesa-dev libegl1-mesa-dev fonts-noto-cjk fonts-liberation fonts-ubuntu fonts-liberation fonts-ubuntu fonts-noto-cjk fonts-ipafont-gothic fonts-ipafont-mincho fonts-unfonts-core
|
||||
shell: bash
|
||||
|
||||
- name: Setup Xvfb and Mesa (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
uses: ./.github/actions/setup-xvfb-mesa
|
||||
|
||||
- name: Download and extract test data (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
cd data
|
||||
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
|
||||
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
|
||||
Remove-Item opencascade-dataset-7.9.0.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Download test data (macOS/Linux)
|
||||
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') }}
|
||||
run: |
|
||||
cd data
|
||||
wget -q https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
|
||||
tar -xf opencascade-dataset-7.9.0.tar.xz
|
||||
shell: bash
|
||||
|
||||
- name: Download and extract install directory
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: install
|
||||
|
||||
- name: Download and extract Mesa3D (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
|
||||
7z x mesa3d.7z -omesa3d
|
||||
shell: pwsh
|
||||
|
||||
- name: Run system-wide deployment (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
cd mesa3d
|
||||
.\systemwidedeploy.cmd 1
|
||||
.\systemwidedeploy.cmd 5
|
||||
shell: cmd
|
||||
|
||||
- name: Install CJK Fonts (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
Invoke-WebRequest -Uri https://noto-website-2.storage.googleapis.com/pkgs/Noto-hinted.zip -OutFile Noto-hinted.zip
|
||||
Expand-Archive -Path Noto-hinted.zip -DestinationPath $env:windir\Fonts
|
||||
Remove-Item Noto-hinted.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Set LIBGL_ALWAYS_SOFTWARE environment variable (macOS)
|
||||
if: ${{ inputs.platform == 'macos' }}
|
||||
run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Set execute permissions on DRAWEXE (macOS/Linux)
|
||||
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
|
||||
run: chmod +x install/bin/DRAWEXE
|
||||
shell: bash
|
||||
|
||||
- name: Run tests (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
cd install
|
||||
call env.bat vc14 win64 release
|
||||
DRAWEXE.exe -v -f ${{ github.workspace }}/${{ inputs.test-script }}
|
||||
shell: cmd
|
||||
env:
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Run tests (macOS/Linux)
|
||||
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
|
||||
run: |
|
||||
cd install
|
||||
cd bin
|
||||
source env.sh
|
||||
./DRAWEXE -v -f ${{ github.workspace }}/${{ inputs.test-script }}
|
||||
shell: bash
|
||||
env:
|
||||
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Clean up test results (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
run: |
|
||||
cd install
|
||||
call env.bat vc14 win64 release
|
||||
DRAWEXE.exe -v -c cleanuptest results/${{ inputs.test-directory-name }}
|
||||
shell: cmd
|
||||
env:
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Clean up test results (macOS/Linux)
|
||||
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
|
||||
run: |
|
||||
cd install
|
||||
cd bin
|
||||
source env.sh
|
||||
./DRAWEXE -v -c cleanuptest results/${{ inputs.test-directory-name }}
|
||||
shell: bash
|
||||
env:
|
||||
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
|
||||
LIBGL_ALWAYS_SOFTWARE: 1
|
||||
CSF_TestScriptsPath: ${{ github.workspace }}/tests
|
||||
CSF_TestDataPath: ${{ github.workspace }}/data
|
||||
|
||||
- name: Upload test results (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: results-${{ inputs.test-directory-name }}
|
||||
path: |
|
||||
install/results/**/*.log
|
||||
install/results/**/*.png
|
||||
install/results/**/*.html
|
||||
retention-days: 15
|
||||
|
||||
- name: Upload test results (macOS/Linux)
|
||||
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: results-${{ inputs.test-directory-name }}
|
||||
path: |
|
||||
install/bin/results/**/*.log
|
||||
install/bin/results/**/*.png
|
||||
install/bin/results/**/*.html
|
||||
retention-days: 15
|
90
.github/actions/scripts/cleanup_test_images.py
vendored
90
.github/actions/scripts/cleanup_test_images.py
vendored
@@ -1,90 +0,0 @@
|
||||
import os
|
||||
import re
|
||||
from bs4 import BeautifulSoup
|
||||
from pathlib import Path
|
||||
import glob
|
||||
|
||||
import os.path
|
||||
|
||||
def get_referenced_images(html_file):
|
||||
# Get the directory containing the HTML file
|
||||
html_dir = os.path.dirname(os.path.abspath(html_file))
|
||||
|
||||
with open(html_file, 'r', encoding='utf-8') as f:
|
||||
soup = BeautifulSoup(f.read(), 'html.parser')
|
||||
|
||||
images = set()
|
||||
|
||||
# Extract direct image references
|
||||
for img in soup.find_all('img'):
|
||||
if src := img.get('src'):
|
||||
# Convert relative path to absolute
|
||||
abs_path = os.path.normpath(os.path.join(html_dir, src))
|
||||
images.add(abs_path)
|
||||
|
||||
# Extract toggle references
|
||||
for elem in soup.find_all(attrs={'onclick': True}):
|
||||
onclick = elem['onclick']
|
||||
paths = re.findall(r'diffimage_toggle\(this,"([^"]+)","([^"]+)"\)', onclick)
|
||||
for src1, src2 in paths:
|
||||
# Convert relative paths to absolute
|
||||
abs_path1 = os.path.normpath(os.path.join(html_dir, src1))
|
||||
abs_path2 = os.path.normpath(os.path.join(html_dir, src2))
|
||||
images.add(abs_path1)
|
||||
images.add(abs_path2)
|
||||
|
||||
return images
|
||||
|
||||
def cleanup_platform_images(results_dir, platform):
|
||||
html_file = f"{results_dir}/current/{platform}/diff-*.html"
|
||||
html_files = glob.glob(html_file)
|
||||
|
||||
if not html_files:
|
||||
print(f"No diff HTML found for {platform}")
|
||||
return
|
||||
|
||||
# Get referenced images from HTML
|
||||
referenced = set()
|
||||
for html in html_files:
|
||||
images = get_referenced_images(html)
|
||||
referenced.update(images)
|
||||
|
||||
# Convert relative paths to absolute
|
||||
base_dir = Path(results_dir)
|
||||
current_dir = base_dir / "current" / platform
|
||||
master_dir = base_dir / "master" / platform
|
||||
|
||||
# Find all PNGs
|
||||
png_files = set()
|
||||
for directory in [current_dir, master_dir]:
|
||||
for root, _, files in os.walk(directory):
|
||||
for file in files:
|
||||
if file.lower().endswith('.png'):
|
||||
png_files.add(Path(root) / file)
|
||||
|
||||
# Remove unreferenced PNGs
|
||||
for png in png_files:
|
||||
if str(png) not in referenced:
|
||||
try:
|
||||
png.unlink()
|
||||
except OSError as e:
|
||||
print(f"Error removing {png}: {e}")
|
||||
|
||||
def main():
|
||||
platforms = [
|
||||
"windows-x64",
|
||||
"windows-clang-x64",
|
||||
"macos-x64",
|
||||
"macos-gcc-x64",
|
||||
"linux-clang-x64",
|
||||
"linux-gcc-x64"
|
||||
]
|
||||
|
||||
results_dir = Path("./").resolve()
|
||||
|
||||
for platform in platforms:
|
||||
print(f"\nProcessing {platform}...")
|
||||
cleanup_platform_images(results_dir, platform)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
30
.github/actions/setup-msys2/action.yml
vendored
30
.github/actions/setup-msys2/action.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: 'Setup MSYS2'
|
||||
description: 'Setup MSYS2 environment for MinGW builds'
|
||||
|
||||
inputs:
|
||||
msystem:
|
||||
description: 'MSYS2 subsystem (MINGW64, CLANG64, UCRT64)'
|
||||
required: true
|
||||
packages:
|
||||
description: 'Packages to install'
|
||||
required: true
|
||||
dependencies:
|
||||
description: 'Additional dependencies to install'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ inputs.msystem }}
|
||||
update: true
|
||||
install: ${{ inputs.packages }} ${{ inputs.dependencies }}
|
||||
|
||||
- name: Setup environment
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
echo "Setting up environment variables..."
|
||||
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
|
||||
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV
|
15
.github/actions/setup-ubuntu-deps/action.yml
vendored
15
.github/actions/setup-ubuntu-deps/action.yml
vendored
@@ -1,15 +0,0 @@
|
||||
name: 'Setup Ubuntu Dependencies'
|
||||
description: 'Install Ubuntu dependencies and rapidjson for OCCT builds'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev
|
||||
shell: bash
|
||||
|
||||
- name: Install rapidjson
|
||||
run: |
|
||||
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
|
||||
unzip rapidjson.zip
|
||||
shell: bash
|
@@ -1,30 +0,0 @@
|
||||
name: 'Setup Windows MSVC Dependencies'
|
||||
description: 'Download and setup 3rdparty dependencies and Mesa3D for Windows MSVC builds'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Download and extract 3rdparty dependencies
|
||||
run: |
|
||||
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
|
||||
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
|
||||
Remove-Item 3rdparty-vc14-64.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Download and extract Mesa3D
|
||||
run: |
|
||||
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
|
||||
7z x mesa3d.7z -omesa3d
|
||||
shell: pwsh
|
||||
|
||||
- name: Run system-wide deployment
|
||||
run: |
|
||||
cd mesa3d
|
||||
.\systemwidedeploy.cmd 1
|
||||
.\systemwidedeploy.cmd 5
|
||||
shell: cmd
|
134
.github/actions/test-summary/action.yml
vendored
134
.github/actions/test-summary/action.yml
vendored
@@ -1,134 +0,0 @@
|
||||
name: 'Test Summary'
|
||||
description: 'Compare test results between current branch and master'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download vcpkg cache
|
||||
uses: ./.github/actions/download-vcpkg-cache
|
||||
with:
|
||||
artifact-name: install-linux-clang-x64-cache
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y cmake clang g++ make libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev
|
||||
shell: bash
|
||||
|
||||
- name: Setup Xvfb and Mesa
|
||||
uses: ./.github/actions/setup-xvfb-mesa
|
||||
|
||||
- name: Set environment variables
|
||||
run: |
|
||||
echo "DISPLAY=:99" >> $GITHUB_ENV
|
||||
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Download and extract install directory
|
||||
uses: actions/download-artifact@v4.3.0
|
||||
with:
|
||||
name: install-linux-clang-x64
|
||||
path: install
|
||||
|
||||
- name: Set execute permissions on DRAWEXE
|
||||
run: chmod +x install/bin/DRAWEXE
|
||||
shell: bash
|
||||
|
||||
- name: Get latest workflow run ID from target branch
|
||||
id: get_run_id
|
||||
run: |
|
||||
response=$(curl -s \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=${{ github.event.pull_request.base.ref }}&status=success")
|
||||
latest_run_id=$(echo "$response" | jq -r \
|
||||
--arg repo "${{ github.repository }}" \
|
||||
'.workflow_runs[] | select(.name=="Build and Test OCCT on Multiple Platforms" and .head_repository.full_name==$repo) | .id' | head -n 1)
|
||||
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Download master branch test results
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
for platform in windows-x64 macos-x64 linux-clang-x64; do
|
||||
echo "Downloading results for $platform"
|
||||
gh run download ${{ env.latest_run_id }} -n "results-$platform" -D "install/bin/results/master/"
|
||||
done
|
||||
shell: bash
|
||||
|
||||
- name: Download current branch test results
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
for platform in windows-x64 macos-x64 linux-clang-x64; do
|
||||
echo "Downloading results for $platform"
|
||||
gh run download -n "results-$platform" -D "install/bin/results/current/"
|
||||
done
|
||||
shell: bash
|
||||
|
||||
- name: Compare test results
|
||||
run: |
|
||||
echo "Comparing test results..."
|
||||
cd install/bin
|
||||
source env.sh
|
||||
for platform in windows-x64 macos-x64 linux-clang-x64; do
|
||||
./DRAWEXE -v -c testdiff "results/current/$platform" "results/master/$platform" &
|
||||
done
|
||||
wait
|
||||
shell: bash
|
||||
|
||||
- name: Install BeautifulSoup
|
||||
run: pip install beautifulsoup4
|
||||
shell: bash
|
||||
|
||||
- name: Clean unused test images
|
||||
run: |
|
||||
# copy to the install/bin/results directory
|
||||
cp ${{ github.workspace }}/.github/actions/scripts/cleanup_test_images.py install/bin/results
|
||||
cd install/bin/results
|
||||
python cleanup_test_images.py
|
||||
shell: bash
|
||||
|
||||
- name: Upload comparison results
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: test-compare-results
|
||||
retention-days: 15
|
||||
overwrite: true
|
||||
path: |
|
||||
install/bin/results/**/diff-*.html
|
||||
install/bin/results/**/diff-*.log
|
||||
install/bin/results/**/summary.html
|
||||
install/bin/results/**/tests.log
|
||||
install/bin/results/**/*.png
|
||||
|
||||
- name: Post performance summary to PR
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT' && github.head_ref == 'IR' && github.base_ref == 'master'
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
COMMENT_FILE=$(mktemp)
|
||||
|
||||
# Get commit ID and commit header
|
||||
COMMIT_ID=$(git rev-parse HEAD)
|
||||
COMMIT_HEADER=$(git log -1 --pretty=%s)
|
||||
|
||||
echo -e "**Performance Test Summary**\n" > "$COMMENT_FILE"
|
||||
echo -e "**Commit**: \`${COMMIT_ID}\`\n" >> "$COMMENT_FILE"
|
||||
echo -e "**Title**: ${COMMIT_HEADER}\n" >> "$COMMENT_FILE"
|
||||
|
||||
LOG_FILES=$(find install/bin/results/current -name "diff-*.log")
|
||||
if [ -z "$LOG_FILES" ]; then
|
||||
echo "No diff logs found." >> "$COMMENT_FILE"
|
||||
else
|
||||
for log_file in $LOG_FILES; do
|
||||
PLATFORM=$(basename $(dirname "$log_file"))
|
||||
echo "**Platform: ${PLATFORM}**" >> "$COMMENT_FILE"
|
||||
echo '```' >> "$COMMENT_FILE"
|
||||
grep -E "Total (MEMORY|CPU|IMAGE) difference:" "$log_file" >> "$COMMENT_FILE" || echo "No performance summary found." >> "$COMMENT_FILE"
|
||||
echo '```' >> "$COMMENT_FILE"
|
||||
echo "" >> "$COMMENT_FILE"
|
||||
done
|
||||
fi
|
||||
gh pr comment ${PR_NUMBER} --body-file "$COMMENT_FILE"
|
||||
rm "$COMMENT_FILE"
|
||||
shell: bash
|
8
.github/actions/testgrid/testwindows.tcl
vendored
8
.github/actions/testgrid/testwindows.tcl
vendored
@@ -17,13 +17,7 @@ set exclude_list [list \
|
||||
"chamfer dist_angle_complex A4" \
|
||||
"chamfer dist_angle_complex A5" \
|
||||
"chamfer dist_angle_sequence A1" \
|
||||
"chamfer dist_angle_sequence A4" \
|
||||
"caf basic W12" \
|
||||
"opengles3 general msaa" \
|
||||
"opengles3 geom interior1" \
|
||||
"opengles3 geom interior2" \
|
||||
"opengles3 shadows dir2" \
|
||||
"opengles3 textures alpha_mask"
|
||||
"chamfer dist_angle_sequence A4"
|
||||
]
|
||||
|
||||
set exclude_str [join $exclude_list ,]
|
||||
|
@@ -18,14 +18,7 @@ set exclude_list [list \
|
||||
"chamfer dist_angle_complex A4" \
|
||||
"chamfer dist_angle_complex A5" \
|
||||
"chamfer dist_angle_sequence A1" \
|
||||
"chamfer dist_angle_sequence A4" \
|
||||
"bugs fclasses bug30775" \
|
||||
"caf basic W12" \
|
||||
"opengles3 general msaa" \
|
||||
"opengles3 geom interior1" \
|
||||
"opengles3 geom interior2" \
|
||||
"opengles3 shadows dir2" \
|
||||
"opengles3 textures alpha_mask"
|
||||
"chamfer dist_angle_sequence A4"
|
||||
]
|
||||
|
||||
set exclude_str [join $exclude_list ,]
|
||||
|
33
.github/actions/upload-vcpkg-cache/action.yml
vendored
33
.github/actions/upload-vcpkg-cache/action.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: 'Upload vcpkg Cache'
|
||||
description: 'Upload vcpkg installed packages and cache for reuse'
|
||||
|
||||
inputs:
|
||||
artifact-name:
|
||||
description: 'Name of the artifact to store vcpkg cache'
|
||||
required: true
|
||||
build-directory:
|
||||
description: 'Build directory containing vcpkg_installed'
|
||||
required: false
|
||||
default: 'build'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- name: Create vcpkg tar archive
|
||||
run: |
|
||||
cd ${{ inputs.build-directory }}
|
||||
tar -czf vcpkg-dependencies.tar.gz \
|
||||
--exclude='vcpkg_installed/*/debug' \
|
||||
--exclude='vcpkg_installed/**/*.pdb' \
|
||||
--exclude='vcpkg_installed/**/*.lib' \
|
||||
./vcpkg_installed/
|
||||
shell: bash
|
||||
|
||||
- name: Upload vcpkg tar archive
|
||||
uses: actions/upload-artifact@v4.6.2
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: ${{ inputs.build-directory }}/vcpkg-dependencies.tar.gz
|
||||
retention-days: 7
|
||||
compression-level: 1
|
110
.github/actions/vcpkg-setup/action.yml
vendored
110
.github/actions/vcpkg-setup/action.yml
vendored
@@ -1,110 +0,0 @@
|
||||
name: 'Setup vcpkg'
|
||||
description: 'Setup vcpkg dependencies for OCCT build on a specific platform'
|
||||
|
||||
inputs:
|
||||
vcpkg-tag:
|
||||
description: 'vcpkg tag to checkout'
|
||||
required: false
|
||||
default: '2025.06.13'
|
||||
github-token:
|
||||
description: 'GitHub token for NuGet package access'
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set environment variables
|
||||
run: |
|
||||
echo "USERNAME=Open-Cascade-SAS" >> $GITHUB_ENV
|
||||
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $GITHUB_ENV
|
||||
echo "VCPKG_EXE=${{ github.workspace }}/vcpkg/vcpkg" >> $GITHUB_ENV
|
||||
echo "FEED_URL=https://nuget.pkg.github.com/Open-Cascade-SAS/index.json" >> $GITHUB_ENV
|
||||
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite" >> $GITHUB_ENV
|
||||
echo "VCPKG_FEATURE_FLAGS=binarycaching,manifests,versions" >> $GITHUB_ENV
|
||||
echo "VCPKG_DISABLE_COMPILER_TRACKING=1" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
if: runner.os != 'Windows'
|
||||
|
||||
- name: Set environment variables (Windows)
|
||||
run: |
|
||||
echo "USERNAME=Open-Cascade-SAS" >> $env:GITHUB_ENV
|
||||
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $env:GITHUB_ENV
|
||||
echo "VCPKG_EXE=${{ github.workspace }}/vcpkg/vcpkg" >> $env:GITHUB_ENV
|
||||
echo "FEED_URL=https://nuget.pkg.github.com/Open-Cascade-SAS/index.json" >> $env:GITHUB_ENV
|
||||
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite" >> $env:GITHUB_ENV
|
||||
echo "VCPKG_FEATURE_FLAGS=binarycaching,manifests,versions" >> $env:GITHUB_ENV
|
||||
echo "VCPKG_DISABLE_COMPILER_TRACKING=1" >> $env:GITHUB_ENV
|
||||
shell: pwsh
|
||||
if: runner.os == 'Windows'
|
||||
|
||||
- name: Install required packages (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete \
|
||||
libx11-dev \
|
||||
libxi-dev \
|
||||
libxext-dev \
|
||||
mesa-common-dev \
|
||||
libglu1-mesa-dev \
|
||||
libegl1-mesa-dev \
|
||||
libgles2-mesa-dev
|
||||
shell: bash
|
||||
|
||||
|
||||
- name: Install required packages (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
brew update || true
|
||||
brew install cmake ninja nasm autoconf automake mono openexr || true
|
||||
brew install --cask xquartz || true
|
||||
shell: bash
|
||||
|
||||
|
||||
- name: Set up vcpkg (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
git checkout ${{ inputs.vcpkg-tag }}
|
||||
./bootstrap-vcpkg.sh
|
||||
shell: bash
|
||||
|
||||
- name: Set up vcpkg (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
git checkout ${{ inputs.vcpkg-tag }}
|
||||
.\bootstrap-vcpkg.bat
|
||||
shell: cmd
|
||||
|
||||
- name: Add NuGet sources
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
.$(${{ env.VCPKG_EXE }} fetch nuget) `
|
||||
sources add `
|
||||
-Source "${{ env.FEED_URL }}" `
|
||||
-StorePasswordInClearText `
|
||||
-Name GitHubPackages `
|
||||
-UserName "${{ env.USERNAME }}" `
|
||||
-Password "${{ inputs.github-token }}"
|
||||
.$(${{ env.VCPKG_EXE }} fetch nuget) `
|
||||
setapikey "${{ inputs.github-token }}" `
|
||||
-Source "${{ env.FEED_URL }}"
|
||||
shell: pwsh
|
||||
|
||||
- name: Add NuGet sources
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
|
||||
sources add \
|
||||
-Source "${{ env.FEED_URL }}" \
|
||||
-StorePasswordInClearText \
|
||||
-Name GitHubPackages \
|
||||
-UserName "${{ env.USERNAME }}" \
|
||||
-Password "${{ inputs.github-token }}"
|
||||
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
|
||||
setapikey "${{ inputs.github-token }}" \
|
||||
-Source "${{ env.FEED_URL }}"
|
||||
shell: bash
|
247
.github/copilot-instructions.md
vendored
247
.github/copilot-instructions.md
vendored
@@ -1,247 +0,0 @@
|
||||
# OCCT Copilot Instructions
|
||||
|
||||
This file provides the comprehensive guidance for AI assistants working with the Open CASCADE Technology (OCCT) C++17+ 3D CAD/CAM/CAE library.
|
||||
|
||||
---
|
||||
|
||||
## 1. Core Directives for AI Assistant
|
||||
|
||||
> **IMPORTANT:** These are the most critical rules. Follow them strictly.
|
||||
|
||||
1. **Memory Management is Paramount:**
|
||||
- **ALWAYS** use `Handle(ClassName)` for any class inheriting from `Standard_Transient` (e.g., `Geom_*`, `Poly_*`, `AIS_*`, `V3d_*`). This is for reference-counted objects.
|
||||
- **NEVER** use raw pointers (`ClassName*`) for these types, as it will cause memory leaks.
|
||||
- **Correct:** `Handle(Geom_Circle) aCircle = new Geom_Circle(...);`
|
||||
- **Wrong:** `Geom_Circle* aCircle = new Geom_Circle(...);`
|
||||
|
||||
2. **Check Operation Status:**
|
||||
- After using an API that performs a geometric operation (e.g., `BRepAlgoAPI_Fuse`, `BRepBuilderAPI_MakeEdge`), **ALWAYS** check if the operation was successful using the `IsDone()` method before accessing the result.
|
||||
- **Correct:**
|
||||
```cpp
|
||||
BRepAlgoAPI_Fuse aFuser(theShape1, theShape2);
|
||||
if (aFuser.IsDone()) {
|
||||
auto aResult = aFuser.Shape();
|
||||
} else {
|
||||
// Handle error
|
||||
}
|
||||
```
|
||||
|
||||
3. **Strict Naming and File Conventions:**
|
||||
- Adhere to the strict `Package_ClassName` convention.
|
||||
- Place new files in the correct directory: `src/Module/Toolkit/Package/`.
|
||||
- After adding a file, **ALWAYS** update the corresponding `src/Module/Toolkit/FILES.cmake` file.
|
||||
|
||||
4. **Use Modern C++ Idioms:**
|
||||
- Prefer `auto` for variable declarations where the type is clear, especially with iterators.
|
||||
- Use range-based `for` loops and structured bindings where applicable.
|
||||
- Use the modern `TopExp_Explorer` constructor style.
|
||||
- **Correct:** `for (TopExp_Explorer anExp(theShape, TopAbs_FACE); anExp.More(); anExp.Next()) { ... }`
|
||||
- **Wrong:** `for (TopExp_Explorer anExp; anExp.Init(theShape, TopAbs_FACE); anExp.More(); anExp.Next()) { ... }`
|
||||
|
||||
5. **Safe Type Casting:**
|
||||
- When downcasting topological shapes, **ALWAYS** use the `TopoDS` helper functions to avoid errors.
|
||||
- **Correct:** `auto aFace = TopoDS::Face(anExp.Current());`
|
||||
- **Wrong:** `auto aFace = (const TopoDS_Face&)anExp.Current();`
|
||||
|
||||
6. **Handle Downcasting:**
|
||||
- Use `Handle(DerivedClass)::DownCast(BaseHandle)` to safely downcast handles.
|
||||
- **Correct:**
|
||||
```cpp
|
||||
Handle(Geom_Circle) circ = Handle(Geom_Circle)::DownCast(someCurveHandle);
|
||||
```
|
||||
- **Wrong:**
|
||||
```cpp
|
||||
// Do not use C-style casts on handles
|
||||
Geom_Circle* circ = (Geom_Circle*)someHandle.Get();
|
||||
```
|
||||
|
||||
7. **Validate Handles for Null Safety:**
|
||||
- **ALWAYS** check that a `Handle(ClassName)` is not null before dereferencing it:
|
||||
```cpp
|
||||
if (!theHandle.IsNull()) {
|
||||
// use theHandle
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 2. Project Overview
|
||||
|
||||
Open CASCADE Technology (OCCT) is a comprehensive C++ software development platform for 3D surface and solid modeling, CAD data exchange, and visualization. It's a modern C++17+ library providing services for CAD/CAM/CAE applications.
|
||||
|
||||
### Architecture & Source Organization
|
||||
|
||||
- **`src/`**: Source code, organized by a `Module/Toolkit/Package` hierarchy.
|
||||
- **`tests/`**: Draw Harness test files, organized by functionality.
|
||||
- **`adm/`**: Administrative and build configuration files (CMake).
|
||||
- **`samples/`**: Example applications.
|
||||
|
||||
---
|
||||
|
||||
## 3. Code Conventions
|
||||
|
||||
### Naming Patterns
|
||||
|
||||
| Element Type | Pattern | Example |
|
||||
| --------------------------- | ---------------------------- | -------------------------------- |
|
||||
| **Classes** | `Package_ClassName` | `TopoDS_Shape`, `BRep_Builder` |
|
||||
| **Public Methods** | `MethodName` | `IsDone()`, `Shape()` |
|
||||
| **Private Methods** | `methodName` | `myInternalMethod()` |
|
||||
| **Method Parameters** | `theParameterName` | `theShape`, `theTolerance` |
|
||||
| **Local Variables** | `aVariableName` | `aBox`, `anExplorer` |
|
||||
| **Class Member Fields** | `myFieldName` | `myShape`, `myIsDone` |
|
||||
| **Struct Member Fields** | `FieldVariableName` | `Point`, `Value` |
|
||||
| **Global Variables** | `THE_GLOBAL_VARIABLE` | `THE_DEFAULT_PRECISION` |
|
||||
|
||||
### Type Mappings
|
||||
|
||||
| OCCT Type | C++ Equivalent | Notes |
|
||||
| ------------------- | -------------- | ----------------------------------- |
|
||||
| `Standard_Real` | `double` | Use for all floating-point numbers. |
|
||||
| `Standard_Integer` | `int` | Use for all integer values. |
|
||||
| `Standard_Boolean` | `bool` | Use for `true`/`false` values. |
|
||||
|
||||
### Modern C++ Encouraged
|
||||
This is a C++17+ codebase. Proactively use modern features to improve code quality:
|
||||
- `auto`
|
||||
- Range-based `for` loops
|
||||
- Structured bindings: `for (const auto& [key, value] : aMap)`
|
||||
- `std::optional` for optional return values where appropriate.
|
||||
- `if constexpr` for compile-time conditions.
|
||||
|
||||
---
|
||||
|
||||
## 4. Step-by-Step Workflow Example: Adding a New Class and Test
|
||||
|
||||
This example demonstrates the end-to-end process for adding a new class `BRepTest_MyNewClass` to the `TKTopAlgo` toolkit and creating a corresponding GTest.
|
||||
|
||||
**1. Create Header and Source Files:**
|
||||
Navigate to the correct package directory and create the files.
|
||||
```bash
|
||||
# Navigate to the BRepTest package in the ModelingAlgorithms module
|
||||
cd src/ModelingAlgorithms/TKTopAlgo/BRepTest
|
||||
touch BRepTest_MyNewClass.hxx BRepTest_MyNewClass.cxx
|
||||
```
|
||||
|
||||
**2. Implement the Class:**
|
||||
Add content to `BRepTest_MyNewClass.hxx` and `.cxx`, following all code conventions.
|
||||
|
||||
**3. Add Files to CMake:**
|
||||
Edit the toolkit's `FILES.cmake` to register the new files.
|
||||
```bash
|
||||
# Edit the CMake file for TKTopAlgo
|
||||
vim src/ModelingAlgorithms/TKTopAlgo/FILES.cmake
|
||||
```
|
||||
Add the new files to the `OCCT_<PackageName>_FILES` list:
|
||||
```cmake
|
||||
# In FILES.cmake
|
||||
...
|
||||
set (OCCT_BRepTest_FILES
|
||||
...
|
||||
BRepTest_MyNewClass.hxx
|
||||
BRepTest_MyNewClass.cxx
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
**4. Create a GTest:**
|
||||
Navigate to the GTest directory for the toolkit and create a test file.
|
||||
```bash
|
||||
# Navigate to the GTest directory for TKTopAlgo
|
||||
cd src/ModelingAlgorithms/TKTopAlgo/GTests
|
||||
touch BRepTest_MyNewClass_Test.cxx
|
||||
```
|
||||
Write the test implementation in the new file.
|
||||
|
||||
**5. Add GTest to CMake:**
|
||||
Edit the same `FILES.cmake` to add the test file.
|
||||
```cmake
|
||||
# In FILES.cmake
|
||||
...
|
||||
set (OCCT_TKTopAlgo_GTests_FILES
|
||||
...
|
||||
GTests/BRepTest_MyNewClass_Test.cxx
|
||||
...
|
||||
)
|
||||
```
|
||||
|
||||
**6. Build and Run Test:**
|
||||
From the `build` directory, build the project and run the tests.
|
||||
```bash
|
||||
# Navigate to build directory
|
||||
cd build
|
||||
|
||||
# Re-run CMake to pick up new files (usually not needed, but good practice)
|
||||
cmake .. -DBUILD_GTEST=ON
|
||||
|
||||
# Build the project
|
||||
cmake --build . --config Release
|
||||
|
||||
# Run the tests
|
||||
./bin/OpenCascadeGTest --gtest_filter=*MyNewClass*
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. Build and Test System
|
||||
|
||||
### Build System (CMake)
|
||||
- **Primary build system:** CMake 3.16+ recommended.
|
||||
- **Build Directory:** Always build in a separate directory (e.g., `build/`).
|
||||
- **Quick Build:**
|
||||
```bash
|
||||
mkdir -p build && cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_GTEST=ON
|
||||
cmake --build . --config Release --parallel
|
||||
```
|
||||
- **Environment:** Before running any OCCT executable (including tests), you **must** source the environment script: `source build/env.sh` (or `build\env.bat` on Windows).
|
||||
|
||||
### Testing Frameworks
|
||||
- **Draw Harness:** Tcl-based framework for interactive testing. Located in `tests/`. Run with `build/DRAWEXE`.
|
||||
- **GTest:** C++ unit testing framework. Tests are located in `src/.../GTests/`. Enable with `-DBUILD_GTEST=ON`.
|
||||
|
||||
---
|
||||
|
||||
## 6. Common Patterns & Key Packages
|
||||
|
||||
### Common Operations
|
||||
|
||||
- **Shape Creation:** Use `BRepPrimAPI_` classes (`MakeBox`, `MakeCylinder`).
|
||||
- **Boolean Operations:** Use `BRepAlgoAPI_` classes (`Fuse`, `Cut`, `Common`).
|
||||
- **Shape Exploration:** Use `TopExp_Explorer`.
|
||||
- **Transformations:** Use `gp_Trsf` and `BRepBuilderAPI_Transform`.
|
||||
|
||||
### Key Packages
|
||||
|
||||
| Package | Purpose | Module |
|
||||
| ----------- | ------------------------------------- | --------------------- |
|
||||
| `gp` | Geometric Primitives (Points, Vecs) | FoundationClasses |
|
||||
| `Geom` | Geometric entities (Curves, Surfaces) | ModelingData |
|
||||
| `TopoDS` | Topological Data Structures (Shapes) | ModelingData |
|
||||
| `TopExp` | Exploring topological shapes | ModelingData |
|
||||
| `BRepAlgoAPI` | High-level modeling algorithms | ModelingAlgorithms |
|
||||
| `BRepPrimAPI` | Geometric primitives creation | ModelingAlgorithms |
|
||||
| `AIS` | Application Interactive Services | Visualization |
|
||||
|
||||
### Common Headers
|
||||
```cpp
|
||||
#include <Standard_Failure.hxx>
|
||||
#include <Handle_Geom_Circle.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepAlgoAPI_Fuse.hxx>
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
#include <BRepPrimAPI_MakeBox.hxx>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 7. Key Files & Platform Notes
|
||||
|
||||
- **`adm/MODULES`**: Defines all modules and toolkits.
|
||||
- **`src/*/FILES.cmake`**: Lists all source/header files for a toolkit. **You must edit this when adding/removing files.**
|
||||
- **`build/env.sh/bat`**: The crucial environment script.
|
1791
.github/workflows/build-and-test-multiplatform.yml
vendored
1791
.github/workflows/build-and-test-multiplatform.yml
vendored
File diff suppressed because it is too large
Load Diff
59
.github/workflows/build-docs.yml
vendored
Normal file
59
.github/workflows/build-docs.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# 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
|
216
.github/workflows/build-multiconfig-mingw.yml
vendored
Normal file
216
.github/workflows/build-multiconfig-mingw.yml
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
# This workflow validates the build on Windows using MinGW and MSYS2.
|
||||
# It is triggered on pushes to the master branch.
|
||||
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
|
||||
|
||||
name: MinGW build validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main_job:
|
||||
name: Windows MinGW validation
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "GCC",
|
||||
cc: "x86_64-w64-mingw32-gcc",
|
||||
cxx: "x86_64-w64-mingw32-g++",
|
||||
package: "mingw-w64-x86_64-toolchain",
|
||||
thirdparty_dir: "/mingw64",
|
||||
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
package: "mingw-w64-clang-x86_64-toolchain",
|
||||
thirdparty_dir: "/clang64",
|
||||
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
- {
|
||||
name: "UCRT",
|
||||
cc: "x86_64-w64-mingw32-gcc",
|
||||
cxx: "x86_64-w64-mingw32-g++",
|
||||
package: "mingw-w64-ucrt-x86_64-toolchain",
|
||||
thirdparty_dir: "/ucrt64",
|
||||
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.config.name == 'Clang' && 'CLANG64' || matrix.config.name == 'UCRT' && 'UCRT64' || 'MINGW64' }}
|
||||
update: true
|
||||
install: ${{ matrix.config.package }} ${{ matrix.config.dependencies }}
|
||||
|
||||
- name: Setup environment
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
echo "Checking compiler version:"
|
||||
${{ matrix.config.cc }} --version
|
||||
echo "Checking CMake version:"
|
||||
cmake --version
|
||||
echo "Setting up environment variables..."
|
||||
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
|
||||
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure basic
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
|
||||
|
||||
- name: Build basic
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
|
||||
- name: Configure full shared
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR="${{ github.workspace }}/install" \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=OFF \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
|
||||
|
||||
- name: Build full shared
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full static
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Static \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR="${{ github.workspace }}/install" \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=OFF \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
|
||||
|
||||
- name: Build full static
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full with DEBUG define
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D BUILD_WITH_DEBUG=ON \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D INSTALL_DIR="${{ github.workspace }}/install" \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=OFF \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON ..
|
||||
|
||||
- name: Build full with DEBUG define
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
213
.github/workflows/build-multiconfig-msvc.yml
vendored
Normal file
213
.github/workflows/build-multiconfig-msvc.yml
vendored
Normal file
@@ -0,0 +1,213 @@
|
||||
# This workflow validates the build on Windows using MSVC and Clang compilers.
|
||||
# It is triggered on pushes to the master branch.
|
||||
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
|
||||
|
||||
name: MSVC build validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main_job:
|
||||
name: Windows MSVC/Clang validation
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "MSVC",
|
||||
cc: "cl",
|
||||
cxx: "cl",
|
||||
generator: "Visual Studio 17 2022",
|
||||
toolset: "host=x64",
|
||||
c_flags: "/W4 /WX",
|
||||
cxx_flags: "/W4 /WX"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
generator: "Ninja",
|
||||
toolset: "",
|
||||
c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option",
|
||||
cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option"
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Set up MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Download and extract 3rdparty dependencies
|
||||
run: |
|
||||
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
|
||||
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
|
||||
Remove-Item 3rdparty-vc14-64.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Download and extract Mesa3D
|
||||
run: |
|
||||
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
|
||||
7z x mesa3d.7z -omesa3d
|
||||
|
||||
- name: Run system-wide deployment
|
||||
run: |
|
||||
cd mesa3d
|
||||
.\systemwidedeploy.cmd 1
|
||||
.\systemwidedeploy.cmd 5
|
||||
shell: cmd
|
||||
|
||||
- name: Configure basic
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
|
||||
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build basic
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --config Release
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure full shared
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D BUILD_USE_PCH=OFF `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_LIBRARY_TYPE=Shared `
|
||||
-D CMAKE_BUILD_TYPE=Debug `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D USE_MMGR_TYPE=JEMALLOC `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
|
||||
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build full shared
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure full static
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D BUILD_USE_PCH=OFF `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_LIBRARY_TYPE=Static `
|
||||
-D CMAKE_BUILD_TYPE=Debug `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D USE_MMGR_TYPE=JEMALLOC `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=OFF `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
|
||||
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build full static
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure full with DEBUG define
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D BUILD_WITH_DEBUG=ON `
|
||||
-D BUILD_USE_PCH=OFF `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_LIBRARY_TYPE=Shared `
|
||||
-D CMAKE_BUILD_TYPE=Debug `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON ` ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build full with DEBUG define
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
shell: pwsh
|
179
.github/workflows/build-multiconfig-ubuntu.yml
vendored
Normal file
179
.github/workflows/build-multiconfig-ubuntu.yml
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
# This workflow validates the build on the latest Ubuntu version (24.04) using multiple configurations.
|
||||
# It is triggered on pushes to the master branch.
|
||||
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
|
||||
|
||||
name: Ubuntu build validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main_job:
|
||||
name: Latest ubuntu validation
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "GCC",
|
||||
cc: "gcc",
|
||||
cxx: "g++"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++"
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev
|
||||
|
||||
- name: Install rapidjson
|
||||
run: |
|
||||
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
|
||||
unzip rapidjson.zip
|
||||
|
||||
- name: Configure basic
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
|
||||
|
||||
- name: Build basic
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
|
||||
- name: Configure full shared
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=ON \
|
||||
-D USE_TBB=ON \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
|
||||
|
||||
- name: Build full shared
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
rm -rf ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full static
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Static \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=ON \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
|
||||
|
||||
- name: Build full static
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
rm -rf ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full with DEBUG define
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D BUILD_WITH_DEBUG=ON \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=ON \
|
||||
-D USE_TBB=ON \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON ..
|
||||
|
||||
- name: Build full with DEBUG define
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
rm -rf ${{ github.workspace }}/install
|
169
.github/workflows/build-occt-with-vcpkg.yml
vendored
Normal file
169
.github/workflows/build-occt-with-vcpkg.yml
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
# This workflow builds OCCT using vcpkg on multiple platforms (Windows, macOS, Linux).
|
||||
# It builds in both Debug and Release modes.
|
||||
# All dependencies except the compiler are installed using vcpkg.
|
||||
# The workflow includes steps to clone vcpkg, install dependencies, configure and build.
|
||||
|
||||
name: Build OCCT with vcpkg
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
USERNAME: Open-Cascade-SAS
|
||||
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
|
||||
FEED_URL: https://nuget.pkg.github.com/Open-Cascade-SAS/index.json
|
||||
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019, macos-15, macos-14, macos-13]
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Install required packages (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete
|
||||
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
|
||||
|
||||
- name: Install required packages (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
brew update || true
|
||||
brew install cmake ninja nasm autoconf mono || true
|
||||
# temporary workaround for missing tcl-tk
|
||||
brew install tcl-tk || true
|
||||
# Force link any conflicting packages
|
||||
brew link --overwrite python@3.12 || true
|
||||
brew link --overwrite python@3.13 || true
|
||||
|
||||
- name: Install required packages (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Set up vcpkg (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
./vcpkg/bootstrap-vcpkg.sh
|
||||
shell: bash
|
||||
|
||||
- name: Set up vcpkg (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
.\vcpkg\bootstrap-vcpkg.bat
|
||||
shell: cmd
|
||||
|
||||
- name: Add NuGet sources
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
.$(${{ env.VCPKG_EXE }} fetch nuget) `
|
||||
sources add `
|
||||
-Source "${{ env.FEED_URL }}" `
|
||||
-StorePasswordInClearText `
|
||||
-Name GitHubPackages `
|
||||
-UserName "${{ env.USERNAME }}" `
|
||||
-Password "${{ secrets.GITHUB_TOKEN }}"
|
||||
.$(${{ env.VCPKG_EXE }} fetch nuget) `
|
||||
setapikey "${{ secrets.GITHUB_TOKEN }}" `
|
||||
-Source "${{ env.FEED_URL }}"
|
||||
shell: pwsh
|
||||
|
||||
- name: Add NuGet sources
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
|
||||
sources add \
|
||||
-Source "${{ env.FEED_URL }}" \
|
||||
-StorePasswordInClearText \
|
||||
-Name GitHubPackages \
|
||||
-UserName "${{ env.USERNAME }}" \
|
||||
-Password "${{ secrets.GITHUB_TOKEN }}"
|
||||
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
|
||||
setapikey "${{ secrets.GITHUB_TOKEN }}" \
|
||||
-Source "${{ env.FEED_URL }}"
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT ${{ matrix.build_type }} (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
mkdir build-${{ matrix.build_type }}
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-DBUILD_USE_VCPKG=ON \
|
||||
-DUSE_MMGR_TYPE=NATIVE \
|
||||
-DUSE_FREETYPE=ON \
|
||||
-DUSE_TK=OFF \
|
||||
-DBUILD_USE_PCH=ON \
|
||||
-DBUILD_INCLUDE_SYMLINK=ON \
|
||||
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
|
||||
-DUSE_DRACO=ON \
|
||||
-DUSE_FFMPEG=ON \
|
||||
-DUSE_FREEIMAGE=ON \
|
||||
-DUSE_GLES2=OFF \
|
||||
-DUSE_VTK=ON \
|
||||
-DUSE_TBB=ON \
|
||||
-DUSE_RAPIDJSON=ON \
|
||||
-DUSE_OPENGL=ON \
|
||||
-DBUILD_MODULE_Draw=OFF \
|
||||
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build \
|
||||
${{ runner.os != 'macOS' && '-DUSE_OPENVR=ON' || '' }} ..
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT ${{ matrix.build_type }} (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
mkdir build-${{ matrix.build_type }}
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ^
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
|
||||
-DBUILD_USE_VCPKG=ON ^
|
||||
-DUSE_MMGR_TYPE=JEMALLOC ^
|
||||
-DUSE_FREETYPE=ON ^
|
||||
-DUSE_TK=OFF ^
|
||||
-DBUILD_USE_PCH=ON ^
|
||||
-DBUILD_INCLUDE_SYMLINK=ON ^
|
||||
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} ^
|
||||
-DUSE_DRACO=ON ^
|
||||
-DUSE_FFMPEG=OFF ^
|
||||
-DUSE_FREEIMAGE=ON ^
|
||||
-DUSE_GLES2=ON ^
|
||||
-DUSE_OPENVR=ON ^
|
||||
-DUSE_VTK=ON ^
|
||||
-DUSE_TBB=ON ^
|
||||
-DUSE_RAPIDJSON=ON ^
|
||||
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build ^
|
||||
-DUSE_OPENGL=ON ..
|
||||
shell: cmd
|
||||
|
||||
- name: Build OCCT ${{ matrix.build_type }} (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake --build . --target install --config ${{ matrix.build_type }}
|
||||
shell: bash
|
||||
|
||||
- name: Build OCCT ${{ matrix.build_type }} (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake --build . --target install --config ${{ matrix.build_type }}
|
||||
shell: cmd
|
84
.github/workflows/clang-format-check.yml
vendored
Normal file
84
.github/workflows/clang-format-check.yml
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
# This workflow checks the code formatting of changed files in a pull request using clang-format.
|
||||
# It is triggered on pull requests to the master branch.
|
||||
# The workflow verifies that the clang-format version matches 18.1.8,
|
||||
# checks formatting of modified files, and if formatting issues are found,
|
||||
# creates a patch file that can be applied to fix the formatting.
|
||||
|
||||
name: Clang-Format Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
format-check:
|
||||
name: Check code formatting
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check clang-format version
|
||||
run: |
|
||||
$version = clang-format --version
|
||||
Write-Output "Detected clang-format version: $version"
|
||||
$version | Select-String "18.1.8" >$null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
echo "::error::Wrong clang-format version. Expected 18.1.8"
|
||||
Write-Output "Error: Version mismatch - expected 18.1.8"
|
||||
exit 1
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
run: |
|
||||
$changedFiles = git diff --name-only origin/${{ github.base_ref }} HEAD |
|
||||
Where-Object { $_ -match '^(src|tools)/' -and $_ -match '\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$' }
|
||||
$changedFiles | Set-Content "changed_files.txt"
|
||||
if ($changedFiles.Count -gt 0) {
|
||||
echo "has_files=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Check formatting
|
||||
id: check
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
run: |
|
||||
$files = Get-Content "changed_files.txt"
|
||||
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
|
||||
clang-format -i -style=file $_
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Check git status
|
||||
id: git-check
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
run: |
|
||||
git diff > format.patch
|
||||
if ((Get-Item format.patch).length -gt 0) {
|
||||
echo "has_changes=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Upload patch
|
||||
if: steps.git-check.outputs.has_changes == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: format-patch
|
||||
path: format.patch
|
||||
|
||||
- name: Fail with instructions
|
||||
if: steps.git-check.outputs.has_changes == 'true'
|
||||
run: |
|
||||
echo "::error::Files need formatting. To fix: 1. Download format.patch 2. "git apply format.patch" 3. Commit and push"
|
||||
exit 1
|
||||
shell: pwsh
|
97
.github/workflows/code-analysis.yml
vendored
Normal file
97
.github/workflows/code-analysis.yml
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
# This workflow performs code analysis using both CodeQL and Microsoft C++ Code Analysis.
|
||||
# It is triggered on pushes to the 'master' branch and publishes warnings into the security GitHub tab.
|
||||
# The workflow includes two jobs: one for CodeQL analysis on Ubuntu and another for MSVC Code Analysis on Windows.
|
||||
|
||||
name: Code Analysis
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
packages: read
|
||||
|
||||
env:
|
||||
# Path to the CMake build directory.
|
||||
build: '${{ github.workspace }}/build'
|
||||
config: 'Debug'
|
||||
|
||||
jobs:
|
||||
codeql-analyze:
|
||||
name: CodeQL Analyze (C/C++)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Step: Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
# Step: Install necessary dependencies for building the project
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev
|
||||
|
||||
# Step: Initialize CodeQL for scanning
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3.26.5
|
||||
with:
|
||||
languages: c-cpp
|
||||
build-mode: manual
|
||||
|
||||
# Step: Build the project using CMake and Make
|
||||
- name: Build project
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" \
|
||||
-D CMAKE_C_COMPILER=gcc \
|
||||
-D CMAKE_CXX_COMPILER=g++ \
|
||||
-D USE_FREETYPE=OFF \
|
||||
-D CMAKE_BUILD_TYPE=Release ..
|
||||
make -j$(nproc)
|
||||
|
||||
# Step: Perform CodeQL Analysis
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3.26.5
|
||||
with:
|
||||
category: "/language:c-cpp"
|
||||
|
||||
msvc-analyze:
|
||||
name: Microsoft C++ Code Analysis
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
# Step: Checkout the repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
# Step: Install necessary dependencies using Chocolatey
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
|
||||
choco install magicsplat-tcl-tk -y
|
||||
|
||||
# Step: Configure the project using CMake
|
||||
- name: Configure CMake
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} ..
|
||||
|
||||
# Step: Run MSVC Code Analysis
|
||||
- name: Run MSVC Code Analysis
|
||||
uses: microsoft/msvc-code-analysis-action@v0.1.1
|
||||
id: run-analysis
|
||||
with:
|
||||
cmakeBuildDirectory: ${{ env.build }}
|
||||
buildConfiguration: ${{ env.config }}
|
||||
ruleset: NativeRecommendedRules.ruleset
|
||||
|
||||
# Step: Upload SARIF file to GitHub Code Scanning Alerts
|
||||
- name: Upload SARIF to GitHub
|
||||
uses: github/codeql-action/upload-sarif@v3.26.5
|
||||
with:
|
||||
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
81
.github/workflows/daily-ir-vcpkg-configure.yml
vendored
81
.github/workflows/daily-ir-vcpkg-configure.yml
vendored
@@ -1,81 +0,0 @@
|
||||
# This workflow runs daily on the IR branch to configure OCCT with vcpkg packages.
|
||||
# It only performs configuration without building or installing, using vcpkg for dependency management.
|
||||
|
||||
name: Daily IR Branch vcpkg Configure
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Run daily at 02:00 UTC
|
||||
- cron: '0 2 * * *'
|
||||
workflow_dispatch:
|
||||
# Allow manual triggering
|
||||
|
||||
jobs:
|
||||
configure-windows:
|
||||
name: Configure OCCT on Windows with MSVC
|
||||
runs-on: windows-2025
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
ref: IR
|
||||
|
||||
- name: Configure OCCT
|
||||
uses: ./.github/actions/configure-occt
|
||||
with:
|
||||
platform: windows
|
||||
compiler: msvc
|
||||
cmake-build-type: Release
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify configuration output
|
||||
run: |
|
||||
echo "::notice::Successfully configured OCCT on Windows with vcpkg packages"
|
||||
|
||||
configure-macos:
|
||||
name: Configure OCCT on macOS with Clang
|
||||
runs-on: macos-15
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
ref: IR
|
||||
|
||||
- name: Configure OCCT
|
||||
uses: ./.github/actions/configure-occt
|
||||
with:
|
||||
platform: macos
|
||||
compiler: clang
|
||||
cmake-build-type: Release
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify configuration output
|
||||
run: |
|
||||
echo "::notice::Successfully configured OCCT on macOS with vcpkg packages"
|
||||
|
||||
configure-linux:
|
||||
name: Configure OCCT on Ubuntu with Clang
|
||||
runs-on: ubuntu-24.04
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
ref: IR
|
||||
|
||||
- name: Configure OCCT
|
||||
uses: ./.github/actions/configure-occt
|
||||
with:
|
||||
platform: linux
|
||||
compiler: clang
|
||||
cmake-build-type: Release
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Verify configuration output
|
||||
run: |
|
||||
echo "::notice::Successfully configured OCCT on Linux with vcpkg packages"
|
297
.github/workflows/master-validation.yml
vendored
297
.github/workflows/master-validation.yml
vendored
@@ -1,297 +0,0 @@
|
||||
# Master validation workflow that combines multiple build configurations
|
||||
# This workflow is triggered only on pushes to the master branch of the main repository
|
||||
# It includes Windows (MSVC, MinGW), Ubuntu, vcpkg builds, and code analysis
|
||||
|
||||
name: Master Validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# Windows MSVC/Clang builds
|
||||
windows-msvc:
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
name: Windows MSVC/Clang validation
|
||||
runs-on: windows-2025
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "MSVC",
|
||||
cc: "cl",
|
||||
cxx: "cl",
|
||||
generator: "Visual Studio 17 2022",
|
||||
toolset: "host=x64",
|
||||
c_flags: "/W4 /WX",
|
||||
cxx_flags: "/W4 /WX"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
generator: "Ninja",
|
||||
toolset: "",
|
||||
c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option -Wno-error=cast-function-type-mismatch",
|
||||
cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option -Wno-error=cast-function-type-mismatch"
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Setup Windows MSVC dependencies
|
||||
uses: ./.github/actions/setup-windows-msvc-deps
|
||||
|
||||
- name: Build basic configuration
|
||||
uses: ./.github/actions/cmake-build-basic
|
||||
with:
|
||||
generator: ${{ matrix.config.generator }}
|
||||
cc: ${{ matrix.config.cc }}
|
||||
cxx: ${{ matrix.config.cxx }}
|
||||
build-type: "Release"
|
||||
thirdparty-dir: ${{ github.workspace }}/3rdparty-vc14-64
|
||||
compiler-flags: "${{ matrix.config.toolset != '' && format('-T {0}', matrix.config.toolset) || '' }} -D CMAKE_CXX_FLAGS=\"${{ matrix.config.cxx_flags }}\" -D CMAKE_C_FLAGS=\"${{ matrix.config.c_flags }}\""
|
||||
|
||||
- name: Build full shared configuration
|
||||
uses: ./.github/actions/cmake-build-full
|
||||
with:
|
||||
generator: ${{ matrix.config.generator }}
|
||||
cc: ${{ matrix.config.cc }}
|
||||
cxx: ${{ matrix.config.cxx }}
|
||||
build-type: "Debug"
|
||||
library-type: "Shared"
|
||||
opt-profile: "Production"
|
||||
thirdparty-dir: ${{ github.workspace }}/3rdparty-vc14-64
|
||||
compiler-flags: "${{ matrix.config.toolset != '' && format('-T {0}', matrix.config.toolset) || '' }} -D CMAKE_CXX_FLAGS=\"${{ matrix.config.cxx_flags }}\" -D CMAKE_C_FLAGS=\"${{ matrix.config.c_flags }}\" -D USE_FFMPEG=ON"
|
||||
use-vtk: ${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }}
|
||||
use-tbb: "ON"
|
||||
|
||||
# Windows MinGW builds
|
||||
windows-mingw:
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
name: Windows MinGW validation
|
||||
runs-on: windows-2025
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "GCC",
|
||||
cc: "x86_64-w64-mingw32-gcc",
|
||||
cxx: "x86_64-w64-mingw32-g++",
|
||||
package: "mingw-w64-x86_64-toolchain",
|
||||
msystem: "MINGW64",
|
||||
compiler_flags: "",
|
||||
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
package: "mingw-w64-clang-x86_64-toolchain",
|
||||
msystem: "CLANG64",
|
||||
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Wall -Wextra\"",
|
||||
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Setup MSYS2
|
||||
uses: ./.github/actions/setup-msys2
|
||||
with:
|
||||
msystem: ${{ matrix.config.msystem }}
|
||||
packages: ${{ matrix.config.package }}
|
||||
dependencies: ${{ matrix.config.dependencies }}
|
||||
|
||||
- name: Build basic configuration
|
||||
uses: ./.github/actions/cmake-build-basic
|
||||
with:
|
||||
generator: "Ninja"
|
||||
cc: ${{ matrix.config.cc }}
|
||||
cxx: ${{ matrix.config.cxx }}
|
||||
build-type: ${{ matrix.build_type }}
|
||||
shell-type: "msys2"
|
||||
compiler-flags: ${{ matrix.config.compiler_flags }}
|
||||
|
||||
- name: Build full shared configuration
|
||||
uses: ./.github/actions/cmake-build-full
|
||||
with:
|
||||
generator: "Ninja"
|
||||
cc: ${{ matrix.config.cc }}
|
||||
cxx: ${{ matrix.config.cxx }}
|
||||
build-type: ${{ matrix.build_type }}
|
||||
library-type: "Shared"
|
||||
opt-profile: "Production"
|
||||
shell-type: "msys2"
|
||||
compiler-flags: ${{ matrix.config.compiler_flags }}
|
||||
use-vtk: "OFF"
|
||||
use-tbb: "OFF"
|
||||
|
||||
# Ubuntu builds
|
||||
ubuntu:
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
name: Ubuntu validation
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "GCC",
|
||||
cc: "gcc",
|
||||
cxx: "g++",
|
||||
compiler_flags: ""
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Werror -Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Werror -Wall -Wextra\""
|
||||
}
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Setup Ubuntu dependencies
|
||||
uses: ./.github/actions/setup-ubuntu-deps
|
||||
|
||||
- name: Build basic configuration
|
||||
uses: ./.github/actions/cmake-build-basic
|
||||
with:
|
||||
generator: "Ninja"
|
||||
cc: ${{ matrix.config.cc }}
|
||||
cxx: ${{ matrix.config.cxx }}
|
||||
build-type: ${{ matrix.build_type }}
|
||||
compiler-flags: ${{ matrix.config.compiler_flags }}
|
||||
|
||||
- name: Build full shared configuration
|
||||
uses: ./.github/actions/cmake-build-full
|
||||
with:
|
||||
generator: "Ninja"
|
||||
cc: ${{ matrix.config.cc }}
|
||||
cxx: ${{ matrix.config.cxx }}
|
||||
build-type: ${{ matrix.build_type }}
|
||||
library-type: "Shared"
|
||||
opt-profile: "Production"
|
||||
compiler-flags: ${{ matrix.config.compiler_flags }}
|
||||
rapidjson-dir: ${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53
|
||||
use-vtk: "ON"
|
||||
use-tbb: "ON"
|
||||
|
||||
# vcpkg builds
|
||||
vcpkg:
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
name: vcpkg validation
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2025, macos-15, macos-14]
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Build OCCT with vcpkg
|
||||
uses: ./.github/actions/build-occt
|
||||
with:
|
||||
platform: ${{ runner.os == 'Windows' && 'windows' || runner.os == 'macOS' && 'macos' || 'linux' }}
|
||||
compiler: ${{ runner.os == 'Windows' && 'msvc' || 'clang' }}
|
||||
artifact-name: occt-${{ matrix.os }}-${{ matrix.build_type }}
|
||||
cmake-build-type: ${{ matrix.build_type }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Code analysis
|
||||
codeql-analyze:
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
name: CodeQL Analyze (C/C++)
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
packages: read
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3.26.5
|
||||
with:
|
||||
languages: c-cpp
|
||||
build-mode: manual
|
||||
|
||||
- name: Build project for analysis
|
||||
uses: ./.github/actions/cmake-build-basic
|
||||
with:
|
||||
generator: "Unix Makefiles"
|
||||
cc: "gcc"
|
||||
cxx: "g++"
|
||||
build-type: "Release"
|
||||
compiler-flags: "-D USE_FREETYPE=OFF"
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3.26.5
|
||||
with:
|
||||
category: "/language:c-cpp"
|
||||
|
||||
msvc-analyze:
|
||||
if: github.repository == 'Open-Cascade-SAS/OCCT'
|
||||
name: Microsoft C++ Code Analysis
|
||||
runs-on: windows-2025
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
packages: read
|
||||
|
||||
env:
|
||||
build: '${{ github.workspace }}/build'
|
||||
config: 'Debug'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Configure OCCT for analysis
|
||||
uses: ./.github/actions/configure-occt
|
||||
with:
|
||||
platform: 'windows'
|
||||
compiler: 'msvc'
|
||||
build-use-pch: 'false'
|
||||
cmake-build-type: ${{ env.config }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Run MSVC Code Analysis
|
||||
uses: microsoft/msvc-code-analysis-action@v0.1.1
|
||||
id: run-analysis
|
||||
with:
|
||||
cmakeBuildDirectory: ${{ env.build }}
|
||||
buildConfiguration: ${{ env.config }}
|
||||
ruleset: NativeRecommendedRules.ruleset
|
||||
|
||||
- name: Upload SARIF to GitHub
|
||||
uses: github/codeql-action/upload-sarif@v3.26.5
|
||||
with:
|
||||
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
|
18
.gitignore
vendored
18
.gitignore
vendored
@@ -54,20 +54,4 @@ win64
|
||||
/libtool
|
||||
/stamp*
|
||||
/build*
|
||||
/install*
|
||||
/tools/build*
|
||||
|
||||
# Coding agents instructions (keep .github/copilot-instructions.md)
|
||||
/.CLAUDE.md
|
||||
/.AGENT.md
|
||||
/.GEMINI.md
|
||||
/.COPILOT.md
|
||||
/.CURSOR.md
|
||||
/.CODEIUM.md
|
||||
/.TABNINE.md
|
||||
/.CHATGPT.md
|
||||
/.BARD.md
|
||||
/.PERPLEXITY.md
|
||||
/.CONTINUE.md
|
||||
/.AIDER.md
|
||||
/.WINDSURF.md
|
||||
/install
|
||||
|
531
CMakeLists.txt
531
CMakeLists.txt
@@ -1,8 +1,5 @@
|
||||
cmake_minimum_required (VERSION 3.10 FATAL_ERROR)
|
||||
|
||||
# Define OCCT root directory as a cache variable - works for both standalone and subproject builds
|
||||
set(OCCT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "Root directory of OCCT project" FORCE)
|
||||
|
||||
if (NOT DEFINED BUILD_USE_VCPKG)
|
||||
set (BUILD_USE_VCPKG OFF CACHE BOOL "Use vcpkg for 3rdparty libraries.")
|
||||
if (CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg.cmake")
|
||||
@@ -34,62 +31,42 @@ if (BUILD_USE_VCPKG)
|
||||
message(FATAL_ERROR "VCPKG_ROOT is not defined. Please set it to the path of vcpkg root directory.")
|
||||
endif()
|
||||
|
||||
set (VCPKG_MANIFEST_DIR "${OCCT_ROOT_DIR}/adm/vcpkg/ports/opencascade")
|
||||
|
||||
# Disable default features for vcpkg manifest
|
||||
set (VCPKG_MANIFEST_NO_DEFAULT_FEATURES 1)
|
||||
|
||||
# detection for Emscripten toolchain
|
||||
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*mscripten\.cmake$" OR "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" MATCHES ".*mscripten\.cmake$")
|
||||
set(EMSCRIPTEN 1)
|
||||
set (VCPKG_MANIFEST_DIR "${CMAKE_SOURCE_DIR}/adm/vcpkg")
|
||||
endif()
|
||||
|
||||
# detection for Android toolchain
|
||||
if(CMAKE_TOOLCHAIN_FILE MATCHES ".*ndroid\.toolchain\.cmake$" OR "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" MATCHES ".*ndroid\.toolchain\.cmake$")
|
||||
set(ANDROID 1)
|
||||
endif()
|
||||
|
||||
# detection for android common variables
|
||||
if (NOT "${CMAKE_ANDROID_NDK}" STREQUAL "" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Android" OR NOT "${ANDROID_NDK}" STREQUAL "")
|
||||
set (ANDROID 1)
|
||||
endif()
|
||||
else()
|
||||
# Setting up the system and compiler specific variables.
|
||||
# Can't be done on early stages with VCPKG enabled.
|
||||
# VCPKG installing dependencies as soon as call PROJECT,
|
||||
# but for then moment need to define required list of dependencies.
|
||||
PROJECT (OCCT)
|
||||
endif()
|
||||
|
||||
set (CMAKE_MODULE_PATH "${OCCT_ROOT_DIR}/adm/cmake")
|
||||
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
|
||||
|
||||
set (CMAKE_SUPPRESS_REGENERATION TRUE)
|
||||
|
||||
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
|
||||
|
||||
# set using C++ standard
|
||||
set (BUILD_CPP_STANDARD "C++17" CACHE STRING "Select using c++ standard.")
|
||||
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++17" "C++20" "C++23 C++26")
|
||||
set (BUILD_CPP_STANDARD "C++11" CACHE STRING "Select using c++ standard.")
|
||||
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++11" "C++14" "C++17" "C++20" "C++23")
|
||||
|
||||
# Set desired C++ standard
|
||||
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
|
||||
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++11")
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++14")
|
||||
set (CMAKE_CXX_STANDARD 14)
|
||||
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
|
||||
set (CMAKE_CXX_STANDARD 17)
|
||||
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++20")
|
||||
set (CMAKE_CXX_STANDARD 20)
|
||||
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++23")
|
||||
set (CMAKE_CXX_STANDARD 23)
|
||||
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++26")
|
||||
set (CMAKE_CXX_STANDARD 26)
|
||||
else ()
|
||||
message (WARNING "C++ standard is not set or invalid. Set to C++17.")
|
||||
set (CMAKE_CXX_STANDARD 17)
|
||||
message (FATAL_ERROR, "misprint in c++ standard name")
|
||||
endif()
|
||||
|
||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# include cmake file
|
||||
# macro: include patched file if it exists
|
||||
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
|
||||
include (${OCCT_ROOT_DIR}/${BEING_INCLUDED_FILE}.cmake)
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
|
||||
include (${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake)
|
||||
else()
|
||||
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# set using memory manager option for TKernel
|
||||
@@ -116,17 +93,8 @@ if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
|
||||
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX "" CACHE STRING "${BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
message(AUTHOR_WARNING "OCCT is licensed under LGPL 2.1, which has limitations on"
|
||||
"static linking with proprietary software."
|
||||
"OCCT3D offers commercial licensing exceptions to LGPL 2.1."
|
||||
"Please use our contact form at https://occt3d.com/")
|
||||
unset (BUILD_SHARED_LIBS)
|
||||
unset (BUILD_SHARED_LIBRARY_NAME_POSTFIX)
|
||||
if (BUILD_OPT_PROFILE STREQUAL "Production")
|
||||
set (BUILD_OPT_PROFILE "Default" CACHE STRING "Select profile for compiler and linker." FORCE)
|
||||
message(WARNING "Static libraries are not optimized for production builds. "
|
||||
"Please use shared libraries for production builds.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
@@ -223,20 +191,6 @@ if (NOT DEFINED BUILD_INCLUDE_SYMLINK)
|
||||
set (BUILD_INCLUDE_SYMLINK OFF CACHE BOOL "${BUILD_INCLUDE_SYMLINK_DESCR}")
|
||||
endif()
|
||||
|
||||
# Overview
|
||||
if (NOT DEFINED BUILD_DOC_Overview)
|
||||
set (BUILD_DOC_Overview OFF CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
|
||||
endif()
|
||||
|
||||
# Reference Manual
|
||||
if (NOT DEFINED BUILD_DOC_RefMan)
|
||||
set (BUILD_DOC_RefMan OFF CACHE BOOL "${BUILD_DOC_RefMan_DESCR}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED INSTALL_DOC_RefMan)
|
||||
set (INSTALL_DOC_RefMan OFF CACHE BOOL "${INSTALL_DOC_RefMan_DESCR}")
|
||||
endif()
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "3.14")
|
||||
OCCT_CHECK_AND_UNSET (BUILD_INCLUDE_SYMLINK)
|
||||
endif()
|
||||
@@ -263,30 +217,7 @@ if (NOT INSTALL_DIR_LAYOUT)
|
||||
else()
|
||||
set (INSTALL_DIR_LAYOUT "Unix" CACHE STRING "${INSTALL_DIR_LAYOUT_DESCR}" FORCE)
|
||||
endif()
|
||||
SET_PROPERTY(CACHE INSTALL_DIR_LAYOUT PROPERTY STRINGS Windows Unix Vcpkg)
|
||||
endif()
|
||||
|
||||
# Define layout boolean variables for optimization
|
||||
set(LAYOUT_IS_WINDOWS FALSE)
|
||||
set(LAYOUT_IS_UNIX FALSE)
|
||||
set(LAYOUT_IS_VCPKG FALSE)
|
||||
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
|
||||
set(LAYOUT_IS_WINDOWS TRUE)
|
||||
elseif ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set(LAYOUT_IS_UNIX TRUE)
|
||||
elseif ("${INSTALL_DIR_LAYOUT}" STREQUAL "Vcpkg")
|
||||
set(LAYOUT_IS_VCPKG TRUE)
|
||||
endif()
|
||||
|
||||
# set project name for install directories (only used for vcpkg layout)
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
if (NOT DEFINED OCCT_PROJECT_NAME)
|
||||
set (OCCT_PROJECT_NAME "opencascade" CACHE STRING "${OCCT_PROJECT_NAME_DESCR}")
|
||||
endif()
|
||||
else()
|
||||
# unset the variable if it was previously set for vcpkg but layout changed
|
||||
OCCT_CHECK_AND_UNSET (OCCT_PROJECT_NAME)
|
||||
SET_PROPERTY(CACHE INSTALL_DIR_LAYOUT PROPERTY STRINGS Windows Unix)
|
||||
endif()
|
||||
|
||||
# check INSTALL_DIR_LAYOUT changes and update INSTALL_DIR_* paths if necessary
|
||||
@@ -297,16 +228,6 @@ elseif (NOT "${INSTALL_DIR_LAYOUT_PREV}" STREQUAL "${INSTALL_DIR_LAYOUT}")
|
||||
# The structure of install folder should be reset due to changed layout
|
||||
OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS ()
|
||||
|
||||
# Manage OCCT_PROJECT_NAME based on layout
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
if (NOT DEFINED OCCT_PROJECT_NAME)
|
||||
set (OCCT_PROJECT_NAME "opencascade" CACHE STRING "${OCCT_PROJECT_NAME_DESCR}")
|
||||
endif()
|
||||
else()
|
||||
# unset OCCT_PROJECT_NAME if layout changed from vcpkg to something else
|
||||
OCCT_CHECK_AND_UNSET (OCCT_PROJECT_NAME)
|
||||
endif()
|
||||
|
||||
# Unset INSTALL_DIR_WITH_VERSION on windows
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Windows")
|
||||
OCCT_CHECK_AND_UNSET (INSTALL_DIR_WITH_VERSION)
|
||||
@@ -342,7 +263,7 @@ elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}")
|
||||
set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
if (NOT DEFINED INSTALL_DIR_WITH_VERSION_PREV)
|
||||
set (INSTALL_DIR_WITH_VERSION_PREV "${INSTALL_DIR_WITH_VERSION}" CACHE INTERNAL "" FORCE)
|
||||
elseif (NOT "${INSTALL_DIR_WITH_VERSION_PREV}" STREQUAL "${INSTALL_DIR_WITH_VERSION}")
|
||||
@@ -357,13 +278,14 @@ endif()
|
||||
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
|
||||
|
||||
set (BIN_LETTER "")
|
||||
if (NOT LAYOUT_IS_VCPKG)
|
||||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
set (BIN_LETTER "d")
|
||||
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
set (BIN_LETTER "i")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# a directory recognized as a 'patch' for OCCT
|
||||
set (BUILD_PATCH "" CACHE PATH "${BUILD_PATCH_DESCR}")
|
||||
|
||||
# the list of being built toolkits
|
||||
set (BUILD_ADDITIONAL_TOOLKITS "" CACHE STRING "${BUILD_ADDITIONAL_TOOLKITS_DESCR}")
|
||||
@@ -374,6 +296,8 @@ if (MSVC)
|
||||
endif()
|
||||
set (BUILD_SAMPLES_QT OFF CACHE BOOL "${BUILD_SAMPLES_QT_DESCR}")
|
||||
|
||||
set (BUILD_Inspector OFF CACHE BOOL "${BUILD_Inspector_DESCR}")
|
||||
|
||||
# uwp sample
|
||||
if (MSVC)
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
|
||||
@@ -428,11 +352,10 @@ else()
|
||||
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
|
||||
endif()
|
||||
|
||||
# include original list of modules
|
||||
# include the patched or original list of modules
|
||||
# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
|
||||
# list <OCCT_MODULES> will contain all modules
|
||||
OCCT_INCLUDE_CMAKE_FILE ("src/MODULES")
|
||||
set (OCCT_MODULES ${OCCT_LIST_OF_MODULES})
|
||||
OCCT_MODULES_AND_TOOLKITS (MODULES "TOOLKITS" OCCT_MODULES)
|
||||
|
||||
foreach (OCCT_MODULE ${OCCT_MODULES})
|
||||
BUILD_MODULE (${OCCT_MODULE})
|
||||
@@ -452,7 +375,7 @@ list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
|
||||
|
||||
foreach (OCCT_MODULE ${OCCT_MODULES})
|
||||
if (BUILD_MODULE_${OCCT_MODULE})
|
||||
list (APPEND BUILD_TOOLKITS ${OCCT_${OCCT_MODULE}_LIST_OF_TOOLKITS})
|
||||
list (APPEND BUILD_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -487,10 +410,6 @@ else()
|
||||
OCCT_CHECK_AND_UNSET (USE_VTK)
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED BUILD_GTEST)
|
||||
set (BUILD_GTEST OFF CACHE BOOL "${BUILD_GTEST_DESCR}")
|
||||
endif()
|
||||
|
||||
# Rebuild *.yacc and *.lex files that are contained by TKMath toolkit
|
||||
list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH)
|
||||
list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
|
||||
@@ -501,34 +420,13 @@ else()
|
||||
OCCT_CHECK_AND_UNSET (BUILD_YACCLEX)
|
||||
endif()
|
||||
|
||||
# Set 3RDPARTY_DIR based on layout
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
if (NOT DEFINED 3RDPARTY_DIR)
|
||||
# For vcpkg layout, set 3RDPARTY_DIR to vcpkg installed directory for path replacement
|
||||
if (BUILD_USE_VCPKG AND VCPKG_INSTALLED_DIR AND VCPKG_TARGET_TRIPLET)
|
||||
set (3RDPARTY_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH ${3RDPARTY_DIR_DESCR})
|
||||
else()
|
||||
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
|
||||
endif()
|
||||
else()
|
||||
file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
|
||||
set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
# For non-vcpkg layouts, 3RDPARTY_DIR should be user-defined or empty
|
||||
if (NOT DEFINED 3RDPARTY_DIR)
|
||||
set (3RDPARTY_DIR "" CACHE PATH ${3RDPARTY_DIR_DESCR})
|
||||
# If using vcpkg with Windows layout, set to vcpkg installed directory for proper path replacement
|
||||
if (BUILD_USE_VCPKG AND VCPKG_INSTALLED_DIR AND VCPKG_TARGET_TRIPLET)
|
||||
set (3RDPARTY_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH ${3RDPARTY_DIR_DESCR} FORCE)
|
||||
else()
|
||||
get_filename_component (3RDPARTY_DIR "${3RDPARTY_DIR}" ABSOLUTE)
|
||||
endif()
|
||||
else()
|
||||
file (TO_CMAKE_PATH "${3RDPARTY_DIR}" 3RDPARTY_DIR)
|
||||
set (3RDPARTY_DIR "${3RDPARTY_DIR}" CACHE PATH "${3RDPARTY_DIR_DESCR}" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# search for CSF variable in EXTERNLIB of each being used toolkit
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
|
||||
@@ -543,18 +441,10 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
|
||||
|
||||
set (OCCT_3RDPARTY_CMAKE_LIST)
|
||||
|
||||
# define CSF variable
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
|
||||
|
||||
# Tcl (mandatory for Draw Harness)
|
||||
if (USE_TCL)
|
||||
message (STATUS "Info: TCL is used by OCCT")
|
||||
if (CAN_USE_TK AND USE_TK)
|
||||
OCCT_ADD_VCPKG_FEATURE ("tcltk")
|
||||
else()
|
||||
OCCT_ADD_VCPKG_FEATURE ("tcl")
|
||||
OCCT_UNSET_VCPKG_FEATURE ("tcltk")
|
||||
endif()
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/tcl")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
|
||||
@@ -565,6 +455,7 @@ endif()
|
||||
# Tk (optional for Draw Harness)
|
||||
if (CAN_USE_TK AND USE_TK)
|
||||
message (STATUS "Info: TK is used by OCCT")
|
||||
OCCT_ADD_VCPKG_FEATURE ("tk")
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/tk")
|
||||
else()
|
||||
if (NOT CAN_USE_TK)
|
||||
@@ -572,6 +463,7 @@ else()
|
||||
endif()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
|
||||
OCCT_UNSET_VCPKG_FEATURE ("tk")
|
||||
endif()
|
||||
|
||||
# Xlib
|
||||
@@ -686,10 +578,8 @@ if (CAN_USE_GLES2 AND USE_GLES2)
|
||||
if (NOT IOS)
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/egl")
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/gles2")
|
||||
if (NOT EMSCRIPTEN)
|
||||
OCCT_ADD_VCPKG_FEATURE ("angle")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
if (NOT CAN_USE_GLES2)
|
||||
OCCT_CHECK_AND_UNSET ("USE_GLES2")
|
||||
@@ -742,12 +632,7 @@ if (CAN_USE_RAPIDJSON AND USE_RAPIDJSON)
|
||||
elseif (NOT CAN_USE_RAPIDJSON)
|
||||
OCCT_CHECK_AND_UNSET ("USE_RAPIDJSON")
|
||||
OCCT_UNSET_VCPKG_FEATURE ("rapidjson")
|
||||
else()
|
||||
list (REMOVE_ITEM BUILD_TOOLKITS TKDEGLTF)
|
||||
list (REMOVE_ITEM BUILD_TOOLKITS TKXSDRAWGLTF)
|
||||
message(STATUS "Info: TKDEGLTF and TKXSDRAWGLTF toolkits excluded due to RapidJSON usage is disabled")
|
||||
endif()
|
||||
|
||||
if (NOT CAN_USE_RAPIDJSON OR BUILD_USE_VCPKG)
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_RAPIDJSON")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
|
||||
@@ -786,7 +671,7 @@ else()
|
||||
endif()
|
||||
|
||||
# Doxygen
|
||||
if (BUILD_DOC_Overview OR BUILD_DOC_RefMan)
|
||||
if (BUILD_DOC_Overview)
|
||||
if (NOT DEFINED INSTALL_DOC_Overview)
|
||||
set (INSTALL_DOC_Overview OFF CACHE BOOL "${INSTALL_DOC_Overview_DESCR}")
|
||||
endif()
|
||||
@@ -794,7 +679,7 @@ if (BUILD_DOC_Overview OR BUILD_DOC_RefMan)
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/doxygen")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_DOC_Overview")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_DOC_RefMan")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOXYGEN_EXECUTABLE")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
|
||||
endif()
|
||||
@@ -823,19 +708,8 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC")
|
||||
endif()
|
||||
|
||||
# GTest
|
||||
if (BUILD_GTEST)
|
||||
OCCT_ADD_VCPKG_FEATURE ("gtest")
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/gtest")
|
||||
else()
|
||||
OCCT_UNSET_VCPKG_FEATURE ("gtest")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GTEST")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("GTest")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_GTEST")
|
||||
endif()
|
||||
|
||||
# qt for samples
|
||||
if (BUILD_SAMPLES_QT)
|
||||
# qt for inspector and samples
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
# check qt 3rdparty path
|
||||
add_definitions (-DHAVE_QT)
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/qt")
|
||||
@@ -846,26 +720,23 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_QT")
|
||||
endif()
|
||||
|
||||
# VCPKG require delayed processing of 3rdparty.
|
||||
# That is why we delay the creating project and setting up
|
||||
# the platform specific variables.
|
||||
if (BUILD_USE_VCPKG)
|
||||
# the name of the project
|
||||
project (OCCT)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
# set Apple specific variables
|
||||
occt_set_apple_csf_vars()
|
||||
endif()
|
||||
# copying clang-format file to the root of the project
|
||||
file(COPY ${CMAKE_SOURCE_DIR}/.clang-format DESTINATION ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# Get all used variables: OS_WITH_BIT, COMPILER
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
# define CSF variable
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
|
||||
|
||||
# do not define INSTALL_DIR_BIN for win.
|
||||
# Leave library structure for win: <prefix>/win64/vc10/bin(d)
|
||||
if (NOT DEFINED INSTALL_DIR_BIN)
|
||||
if (LAYOUT_IS_UNIX OR LAYOUT_IS_VCPKG)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_BIN "bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "${INSTALL_DIR_BIN_DESCR}")
|
||||
@@ -874,11 +745,8 @@ endif()
|
||||
|
||||
# define folder containing all shell/batch scripts
|
||||
if (NOT DEFINED INSTALL_DIR_SCRIPT)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
# For vcpkg, scripts should follow same debug/release pattern as binaries
|
||||
set (INSTALL_DIR_SCRIPT "$<IF:$<CONFIG:Debug>,debug/bin,bin>" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_SCRIPT "." CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
|
||||
endif()
|
||||
@@ -886,7 +754,7 @@ endif()
|
||||
|
||||
# place the libraries to <prefix>/lib folder for unix and leave old structure for windows
|
||||
if (NOT DEFINED INSTALL_DIR_LIB)
|
||||
if (LAYOUT_IS_UNIX OR LAYOUT_IS_VCPKG)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_LIB "lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "${INSTALL_DIR_LIB_DESCR}")
|
||||
@@ -896,13 +764,11 @@ endif()
|
||||
# OCCT headers: <prefix>/inc for windows,
|
||||
# <prefix>/include/opencascade-7.0.0 for unix
|
||||
if (NOT DEFINED INSTALL_DIR_INCLUDE)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_INCLUDE "include/opencascade" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_INCLUDE "include/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}" FORCE)
|
||||
endif()
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
set (INSTALL_DIR_INCLUDE "include" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "${INSTALL_DIR_INCLUDE_DESCR}")
|
||||
endif()
|
||||
@@ -911,13 +777,11 @@ endif()
|
||||
# OCCT resources: <prefix>/src for windows,
|
||||
# <prefix>/share/opencascade-7.0.0/resources for unix
|
||||
if (NOT DEFINED INSTALL_DIR_RESOURCE)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_RESOURCE "share/opencascade/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_RESOURCE "share/opencascade-${OCC_VERSION_STRING_EXT}/resources" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}" FORCE)
|
||||
endif()
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
set (INSTALL_DIR_RESOURCE "share/${OCCT_PROJECT_NAME}" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_RESOURCE "src" CACHE PATH "${INSTALL_DIR_RESOURCE_DESCR}")
|
||||
endif()
|
||||
@@ -925,13 +789,11 @@ endif()
|
||||
|
||||
# OCCT data
|
||||
if (NOT DEFINED INSTALL_DIR_DATA)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_DATA "share/opencascade/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_DATA "share/opencascade-${OCC_VERSION_STRING_EXT}/data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}" FORCE)
|
||||
endif()
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
set (INSTALL_DIR_DATA "share/${OCCT_PROJECT_NAME}" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_DATA "data" CACHE PATH "${INSTALL_DIR_DATA_DESCR}")
|
||||
endif()
|
||||
@@ -939,13 +801,11 @@ endif()
|
||||
|
||||
# OCCT samples
|
||||
if (NOT DEFINED INSTALL_DIR_SAMPLES)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_SAMPLES "share/opencascade/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_SAMPLES "share/opencascade-${OCC_VERSION_STRING_EXT}/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}" FORCE)
|
||||
endif()
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
set (INSTALL_DIR_SAMPLES "share/${OCCT_PROJECT_NAME}/samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_SAMPLES "samples" CACHE PATH "${INSTALL_DIR_SAMPLES_DESCR}")
|
||||
endif()
|
||||
@@ -953,13 +813,11 @@ endif()
|
||||
|
||||
# OCCT tests
|
||||
if (NOT DEFINED INSTALL_DIR_TESTS)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_TESTS "share/opencascade/tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_TESTS "share/opencascade-${OCC_VERSION_STRING_EXT}/tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}" FORCE)
|
||||
endif()
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
set (INSTALL_DIR_TESTS "share/${OCCT_PROJECT_NAME}/tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_TESTS "tests" CACHE PATH "${INSTALL_DIR_TESTS_DESCR}")
|
||||
endif()
|
||||
@@ -967,13 +825,11 @@ endif()
|
||||
|
||||
# OCCT doc
|
||||
if (NOT DEFINED INSTALL_DIR_DOC)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
set (INSTALL_DIR_DOC "share/doc/opencascade" CACHE PATH "${INSTALL_DIR_DOC_DESCR}")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_DOC "share/doc/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_DOC_DESCR}" FORCE)
|
||||
endif()
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
set (INSTALL_DIR_DOC "share/${OCCT_PROJECT_NAME}/doc" CACHE PATH "${INSTALL_DIR_DOC_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_DOC "doc" CACHE PATH "${INSTALL_DIR_DOC_DESCR}")
|
||||
endif()
|
||||
@@ -981,14 +837,12 @@ endif()
|
||||
|
||||
# define folder containing CMake configuration files
|
||||
if (NOT DEFINED INSTALL_DIR_CMAKE)
|
||||
if (LAYOUT_IS_UNIX)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
if (INSTALL_DIR_WITH_VERSION)
|
||||
set (INSTALL_DIR_CMAKE "lib/cmake/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_CMAKE "lib/cmake/opencascade" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
|
||||
endif()
|
||||
elseif (LAYOUT_IS_VCPKG)
|
||||
set (INSTALL_DIR_CMAKE "share/${OCCT_PROJECT_NAME}" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
|
||||
else()
|
||||
set (INSTALL_DIR_CMAKE "cmake" CACHE PATH "${INSTALL_DIR_CMAKE_DESCR}")
|
||||
endif()
|
||||
@@ -998,7 +852,7 @@ endif()
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_resources")
|
||||
|
||||
# install LICENSE_LGPL_21.txt and OCCT_LGPL_EXCEPTION.txt files
|
||||
if (LAYOUT_IS_UNIX OR LAYOUT_IS_VCPKG)
|
||||
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR_DOC}")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("OCCT_LGPL_EXCEPTION.txt" "${INSTALL_DIR_DOC}")
|
||||
else()
|
||||
@@ -1010,7 +864,20 @@ if(APPLE)
|
||||
set (INSTALL_NAME_DIR "" CACHE STRING "install_name library suffix on OS X (e.g. @executable_path/../Frameworks)")
|
||||
endif()
|
||||
|
||||
# include original list of definitions and flags
|
||||
# Overview
|
||||
if (NOT DEFINED BUILD_DOC_Overview)
|
||||
set (DO_ONLY_CHECK_FOR_DOXYGEN ON)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen")
|
||||
set (DO_ONLY_CHECK_FOR_DOXYGEN OFF)
|
||||
|
||||
if (CAN_DOXYGEN_BE_USED)
|
||||
message (STATUS "Info. Overview building is turned on")
|
||||
endif()
|
||||
|
||||
set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
|
||||
endif()
|
||||
|
||||
# include the patched or original list of definitions and flags
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
|
||||
|
||||
foreach (OCCT_3RDPARTY_LIST ${OCCT_3RDPARTY_CMAKE_LIST})
|
||||
@@ -1076,14 +943,6 @@ endif()
|
||||
|
||||
# build directories
|
||||
if (SINGLE_GENERATOR)
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||
if (WIN32)
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||
endif()
|
||||
else()
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}")
|
||||
@@ -1091,27 +950,7 @@ if (SINGLE_GENERATOR)
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/lib")
|
||||
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/lib")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/lib")
|
||||
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib")
|
||||
|
||||
if (WIN32)
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/bin")
|
||||
endif()
|
||||
else()
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
@@ -1129,17 +968,13 @@ else()
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE} ...")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
|
||||
|
||||
# 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")
|
||||
|
||||
@@ -1155,6 +990,28 @@ else()
|
||||
set (SCRIPT_EXT sh)
|
||||
endif()
|
||||
|
||||
# OCCT tools
|
||||
# include the patched or original list of tools
|
||||
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
|
||||
# list <OCCT_TOOLS> will contain all tools
|
||||
if (BUILD_Inspector)
|
||||
add_definitions (-DHAVE_Inspector)
|
||||
|
||||
OCCT_MODULES_AND_TOOLKITS (TOOLS "TOOL_TOOLKITS" OCCT_TOOLS)
|
||||
foreach (OCCT_TOOL ${OCCT_TOOLS})
|
||||
list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
|
||||
endforeach()
|
||||
|
||||
# collect all the headers to <binary dir>/inc/inspector folder
|
||||
|
||||
# Ensure the include directory exists
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/inspector")
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...")
|
||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "tools" "${INSTALL_DIR_INCLUDE}/inspector")
|
||||
endif()
|
||||
|
||||
# OCCT samples
|
||||
# get absolute path from INSTALL_DIR
|
||||
set (INSTALL_DIR_ABSOLUTE "${INSTALL_DIR}")
|
||||
@@ -1179,6 +1036,7 @@ if (INSTALL_SAMPLES)
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR_SAMPLES}")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR_SAMPLES}")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR_SAMPLES}")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code" "${INSTALL_DIR_SAMPLES}/OCCTOverview")
|
||||
|
||||
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}")
|
||||
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}")
|
||||
@@ -1196,14 +1054,19 @@ if (${DRAWEXE_INDEX} GREATER -1)
|
||||
OCCT_INSTALL_FILE_OR_DIR ("data/" "${INSTALL_DIR_DATA}")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR_SAMPLES}")
|
||||
|
||||
install (FILES "${OCCT_ROOT_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
# copy draw script to install script folder
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}")
|
||||
install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
else()
|
||||
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif()
|
||||
|
||||
# copy draw script to CMake binary folder
|
||||
OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}")
|
||||
endif()
|
||||
|
||||
OCCT_MAKE_COMPILER_BITNESS()
|
||||
set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}")
|
||||
|
||||
if (WIN32)
|
||||
@@ -1242,103 +1105,8 @@ endforeach()
|
||||
|
||||
# write current custom.bat/sh (for install directory)
|
||||
set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}")
|
||||
|
||||
# Set custom bin/lib paths variable for template
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
# For vcpkg layout, paths need to handle debug/release structure
|
||||
# Debug builds: scripts in debug/bin, need to go ../../ to reach root
|
||||
# Release builds: scripts in bin, need to go ../ to reach root
|
||||
if (WIN32)
|
||||
set (OCCT_CUSTOM_BIN_LIB_PATHS "set \"CSF_OCCTBinPath=%CASROOT%\\bin\"
|
||||
set \"CSF_OCCTLibPath=%CASROOT%\\lib\"
|
||||
if exist \"%SCRIPTROOT%\\..\\..\\include\" (
|
||||
set \"CASCONTENTROOT=%SCRIPTROOT%\\..\\..\"
|
||||
) else (
|
||||
set \"CASCONTENTROOT=%SCRIPTROOT%\\..\"
|
||||
)
|
||||
set \"CSF_OCCTIncludePath=%CASCONTENTROOT%\\include\"
|
||||
set \"CSF_OCCTResourcePath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\"
|
||||
set \"CSF_OCCTDataPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\"
|
||||
set \"CSF_OCCTSamplesPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\\samples\"
|
||||
set \"CSF_OCCTTestsPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\\tests\"
|
||||
set \"CSF_OCCTDocPath=%CASCONTENTROOT%\\share\\${OCCT_PROJECT_NAME}\\doc\"")
|
||||
else()
|
||||
set (OCCT_CUSTOM_BIN_LIB_PATHS "export CSF_OCCTBinPath=\"\${CASROOT}/bin\"
|
||||
export CSF_OCCTLibPath=\"\${CASROOT}/lib\"
|
||||
if [ -d \"\${aScriptPath}/../../include\" ]; then
|
||||
export CASCONTENTROOT=\$(cd \"\${aScriptPath}/../..\" && pwd)
|
||||
else
|
||||
export CASCONTENTROOT=\$(cd \"\${aScriptPath}/..\" && pwd)
|
||||
fi
|
||||
export CSF_OCCTIncludePath=\"\${CASCONTENTROOT}/include\"
|
||||
export CSF_OCCTResourcePath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}\"
|
||||
export CSF_OCCTDataPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}\"
|
||||
export CSF_OCCTSamplesPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}/samples\"
|
||||
export CSF_OCCTTestsPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}/tests\"
|
||||
export CSF_OCCTDocPath=\"\${CASCONTENTROOT}/share/${OCCT_PROJECT_NAME}/doc\"")
|
||||
endif()
|
||||
|
||||
# For vcpkg, we handle all paths in the bin/lib paths logic above
|
||||
set (OCCT_CUSTOM_ADDITIONAL_PATHS "")
|
||||
else()
|
||||
# For other layouts, use CASROOT with full paths including build-specific suffixes
|
||||
if (WIN32)
|
||||
set (OCCT_CUSTOM_BIN_LIB_PATHS "set \"CSF_OCCTBinPath=%CASROOT%/${INSTALL_DIR_BIN}%3\"
|
||||
set \"CSF_OCCTLibPath=%CASROOT%/${INSTALL_DIR_LIB}%3\"")
|
||||
set (OCCT_CUSTOM_ADDITIONAL_PATHS "set \"CSF_OCCTIncludePath=%CASROOT%/${INSTALL_DIR_INCLUDE}\"
|
||||
set \"CSF_OCCTResourcePath=%CASROOT%/${INSTALL_DIR_RESOURCE}\"
|
||||
set \"CSF_OCCTDataPath=%CASROOT%/${INSTALL_DIR_DATA}\"
|
||||
set \"CSF_OCCTSamplesPath=%CASROOT%/${INSTALL_DIR_SAMPLES}\"
|
||||
set \"CSF_OCCTTestsPath=%CASROOT%/${INSTALL_DIR_TESTS}\"
|
||||
set \"CSF_OCCTDocPath=%CASROOT%/${INSTALL_DIR_DOC}\"")
|
||||
else()
|
||||
set (OCCT_CUSTOM_BIN_LIB_PATHS "export CSF_OCCTBinPath=\"\${CASROOT}/${INSTALL_DIR_BIN}\"
|
||||
export CSF_OCCTLibPath=\"\${CASROOT}/${INSTALL_DIR_LIB}\"")
|
||||
set (OCCT_CUSTOM_ADDITIONAL_PATHS "export CSF_OCCTIncludePath=\"\${CASROOT}/${INSTALL_DIR_INCLUDE}\"
|
||||
export CSF_OCCTResourcePath=\"\${CASROOT}/${INSTALL_DIR_RESOURCE}\"
|
||||
export CSF_OCCTDataPath=\"\${CASROOT}/${INSTALL_DIR_DATA}\"
|
||||
export CSF_OCCTSamplesPath=\"\${CASROOT}/${INSTALL_DIR_SAMPLES}\"
|
||||
export CSF_OCCTTestsPath=\"\${CASROOT}/${INSTALL_DIR_TESTS}\"
|
||||
export CSF_OCCTDocPath=\"\${CASROOT}/${INSTALL_DIR_DOC}\"")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR_SCRIPT}")
|
||||
|
||||
# Set build directory paths for custom.build script
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
# For vcpkg, use simple bin/lib paths
|
||||
if (WIN32)
|
||||
set (OCCT_CUSTOM_BUILD_BIN_LIB_PATHS "set \"CSF_OCCTBinPath=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@\"
|
||||
set \"CSF_OCCTLibPath=@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@\"
|
||||
if [\"@CMAKE_RUNTIME_OUTPUT_DIRECTORY@\"] == [\"\"] (
|
||||
set \"CSF_OCCTBinPath=@CMAKE_BINARY_DIR@/bin\"
|
||||
set \"CSF_OCCTLibPath=@CMAKE_BINARY_DIR@/lib\"
|
||||
)")
|
||||
else()
|
||||
set (OCCT_CUSTOM_BUILD_BIN_LIB_PATHS "export CSF_OCCTBinPath=\"@CMAKE_RUNTIME_OUTPUT_DIRECTORY@\"
|
||||
export CSF_OCCTLibPath=\"@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@\"")
|
||||
endif()
|
||||
else()
|
||||
# For other layouts, use traditional paths with suffixes
|
||||
if (WIN32)
|
||||
set (OCCT_CUSTOM_BUILD_BIN_LIB_PATHS "set \"CSF_OCCTBinPath=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@\"
|
||||
set \"CSF_OCCTLibPath=@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@\"
|
||||
if [\"@CMAKE_RUNTIME_OUTPUT_DIRECTORY@\"] == [\"\"] (
|
||||
set \"CSF_OCCTBinPath=@CMAKE_BINARY_DIR@/win%ARCH%/%VCVER%/bin%3\"
|
||||
set \"CSF_OCCTLibPath=@CMAKE_BINARY_DIR@/win%ARCH%/%VCVER%/lib%3\"
|
||||
)")
|
||||
else()
|
||||
set (OCCT_CUSTOM_BUILD_BIN_LIB_PATHS "export CSF_OCCTBinPath=\"@CMAKE_RUNTIME_OUTPUT_DIRECTORY@\"
|
||||
export CSF_OCCTLibPath=\"@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@\"")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Expand OCCT_CUSTOM_BUILD_BIN_LIB_PATHS variable to resolve nested @...@ variables
|
||||
if (OCCT_CUSTOM_BUILD_BIN_LIB_PATHS)
|
||||
string(CONFIGURE "${OCCT_CUSTOM_BUILD_BIN_LIB_PATHS}" OCCT_CUSTOM_BUILD_BIN_LIB_PATHS @ONLY)
|
||||
endif()
|
||||
|
||||
# write current custom.bat/sh (for build directory)
|
||||
OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}")
|
||||
|
||||
@@ -1348,16 +1116,6 @@ if (BUILD_SAMPLES_MFC OR BUILD_SAMPLES_QT)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
# Set custom script path variable for Windows template
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
# For vcpkg, scripts are in same directory - use existing SCRIPTROOT variable
|
||||
set (OCCT_CUSTOM_SCRIPT_PATH "custom.${SCRIPT_EXT}")
|
||||
set (OCCT_CUSTOM_SCRIPT_PREFIX "%SCRIPTROOT%/")
|
||||
else()
|
||||
# For other layouts, use CASROOT with full path
|
||||
set (OCCT_CUSTOM_SCRIPT_PATH "custom.${SCRIPT_EXT}")
|
||||
set (OCCT_CUSTOM_SCRIPT_PREFIX "%CASROOT%/")
|
||||
endif()
|
||||
# env script for draw in building environment
|
||||
OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
|
||||
# install env script
|
||||
@@ -1368,20 +1126,6 @@ if (WIN32)
|
||||
else()
|
||||
set (SUB_ENV_NAME "env.${SCRIPT_EXT}")
|
||||
set (SUB_ENV_BUILD_NAME "env.install.${SCRIPT_EXT}")
|
||||
# Set custom script path variable for template
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
# For vcpkg, scripts are in same directory - use existing path variables
|
||||
set (OCCT_CUSTOM_SCRIPT_PATH "custom.${SCRIPT_EXT}")
|
||||
if (WIN32)
|
||||
set (OCCT_CUSTOM_SCRIPT_PREFIX "%SCRIPTROOT%/")
|
||||
else()
|
||||
set (OCCT_CUSTOM_SCRIPT_PREFIX "\${aScriptPath}/")
|
||||
endif()
|
||||
else()
|
||||
# For other layouts, use CASROOT with full path
|
||||
set (OCCT_CUSTOM_SCRIPT_PATH "${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}")
|
||||
set (OCCT_CUSTOM_SCRIPT_PREFIX "\${CASROOT}/")
|
||||
endif()
|
||||
# install env script
|
||||
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/env.install.${SCRIPT_EXT}.in" "${SUB_ENV_BUILD_NAME}" "${SUB_ENV_NAME}" "${INSTALL_DIR_SCRIPT}")
|
||||
# env script for draw in building environment
|
||||
@@ -1399,9 +1143,9 @@ foreach(RESOURCE ${RESOURCES})
|
||||
get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY)
|
||||
if(NOT "${RESOURCE_FOLDER}" STREQUAL "")
|
||||
get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME)
|
||||
OCCT_INSTALL_FILE_OR_DIR ("resources/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
|
||||
else()
|
||||
OCCT_INSTALL_FILE_OR_DIR ("resources/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -1413,13 +1157,13 @@ if (BUILD_SAMPLES_QT)
|
||||
endforeach()
|
||||
|
||||
## Copy sources of OCCTOverview for using in the sample
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/DataExchangeSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/OcafSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/GeometrySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/TopologySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/TriangulationSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/Viewer2dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/qt/OCCTOverview/code/Viewer3dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/DataExchangeSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/OcafSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/GeometrySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/TopologySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/TriangulationSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/Viewer2dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/Viewer3dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1430,30 +1174,11 @@ endif()
|
||||
|
||||
# include patched toolkit projects or original ones
|
||||
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
|
||||
add_subdirectory ("${OCCT_${BUILD_TOOLKIT}_FILES_LOCATION}")
|
||||
OCCT_ADD_SUBDIRECTORY ("src/${BUILD_TOOLKIT}")
|
||||
endforeach()
|
||||
|
||||
# Setup Google Test integration if enabled
|
||||
if (BUILD_GTEST)
|
||||
enable_testing()
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_gtest")
|
||||
# Initialize GTest environment and create the target first
|
||||
OCCT_INIT_GTEST()
|
||||
|
||||
# Collect test files from all active toolkits and add them to the target
|
||||
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
|
||||
OCCT_COLLECT_TOOLKIT_TESTS(${BUILD_TOOLKIT})
|
||||
endforeach()
|
||||
|
||||
# Set environment variables for all tests
|
||||
OCCT_SET_GTEST_ENVIRONMENT()
|
||||
endif()
|
||||
|
||||
if (BUILD_DOC_Overview OR BUILD_DOC_RefMan)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_doc")
|
||||
# Setup documentation targets
|
||||
OCCT_SETUP_DOC_TARGETS()
|
||||
if (BUILD_DOC_Overview)
|
||||
OCCT_ADD_SUBDIRECTORY (dox)
|
||||
endif()
|
||||
|
||||
# patch DRAWEXE
|
||||
@@ -1473,14 +1198,21 @@ if (MSVC AND 3RDPARTY_DLL_DIRS)
|
||||
set (X_COMPILER_BITNESS "Win32")
|
||||
endif()
|
||||
|
||||
OCCT_CONFIGURE ("adm/templates/DRAWEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/src/Draw/DRAWEXE/DRAWEXE.vcxproj.user")
|
||||
OCCT_CONFIGURE ("adm/templates/DRAWEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/src/DRAWEXE/DRAWEXE.vcxproj.user")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include patched toolkit projects or original ones
|
||||
if (BUILD_TOOL_TOOLKITS)
|
||||
foreach (BUILD_TOOL_TOOLKIT ${BUILD_TOOL_TOOLKITS})
|
||||
OCCT_ADD_SUBDIRECTORY ("tools/${BUILD_TOOL_TOOLKIT}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed")
|
||||
# samples do not support patch usage
|
||||
if (BUILD_SAMPLES_MFC OR BUILD_SAMPLES_QT)
|
||||
set (OCCT_ROOT ${OCCT_ROOT_DIR})
|
||||
set (OCCT_ROOT ${CMAKE_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
if (BUILD_SAMPLES_MFC)
|
||||
@@ -1498,19 +1230,7 @@ endif()
|
||||
|
||||
OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES)
|
||||
|
||||
# Load sample configuration files
|
||||
foreach (OCCT_SAMPLE ${OCCT_SAMPLES})
|
||||
foreach (BUILD_SAMPLE_TOOLKIT ${${OCCT_SAMPLE}_SAMPLES_TOOLKITS})
|
||||
OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}/PACKAGES)
|
||||
OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}/EXTERNLIB)
|
||||
OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${BUILD_SAMPLE_TOOLKIT}/FILES)
|
||||
foreach (PACKAGE ${OCCT_${BUILD_SAMPLE_TOOLKIT}_LIST_OF_PACKAGES})
|
||||
OCCT_INCLUDE_CMAKE_FILE (samples/${OCCT_SAMPLE}/${PACKAGE}/FILES)
|
||||
endforeach()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
if (BUILD_SAMPLES_QT)
|
||||
if (BUILD_Inspector OR BUILD_SAMPLES_QT)
|
||||
if (BUILD_SAMPLES_QT)
|
||||
if (NOT Qt5_FOUND OR "${Qt5Gui_EGL_INCLUDE_DIRS}" STREQUAL "" OR NOT WIN32)
|
||||
list (REMOVE_ITEM qt_SAMPLES_TOOLKITS AndroidQt)
|
||||
@@ -1539,6 +1259,21 @@ if (BUILD_MODULE_UwpSample)
|
||||
add_subdirectory(samples/xaml)
|
||||
endif()
|
||||
|
||||
if (BUILD_TOOL_TOOLKITS)
|
||||
# copy tinspector script to install script folder
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}")
|
||||
install (FILES "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
else()
|
||||
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif()
|
||||
|
||||
set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
|
||||
# patch TInspectorEXE
|
||||
OCCT_CONFIGURE ("adm/templates/TInspectorEXE.vcxproj.user.in" "${CMAKE_BINARY_DIR}/tools/TInspectorEXE/TInspectorEXE.vcxproj.user")
|
||||
endif()
|
||||
|
||||
# Prepare variables for configuration of OpenCASCADE cmake config file
|
||||
set (OCCT_MODULES_ENABLED)
|
||||
set (OCCT_LIBRARIES)
|
||||
@@ -1582,7 +1317,7 @@ foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
|
||||
endforeach()
|
||||
set (SET_OpenCASCADE_CMAKE_C_FLAGS "${CMAKE_C_FLAGS_${OCCT_CONFIGURATION_UPPER}}")
|
||||
set (SET_OpenCASCADE_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_${OCCT_CONFIGURATION_UPPER}}")
|
||||
configure_file("${OCCT_ROOT_DIR}/adm/templates/OpenCASCADECompileDefinitionsAndFlags.cmake.in" "OpenCASCADECompileDefinitionsAndFlags-${OCCT_CONFIGURATION_LOWER}.cmake" @ONLY)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADECompileDefinitionsAndFlags.cmake.in" "OpenCASCADECompileDefinitionsAndFlags-${OCCT_CONFIGURATION_LOWER}.cmake" @ONLY)
|
||||
endforeach()
|
||||
# install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
|
||||
install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
|
||||
@@ -1626,7 +1361,7 @@ if (APPLE)
|
||||
endif()
|
||||
|
||||
# Configure and install cmake config file
|
||||
configure_file("${OCCT_ROOT_DIR}/adm/templates/OpenCASCADEConfig.cmake.in" "OpenCASCADEConfig.cmake" @ONLY)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/OpenCASCADEConfig.cmake.in" "OpenCASCADEConfig.cmake" @ONLY)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/OpenCASCADEConfig.cmake" DESTINATION "${INSTALL_DIR_CMAKE}")
|
||||
|
||||
# Configure cmake version file
|
||||
|
@@ -38,17 +38,17 @@ If HTML documentation is not available in your package, you can:
|
||||
- **Generate together with sources:** You need to have CMake and 1.8.4 (or above) installed on your system. Enable `BUILD_DOC_Overview` CMake parameter and set the path to Doxygen `3RDPARTY_DOXYGEN_EXECUTABLE`. Then build ALL or only `Overview`.
|
||||
- **Read documentation in source plain text (Markdown) format** found in the subfolder `dox` or [GitHub Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki).
|
||||
|
||||
See [dox/build/build_documentation/building_documentation.md](dox/build/build_documentation/building_documentation.md) or [Building Documentation](https://dev.opencascade.org/doc/occt-7.8.0/overview/html/build_upgrade__building_documentation.html) for details.
|
||||
See `dox/dev_guides/documentation/documentation.md` or [Building Documentation](https://dev.opencascade.org/doc/occt-7.8.0/overview/html/build_upgrade__building_documentation.html) for details.
|
||||
|
||||
## Building
|
||||
|
||||
In most cases, you need to rebuild OCCT on your platform (OS, compiler) before using it in your project to ensure binary compatibility.
|
||||
|
||||
Consult the file [dox/build/build_occt/building_occt.md](dox/build/build_occt/building_occt.md) or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) or [Building OCCT Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki/build_upgrade) for instructions on building OCCT from sources on supported platforms.
|
||||
Consult the file `dox/dev_guides/building/building.md` or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) or [Building OCCT Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki/build_upgrade) for instructions on building OCCT from sources on supported platforms.
|
||||
|
||||
## Version
|
||||
|
||||
The current version of OCCT can be found in the file [`adm/cmake/version.cmake`](adm/cmake/version.cmake).
|
||||
The current version of OCCT can be found in the file `src/Standard/Standard_Version.hxx`.
|
||||
|
||||
## Development
|
||||
|
||||
|
@@ -1,7 +1,8 @@
|
||||
FoundationClasses TKernel TKMath
|
||||
ModelingData TKG2d TKG3d TKGeomBase TKBRep
|
||||
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing TKExpress
|
||||
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
|
||||
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
|
||||
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
|
||||
DataExchange TKDE TKXSBase TKDESTEP TKDEIGES TKDESTL TKDEVRML TKDECascade TKDEOBJ TKDEGLTF TKDEPLY TKXCAF TKXmlXCAF TKBinXCAF TKRWMesh
|
||||
DETools TKExpress ExpToCasExe
|
||||
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE TKXSDRAWDE TKXSDRAWGLTF TKXSDRAWIGES TKXSDRAWOBJ TKXSDRAWPLY TKXSDRAWSTEP TKXSDRAWSTL TKXSDRAWVRML
|
||||
|
4
adm/TOOLS
Normal file
4
adm/TOOLS
Normal file
@@ -0,0 +1,4 @@
|
||||
TModelingData TKShapeView TKMessageModel TKMessageView
|
||||
TVisualization TKView TKVInspector
|
||||
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
|
||||
TTool TKTInspector TKToolsDraw TInspectorEXE
|
497
adm/UDLIST
Normal file
497
adm/UDLIST
Normal file
@@ -0,0 +1,497 @@
|
||||
n NCollection
|
||||
n BSplCLib
|
||||
n BSplSLib
|
||||
n Bnd
|
||||
n BVH
|
||||
n CSLib
|
||||
n Convert
|
||||
n ElCLib
|
||||
n ElSLib
|
||||
n Expr
|
||||
n ExprIntrp
|
||||
n FSD
|
||||
n GeomAbs
|
||||
n Message
|
||||
n OSD
|
||||
n PLib
|
||||
n Plugin
|
||||
n Poly
|
||||
n Precision
|
||||
n Quantity
|
||||
n Resource
|
||||
n Standard
|
||||
n StdFail
|
||||
n Storage
|
||||
n TColStd
|
||||
n TColgp
|
||||
n TCollection
|
||||
n TShort
|
||||
n TopLoc
|
||||
n Units
|
||||
n UnitsAPI
|
||||
n gp
|
||||
n math
|
||||
r OS
|
||||
n FlexLexer
|
||||
t TKMath
|
||||
t TKernel
|
||||
n Adaptor2d
|
||||
n Adaptor3d
|
||||
n AdvApp2Var
|
||||
n AdvApprox
|
||||
n AppCont
|
||||
n AppDef
|
||||
n AppParCurves
|
||||
n Approx
|
||||
n BRep
|
||||
n BRepAdaptor
|
||||
n BRepLProp
|
||||
n BRepTools
|
||||
n BndLib
|
||||
n CPnts
|
||||
n Extrema
|
||||
n FEmTool
|
||||
n GC
|
||||
n GCE2d
|
||||
n GCPnts
|
||||
n GProp
|
||||
n Geom
|
||||
n Geom2d
|
||||
n Geom2dAdaptor
|
||||
n Geom2dConvert
|
||||
n Geom2dLProp
|
||||
n GeomAdaptor
|
||||
n GeomConvert
|
||||
n GeomLProp
|
||||
n GeomLib
|
||||
n GeomProjLib
|
||||
n GeomTools
|
||||
n GeomEvaluator
|
||||
n Hermit
|
||||
n IntAna
|
||||
n IntAna2d
|
||||
n LProp
|
||||
n LProp3d
|
||||
n ProjLib
|
||||
n TColGeom
|
||||
n TColGeom2d
|
||||
n TopAbs
|
||||
n TopExp
|
||||
n TopTools
|
||||
n TopoDS
|
||||
n gce
|
||||
t TKBRep
|
||||
t TKG2d
|
||||
t TKG3d
|
||||
t TKGeomBase
|
||||
n AppBlend
|
||||
n ApproxInt
|
||||
n BOPTools
|
||||
n BRepAlgo
|
||||
n BRepAlgoAPI
|
||||
n BRepApprox
|
||||
n BRepBlend
|
||||
n BRepBndLib
|
||||
n BRepBuilderAPI
|
||||
n BRepCheck
|
||||
n BRepClass
|
||||
n BRepClass3d
|
||||
n BRepExtrema
|
||||
n BRepFeat
|
||||
n BRepFill
|
||||
n BRepFilletAPI
|
||||
n BRepGProp
|
||||
n BRepIntCurveSurface
|
||||
n BRepLib
|
||||
n BRepMAT2d
|
||||
n BRepMesh
|
||||
n BRepMeshData
|
||||
n BRepOffset
|
||||
n BRepOffsetAPI
|
||||
n BRepPreviewAPI
|
||||
n BRepPrim
|
||||
n BRepPrimAPI
|
||||
n BRepProj
|
||||
n BRepSweep
|
||||
n BRepTopAdaptor
|
||||
n BiTgte
|
||||
n Bisector
|
||||
n Blend
|
||||
n BlendFunc
|
||||
n ChFi2d
|
||||
n ChFi3d
|
||||
n ChFiDS
|
||||
n ChFiKPart
|
||||
n Contap
|
||||
n Draft
|
||||
n FairCurve
|
||||
n FilletSurf
|
||||
n GccAna
|
||||
n GccEnt
|
||||
n GccInt
|
||||
n Geom2dAPI
|
||||
n Geom2dGcc
|
||||
n Geom2dHatch
|
||||
n Geom2dInt
|
||||
n GeomAPI
|
||||
n GeomFill
|
||||
n GeomInt
|
||||
n GeomPlate
|
||||
n HLRAlgo
|
||||
n HLRBRep
|
||||
n HLRTopoBRep
|
||||
n HLRAppli
|
||||
n Hatch
|
||||
n HatchGen
|
||||
n IMeshData
|
||||
n IMeshTools
|
||||
n IntCurve
|
||||
n IntCurveSurface
|
||||
n IntCurvesFace
|
||||
n IntImp
|
||||
n IntImpParGen
|
||||
n IntPatch
|
||||
n IntPolyh
|
||||
n IntRes2d
|
||||
n IntStart
|
||||
n IntSurf
|
||||
n IntTools
|
||||
n IntWalk
|
||||
n Intf
|
||||
n Intrv
|
||||
n Law
|
||||
n LocOpe
|
||||
n LocalAnalysis
|
||||
n MAT
|
||||
n MAT2d
|
||||
n NLPlate
|
||||
n Plate
|
||||
n ShapeAlgo
|
||||
n ShapeAnalysis
|
||||
n ShapeBuild
|
||||
n ShapeConstruct
|
||||
n ShapeCustom
|
||||
n ShapeExtend
|
||||
n ShapeFix
|
||||
n ShapeProcess
|
||||
n ShapeProcessAPI
|
||||
n ShapeUpgrade
|
||||
n Sweep
|
||||
n TopBas
|
||||
n TopClass
|
||||
n TopCnx
|
||||
n TopOpeBRep
|
||||
n TopOpeBRepBuild
|
||||
n TopOpeBRepDS
|
||||
n TopOpeBRepTool
|
||||
n TopTrans
|
||||
n XBRepMesh
|
||||
t TKBO
|
||||
t TKBool
|
||||
t TKFeat
|
||||
t TKFillet
|
||||
t TKGeomAlgo
|
||||
t TKHLR
|
||||
t TKMesh
|
||||
t TKOffset
|
||||
t TKPrim
|
||||
t TKShHealing
|
||||
t TKTopAlgo
|
||||
t TKXMesh
|
||||
n AIS
|
||||
n Aspect
|
||||
n DsgPrs
|
||||
n PrsDim
|
||||
n Graphic3d
|
||||
n Image
|
||||
n Media
|
||||
n MeshVS
|
||||
n OpenGl
|
||||
n OpenGles
|
||||
n D3DHost
|
||||
n Prs3d
|
||||
n PrsMgr
|
||||
n Select3D
|
||||
n SelectBasics
|
||||
n SelectMgr
|
||||
n StdPrs
|
||||
n StdSelect
|
||||
n V3d
|
||||
n Wasm
|
||||
n WNT
|
||||
n Xw
|
||||
n Cocoa
|
||||
r Textures
|
||||
r Shaders
|
||||
r XRResources
|
||||
t TKMeshVS
|
||||
t TKOpenGl
|
||||
t TKOpenGles
|
||||
t TKD3DHost
|
||||
t TKService
|
||||
t TKV3d
|
||||
n BinTObjDrivers
|
||||
n LDOM
|
||||
n TObj
|
||||
n XmlTObjDrivers
|
||||
n AppStd
|
||||
n AppStdL
|
||||
n BinDrivers
|
||||
n BinLDrivers
|
||||
n BinMDF
|
||||
n BinMDataStd
|
||||
n BinMDataXtd
|
||||
n BinMDocStd
|
||||
n BinMFunction
|
||||
n BinMNaming
|
||||
n BinObjMgt
|
||||
n BinTools
|
||||
n CDF
|
||||
n CDM
|
||||
n PCDM
|
||||
n StdLDrivers
|
||||
n StdLPersistent
|
||||
n StdObjMgt
|
||||
n StdDrivers
|
||||
n StdObject
|
||||
n StdPersistent
|
||||
n StdStorage
|
||||
n ShapePersistent
|
||||
n TDF
|
||||
n TDataStd
|
||||
n TDataXtd
|
||||
n TDocStd
|
||||
n TFunction
|
||||
n TNaming
|
||||
n TPrsStd
|
||||
n UTL
|
||||
n XmlDrivers
|
||||
n XmlLDrivers
|
||||
n XmlMDF
|
||||
n XmlMDataStd
|
||||
n XmlMDataXtd
|
||||
n XmlMDocStd
|
||||
n XmlMFunction
|
||||
n XmlMNaming
|
||||
n XmlObjMgt
|
||||
r StdResource
|
||||
r XmlOcafResource
|
||||
|
||||
t TKBin
|
||||
t TKBinL
|
||||
t TKBinTObj
|
||||
t TKCAF
|
||||
t TKCDF
|
||||
t TKLCAF
|
||||
|
||||
t TKStdL
|
||||
t TKStd
|
||||
t TKTObj
|
||||
t TKXml
|
||||
t TKXmlL
|
||||
t TKXmlTObj
|
||||
n IGESFile
|
||||
n StepFile
|
||||
n APIHeaderSection
|
||||
n BRepToIGES
|
||||
n BRepToIGESBRep
|
||||
n BinMXCAFDoc
|
||||
n BinXCAFDrivers
|
||||
n Geom2dToIGES
|
||||
n GeomToIGES
|
||||
n GeomToStep
|
||||
n HeaderSection
|
||||
n IFGraph
|
||||
n IFSelect
|
||||
n IGESAppli
|
||||
n IGESBasic
|
||||
n IGESCAFControl
|
||||
n IGESControl
|
||||
n IGESConvGeom
|
||||
n IGESData
|
||||
n IGESDefs
|
||||
n IGESDimen
|
||||
n IGESDraw
|
||||
n IGESGeom
|
||||
n IGESGraph
|
||||
n IGESSelect
|
||||
n IGESSolid
|
||||
n IGESToBRep
|
||||
n Interface
|
||||
n LibCtl
|
||||
n MoniTool
|
||||
n RWHeaderSection
|
||||
n RWStepAP203
|
||||
n RWStepAP214
|
||||
n RWStepAP242
|
||||
n RWStepBasic
|
||||
n RWStepDimTol
|
||||
n RWStepElement
|
||||
n RWStepFEA
|
||||
n RWStepGeom
|
||||
n RWStepKinematics
|
||||
n RWStepRepr
|
||||
n RWStepShape
|
||||
n RWStepVisual
|
||||
n RWStl
|
||||
n STEPCAFControl
|
||||
n STEPConstruct
|
||||
n STEPControl
|
||||
n STEPEdit
|
||||
n STEPSelections
|
||||
n StepAP203
|
||||
n StepAP209
|
||||
n StepAP214
|
||||
n StepAP242
|
||||
n StepBasic
|
||||
n StepData
|
||||
n StepDimTol
|
||||
n StepElement
|
||||
n StepFEA
|
||||
n StepGeom
|
||||
n StepKinematics
|
||||
n StepRepr
|
||||
n StepSelect
|
||||
n StepShape
|
||||
n StepToGeom
|
||||
n StepToTopoDS
|
||||
n StepVisual
|
||||
n StlAPI
|
||||
n TopoDSToStep
|
||||
n Transfer
|
||||
n TransferBRep
|
||||
n UnitsMethods
|
||||
n Vrml
|
||||
n VrmlAPI
|
||||
n VrmlConverter
|
||||
n VrmlData
|
||||
n XCAFApp
|
||||
n XCAFDimTolObjects
|
||||
n XCAFDoc
|
||||
n XCAFPrs
|
||||
n XSAlgo
|
||||
n XSControl
|
||||
n XmlMXCAFDoc
|
||||
n XmlXCAFDrivers
|
||||
r SHMessage
|
||||
r XSMessage
|
||||
r XSTEPResource
|
||||
t TKBinXCAF
|
||||
t TKDESTL
|
||||
t TKDEVRML
|
||||
t TKXCAF
|
||||
t TKDE
|
||||
t TKDECascade
|
||||
t TKDEIGES
|
||||
t TKDESTEP
|
||||
t TKXSBase
|
||||
t TKXmlXCAF
|
||||
n BOPTest
|
||||
n BRepTest
|
||||
n DBRep
|
||||
n DDF
|
||||
n DDataStd
|
||||
n DDocStd
|
||||
n DE
|
||||
n DEXCAFCascade
|
||||
n DEBRepCascade
|
||||
n DNaming
|
||||
n DPrsStd
|
||||
n Draw
|
||||
n DrawDim
|
||||
n DrawFairCurve
|
||||
n DrawTrSurf
|
||||
n GeometryTest
|
||||
n GeomliteTest
|
||||
n HLRTest
|
||||
n MeshTest
|
||||
n SWDRAW
|
||||
n TObjDRAW
|
||||
n OpenGlTest
|
||||
n OpenGlesTest
|
||||
n D3DHostTest
|
||||
n ViewerTest
|
||||
n XDEDRAW
|
||||
n XSDRAW
|
||||
n XSDRAWIGES
|
||||
n XSDRAWSTEP
|
||||
n XSDRAWSTL
|
||||
n XSDRAWVRML
|
||||
n XSDRAWDE
|
||||
n XSDRAWGLTF
|
||||
n XSDRAWOBJ
|
||||
n XSDRAWPLY
|
||||
r DrawResources
|
||||
t TKDCAF
|
||||
t TKDraw
|
||||
t TKTObjDRAW
|
||||
t TKTopTest
|
||||
t TKOpenGlTest
|
||||
t TKOpenGlesTest
|
||||
t TKD3DHostTest
|
||||
t TKViewerTest
|
||||
t TKXDEDRAW
|
||||
t TKXSDRAW
|
||||
t TKXSDRAWIGES
|
||||
t TKXSDRAWSTEP
|
||||
t TKXSDRAWSTL
|
||||
t TKXSDRAWVRML
|
||||
t TKXSDRAWDE
|
||||
t TKXSDRAWGLTF
|
||||
t TKXSDRAWOBJ
|
||||
t TKXSDRAWPLY
|
||||
x DRAWEXE
|
||||
n QADraw
|
||||
n QANCollection
|
||||
n QANewBRepNaming
|
||||
n QANewDBRepNaming
|
||||
n QANewModTopOpe
|
||||
t TKQADraw
|
||||
n QADNaming
|
||||
n QABugs
|
||||
n Font
|
||||
n BOPAlgo
|
||||
n BOPDS
|
||||
n BOPCol
|
||||
n IVtk
|
||||
n IVtkOCC
|
||||
n IVtkVTK
|
||||
n IVtkTools
|
||||
t TKIVtk
|
||||
n IVtkDraw
|
||||
t TKIVtkDraw
|
||||
n Geom2dEvaluator
|
||||
t TKVCAF
|
||||
n XCAFView
|
||||
n XCAFNoteObjects
|
||||
t TKRWMesh
|
||||
t TKDEGLTF
|
||||
t TKDEOBJ
|
||||
t TKDEPLY
|
||||
n RWGltf
|
||||
n RWMesh
|
||||
n RWObj
|
||||
n RWPly
|
||||
n DFBrowser
|
||||
n DFBrowserPane
|
||||
n DFBrowserPaneXDE
|
||||
n ShapeView
|
||||
n TInspector
|
||||
n TInspectorAPI
|
||||
x TInspectorEXE
|
||||
t TKDFBrowser
|
||||
t TKShapeView
|
||||
t TKTInspector
|
||||
t TKTInspectorAPI
|
||||
t TKToolsDraw
|
||||
t TKTreeModel
|
||||
t TKView
|
||||
t TKVInspector
|
||||
n ToolsDraw
|
||||
n TreeModel
|
||||
n View
|
||||
n ViewControl
|
||||
n VInspector
|
||||
n Express
|
||||
t TKExpress
|
||||
x ExpToCasExe
|
@@ -56,7 +56,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# hide all redundant variables
|
||||
mark_as_advanced (DOXYGEN_SKIP_DOT)
|
||||
mark_as_advanced (DOXYGEN_EXECUTABLE)
|
||||
mark_as_advanced (DOXYGEN_DOT_EXECUTABLE)
|
||||
# unset all redundant variables
|
||||
OCCT_CHECK_AND_UNSET (DOXYGEN_SKIP_DOT)
|
||||
OCCT_CHECK_AND_UNSET (DOXYGEN_EXECUTABLE)
|
||||
OCCT_CHECK_AND_UNSET (DOXYGEN_DOT_EXECUTABLE)
|
||||
|
@@ -38,7 +38,11 @@ endmacro()
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package (draco CONFIG REQUIRED)
|
||||
set(CSF_Draco draco::draco)
|
||||
|
||||
set (3RDPARTY_DRACO_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
|
||||
SEARCH_DRACO_LIB()
|
||||
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/draco")
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
@@ -83,5 +83,5 @@ else()
|
||||
set (3RDPARTY_EIGEN_INCLUDE_DIR "" CACHE PATH "the path to Eigen header file" FORCE)
|
||||
endif()
|
||||
|
||||
# hide all redundant variables
|
||||
mark_as_advanced(Eigen3_DIR)
|
||||
# unset all redundant variables
|
||||
OCCT_CHECK_AND_UNSET(Eigen3_DIR)
|
||||
|
@@ -247,7 +247,7 @@ foreach (LIBRARY_NAME ${CSF_FFmpeg})
|
||||
mark_as_advanced (3RDPARTY_FFMPEG_LIBRARY_${LIBRARY_NAME} 3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME})
|
||||
endforeach()
|
||||
|
||||
# hide all redundant variables
|
||||
mark_as_advanced (FFMPEG_INCLUDE_DIRS)
|
||||
mark_as_advanced (FFMPEG_LIBRARY_DIRS)
|
||||
mark_as_advanced (FFMPEG_DIR)
|
||||
# unset all redundant variables
|
||||
OCCT_CHECK_AND_UNSET (FFMPEG_INCLUDE_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (FFMPEG_LIBRARY_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (FFMPEG_DIR)
|
||||
|
@@ -33,11 +33,11 @@ if (NOT FLEX_FOUND OR NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}/Fl
|
||||
endif()
|
||||
|
||||
# remove old general version of FlexLexer
|
||||
if (EXISTS ${OCCT_ROOT_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
|
||||
message (STATUS "Info: remove old FLEX header file: ${OCCT_ROOT_DIR}/src/FlexLexer/FlexLexer.h")
|
||||
file(REMOVE ${OCCT_ROOT_DIR}/src/FlexLexer/FlexLexer.h)
|
||||
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
|
||||
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h")
|
||||
file(REMOVE ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h)
|
||||
endif()
|
||||
# install copy of FlexLexer.h locally to allow further building without flex
|
||||
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
|
||||
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${OCCT_ROOT_DIR}/src/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
|
||||
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
|
||||
endif()
|
||||
|
@@ -389,10 +389,10 @@ endif()
|
||||
endif()
|
||||
#endif()
|
||||
|
||||
# hide all redundant variables
|
||||
mark_as_advanced(FREETYPE_INCLUDE_DIR_ft2build)
|
||||
mark_as_advanced(FREETYPE_INCLUDE_DIR_freetype2)
|
||||
mark_as_advanced(FREETYPE_LIBRARY_RELEASE)
|
||||
# unset all redundant variables
|
||||
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
|
||||
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
|
||||
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY_RELEASE)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)
|
||||
|
@@ -1,66 +0,0 @@
|
||||
# Google Test integration for OCCT
|
||||
|
||||
# Only proceed if tests are enabled
|
||||
if (NOT BUILD_GTEST)
|
||||
set(GOOGLETEST_FOUND FALSE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Check if the user has specified whether to install Google Test
|
||||
if (NOT DEFINED INSTALL_GTEST)
|
||||
set(INSTALL_GTEST OFF CACHE BOOL "Install Google Test")
|
||||
endif()
|
||||
|
||||
# Google Test configuration options
|
||||
option(GTEST_USE_EXTERNAL "Use externally provided Google Test installation" OFF)
|
||||
option(GTEST_USE_FETCHCONTENT "Use FetchContent to download and build Google Test" ON)
|
||||
|
||||
# Try to find existing GTest installation
|
||||
find_package(GTest QUIET)
|
||||
|
||||
if(GTest_FOUND)
|
||||
message(STATUS "Found Googletest installation")
|
||||
set(GOOGLETEST_FOUND TRUE)
|
||||
set(GTEST_USE_EXTERNAL TRUE)
|
||||
set(GTEST_USE_FETCHCONTENT FALSE)
|
||||
else()
|
||||
message(STATUS "Googletest not found in system paths")
|
||||
if(GTEST_USE_FETCHCONTENT)
|
||||
include(FetchContent)
|
||||
|
||||
# Set option to disable GMock before declaring the content
|
||||
set(BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject" FORCE)
|
||||
|
||||
# For Windows: Prevent overriding the parent project's compiler/linker settings
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
URL https://github.com/google/googletest/archive/refs/tags/v1.16.0.zip
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP true
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
|
||||
# Set proper grouping for the targets in solution explorer
|
||||
if(TARGET gtest)
|
||||
set_target_properties(gtest PROPERTIES FOLDER "ThirdParty/GoogleTest")
|
||||
target_compile_definitions(gtest PRIVATE GTEST_CREATE_SHARED_LIBRARY=1)
|
||||
endif()
|
||||
if(TARGET gtest_main)
|
||||
set_target_properties(gtest_main PROPERTIES FOLDER "ThirdParty/GoogleTest")
|
||||
target_compile_definitions(gtest_main PRIVATE GTEST_CREATE_SHARED_LIBRARY=1)
|
||||
endif()
|
||||
|
||||
# Set variables for consistent use throughout the build system
|
||||
set(GOOGLETEST_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "Google Test not available. Tests will be skipped.")
|
||||
set(GOOGLETEST_FOUND FALSE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Enable CTest if Google Test is available
|
||||
if(GOOGLETEST_FOUND)
|
||||
include(GoogleTest)
|
||||
endif()
|
@@ -82,25 +82,6 @@ else()
|
||||
set (CSF_Draco)
|
||||
endif()
|
||||
|
||||
# VTK
|
||||
if (USE_VTK)
|
||||
# the variable must to be empty, but keep there the list of libs
|
||||
# that is used in the VTK component.
|
||||
set (CSF_VTK
|
||||
# vtkCommonCore
|
||||
# vtkRenderingCore
|
||||
# vtkRenderingFreeType
|
||||
# vtkFiltersGeneral
|
||||
# vtkIOImage
|
||||
# vtkImagingCore
|
||||
# vtkInteractionStyle
|
||||
# vtkRenderingOpenGL
|
||||
# vtkRenderingFreeTypeOpenGL
|
||||
)
|
||||
else()
|
||||
set (CSF_VTK)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set (CSF_advapi32 "advapi32.lib")
|
||||
set (CSF_gdi32 "gdi32.lib")
|
||||
@@ -113,8 +94,37 @@ if (WIN32)
|
||||
set (CSF_OpenGlLibs "opengl32.lib")
|
||||
set (CSF_OpenGlesLibs "libEGL libGLESv2")
|
||||
else()
|
||||
|
||||
if (APPLE)
|
||||
# Will be called later
|
||||
set (CSF_objc "objc")
|
||||
|
||||
# frameworks
|
||||
if (IOS)
|
||||
find_library (Appkit_LIB NAMES UIKit)
|
||||
set (CSF_Appkit ${Appkit_LIB})
|
||||
else()
|
||||
find_library (Appkit_LIB NAMES AppKit)
|
||||
set (CSF_Appkit ${Appkit_LIB})
|
||||
endif()
|
||||
OCCT_CHECK_AND_UNSET (Appkit_LIB)
|
||||
|
||||
find_library (IOKit_LIB NAMES IOKit)
|
||||
set (CSF_IOKit ${IOKit_LIB})
|
||||
OCCT_CHECK_AND_UNSET (IOKit_LIB)
|
||||
|
||||
if (IOS)
|
||||
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
|
||||
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB})
|
||||
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
|
||||
elseif (USE_XLIB)
|
||||
set (CSF_OpenGlLibs "GL")
|
||||
set (CSF_XwLibs "X11")
|
||||
else()
|
||||
find_library (OpenGlLibs_LIB NAMES OpenGL)
|
||||
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
|
||||
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
|
||||
endif()
|
||||
|
||||
elseif (EMSCRIPTEN)
|
||||
set (CSF_ThreadLibs "pthread rt stdc++")
|
||||
set (CSF_OpenGlesLibs "EGL GLESv2")
|
||||
@@ -134,59 +144,7 @@ else()
|
||||
set (CSF_OpenGlesLibs "EGL GLESv2")
|
||||
set (CSF_dl "dl")
|
||||
if (USE_FREETYPE)
|
||||
set (CSF_fontconfig "fontconfig expat")
|
||||
set (CSF_fontconfig "fontconfig")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Updates APPLE variables
|
||||
function(occt_set_apple_csf_vars)
|
||||
set (CSF_objc "objc" PARENT_SCOPE)
|
||||
|
||||
# frameworks
|
||||
if (IOS)
|
||||
find_library (Appkit_LIB NAMES UIKit)
|
||||
if (Appkit_LIB)
|
||||
set (CSF_Appkit ${Appkit_LIB} PARENT_SCOPE)
|
||||
else()
|
||||
set (CSF_Appkit "UIKit" PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
find_library (Appkit_LIB NAMES AppKit)
|
||||
if (Appkit_LIB)
|
||||
set (CSF_Appkit ${Appkit_LIB} PARENT_SCOPE)
|
||||
else()
|
||||
set (CSF_Appkit "AppKit" PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
OCCT_CHECK_AND_UNSET (Appkit_LIB)
|
||||
|
||||
find_library (IOKit_LIB NAMES IOKit)
|
||||
if (IOKit_LIB)
|
||||
set (CSF_IOKit ${IOKit_LIB} PARENT_SCOPE)
|
||||
else()
|
||||
set (CSF_IOKit "IOKit" PARENT_SCOPE)
|
||||
endif()
|
||||
OCCT_CHECK_AND_UNSET (IOKit_LIB)
|
||||
|
||||
if (IOS)
|
||||
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
|
||||
if (OpenGlesLibs_LIB)
|
||||
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB} PARENT_SCOPE)
|
||||
else()
|
||||
set (CSF_OpenGlesLibs "OpenGLES" PARENT_SCOPE)
|
||||
endif()
|
||||
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
|
||||
elseif (USE_XLIB)
|
||||
set (CSF_OpenGlLibs "GL" PARENT_SCOPE)
|
||||
set (CSF_XwLibs "X11" PARENT_SCOPE)
|
||||
else()
|
||||
find_library (OpenGlLibs_LIB NAMES OpenGL)
|
||||
if (OpenGlLibs_LIB)
|
||||
set (CSF_OpenGlLibs ${OpenGlLibs_LIB} PARENT_SCOPE)
|
||||
else()
|
||||
set (CSF_OpenGlLibs "OpenGL" PARENT_SCOPE)
|
||||
endif()
|
||||
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
|
||||
endif()
|
||||
endfunction()
|
||||
|
@@ -26,7 +26,7 @@ endif()
|
||||
|
||||
if (MSVC)
|
||||
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd26812")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
|
||||
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
|
||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
else()
|
||||
@@ -151,27 +151,15 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
|
||||
# /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang.
|
||||
# /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically.
|
||||
# /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang.
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
|
||||
|
||||
# Apply LTO optimization on all platforms
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
|
||||
|
||||
# Apply function sections only on non-macOS platforms
|
||||
if (NOT APPLE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffunction-sections")
|
||||
endif()
|
||||
|
||||
# Link-Time Code Generation (LTCG) is required for Whole Program Optimization
|
||||
# Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL)
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto")
|
||||
|
||||
# Add garbage collection sections only on Linux (not on macOS or Windows)
|
||||
if (NOT WIN32 AND NOT APPLE)
|
||||
if (NOT WIN32)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
|
||||
@@ -184,7 +172,7 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
|
||||
if (APPLE)
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
elseif(NOT WIN32)
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-lm -Wl,-Bsymbolic ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -1,687 +0,0 @@
|
||||
##
|
||||
|
||||
# Function to collect modules, toolkits, and packages information for documentation
|
||||
function(OCCT_DOC_COLLECT_MODULES_INFO)
|
||||
# Set output variables in parent scope
|
||||
set(OCCT_MODULES ${OCCT_MODULES} PARENT_SCOPE)
|
||||
|
||||
# For each module, collect its toolkits
|
||||
foreach(OCCT_MODULE ${OCCT_MODULES})
|
||||
if(NOT "${OCCT_MODULE}" STREQUAL "")
|
||||
set(MODULES_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
|
||||
set(TOOLKITS_IN_MODULE_${OCCT_MODULE} ${MODULES_TOOLKITS} PARENT_SCOPE)
|
||||
|
||||
# For each toolkit, collect its packages
|
||||
foreach(TOOLKIT ${MODULES_TOOLKITS})
|
||||
set(TOOLKIT_PARENT_MODULE_${TOOLKIT} ${OCCT_MODULE} PARENT_SCOPE)
|
||||
|
||||
# Get packages from toolkit
|
||||
set(TOOLKIT_PACKAGES "")
|
||||
EXTRACT_TOOLKIT_PACKAGES("src" ${TOOLKIT} TOOLKIT_PACKAGES)
|
||||
set(PACKAGES_IN_TOOLKIT_${TOOLKIT} ${TOOLKIT_PACKAGES} PARENT_SCOPE)
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Function to generate module dependency graph
|
||||
function(OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME)
|
||||
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
|
||||
|
||||
# Create .dot file for module dependencies
|
||||
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
||||
|
||||
# Create a list to track unique module connections
|
||||
set(MODULE_CONNECTIONS)
|
||||
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
# Convert module name to lowercase for URL
|
||||
string(TOLOWER ${MODULE} MODULE_LOWER)
|
||||
file(APPEND ${DOT_FILE} "\t${MODULE} [ URL = \"module_${MODULE_LOWER}.html\" ]\n")
|
||||
|
||||
# Add dependencies between modules
|
||||
foreach(MODULE_TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${MODULE_TOOLKIT}})
|
||||
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
|
||||
NOT "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE}")
|
||||
# Create a unique connection identifier
|
||||
set(CONNECTION "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}->${MODULE}")
|
||||
list(FIND MODULE_CONNECTIONS "${CONNECTION}" CONNECTION_EXISTS)
|
||||
|
||||
# Add connection only if it doesn't exist yet
|
||||
if(${CONNECTION_EXISTS} EQUAL -1)
|
||||
list(APPEND MODULE_CONNECTIONS "${CONNECTION}")
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}} -> ${MODULE} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${DOT_FILE} "}\n")
|
||||
|
||||
# Return the output file name
|
||||
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to generate toolkit dependency graph for a module
|
||||
function(OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME MODULE_NAME)
|
||||
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
|
||||
|
||||
# Create .dot file for toolkit dependencies within a module
|
||||
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
||||
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE_NAME}})
|
||||
# Convert toolkit name to lowercase for URL
|
||||
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT} [ URL = \"toolkit_${TOOLKIT_LOWER}.html\" ]\n")
|
||||
|
||||
# Add dependencies between toolkits in the same module
|
||||
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT}})
|
||||
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
|
||||
"${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE_NAME}")
|
||||
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} -> ${TOOLKIT} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${DOT_FILE} "}\n")
|
||||
|
||||
# Return the output file name
|
||||
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to generate dependency graph for a specific toolkit
|
||||
function(OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME TOOLKIT_NAME)
|
||||
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
|
||||
|
||||
# Create .dot file for dependencies of a single toolkit
|
||||
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
||||
|
||||
# Convert toolkit name to lowercase for URL
|
||||
string(TOLOWER ${TOOLKIT_NAME} TOOLKIT_NAME_LOWER)
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} [ URL = \"toolkit_${TOOLKIT_NAME_LOWER}.html\", shape = box ]\n")
|
||||
|
||||
# Add toolkit dependencies
|
||||
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT_NAME}})
|
||||
# Convert dependent toolkit name to lowercase for URL
|
||||
string(TOLOWER ${DEPENDENT_TOOLKIT} DEPENDENT_TOOLKIT_LOWER)
|
||||
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} [ URL = \"toolkit_${DEPENDENT_TOOLKIT_LOWER}.html\", shape = box ]\n")
|
||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} -> ${DEPENDENT_TOOLKIT} [ color = \"midnightblue\", style = \"solid\" ]\n")
|
||||
endforeach()
|
||||
|
||||
if(TOOLKIT_DEPENDENCY_${TOOLKIT_NAME})
|
||||
list(LENGTH TOOLKIT_DEPENDENCY_${TOOLKIT_NAME} DEPS_COUNT)
|
||||
if(DEPS_COUNT GREATER 1)
|
||||
file(APPEND ${DOT_FILE} "\taspect = 1\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(APPEND ${DOT_FILE} "}\n")
|
||||
|
||||
# Return the output file name
|
||||
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to generate main page for documentation
|
||||
function(OCCT_DOC_GENERATE_MAIN_PAGE OUTPUT_DIR OUTPUT_FILE)
|
||||
set(MAIN_PAGE_FILE "${OUTPUT_DIR}/${OUTPUT_FILE}")
|
||||
file(WRITE ${MAIN_PAGE_FILE} "/**\n")
|
||||
|
||||
# Check if we're generating documentation for a single module
|
||||
if(DOC_SINGLE_MODULE)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${DOC_SINGLE_MODULE}\n")
|
||||
else()
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage Open CASCADE Technology Reference Manual\n\n")
|
||||
# List all modules
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
# page id must be in lowercase
|
||||
string(TOLOWER ${MODULE} MODULE_LOWER)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage module_${MODULE_LOWER}\n")
|
||||
endif()
|
||||
endforeach()
|
||||
# Add modules relationship diagram
|
||||
OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_all_modules")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_all_modules.dot\n")
|
||||
endif()
|
||||
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
|
||||
# Generate pages for modules and their toolkits
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
|
||||
|
||||
if(DOC_SINGLE_MODULE)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${MODULE}\n")
|
||||
else()
|
||||
# page id must be in lowercase
|
||||
string(TOLOWER ${MODULE} MODULE_LOWER)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\page module_${MODULE_LOWER} Module ${MODULE}\n")
|
||||
endif()
|
||||
|
||||
# List toolkits in the module
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
# page id must be in lowercase
|
||||
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage toolkit_${TOOLKIT_LOWER}\n")
|
||||
endforeach()
|
||||
|
||||
# Add module diagram
|
||||
OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${MODULE}" ${MODULE})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${MODULE}.dot\n")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Generate pages for toolkits and their packages
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
|
||||
# page id must be in lowercase
|
||||
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\page toolkit_${TOOLKIT_LOWER} Toolkit ${TOOLKIT}\n")
|
||||
|
||||
# List packages in toolkit
|
||||
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
|
||||
set(PACKAGE_NAME ${PACKAGE})
|
||||
# page id must be in lowercase
|
||||
string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage package_${PACKAGE_NAME_LOWER}\n")
|
||||
endforeach()
|
||||
|
||||
# Add toolkit dependencies diagram
|
||||
OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${TOOLKIT}" ${TOOLKIT})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${TOOLKIT}.dot\n")
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Generate pages for packages and their classes
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
|
||||
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
|
||||
# page id must be in lowercase
|
||||
string(TOLOWER ${PACKAGE} PACKAGE_LOWER)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\page package_${PACKAGE_LOWER} Package ${PACKAGE}\n")
|
||||
|
||||
# Find header files in the package
|
||||
EXTRACT_PACKAGE_FILES ("src" ${PACKAGE} ALL_FILES _)
|
||||
set (HEADER_FILES_FILTERING ${ALL_FILES})
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|hxx|hpp)$")
|
||||
|
||||
foreach(HEADER ${HEADER_FILES_FILTERING})
|
||||
get_filename_component(HEADER_NAME ${HEADER} NAME_WE)
|
||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage ${HEADER_NAME}\n")
|
||||
# Append header file to DOXYGEN_INPUT_FILES list
|
||||
list(APPEND DOXYGEN_INPUT_FILES "${HEADER}")
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Create a variable containing all input files for Doxygen
|
||||
string(REPLACE ";" " " DOXYGEN_INPUT_FILES_STRING "${DOXYGEN_INPUT_FILES}")
|
||||
set(DOXYGEN_INPUT_FILES_STRING ${DOXYGEN_INPUT_FILES_STRING} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to extract dependency information for toolkits
|
||||
function(OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES)
|
||||
foreach(MODULE ${OCCT_MODULES})
|
||||
if(NOT "${MODULE}" STREQUAL "")
|
||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||
EXTRACT_TOOLKIT_EXTERNLIB("src" ${TOOLKIT} EXTERNLIB_LIST)
|
||||
|
||||
set(DEPENDENT_TOOLKITS "")
|
||||
foreach(EXTERNLIB ${EXTERNLIB_LIST})
|
||||
if(EXTERNLIB MATCHES "^TK")
|
||||
list(APPEND DEPENDENT_TOOLKITS ${EXTERNLIB})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(TOOLKIT_DEPENDENCY_${TOOLKIT} ${DEPENDENT_TOOLKITS} PARENT_SCOPE)
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Function to load file lists for documentation
|
||||
function(OCCT_DOC_LOAD_FILE_LISTS)
|
||||
# Load list of HTML documentation files
|
||||
set(FILES_HTML_PATH "${OCCT_ROOT_DIR}/dox/FILES_HTML.txt")
|
||||
if(EXISTS ${FILES_HTML_PATH})
|
||||
file(STRINGS ${FILES_HTML_PATH} HTML_FILES REGEX "^[^#]+")
|
||||
set(OCCT_DOC_HTML_FILES ${HTML_FILES} PARENT_SCOPE)
|
||||
else()
|
||||
set(OCCT_DOC_HTML_FILES "" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Load list of PDF documentation files
|
||||
set(FILES_PDF_PATH "${OCCT_ROOT_DIR}/dox/FILES_PDF.txt")
|
||||
if(EXISTS ${FILES_PDF_PATH})
|
||||
file(STRINGS ${FILES_PDF_PATH} PDF_FILES REGEX "^[^#]+")
|
||||
set(OCCT_DOC_PDF_FILES ${PDF_FILES} PARENT_SCOPE)
|
||||
else()
|
||||
set(OCCT_DOC_PDF_FILES "" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Function to collect image directories from input files
|
||||
function(OCCT_DOC_COLLECT_IMAGE_DIRS INPUT_DIRS RESULT_IMAGE_DIRS)
|
||||
set(IMAGE_DIRS "")
|
||||
|
||||
foreach(INPUT_DIR ${INPUT_DIRS})
|
||||
# Check if directory exists
|
||||
if(EXISTS "${INPUT_DIR}")
|
||||
# Add the standard "images" subdirectory if it exists
|
||||
if(EXISTS "${INPUT_DIR}/images")
|
||||
list(APPEND IMAGE_DIRS "${INPUT_DIR}/images")
|
||||
endif()
|
||||
|
||||
# Find all subdirectories containing images
|
||||
file(GLOB_RECURSE IMAGE_FILES
|
||||
"${INPUT_DIR}/*.png"
|
||||
"${INPUT_DIR}/*.jpg"
|
||||
"${INPUT_DIR}/*.jpeg"
|
||||
"${INPUT_DIR}/*.gif"
|
||||
"${INPUT_DIR}/*.svg")
|
||||
|
||||
foreach(IMAGE_FILE ${IMAGE_FILES})
|
||||
get_filename_component(IMAGE_DIR ${IMAGE_FILE} DIRECTORY)
|
||||
list(APPEND IMAGE_DIRS "${IMAGE_DIR}")
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(IMAGE_DIRS)
|
||||
list(REMOVE_DUPLICATES IMAGE_DIRS)
|
||||
endif()
|
||||
|
||||
set(${RESULT_IMAGE_DIRS} ${IMAGE_DIRS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to configure and run Doxygen for documentation generation
|
||||
function(OCCT_DOC_CONFIGURE_DOXYGEN OUTPUT_DIR CONFIG_FILE DOC_TYPE)
|
||||
# Create output directory if it doesn't exist
|
||||
file(MAKE_DIRECTORY ${OUTPUT_DIR})
|
||||
|
||||
# Use existing Doxygen template file as base
|
||||
if(DOC_TYPE STREQUAL "OVERVIEW")
|
||||
set(TEMPLATE_DOXYFILE "${OCCT_ROOT_DIR}/dox/resources/occt_ug_html.doxyfile")
|
||||
else()
|
||||
set(TEMPLATE_DOXYFILE "${OCCT_ROOT_DIR}/dox/resources/occt_rm.doxyfile")
|
||||
endif()
|
||||
|
||||
# Define Doxygen parameters that need to be overridden from the template
|
||||
set(DOXYGEN_CONFIG_FILE "${OUTPUT_DIR}/${CONFIG_FILE}")
|
||||
|
||||
# Check if template file exists
|
||||
if(NOT EXISTS ${TEMPLATE_DOXYFILE})
|
||||
message(FATAL_ERROR "ERROR: Doxygen template file not found: ${TEMPLATE_DOXYFILE}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Read template content
|
||||
file(READ ${TEMPLATE_DOXYFILE} DOXYGEN_TEMPLATE_CONTENT)
|
||||
|
||||
# Create the output Doxyfile
|
||||
file(WRITE ${DOXYGEN_CONFIG_FILE} "# Doxyfile generated by OCCT_DOC_CONFIGURE_DOXYGEN\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Base template: ${TEMPLATE_DOXYFILE}\n\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "${DOXYGEN_TEMPLATE_CONTENT}\n\n")
|
||||
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Custom overrides set by CMake:\n")
|
||||
|
||||
# Project information
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "OUTPUT_DIRECTORY = ${OUTPUT_DIR}\n")
|
||||
|
||||
# Ensure client-side search is configured correctly
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Search engine settings\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHENGINE = YES\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "SERVER_BASED_SEARCH = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTERNAL_SEARCH = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHDATA_FILE = searchdata.xml\n")
|
||||
|
||||
# Additional parameters based on the document type
|
||||
if(DOC_TYPE STREQUAL "OVERVIEW")
|
||||
# Settings for Overview documentation
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${OCCT_ROOT_DIR}/dox/resources/occ_logo.png\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_ALL = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_STATIC = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */src/* */inc/* */drv/* */Properties/*\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "ENABLED_SECTIONS = OVERVIEW_SECTION\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt.tag\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TREEVIEW = YES\n")
|
||||
|
||||
# Setup tag file for cross-referencing with Reference Manual
|
||||
if(BUILD_DOC_RefMan)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Cross-referencing with Reference Manual\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "TAGFILES = \"${CMAKE_BINARY_DIR}/doc/refman/occt_refman.tag=../../refman/html\"\n")
|
||||
endif()
|
||||
|
||||
# Input files for overview
|
||||
if(DEFINED OCCT_OVERVIEW_FILES)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${OCCT_OVERVIEW_FILES}\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${OCCT_ROOT_DIR}/dox\n")
|
||||
endif()
|
||||
|
||||
# Collect image directories for overview
|
||||
set(OVERVIEW_INPUT_DIRS ${OCCT_ROOT_DIR}/dox)
|
||||
OCCT_DOC_COLLECT_IMAGE_DIRS("${OVERVIEW_INPUT_DIRS}" OVERVIEW_IMAGE_DIRS)
|
||||
|
||||
# Image path for overview
|
||||
if(OVERVIEW_IMAGE_DIRS)
|
||||
string(REPLACE ";" " " OVERVIEW_IMAGE_DIRS_STR "${OVERVIEW_IMAGE_DIRS}")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${OVERVIEW_IMAGE_DIRS_STR} ${OCCT_ROOT_DIR}/dox/resources\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${OCCT_ROOT_DIR}/dox/resources\n")
|
||||
endif()
|
||||
|
||||
# Example paths
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXAMPLE_PATH = ${OCCT_ROOT_DIR}/src ${OCCT_ROOT_DIR}/samples\n")
|
||||
else()
|
||||
# Settings for Reference Manual
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NAME = \"Open CASCADE Technology Reference Manual\"\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${OCCT_ROOT_DIR}/dox/resources/occ_logo.png\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "BUILTIN_STL_SUPPORT = YES\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PACKAGE = YES\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */Properties/*\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "FILE_PATTERNS = *.h *.hxx *.lxx *.gxx *.pxx *.cxx *.cpp *.c *.md\n")
|
||||
|
||||
# Generate a tag file for cross-referencing from Overview
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Generate tag file for cross-referencing\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt_refman.tag\n")
|
||||
|
||||
# Input files for reference manual - CRITICAL FOR PROPER GENERATION
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Input files for reference manual\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${OCCT_ROOT_DIR}/src\n")
|
||||
|
||||
# If generating documentation for specific modules
|
||||
if(DEFINED OCCT_DOC_MODULES)
|
||||
set(MODULE_PATHS "")
|
||||
foreach(MODULE ${OCCT_DOC_MODULES})
|
||||
foreach(TOOLKIT ${${MODULE}_TOOLKITS})
|
||||
list(APPEND MODULE_PATHS "${OCCT_ROOT_DIR}/src/${TOOLKIT}")
|
||||
endforeach()
|
||||
endforeach()
|
||||
string(REPLACE ";" " " MODULE_PATHS_STR "${MODULE_PATHS}")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${MODULE_PATHS_STR}\n") # Use += to append to existing INPUT
|
||||
endif()
|
||||
|
||||
# Configure image path for reference manual
|
||||
set(REFMAN_INPUT_DIRS ${OCCT_ROOT_DIR}/src)
|
||||
OCCT_DOC_COLLECT_IMAGE_DIRS("${REFMAN_INPUT_DIRS}" REFMAN_IMAGE_DIRS)
|
||||
|
||||
if(REFMAN_IMAGE_DIRS)
|
||||
string(REPLACE ";" " " REFMAN_IMAGE_DIRS_STR "${REFMAN_IMAGE_DIRS}")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${REFMAN_IMAGE_DIRS_STR} ${OCCT_ROOT_DIR}/dox/resources\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${OCCT_ROOT_DIR}/dox/resources\n")
|
||||
endif()
|
||||
|
||||
# Add main page file if generated
|
||||
if(EXISTS "${OUTPUT_DIR}/main_page.dox")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${OUTPUT_DIR}/main_page.dox\n") # Use += to append to existing INPUT
|
||||
endif()
|
||||
|
||||
# Add header files to Doxygen input
|
||||
if(DEFINED DOXYGEN_INPUT_FILES_STRING)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${DOXYGEN_INPUT_FILES_STRING}\n") # Use += to append to existing INPUT
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Custom CSS
|
||||
if(EXISTS "${OCCT_ROOT_DIR}/dox/resources/custom.css")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "HTML_EXTRA_STYLESHEET = ${OCCT_ROOT_DIR}/dox/resources/custom.css\n")
|
||||
endif()
|
||||
|
||||
# Set paths for dot tool
|
||||
if(GRAPHVIZ_DOT_EXECUTABLE)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOT_PATH = ${GRAPHVIZ_DOT_EXECUTABLE}\n")
|
||||
get_filename_component(DOT_DIRECTORY ${GRAPHVIZ_DOT_EXECUTABLE} DIRECTORY)
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFONTPATH = ${DOT_DIRECTORY}\n")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFILE_DIRS = ${OUTPUT_DIR}/html\n")
|
||||
endif()
|
||||
|
||||
# Confirm file creation
|
||||
if(EXISTS ${DOXYGEN_CONFIG_FILE})
|
||||
message(STATUS "Successfully created Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
|
||||
else()
|
||||
message(FATAL_ERROR "Failed to create Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Function to check if required tools are available
|
||||
function(OCCT_DOC_CHECK_TOOLS)
|
||||
# Find Doxygen
|
||||
find_package(Doxygen QUIET)
|
||||
if(NOT DOXYGEN_FOUND)
|
||||
message(WARNING "Doxygen not found. Documentation will not be generated.")
|
||||
set(OCCT_DOC_TOOLS_AVAILABLE FALSE PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Find Graphviz
|
||||
find_program(GRAPHVIZ_DOT_EXECUTABLE NAMES dot)
|
||||
|
||||
# Check for MathJax for LaTeX formulas
|
||||
if(NOT MATHJAX_PATH)
|
||||
set(MATHJAX_PATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5")
|
||||
endif()
|
||||
|
||||
# Find tools for PDF generation if needed
|
||||
if(BUILD_DOC_PDF)
|
||||
# Find pdflatex
|
||||
find_program(PDFLATEX_EXECUTABLE NAMES pdflatex)
|
||||
if(NOT PDFLATEX_EXECUTABLE)
|
||||
message(WARNING "pdflatex not found. PDF documentation will not be generated.")
|
||||
set(BUILD_DOC_PDF FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Find Inkscape (for SVG to PNG conversion for PDFs)
|
||||
find_program(INKSCAPE_EXECUTABLE NAMES inkscape)
|
||||
if(NOT INKSCAPE_EXECUTABLE)
|
||||
message(WARNING "Inkscape not found. SVG images will not be properly converted in PDF documentation.")
|
||||
endif()
|
||||
|
||||
set(PDFLATEX_EXECUTABLE ${PDFLATEX_EXECUTABLE} PARENT_SCOPE)
|
||||
set(INKSCAPE_EXECUTABLE ${INKSCAPE_EXECUTABLE} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# Find tools for CHM generation if needed
|
||||
if(BUILD_DOC_CHM AND WIN32)
|
||||
# Find HTML Help Compiler
|
||||
find_program(HHC_EXECUTABLE NAMES hhc HHC)
|
||||
if(NOT HHC_EXECUTABLE)
|
||||
message(WARNING "HTML Help Compiler not found. CHM documentation will not be generated.")
|
||||
set(BUILD_DOC_CHM FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
set(HHC_EXECUTABLE ${HHC_EXECUTABLE} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
set(GRAPHVIZ_DOT_EXECUTABLE ${GRAPHVIZ_DOT_EXECUTABLE} PARENT_SCOPE)
|
||||
set(MATHJAX_PATH ${MATHJAX_PATH} PARENT_SCOPE)
|
||||
set(OCCT_DOC_TOOLS_AVAILABLE TRUE PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to process LaTeX files for PDF generation
|
||||
function(OCCT_DOC_PROCESS_LATEX OUTPUT_DIR)
|
||||
# Skip if PDF generation is not enabled or pdflatex not found
|
||||
if(NOT BUILD_DOC_PDF OR NOT PDFLATEX_EXECUTABLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(STATUS "Processing LaTeX files for PDF generation...")
|
||||
|
||||
# Process SVG images if Inkscape is available
|
||||
if(INKSCAPE_EXECUTABLE)
|
||||
file(GLOB SVG_FILES "${OUTPUT_DIR}/latex/*.svg")
|
||||
foreach(SVG_FILE ${SVG_FILES})
|
||||
get_filename_component(FILE_NAME ${SVG_FILE} NAME_WE)
|
||||
set(PNG_FILE "${OUTPUT_DIR}/latex/${FILE_NAME}.png")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${INKSCAPE_EXECUTABLE} -z -e ${PNG_FILE} ${SVG_FILE}
|
||||
RESULT_VARIABLE INKSCAPE_RESULT
|
||||
)
|
||||
|
||||
if(NOT INKSCAPE_RESULT EQUAL 0)
|
||||
message(WARNING "Failed to convert ${SVG_FILE} to PNG")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Generate PDF from LaTeX
|
||||
execute_process(
|
||||
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
|
||||
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
|
||||
RESULT_VARIABLE LATEX_RESULT
|
||||
OUTPUT_VARIABLE LATEX_OUTPUT
|
||||
ERROR_VARIABLE LATEX_ERROR
|
||||
)
|
||||
|
||||
if(NOT LATEX_RESULT EQUAL 0)
|
||||
message(WARNING "Error generating PDF: ${LATEX_ERROR}")
|
||||
else()
|
||||
# Run pdflatex again for references
|
||||
execute_process(
|
||||
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
|
||||
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
|
||||
)
|
||||
|
||||
message(STATUS "PDF documentation generated at ${OUTPUT_DIR}/latex/refman.pdf")
|
||||
|
||||
# Copy the PDF to a more accessible location
|
||||
file(COPY "${OUTPUT_DIR}/latex/refman.pdf" DESTINATION "${OUTPUT_DIR}")
|
||||
file(RENAME "${OUTPUT_DIR}/refman.pdf" "${OUTPUT_DIR}/${DOC_OUTPUT_NAME}.pdf")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Main function to set up documentation targets
|
||||
function(OCCT_SETUP_DOC_TARGETS)
|
||||
# Check if required tools are available
|
||||
OCCT_DOC_CHECK_TOOLS()
|
||||
if(NOT OCCT_DOC_TOOLS_AVAILABLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Load lists of documentation files
|
||||
OCCT_DOC_LOAD_FILE_LISTS()
|
||||
|
||||
# Collect module information
|
||||
OCCT_DOC_COLLECT_MODULES_INFO()
|
||||
|
||||
# Extract toolkit dependencies
|
||||
OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES()
|
||||
|
||||
# Create documentation output directories
|
||||
set(DOC_ROOT_DIR "${CMAKE_BINARY_DIR}/doc")
|
||||
file(MAKE_DIRECTORY ${DOC_ROOT_DIR})
|
||||
|
||||
# Setup Reference Manual target
|
||||
if(BUILD_DOC_RefMan)
|
||||
# Create output directories
|
||||
set(REFMAN_OUTPUT_DIR "${DOC_ROOT_DIR}/refman")
|
||||
file(MAKE_DIRECTORY ${REFMAN_OUTPUT_DIR})
|
||||
file(MAKE_DIRECTORY "${REFMAN_OUTPUT_DIR}/html")
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file(COPY "${OCCT_ROOT_DIR}/dox/resources/index.html" DESTINATION "${REFMAN_OUTPUT_DIR}")
|
||||
|
||||
# Generate main page for reference manual
|
||||
OCCT_DOC_GENERATE_MAIN_PAGE(${REFMAN_OUTPUT_DIR} "main_page.dox")
|
||||
|
||||
# Configure Doxygen
|
||||
set(DOC_TYPE "REFMAN")
|
||||
OCCT_DOC_CONFIGURE_DOXYGEN(${REFMAN_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
|
||||
|
||||
# Add custom target for reference manual
|
||||
add_custom_target(RefMan
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${REFMAN_OUTPUT_DIR}/Doxyfile
|
||||
COMMENT "Generating Reference Manual with Doxygen"
|
||||
WORKING_DIRECTORY ${OCCT_ROOT_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Add custom command to install generated documentation if required
|
||||
if(INSTALL_DOC_RefMan)
|
||||
install(DIRECTORY "${REFMAN_OUTPUT_DIR}/html/"
|
||||
DESTINATION "${INSTALL_DIR_DOC}/refman/html"
|
||||
OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Setup Overview documentation target (after RefMan so it can use the RefMan tag file)
|
||||
if(BUILD_DOC_Overview)
|
||||
# Create output directories
|
||||
set(OVERVIEW_OUTPUT_DIR "${DOC_ROOT_DIR}/overview")
|
||||
file(MAKE_DIRECTORY ${OVERVIEW_OUTPUT_DIR})
|
||||
file(MAKE_DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html")
|
||||
|
||||
# Configure Doxygen for Overview
|
||||
set(DOC_TYPE "OVERVIEW")
|
||||
OCCT_DOC_CONFIGURE_DOXYGEN(${OVERVIEW_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
|
||||
|
||||
# Add custom target for overview documentation
|
||||
add_custom_target(Overview
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${OVERVIEW_OUTPUT_DIR}/Doxyfile
|
||||
COMMENT "Generating Overview documentation with Doxygen"
|
||||
WORKING_DIRECTORY ${OCCT_ROOT_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file(COPY "${OCCT_ROOT_DIR}/dox/resources/index.html" DESTINATION "${OVERVIEW_OUTPUT_DIR}")
|
||||
|
||||
# Add custom command to copy generated documentation to install location if required
|
||||
if(INSTALL_DOC_Overview)
|
||||
install(DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html/"
|
||||
DESTINATION "${INSTALL_DIR_DOC}/overview/html"
|
||||
OPTIONAL)
|
||||
|
||||
# Create overview.html only for windows
|
||||
if(WIN32)
|
||||
install(FILES "${OCCT_ROOT_DIR}/dox/resources/overview.html"
|
||||
DESTINATION "${INSTALL_DIR_DOC}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Combined documentation target
|
||||
if(BUILD_DOC_Overview AND BUILD_DOC_RefMan)
|
||||
add_custom_target(doc ALL
|
||||
DEPENDS RefMan Overview
|
||||
COMMENT "Generating all documentation"
|
||||
)
|
||||
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
|
||||
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
||||
add_dependencies(Overview RefMan) # Ensure Overview uses RefMan tag file
|
||||
elseif(BUILD_DOC_Overview)
|
||||
add_custom_target(doc ALL
|
||||
DEPENDS Overview
|
||||
COMMENT "Generating Overview documentation"
|
||||
)
|
||||
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
|
||||
elseif(BUILD_DOC_RefMan)
|
||||
add_custom_target(doc ALL
|
||||
DEPENDS RefMan
|
||||
COMMENT "Generating Reference Manual"
|
||||
)
|
||||
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
||||
endif()
|
||||
set_property (TARGET doc PROPERTY FOLDER "Documentation")
|
||||
endfunction()
|
@@ -1,245 +0,0 @@
|
||||
# Google Test integration for OCCT toolkits
|
||||
|
||||
set (TEST_PROJECT_NAME OpenCascadeGTest)
|
||||
|
||||
# Initialize Google Test environment and create the target
|
||||
function(OCCT_INIT_GTEST)
|
||||
if (NOT GOOGLETEST_FOUND)
|
||||
message(STATUS "Google Test not available. Skipping test project ${TEST_PROJECT_NAME}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Initialize test data collections
|
||||
set(OCCT_GTEST_SOURCE_FILES "" PARENT_SCOPE)
|
||||
set(OCCT_GTEST_SOURCE_FILES_ABS "" PARENT_SCOPE)
|
||||
set(OCCT_GTEST_TESTS_LIST "" PARENT_SCOPE)
|
||||
|
||||
# Create the test executable once
|
||||
add_executable(${TEST_PROJECT_NAME})
|
||||
|
||||
set_target_properties(${TEST_PROJECT_NAME} PROPERTIES FOLDER "Testing")
|
||||
|
||||
# Link with Google Test
|
||||
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE GTest::gtest_main)
|
||||
|
||||
# Add pthreads if necessary (for Linux)
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE pthread)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(${TEST_PROJECT_NAME} PRIVATE GTEST_LINKED_AS_SHARED_LIBRARY=1)
|
||||
|
||||
# Link with all active toolkits that are libraries
|
||||
foreach(TOOLKIT ${BUILD_TOOLKITS})
|
||||
if(TARGET ${TOOLKIT})
|
||||
get_target_property(TOOLKIT_TYPE ${TOOLKIT} TYPE)
|
||||
if(TOOLKIT_TYPE STREQUAL "SHARED_LIBRARY" OR TOOLKIT_TYPE STREQUAL "STATIC_LIBRARY")
|
||||
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE ${TOOLKIT})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (INSTALL_GTEST)
|
||||
# Install the test executable
|
||||
install (TARGETS ${TEST_PROJECT_NAME}
|
||||
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${TEST_PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Add tests from a specific toolkit to the main test executable
|
||||
function(OCCT_COLLECT_TOOLKIT_TESTS TOOLKIT_NAME)
|
||||
# Skip if Google Test is not available or the test executable wasn't created
|
||||
if (NOT GOOGLETEST_FOUND OR NOT TARGET ${TEST_PROJECT_NAME})
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Extract test source files from FILES.cmake
|
||||
set(FILES_CMAKE_PATH "${OCCT_${TOOLKIT_NAME}_FILES_LOCATION}/GTests/FILES.cmake")
|
||||
if(EXISTS "${FILES_CMAKE_PATH}")
|
||||
# Reset toolkit test files list
|
||||
set(OCCT_${TOOLKIT_NAME}_GTests_FILES)
|
||||
|
||||
# Include the toolkit's FILES.cmake which sets OCCT_${TOOLKIT_NAME}_GTests_FILES
|
||||
include("${FILES_CMAKE_PATH}")
|
||||
set(TEST_SOURCE_FILES "${OCCT_${TOOLKIT_NAME}_GTests_FILES}")
|
||||
|
||||
# Skip if no test files found
|
||||
if(NOT TEST_SOURCE_FILES)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Get module name for test organization
|
||||
get_target_property(TOOLKIT_MODULE ${TOOLKIT_NAME} MODULE)
|
||||
if(NOT TOOLKIT_MODULE)
|
||||
set(TOOLKIT_MODULE "Unknown")
|
||||
endif()
|
||||
|
||||
# Get absolute paths of test source files and add them to the executable
|
||||
set(TEST_SOURCE_FILES_ABS)
|
||||
foreach(TEST_SOURCE_FILE ${TEST_SOURCE_FILES})
|
||||
set(TEST_SOURCE_FILE_ABS "${OCCT_${TOOLKIT_NAME}_GTests_FILES_LOCATION}/${TEST_SOURCE_FILE}")
|
||||
list(APPEND TEST_SOURCE_FILES_ABS "${TEST_SOURCE_FILE_ABS}")
|
||||
endforeach()
|
||||
|
||||
# Add test sources to the executable
|
||||
target_sources(${TEST_PROJECT_NAME} PRIVATE ${TEST_SOURCE_FILES_ABS})
|
||||
|
||||
# Create a more reliable test discovery approach
|
||||
# Use the WORKING_DIRECTORY parameter to ensure proper test execution context
|
||||
gtest_add_tests(
|
||||
TARGET ${TEST_PROJECT_NAME}
|
||||
TEST_PREFIX "${TOOLKIT_MODULE}::${TOOLKIT_NAME}::"
|
||||
SOURCES ${TEST_SOURCE_FILES_ABS}
|
||||
TEST_LIST TOOLKIT_TESTS
|
||||
SKIP_DEPENDENCY
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
|
||||
# Configure test output properties to improve result capture
|
||||
foreach(test_name ${TOOLKIT_TESTS})
|
||||
set_tests_properties(${test_name} PROPERTIES
|
||||
# Use proper result detection by checking output and return code
|
||||
PASS_REGULAR_EXPRESSION "\\[ PASSED \\]"
|
||||
FAIL_REGULAR_EXPRESSION "\\[ FAILED \\]"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Add these tests to the main list so we can set environment for all tests later
|
||||
# Get the existing list first
|
||||
if(DEFINED OCCT_GTEST_TESTS_LIST)
|
||||
set(TEMP_GTEST_TESTS_LIST ${OCCT_GTEST_TESTS_LIST})
|
||||
else()
|
||||
set(TEMP_GTEST_TESTS_LIST "")
|
||||
endif()
|
||||
|
||||
# Append the new tests
|
||||
list(APPEND TEMP_GTEST_TESTS_LIST ${TOOLKIT_TESTS})
|
||||
|
||||
# Update the parent scope variable
|
||||
set(OCCT_GTEST_TESTS_LIST "${TEMP_GTEST_TESTS_LIST}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Set environment variables for all collected tests
|
||||
function(OCCT_SET_GTEST_ENVIRONMENT)
|
||||
if (NOT GOOGLETEST_FOUND OR NOT TARGET ${TEST_PROJECT_NAME})
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (OCCT_GTEST_TESTS_LIST)
|
||||
# Set common environment variables
|
||||
set(TEST_ENVIRONMENT
|
||||
"CSF_LANGUAGE=us"
|
||||
"MMGT_CLEAR=1"
|
||||
"CSF_SHMessage=${OCCT_ROOT_DIR}/resources/SHMessage"
|
||||
"CSF_MDTVTexturesDirectory=${OCCT_ROOT_DIR}/resources/Textures"
|
||||
"CSF_ShadersDirectory=${OCCT_ROOT_DIR}/resources/Shaders"
|
||||
"CSF_XSMessage=${OCCT_ROOT_DIR}/resources/XSMessage"
|
||||
"CSF_TObjMessage=${OCCT_ROOT_DIR}/resources/TObj"
|
||||
"CSF_StandardDefaults=${OCCT_ROOT_DIR}/resources/StdResource"
|
||||
"CSF_PluginDefaults=${OCCT_ROOT_DIR}/resources/StdResource"
|
||||
"CSF_XCAFDefaults=${OCCT_ROOT_DIR}/resources/StdResource"
|
||||
"CSF_TObjDefaults=${OCCT_ROOT_DIR}/resources/StdResource"
|
||||
"CSF_StandardLiteDefaults=${OCCT_ROOT_DIR}/resources/StdResource"
|
||||
"CSF_IGESDefaults=${OCCT_ROOT_DIR}/resources/XSTEPResource"
|
||||
"CSF_STEPDefaults=${OCCT_ROOT_DIR}/resources/XSTEPResource"
|
||||
"CSF_XmlOcafResource=${OCCT_ROOT_DIR}/resources/XmlOcafResource"
|
||||
"CSF_MIGRATION_TYPES=${OCCT_ROOT_DIR}/resources/StdResource/MigrationSheet.txt"
|
||||
"CSF_OCCTResourcePath=${OCCT_ROOT_DIR}/resources"
|
||||
"CSF_OCCTDataPath=${OCCT_ROOT_DIR}/data"
|
||||
"CSF_OCCTDocPath=${OCCT_ROOT_DIR}/doc"
|
||||
"CSF_OCCTSamplesPath=${OCCT_ROOT_DIR}/samples"
|
||||
"CSF_OCCTTestsPath=${OCCT_ROOT_DIR}/tests"
|
||||
"CSF_OCCTBinPath=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
||||
"CSF_OCCTLibPath=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}"
|
||||
"CSF_OCCTIncludePath=${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}"
|
||||
"CASROOT=${OCCT_ROOT_DIR}"
|
||||
)
|
||||
|
||||
# Build PATH environment variable
|
||||
set(PATH_ELEMENTS
|
||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
||||
)
|
||||
|
||||
# Add 3rdparty paths to PATH
|
||||
if(3RDPARTY_TCL_LIBRARY_DIR)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_TCL_LIBRARY_DIR}")
|
||||
endif()
|
||||
if(3RDPARTY_TK_LIBRARY_DIR)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_TK_LIBRARY_DIR}")
|
||||
endif()
|
||||
if(3RDPARTY_FREETYPE_LIBRARY_DIR)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
|
||||
endif()
|
||||
if(3RDPARTY_FREEIMAGE_LIBRARY_DIRS)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_FREEIMAGE_LIBRARY_DIRS}")
|
||||
endif()
|
||||
if(3RDPARTY_TBB_LIBRARY_DIR)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_TBB_LIBRARY_DIR}")
|
||||
endif()
|
||||
if(3RDPARTY_VTK_LIBRARY_DIR)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_VTK_LIBRARY_DIR}")
|
||||
endif()
|
||||
if(3RDPARTY_FFMPEG_LIBRARY_DIR)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
|
||||
endif()
|
||||
if(3RDPARTY_QT_DIR)
|
||||
list(APPEND PATH_ELEMENTS "${3RDPARTY_QT_DIR}/bin")
|
||||
endif()
|
||||
if (3RDPARTY_DLL_DIRS)
|
||||
foreach(DLL_DIR ${3RDPARTY_DLL_DIRS})
|
||||
list(APPEND PATH_ELEMENTS "${DLL_DIR}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Create the PATH variable that ctest will use
|
||||
if(WIN32)
|
||||
string(REPLACE ";" "\\;" TEST_PATH_ENV "$ENV{PATH}")
|
||||
string(REPLACE ";" "\\;" PATH_ELEMENTS_STR "${PATH_ELEMENTS}")
|
||||
list(APPEND TEST_ENVIRONMENT "PATH=${PATH_ELEMENTS_STR}\\;${TEST_PATH_ENV}")
|
||||
else()
|
||||
string(REPLACE ";" ":" PATH_ELEMENTS_STR "${PATH_ELEMENTS}")
|
||||
list(APPEND TEST_ENVIRONMENT "PATH=${PATH_ELEMENTS_STR}:$ENV{PATH}")
|
||||
|
||||
# Set LD_LIBRARY_PATH for Unix systems
|
||||
list(APPEND TEST_ENVIRONMENT "LD_LIBRARY_PATH=${PATH_ELEMENTS_STR}:$ENV{LD_LIBRARY_PATH}")
|
||||
|
||||
# Set DYLD_LIBRARY_PATH for macOS
|
||||
if(APPLE)
|
||||
list(APPEND TEST_ENVIRONMENT "DYLD_LIBRARY_PATH=${PATH_ELEMENTS_STR}:$ENV{DYLD_LIBRARY_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add DrawResources related environment if it exists
|
||||
if(EXISTS "${OCCT_ROOT_DIR}/resources/DrawResources")
|
||||
list(APPEND TEST_ENVIRONMENT "DRAWHOME=${OCCT_ROOT_DIR}/resources/DrawResources")
|
||||
list(APPEND TEST_ENVIRONMENT "CSF_DrawPluginDefaults=${OCCT_ROOT_DIR}/resources/DrawResources")
|
||||
|
||||
if(EXISTS "${OCCT_ROOT_DIR}/resources/DrawResources/DrawDefault")
|
||||
list(APPEND TEST_ENVIRONMENT "DRAWDEFAULT=${OCCT_ROOT_DIR}/resources/DrawResources/DrawDefault")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set FPE signal handler if enabled
|
||||
if(BUILD_ENABLE_FPE_SIGNAL_HANDLER)
|
||||
list(APPEND TEST_ENVIRONMENT "CSF_FPE=1")
|
||||
endif()
|
||||
|
||||
# Set TCL/TK library paths if they differ
|
||||
if(3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TK_LIBRARY_DIR AND NOT 3RDPARTY_TCL_LIBRARY_DIR STREQUAL 3RDPARTY_TK_LIBRARY_DIR)
|
||||
if(3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT)
|
||||
list(APPEND TEST_ENVIRONMENT "TCL_LIBRARY=${3RDPARTY_TCL_LIBRARY_DIR}/../lib/tcl${3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT}")
|
||||
endif()
|
||||
if(3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT)
|
||||
list(APPEND TEST_ENVIRONMENT "TK_LIBRARY=${3RDPARTY_TK_LIBRARY_DIR}/../lib/tk${3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set environment for all tests in the project
|
||||
set_tests_properties(${OCCT_GTEST_TESTS_LIST} PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT}")
|
||||
endif()
|
||||
endfunction()
|
@@ -3,9 +3,9 @@
|
||||
if(OCCT_MACROS_ALREADY_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(OCCT_MACROS_ALREADY_INCLUDED 1)
|
||||
|
||||
|
||||
macro (OCCT_CHECK_AND_UNSET VARNAME)
|
||||
if (DEFINED ${VARNAME})
|
||||
unset (${VARNAME} CACHE)
|
||||
@@ -34,16 +34,20 @@ endmacro()
|
||||
|
||||
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
|
||||
set (LOCAL_FILE_CONTENT)
|
||||
if (EXISTS "${OCCT_ROOT_DIR}/${FILE_NAME}")
|
||||
file (STRINGS "${OCCT_ROOT_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
|
||||
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
|
||||
endif()
|
||||
|
||||
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(FIND_FOLDER_OR_FILE FILE_OR_FOLDER_NAME RESULT_PATH)
|
||||
if (EXISTS "${OCCT_ROOT_DIR}/${FILE_OR_FOLDER_NAME}")
|
||||
set (${RESULT_PATH} "${OCCT_ROOT_DIR}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}")
|
||||
set (${RESULT_PATH} "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
|
||||
set (${RESULT_PATH} "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
|
||||
else()
|
||||
set (${RESULT_PATH} "" PARENT_SCOPE)
|
||||
endif()
|
||||
@@ -71,45 +75,37 @@ endmacro()
|
||||
# COMPILER variable
|
||||
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
||||
if (MSVC)
|
||||
if (MSVC_VERSION LESS 1914)
|
||||
message (FATAL_ERROR "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
|
||||
endif()
|
||||
if ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
|
||||
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
|
||||
set (COMPILER vc7)
|
||||
elseif (MSVC_VERSION EQUAL 1400)
|
||||
set (COMPILER vc8)
|
||||
elseif (MSVC_VERSION EQUAL 1500)
|
||||
set (COMPILER vc9)
|
||||
elseif (MSVC_VERSION EQUAL 1600)
|
||||
set (COMPILER vc10)
|
||||
elseif (MSVC_VERSION EQUAL 1700)
|
||||
set (COMPILER vc11)
|
||||
elseif (MSVC_VERSION EQUAL 1800)
|
||||
set (COMPILER vc12)
|
||||
elseif (MSVC_VERSION EQUAL 1900)
|
||||
set (COMPILER vc14)
|
||||
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
|
||||
# Since Visual Studio 15 (2017), its version diverged from version of
|
||||
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
|
||||
# we keep its id as "vc14" to be compatible
|
||||
# we keep its id as "vc14" to be compatibille
|
||||
set (COMPILER vc14)
|
||||
else()
|
||||
message (FATAL_ERROR "Unrecognized MSVC_VERSION")
|
||||
endif()
|
||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
||||
message (FATAL_ERROR "GCC version 8.0 or newer is required for C++17 support")
|
||||
endif()
|
||||
set (COMPILER gcc)
|
||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
||||
message (FATAL_ERROR "GCC version 8.0 or newer is required for C++17 support")
|
||||
endif()
|
||||
set (COMPILER gxx)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
|
||||
if(APPLE)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
|
||||
message (FATAL_ERROR "Apple Clang version 11.0.0 or newer is required for C++17 support")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
|
||||
message (FATAL_ERROR "Clang version 7.0 or newer is required for C++17 support")
|
||||
endif()
|
||||
endif()
|
||||
set (COMPILER clang)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.1.1)
|
||||
message (FATAL_ERROR "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
|
||||
endif()
|
||||
set (COMPILER icc)
|
||||
else()
|
||||
message (AUTHOR_WARNING "Unknown compiler - please verify C++17 support")
|
||||
set (COMPILER ${CMAKE_GENERATOR})
|
||||
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
|
||||
endif()
|
||||
@@ -156,8 +152,25 @@ function (FIND_SUBDIRECTORY ROOT_DIRECTORY DIRECTORY_SUFFIX SUBDIRECTORY_NAME)
|
||||
endfunction()
|
||||
|
||||
function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
|
||||
file (GLOB ORIGIN_FILES "${OCCT_ROOT_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
|
||||
set (${RESULT} ${ORIGIN_FILES} PARENT_SCOPE)
|
||||
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
|
||||
file (GLOB FOUND_FILES "${BUILD_PATCH}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
|
||||
endif()
|
||||
|
||||
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
|
||||
foreach (ORIGIN_FILE ${ORIGIN_FILES})
|
||||
# check for existence of patched version of current file
|
||||
if (NOT BUILD_PATCH OR NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
|
||||
list (APPEND FOUND_FILES ${ORIGIN_FILE})
|
||||
else()
|
||||
get_filename_component (ORIGIN_FILE_NAME "${ORIGIN_FILE}" NAME)
|
||||
if (NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
|
||||
list (APPEND FOUND_FILES ${ORIGIN_FILE})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function (FILLUP_PRODUCT_SEARCH_TEMPLATE PRODUCT_NAME COMPILER COMPILER_BITNESS SEARCH_TEMPLATES)
|
||||
@@ -213,31 +226,60 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
|
||||
endfunction()
|
||||
|
||||
macro (OCCT_INSTALL_FILE_OR_DIR BEING_INSTALLED_OBJECT DESTINATION_PATH)
|
||||
if (IS_DIRECTORY "${OCCT_ROOT_DIR}/${BEING_INSTALLED_OBJECT}")
|
||||
install (DIRECTORY "${OCCT_ROOT_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
|
||||
if (IS_DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
|
||||
# first of all, install original files
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
|
||||
# secondly, rewrite original files with patched ones
|
||||
install (DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
else()
|
||||
install (FILES "${OCCT_ROOT_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
install (FILES "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
endif()
|
||||
else()
|
||||
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
|
||||
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
else()
|
||||
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME DESTINATION_PATH)
|
||||
configure_file("${OCCT_ROOT_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
|
||||
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
|
||||
else()
|
||||
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
|
||||
endif()
|
||||
|
||||
install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
|
||||
endmacro()
|
||||
|
||||
function (EXTRACT_TOOLKIT_PACKAGES RELATIVE_PATH OCCT_TOOLKIT RESULT_PACKAGES)
|
||||
set (${RESULT_PACKAGES} ${OCCT_${OCCT_TOOLKIT}_LIST_OF_PACKAGES} PARENT_SCOPE)
|
||||
set (OCCT_TOOLKIT_PACKAGES "")
|
||||
get_property(OCCT_TOOLKIT_PACKAGES GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_PACKAGES)
|
||||
if (OCCT_TOOLKIT_PACKAGES)
|
||||
set (${RESULT_PACKAGES} ${OCCT_TOOLKIT_PACKAGES} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
FILE_TO_LIST ("${RELATIVE_PATH}/${OCCT_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
|
||||
set (${RESULT_PACKAGES} ${OCCT_TOOLKIT_PACKAGES} PARENT_SCOPE)
|
||||
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_PACKAGES "${OCCT_TOOLKIT_PACKAGES}")
|
||||
endfunction()
|
||||
|
||||
function(EXTRACT_TOOLKIT_EXTERNLIB RELATIVE_PATH OCCT_TOOLKIT RESULT_LIBS)
|
||||
set (${RESULT_LIBS} ${OCCT_${OCCT_TOOLKIT}_EXTERNAL_LIBS} PARENT_SCOPE)
|
||||
set (OCCT_TOOLKIT_LIBS "")
|
||||
get_property(OCCT_TOOLKIT_LIBS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_LIBS)
|
||||
if (OCCT_TOOLKIT_LIBS)
|
||||
set (${RESULT_LIBS} ${OCCT_TOOLKIT_LIBS} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
FILE_TO_LIST ("${RELATIVE_PATH}/${OCCT_TOOLKIT}/EXTERNLIB" OCCT_TOOLKIT_LIBS)
|
||||
set (${RESULT_LIBS} ${OCCT_TOOLKIT_LIBS} PARENT_SCOPE)
|
||||
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_LIBS "${OCCT_TOOLKIT_LIBS}")
|
||||
endfunction()
|
||||
|
||||
function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_INCLUDE_FOLDER)
|
||||
|
||||
# Package name can be relative path, need to get only the name of the final element
|
||||
get_filename_component (OCCT_PACKAGE ${OCCT_PACKAGE} NAME)
|
||||
|
||||
# package name is not unique, it can be reuse in tools and src,
|
||||
# use extra parameter as relative path to distinguish between them
|
||||
set (OCCT_PACKAGE_FILES "")
|
||||
@@ -249,20 +291,32 @@ function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_I
|
||||
return()
|
||||
endif()
|
||||
|
||||
set (OCCT_PACKAGE_INCLUDE_DIR "${OCCT_${OCCT_PACKAGE}_FILES_LOCATION}")
|
||||
set (OCCT_PACKAGE_FILES "${OCCT_${OCCT_PACKAGE}_FILES}")
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
|
||||
file (STRINGS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
|
||||
set (OCCT_PACKAGE_INCLUDE_DIR "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
|
||||
set (OCCT_PACKAGE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
|
||||
endif()
|
||||
|
||||
# collect and search for the files in the package directory or patched one
|
||||
# FILE only contains filename that must to be inside package or patched directory
|
||||
# collect and searach for the files in the package directory or patached one
|
||||
# FILE contains inly filename that must to be inside package or patched directory
|
||||
set (FILE_PATH_LIST)
|
||||
|
||||
foreach (OCCT_FILE ${OCCT_PACKAGE_FILES})
|
||||
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE "${OCCT_FILE}")
|
||||
list (APPEND FILE_PATH_LIST "${OCCT_PACKAGE_INCLUDE_DIR}/${OCCT_FILE}")
|
||||
FIND_FOLDER_OR_FILE ("${RELATIVE_PATH}/${OCCT_PACKAGE}/${OCCT_FILE}" CUSTOM_FILE_PATH)
|
||||
if (CUSTOM_FILE_PATH)
|
||||
list (APPEND FILE_PATH_LIST "${CUSTOM_FILE_PATH}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (NOT FILE_PATH_LIST)
|
||||
message (WARNING "FILES has not been found in ${OCCT_PACKAGE_INCLUDE_DIR} for package ${OCCT_PACKAGE}")
|
||||
if(BUILD_PATH)
|
||||
message (WARNING "FILES has not been found in ${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
|
||||
else()
|
||||
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (${RESULT_FILES} ${FILE_PATH_LIST} PARENT_SCOPE)
|
||||
@@ -271,11 +325,7 @@ function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_I
|
||||
set_property(GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_INCLUDE_DIR "${OCCT_PACKAGE_INCLUDE_DIR}")
|
||||
endfunction()
|
||||
|
||||
# SOLUTION_TYPE: MODULES, TOOLS, SAMPLES
|
||||
# OCCT_TOOLKIT: TK*
|
||||
# RESULT_TKS_AS_DEPS: TK* dependencies
|
||||
# RESULT_INCLUDE_FOLDERS: include folders
|
||||
function(EXCTRACT_TOOLKIT_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
|
||||
function(EXCTRACT_TOOLKIT_DEPS RELATIVE_PATH OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
|
||||
set (OCCT_TOOLKIT_DEPS "")
|
||||
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
|
||||
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS)
|
||||
@@ -286,7 +336,7 @@ function(EXCTRACT_TOOLKIT_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RES
|
||||
return()
|
||||
endif()
|
||||
set (EXTERNAL_LIBS)
|
||||
EXTRACT_TOOLKIT_EXTERNLIB (${SOLUTION_TYPE} ${OCCT_TOOLKIT} EXTERNAL_LIBS)
|
||||
EXTRACT_TOOLKIT_EXTERNLIB (${RELATIVE_PATH} ${OCCT_TOOLKIT} EXTERNAL_LIBS)
|
||||
foreach (EXTERNAL_LIB ${EXTERNAL_LIBS})
|
||||
string (REGEX MATCH "^TK" TK_FOUND ${EXTERNAL_LIB})
|
||||
if (TK_FOUND)
|
||||
@@ -295,9 +345,9 @@ function(EXCTRACT_TOOLKIT_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RES
|
||||
endforeach()
|
||||
|
||||
set (OCCT_TOOLKIT_PACKAGES)
|
||||
EXTRACT_TOOLKIT_PACKAGES (${SOLUTION_TYPE} ${OCCT_TOOLKIT} OCCT_TOOLKIT_PACKAGES)
|
||||
EXTRACT_TOOLKIT_PACKAGES (${RELATIVE_PATH} ${OCCT_TOOLKIT} OCCT_TOOLKIT_PACKAGES)
|
||||
foreach(OCCT_PACKAGE ${OCCT_TOOLKIT_PACKAGES})
|
||||
EXTRACT_PACKAGE_FILES (${SOLUTION_TYPE} ${OCCT_PACKAGE} OCCT_PACKAGE_FILES OCCT_PACKAGE_INCLUDE_DIR)
|
||||
EXTRACT_PACKAGE_FILES (${RELATIVE_PATH} ${OCCT_PACKAGE} OCCT_PACKAGE_FILES OCCT_PACKAGE_INCLUDE_DIR)
|
||||
list (APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_PACKAGE_INCLUDE_DIR})
|
||||
endforeach()
|
||||
|
||||
@@ -307,11 +357,7 @@ function(EXCTRACT_TOOLKIT_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RES
|
||||
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_INCLUDE_FOLDERS "${OCCT_TOOLKIT_INCLUDE_FOLDERS}")
|
||||
endfunction()
|
||||
|
||||
# SOLUTION_TYPE: MODULES, TOOLS, SAMPLES
|
||||
# OCCT_TOOLKIT: TK*
|
||||
# RESULT_TKS_AS_DEPS: list of TK* dependencies
|
||||
# RESULT_INCLUDE_FOLDERS: list of include folders
|
||||
function(EXCTRACT_TOOLKIT_FULL_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
|
||||
function(EXCTRACT_TOOLKIT_FULL_DEPS RELATIVE_PATH OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
|
||||
set (OCCT_TOOLKIT_DEPS "")
|
||||
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
|
||||
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS)
|
||||
@@ -322,12 +368,12 @@ function(EXCTRACT_TOOLKIT_FULL_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEP
|
||||
return()
|
||||
endif()
|
||||
|
||||
EXCTRACT_TOOLKIT_DEPS(${SOLUTION_TYPE} ${OCCT_TOOLKIT} OCCT_TOOLKIT_DEPS OCCT_TOOLKIT_INCLUDE_DIR)
|
||||
EXCTRACT_TOOLKIT_DEPS(${RELATIVE_PATH} ${OCCT_TOOLKIT} OCCT_TOOLKIT_DEPS OCCT_TOOLKIT_INCLUDE_DIR)
|
||||
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${OCCT_TOOLKIT_DEPS})
|
||||
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_TOOLKIT_INCLUDE_DIR})
|
||||
|
||||
foreach(DEP ${OCCT_TOOLKIT_DEPS})
|
||||
EXCTRACT_TOOLKIT_FULL_DEPS(${SOLUTION_TYPE} ${DEP} DEP_TOOLKIT_DEPS DEP_INCLUDE_DIRS)
|
||||
EXCTRACT_TOOLKIT_FULL_DEPS(${RELATIVE_PATH} ${DEP} DEP_TOOLKIT_DEPS DEP_INCLUDE_DIRS)
|
||||
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${DEP_TOOLKIT_DEPS})
|
||||
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${DEP_INCLUDE_DIRS})
|
||||
endforeach()
|
||||
@@ -343,8 +389,10 @@ endfunction()
|
||||
|
||||
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
|
||||
set (LOCAL_FILE_CONTENT)
|
||||
if (EXISTS "${OCCT_ROOT_DIR}/${FILE_NAME}")
|
||||
file (STRINGS "${OCCT_ROOT_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
|
||||
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
|
||||
endif()
|
||||
|
||||
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
|
||||
@@ -354,7 +402,10 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
|
||||
set (OCCT_USED_PACKAGES)
|
||||
|
||||
# consider patched header.in template
|
||||
set (TEMPLATE_HEADER_PATH "${OCCT_ROOT_DIR}/adm/templates/header.in")
|
||||
set (TEMPLATE_HEADER_PATH "${CMAKE_SOURCE_DIR}/adm/templates/header.in")
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/header.in")
|
||||
set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in")
|
||||
endif()
|
||||
|
||||
set (OCCT_HEADER_FILES_COMPLETE)
|
||||
foreach(OCCT_TOOLKIT ${THE_OCCT_BUILD_TOOLKITS})
|
||||
@@ -363,14 +414,9 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
|
||||
foreach(OCCT_PACKAGE ${USED_PACKAGES})
|
||||
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_PACKAGE} ALL_FILES _)
|
||||
set (HEADER_FILES_FILTERING ${ALL_FILES})
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx)")
|
||||
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
|
||||
endforeach()
|
||||
# parse root of the toolkit file
|
||||
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_TOOLKIT} ALL_FILES _)
|
||||
set (HEADER_FILES_FILTERING ${ALL_FILES})
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
|
||||
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
|
||||
endforeach()
|
||||
|
||||
# Check that copying is done and match the include installation type.
|
||||
@@ -408,49 +454,46 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
|
||||
endforeach()
|
||||
|
||||
set (OCCT_HEADER_FILES_INSTALLATION ${OCCT_HEADER_FILES_COMPLETE})
|
||||
list (FILTER OCCT_HEADER_FILES_INSTALLATION INCLUDE REGEX ".*[.](h|hxx|lxx)$")
|
||||
list (FILTER OCCT_HEADER_FILES_INSTALLATION INCLUDE REGEX ".*[.](h|lxx)")
|
||||
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()
|
||||
endif()
|
||||
|
||||
# Angular bracket syntax is achieved using $<ANGLE-R> for closing bracket
|
||||
if (${THE_IS_PRIVATE})
|
||||
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:<${PRECOMPILED_HEADER}$<ANGLE-R>>")
|
||||
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
|
||||
else()
|
||||
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:<${PRECOMPILED_HEADER}$<ANGLE-R>>")
|
||||
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
|
||||
# first of all, copy original files
|
||||
if (EXISTS "${OCCT_ROOT_DIR}/${BEING_COPIED_OBJECT}")
|
||||
file (COPY "${OCCT_ROOT_DIR}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}")
|
||||
file (COPY "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
endif()
|
||||
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_COPIED_OBJECT}")
|
||||
# secondly, rewrite original files with patched ones
|
||||
file (COPY "${BUILD_PATCH}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_CONFIGURE BEING_CONGIRUGED_FILE FINAL_NAME)
|
||||
configure_file("${OCCT_ROOT_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
|
||||
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
|
||||
else()
|
||||
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_ADD_SUBDIRECTORY BEING_ADDED_DIRECTORY)
|
||||
if (EXISTS "${OCCT_ROOT_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
|
||||
add_subdirectory (${OCCT_ROOT_DIR}/${BEING_ADDED_DIRECTORY})
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
|
||||
add_subdirectory(${BUILD_PATCH}/${BEING_ADDED_DIRECTORY})
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
|
||||
add_subdirectory (${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY})
|
||||
else()
|
||||
message (STATUS "${BEING_ADDED_DIRECTORY} directory is not included")
|
||||
endif()
|
||||
@@ -507,80 +550,42 @@ function (OCCT_MODULES_AND_TOOLKITS FILE_NAME TOOLKITS_NAME_SUFFIX MODULE_LIST)
|
||||
set (${MODULE_LIST} ${${MODULE_LIST}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
# 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 ${OCCT_ROOT_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 ${OCCT_ROOT_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
|
||||
# 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)
|
||||
|
||||
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 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()
|
||||
endif()
|
||||
|
||||
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 (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()
|
||||
|
||||
set (SET_OCC_VERSION_DEVELOPMENT "")
|
||||
if (${OCCT_ON_DEVELOPMENT})
|
||||
# Use special flag from cache to turn on or off git hash extraction
|
||||
if (NOT DEFINED USE_GIT_HASH)
|
||||
set (USE_GIT_HASH ON CACHE BOOL "Use git hash in version string")
|
||||
endif()
|
||||
if (${USE_GIT_HASH})
|
||||
OCCT_GET_GIT_HASH()
|
||||
endif()
|
||||
if (NOT "${GIT_HASH}" STREQUAL "")
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}-${GIT_HASH}")
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
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_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}")
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}" 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}\"")
|
||||
set (SET_OCC_VERSION_DEVELOPMENT "${SET_OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET(USE_GIT_HASH)
|
||||
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)
|
||||
@@ -630,7 +635,7 @@ macro (FLEX_AND_BISON_TARGET_APPLY THE_PACKAGE_NAME RELATIVE_SOURCES_DIR)
|
||||
continue()
|
||||
endif()
|
||||
# Note: files are generated in original source directory (not in patch!)
|
||||
set (FLEX_BISON_TARGET_DIR "${OCCT_ROOT_DIR}/${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}")
|
||||
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}")
|
||||
# choose appropriate extension for generated files: "cxx" if source file contains
|
||||
# instruction to generate C++ code, "c" otherwise
|
||||
set (BISON_OUTPUT_FILE_EXT "c")
|
||||
@@ -664,7 +669,7 @@ macro (FLEX_AND_BISON_TARGET_APPLY THE_PACKAGE_NAME RELATIVE_SOURCES_DIR)
|
||||
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
|
||||
endif()
|
||||
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
|
||||
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${OCCT_ROOT_DIR}/${RELATIVE_SOURCES_DIR}/=")
|
||||
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
|
||||
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
|
||||
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
|
||||
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
|
||||
@@ -684,7 +689,7 @@ macro (OCCT_UPDATE_TARGET_FILE)
|
||||
|
||||
install (CODE
|
||||
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
|
||||
file (GLOB ALL_OCCT_TARGET_FILES \"\$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
|
||||
file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
|
||||
foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
|
||||
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
|
||||
file (REMOVE \"\${TARGET_FILENAME}\")
|
||||
@@ -696,9 +701,6 @@ macro (OCCT_UPDATE_TARGET_FILE)
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_INSERT_CODE_FOR_TARGET)
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
install(CODE "set (OCCT_INSTALL_BIN_LETTER \"\")")
|
||||
else()
|
||||
install(CODE "if (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$\")
|
||||
set (OCCT_INSTALL_BIN_LETTER \"\")
|
||||
elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Rr][Ee][Ll][Ww][Ii][Tt][Hh][Dd][Ee][Bb][Ii][Nn][Ff][Oo])$\")
|
||||
@@ -706,7 +708,6 @@ macro (OCCT_INSERT_CODE_FOR_TARGET)
|
||||
elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\")
|
||||
set (OCCT_INSTALL_BIN_LETTER \"d\")
|
||||
endif()")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_UPDATE_DRAW_DEFAULT_FILE)
|
||||
@@ -832,12 +833,12 @@ function (PROCESS_CSF_LIBRARIES CURRENT_CSF LIST_NAME TARGET_NAME)
|
||||
|
||||
foreach (RELEASE_DIR ${FOUND_RELEASE_DIRS})
|
||||
get_filename_component(RELEASE_DIR_ABS "${RELEASE_DIR}" ABSOLUTE)
|
||||
target_link_directories(${TARGET_NAME} PRIVATE "$<$<CONFIG:RELEASE>:${RELEASE_DIR_ABS}>;$<$<CONFIG:RELWITHDEBINFO>:${RELEASE_DIR_ABS}>")
|
||||
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_DIR_ABS}>;$<$<CONFIG:RELWITHDEBINFO>:${RELEASE_DIR_ABS}>")
|
||||
endforeach()
|
||||
|
||||
foreach (DEBUG_DIR ${FOUND_DEBUG_DIRS})
|
||||
get_filename_component(DEBUG_DIR_ABS "${DEBUG_DIR}" ABSOLUTE)
|
||||
target_link_directories(${TARGET_NAME} PRIVATE "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
|
||||
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
|
||||
endforeach()
|
||||
endfunction()
|
||||
macro(OCCT_ADD_VCPKG_FEATURE THE_FEATURE)
|
||||
|
@@ -3,8 +3,8 @@
|
||||
macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
|
||||
set (RESOURCE_FILES)
|
||||
set (isResDirectory FALSE)
|
||||
if (IS_DIRECTORY "${OCCT_ROOT_DIR}/resources/${CurrentResource}")
|
||||
file (STRINGS "${OCCT_ROOT_DIR}/resources/${CurrentResource}/FILES" RESOURCE_FILES)
|
||||
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/src/${CurrentResource}")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource}/FILES" RESOURCE_FILES)
|
||||
set (CurrentResource_Directory "${CurrentResource}")
|
||||
set (isResDirectory TRUE)
|
||||
else()
|
||||
@@ -27,23 +27,37 @@ macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
|
||||
string (REPLACE "." "_" CurrentResource_FileName "${CurrentResource_FileName}")
|
||||
set (HEADER_FILE_NAME "${CurrentResource_Directory}_${CurrentResource_FileName}.pxx")
|
||||
|
||||
message(STATUS "Info. Generating header file from resource file: ${OCCT_ROOT_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}")
|
||||
set (toProcessResFile TRUE)
|
||||
if (isResDirectory)
|
||||
list (FIND RESOURCE_FILES "${HEADER_FILE_NAME}" aResIndex)
|
||||
if ("${aResIndex}" STREQUAL "-1")
|
||||
set (toProcessResFile FALSE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (toProcessResFile)
|
||||
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}")
|
||||
|
||||
# generate content for header file
|
||||
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file resources/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
|
||||
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
|
||||
|
||||
# read resource file
|
||||
file (STRINGS "${OCCT_ROOT_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
|
||||
|
||||
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
|
||||
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
|
||||
string (REPLACE "\"" "\\\"" line "${line}")
|
||||
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
|
||||
endforeach()
|
||||
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};\n\n")
|
||||
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};")
|
||||
|
||||
# Save generated content to header file
|
||||
set (HEADER_FILE "${OCCT_${CurrentResource_Directory}_FILES_LOCATION}/${HEADER_FILE_NAME}")
|
||||
set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")
|
||||
if (EXISTS "${HEADER_FILE}")
|
||||
file (REMOVE "${HEADER_FILE}")
|
||||
endif()
|
||||
configure_file ("${OCCT_ROOT_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
|
||||
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
@@ -64,12 +64,12 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
||||
set (HEADER_FILES_FILTERING ${ALL_FILES})
|
||||
set (SOURCE_FILES_FILTERING ${ALL_FILES})
|
||||
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|p|g|lxx|hxx|pxx|hpp|gxx)$")
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|p|g|lxx)")
|
||||
|
||||
if(APPLE)
|
||||
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cxx|cpp|mm)$")
|
||||
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|mm)")
|
||||
else()
|
||||
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cpp|cxx)$")
|
||||
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c)")
|
||||
endif()
|
||||
|
||||
list (APPEND HEADER_FILES ${HEADER_FILES_FILTERING})
|
||||
@@ -96,7 +96,12 @@ string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
|
||||
set (USED_RCFILE "")
|
||||
if (MSVC)
|
||||
set (USED_RCFILE "${CMAKE_BINARY_DIR}/resources/${PROJECT_NAME}.rc")
|
||||
configure_file("${OCCT_ROOT_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
|
||||
|
||||
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in")
|
||||
configure_file("${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
|
||||
else()
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (CURRENT_MODULE)
|
||||
@@ -120,13 +125,8 @@ endif (USE_QT)
|
||||
if (EXECUTABLE_PROJECT)
|
||||
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
|
||||
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
DESTINATION "$<IF:$<CONFIG:Debug>,debug/${INSTALL_DIR_BIN},${INSTALL_DIR_BIN}>")
|
||||
else()
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||
@@ -134,7 +134,7 @@ if (EXECUTABLE_PROJECT)
|
||||
else()
|
||||
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
if (MSVC)
|
||||
if (BUILD_FORCE_RelWithDebInfo)
|
||||
set (aReleasePdbConf "Release")
|
||||
else()
|
||||
@@ -156,21 +156,12 @@ else()
|
||||
set (CMAKE_SHARED_LIBRARY_SUFFIX "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
if (LAYOUT_IS_VCPKG)
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
|
||||
RUNTIME DESTINATION "$<IF:$<CONFIG:Debug>,debug/${INSTALL_DIR_BIN},${INSTALL_DIR_BIN}>"
|
||||
ARCHIVE DESTINATION "$<IF:$<CONFIG:Debug>,debug/${INSTALL_DIR_LIB},${INSTALL_DIR_LIB}>"
|
||||
LIBRARY DESTINATION "$<IF:$<CONFIG:Debug>,debug/${INSTALL_DIR_LIB},${INSTALL_DIR_LIB}>"
|
||||
INCLUDES DESTINATION ${INSTALL_DIR_INCLUDE})
|
||||
else()
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
|
||||
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
|
||||
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
|
||||
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
|
||||
INCLUDES DESTINATION ${INSTALL_DIR_INCLUDE})
|
||||
endif()
|
||||
|
||||
if (NOT WIN32)
|
||||
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
|
||||
@@ -203,7 +194,6 @@ elseif (BUILD_SOVERSION_NUMBERS GREATER 1)
|
||||
elseif (BUILD_SOVERSION_NUMBERS GREATER 0)
|
||||
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}")
|
||||
endif()
|
||||
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
|
||||
SOVERSION "${OCC_SOVERSION}"
|
||||
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
|
||||
@@ -291,18 +281,19 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
|
||||
if(IS_VTK_9XX)
|
||||
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
|
||||
endif()
|
||||
|
||||
target_link_libraries (${PROJECT_NAME} PUBLIC ${USED_TOOLKITS_BY_CURRENT_PROJECT} PRIVATE ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
endif()
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
|
||||
if (USE_QT)
|
||||
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
|
||||
target_link_libraries (${PROJECT_NAME} PRIVATE debug ${PROJECT_LIBRARY_DEBUG})
|
||||
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
|
||||
endforeach()
|
||||
foreach (PROJECT_LIBRARY_RELEASE ${PROJECT_LIBRARIES_RELEASE})
|
||||
target_link_libraries (${PROJECT_NAME} PRIVATE optimized ${PROJECT_LIBRARY_RELEASE})
|
||||
target_link_libraries (${PROJECT_NAME} optimized ${PROJECT_LIBRARY_RELEASE})
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
18
adm/cmake/occt_toolkit_prepare_sample.cmake
Normal file
18
adm/cmake/occt_toolkit_prepare_sample.cmake
Normal file
@@ -0,0 +1,18 @@
|
||||
if ("${TARGET_FOLDER}" STREQUAL "")
|
||||
set (EXECUTABLE_PROJECT ON)
|
||||
set (USE_QT ON)
|
||||
|
||||
set (RELATIVE_DIR "samples/qt")
|
||||
set (MODULES_LIST ${OCCT_SAMPLES})
|
||||
set (TARGET_FOLDER "Samples")
|
||||
set (TOOLKITS_NAME_SUFFIX "SAMPLES_TOOLKITS")
|
||||
|
||||
include_directories("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/${RELATIVE_DIR}")
|
||||
else()
|
||||
unset (USE_QT)
|
||||
unset (RELATIVE_DIR)
|
||||
unset (EXECUTABLE_PROJECT)
|
||||
unset (MODULES_LIST)
|
||||
unset (TARGET_FOLDER)
|
||||
unset (TOOLKITS_NAME_SUFFIX)
|
||||
endif("${TARGET_FOLDER}" STREQUAL "")
|
13
adm/cmake/occt_toolkit_prepare_tool.cmake
Normal file
13
adm/cmake/occt_toolkit_prepare_tool.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
if ("${TARGET_FOLDER}" STREQUAL "")
|
||||
set (USE_QT ON)
|
||||
set (RELATIVE_DIR "tools")
|
||||
set (MODULES_LIST ${OCCT_TOOLS})
|
||||
set (TARGET_FOLDER "Tools")
|
||||
set (TOOLKITS_NAME_SUFFIX "TOOL_TOOLKITS")
|
||||
else()
|
||||
unset (USE_QT)
|
||||
unset (RELATIVE_DIR)
|
||||
unset (MODULES_LIST)
|
||||
unset (TARGET_FOLDER)
|
||||
unset (TOOLKITS_NAME_SUFFIX)
|
||||
endif("${TARGET_FOLDER}" STREQUAL "")
|
@@ -3,20 +3,21 @@
|
||||
# Qt is searched manually first (just determine root)
|
||||
message (STATUS "Processing Qt 3-rd party")
|
||||
|
||||
set (USE_QT_FROM_3RDPARTY_DIR TRUE)
|
||||
if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
|
||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
|
||||
|
||||
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
|
||||
set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt")
|
||||
set (USE_QT_FROM_3RDPARTY_DIR FALSE)
|
||||
else()
|
||||
# Combine directory name with absolute path and show in GUI
|
||||
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
|
||||
endif()
|
||||
message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR")
|
||||
endif()
|
||||
|
||||
if (${USE_QT_FROM_3RDPARTY_DIR})
|
||||
# Combine directory name with absolute path and show in GUI
|
||||
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
|
||||
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
|
||||
endif()
|
||||
|
||||
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
|
||||
|
||||
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
|
||||
# Without this setting find_package() will not work
|
||||
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
|
||||
@@ -24,33 +25,16 @@ if (${USE_QT_FROM_3RDPARTY_DIR})
|
||||
# Now we can apply standard CMake finder for Qt5. We do this mostly
|
||||
# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
|
||||
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml)
|
||||
endif()
|
||||
if (NOT ${Qt5_FOUND})
|
||||
# Now we can apply standard CMake finder for Qt. We do this mostly
|
||||
# to have qt4_wrap_cpp() function available
|
||||
find_package(Qt4)
|
||||
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR} AND WIN32)
|
||||
# Qt5_DIR typically points to lib/cmake/Qt5, need to go up to Qt root
|
||||
get_filename_component(QT_CMAKE_DIR "${Qt5_DIR}" DIRECTORY)
|
||||
get_filename_component(QT_LIB_DIR "${QT_CMAKE_DIR}" DIRECTORY)
|
||||
get_filename_component(QT_ROOT_DIR "${QT_LIB_DIR}" DIRECTORY)
|
||||
|
||||
# Verify this is indeed the Qt root by checking for bin and packages directories
|
||||
if(EXISTS "${QT_ROOT_DIR}/bin")
|
||||
set(3RDPARTY_QT_DIR ${QT_ROOT_DIR} CACHE PATH "The directory containing Qt" FORCE)
|
||||
#message (STATUS "Qt4 cmake configuration")
|
||||
else()
|
||||
message(WARNING "Found Qt5 at ${Qt5_DIR} but could not determine Qt root directory with bin/ and plugins/ folders")
|
||||
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
|
||||
endif()
|
||||
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR})
|
||||
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
|
||||
#message (STATUS "Qt5 cmake configuration")
|
||||
endif()
|
||||
|
||||
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
|
||||
|
||||
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}/bin")
|
||||
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR)
|
||||
|
@@ -79,24 +79,8 @@ macro (FIND_AND_WRAP_TS_FILE RESOURCE_FILE_NAME TARGET_FOLDER QM_FILES)
|
||||
endmacro()
|
||||
|
||||
macro (FIND_AND_INSTALL_QT_RESOURCES OCCT_PACKAGE RESOURCE_FILES)
|
||||
# Package name is now the sample name (e.g., "Tutorial")
|
||||
set(PACKAGE_NAME ${OCCT_PACKAGE})
|
||||
|
||||
# Get files from CMAKE variables with proper location
|
||||
set(ALL_FILES ${OCCT_${PACKAGE_NAME}_FILES})
|
||||
set(FILES_LOCATION ${OCCT_${PACKAGE_NAME}_FILES_LOCATION})
|
||||
|
||||
# Filter for .ts and .qrc files with full paths
|
||||
set(TS_FILES)
|
||||
set(QRC_FILES)
|
||||
foreach(FILE ${ALL_FILES})
|
||||
if(FILE MATCHES ".+[.]ts$")
|
||||
list(APPEND TS_FILES "${FILES_LOCATION}/${FILE}")
|
||||
endif()
|
||||
if(FILE MATCHES ".+[.]qrc$")
|
||||
list(APPEND QRC_FILES "${FILES_LOCATION}/${FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" TS_FILES REGEX ".+[.]ts")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" QRC_FILES REGEX ".+[.]qrc")
|
||||
|
||||
string (FIND "${OCCT_PACKAGE}" "/" _index)
|
||||
if (_index GREATER -1)
|
||||
@@ -108,17 +92,19 @@ macro (FIND_AND_INSTALL_QT_RESOURCES OCCT_PACKAGE RESOURCE_FILES)
|
||||
|
||||
#message("QRC files are: ${QRC_FILES} in ${OCCT_PACKAGE}")
|
||||
foreach (QRC_FILE ${QRC_FILES})
|
||||
if (EXISTS ${QRC_FILE})
|
||||
FIND_AND_WRAP_RESOURCE_FILE(${QRC_FILE} RCC_FILES)
|
||||
set (QRC_FILE_RELATIVE "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${QRC_FILE}")
|
||||
if (EXISTS ${QRC_FILE_RELATIVE})
|
||||
FIND_AND_WRAP_RESOURCE_FILE(${QRC_FILE_RELATIVE} RCC_FILES)
|
||||
list (APPEND ${RESOURCE_FILES} "${RCC_FILES}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
#message("TS files are: ${TS_FILES} in ${OCCT_PACKAGE}")
|
||||
foreach (TS_FILE ${TS_FILES})
|
||||
FIND_AND_WRAP_TS_FILE(${TS_FILE} "${TARGET_FOLDER}/${CURRENT_MODULE}" QM_FILES)
|
||||
if (EXISTS ${TS_FILE})
|
||||
list (APPEND ${RESOURCE_FILES} "${TS_FILE}")
|
||||
set (TS_FILE_RELATIVE "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${TS_FILE}")
|
||||
FIND_AND_WRAP_TS_FILE(${TS_FILE_RELATIVE} "${TARGET_FOLDER}/${CURRENT_MODULE}" QM_FILES)
|
||||
if (EXISTS ${TS_FILE_RELATIVE})
|
||||
list (APPEND ${RESOURCE_FILES} "${TS_FILE_RELATIVE}")
|
||||
list (APPEND ${RESOURCE_FILES} "${QM_FILES}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
@@ -90,5 +90,5 @@ else()
|
||||
set (3RDPARTY_RAPIDJSON_INCLUDE_DIR "" CACHE PATH "the path to RapidJSON header file" FORCE)
|
||||
endif()
|
||||
|
||||
# hide all redundant variables
|
||||
mark_as_advanced(RapidJSON_DIR)
|
||||
# unset all redundant variables
|
||||
OCCT_CHECK_AND_UNSET(RapidJSON_DIR)
|
||||
|
@@ -71,12 +71,7 @@ if (WIN32)
|
||||
|
||||
# Get installed configuration of tbb
|
||||
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
|
||||
# Prioritize RELEASE configuration if available
|
||||
if (";${TARGET_TBB_IMPORT_CONFS};" MATCHES ";RELEASE;")
|
||||
set (CHOSEN_IMPORT_CONF "RELEASE")
|
||||
else()
|
||||
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
||||
endif()
|
||||
|
||||
separate_arguments (CSF_TBB)
|
||||
foreach (LIB IN LISTS CSF_TBB)
|
||||
@@ -209,12 +204,7 @@ else ()
|
||||
|
||||
# Get installed configuration of tbb
|
||||
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
|
||||
# Prioritize RELEASE configuration if available
|
||||
if (";${TARGET_TBB_IMPORT_CONFS};" MATCHES ";RELEASE;")
|
||||
set (CHOSEN_IMPORT_CONF "RELEASE")
|
||||
else()
|
||||
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
||||
endif()
|
||||
|
||||
separate_arguments (CSF_TBB)
|
||||
foreach (LIB IN LISTS CSF_TBB)
|
||||
|
@@ -17,7 +17,6 @@ endif()
|
||||
if (BUILD_USE_VCPKG)
|
||||
set (3RDPARTY_TCL_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcl" FORCE)
|
||||
set (3RDPARTY_TCL_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tcl" FORCE)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" CACHE FILEPATH "The directory containing tcl library" FORCE)
|
||||
endif()
|
||||
|
||||
# tcl library file (with absolute path)
|
||||
@@ -183,7 +182,7 @@ endif()
|
||||
|
||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
|
||||
elseif(NOT BUILD_USE_VCPKG)
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
endif()
|
||||
|
||||
@@ -274,12 +273,13 @@ if (TK_FOUND AND 3RDPARTY_TCL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# hide all redundant variables
|
||||
# unset all redundant variables
|
||||
#TCL
|
||||
mark_as_advanced (TCL_LIBRARY)
|
||||
mark_as_advanced (TCL_INCLUDE_PATH)
|
||||
mark_as_advanced (TCL_TCLSH)
|
||||
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
|
||||
#TK
|
||||
mark_as_advanced (TK_LIBRARY)
|
||||
mark_as_advanced (TK_INCLUDE_PATH)
|
||||
mark_as_advanced (TK_WISH)
|
||||
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TK_WISH)
|
||||
|
||||
|
@@ -18,11 +18,11 @@ if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
|
||||
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
|
||||
endif()
|
||||
|
||||
if (BUILD_USE_VCPKG)
|
||||
set (3RDPARTY_TK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tk" FORCE)
|
||||
set (3RDPARTY_TCLTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcltk" FORCE)
|
||||
set (3RDPARTY_TK_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tk" FORCE)
|
||||
endif()
|
||||
# if (BUILD_USE_VCPKG)
|
||||
# set (3RDPARTY_TK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tk" FORCE)
|
||||
# set (3RDPARTY_TCLTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcltk" FORCE)
|
||||
# set (3RDPARTY_TK_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tk" FORCE)
|
||||
# endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
# tk library file (with absolute path)
|
||||
@@ -274,15 +274,15 @@ if (BUILD_SHARED_LIBS)
|
||||
mark_as_advanced (3RDPARTY_TK_LIBRARY 3RDPARTY_TK_DLL)
|
||||
endif()
|
||||
|
||||
# hide all redundant variables
|
||||
|
||||
mark_as_advanced (TCL_LIBRARY)
|
||||
mark_as_advanced (TCL_INCLUDE_PATH)
|
||||
mark_as_advanced (TCL_TCLSH)
|
||||
# unset all redundant variables
|
||||
#TCL
|
||||
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
|
||||
#TK
|
||||
mark_as_advanced (TK_LIBRARY)
|
||||
mark_as_advanced (TK_INCLUDE_PATH)
|
||||
mark_as_advanced (TK_WISH)
|
||||
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TK_WISH)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
OCCT_CHECK_AND_UNSET (3RDPARTY_TK_LIBRARY)
|
||||
|
@@ -1,8 +1,12 @@
|
||||
# variable description
|
||||
|
||||
set (OCCT_PROJECT_NAME_DESCR
|
||||
"Project name used in install directory paths for Unix and vcpkg layouts.
|
||||
Allows customization of directory structure for different package names.")
|
||||
#
|
||||
set (BUILD_PATCH_DESCR
|
||||
"Points to the directory recognized as a 'patch' for OCCT. If specified,
|
||||
the files from this directory take precedence over the corresponding native
|
||||
OCCT sources. This way you are able to introduce patches to Open CASCADE
|
||||
Technology not affecting the original source distribution")
|
||||
|
||||
|
||||
set (BUILD_LIBRARY_TYPE_DESCR
|
||||
"Specifies the type of library to be created. 'Shared' libraries
|
||||
@@ -60,7 +64,7 @@ set (INSTALL_DIR_WITH_VERSION_DESCR
|
||||
|
||||
set (INSTALL_DIR_LAYOUT_DESCR
|
||||
"Defines structure of OCCT files (binaries, resources, headers etc.) for the install directory.
|
||||
Three variants are predefined: for Windows (standard OCCT layout), for Unix operating systems (standard Linux layout), and for vcpkg (standard vcpkg layout without 'd' and 'i' suffixes).
|
||||
Two variants are predefined: for Windows (standard OCCT layout) and for Unix operating systems (standard Linux layout).
|
||||
If needed, layout can be customized with INSTALL_DIR_* variables.")
|
||||
|
||||
set (INSTALL_DIR_BIN_DESCR
|
||||
@@ -117,6 +121,7 @@ endmacro()
|
||||
|
||||
BUILD_MODULE_MESSAGE (BUILD_MODULE_ApplicationFramework "ApplicationFramework")
|
||||
BUILD_MODULE_MESSAGE (BUILD_MODULE_DataExchange "DataExchange")
|
||||
BUILD_MODULE_MESSAGE (BUILD_MODULE_DETools "DETools")
|
||||
BUILD_MODULE_MESSAGE (BUILD_MODULE_Draw "Draw")
|
||||
BUILD_MODULE_MESSAGE (BUILD_MODULE_FoundationClasses "FoundationClasses")
|
||||
BUILD_MODULE_MESSAGE (BUILD_MODULE_ModelingAlgorithms "ModelingAlgorithms")
|
||||
@@ -140,6 +145,13 @@ set (BUILD_SAMPLES_QT_DESCR
|
||||
These samples show some possibilities of using OCCT and they can be executed
|
||||
with script samples.bat from the installation directory (INSTALL_DIR)")
|
||||
|
||||
set (BUILD_Inspector_DESCR
|
||||
"Indicates whether OCCT inspector should be built together with OCCT.
|
||||
This inspector provides functionality to interactively inspect low-level content
|
||||
of the OCAF data model, OCCT viewer, etc. have been introduced in OCCT.
|
||||
It can be executed with script inspector.bat from the installation directory (INSTALL_DIR) or
|
||||
using 'tinspector' command in DRAW interpretator")
|
||||
|
||||
set (BUILD_MODULE_UwpSample_DESCR
|
||||
"Indicates whether OCCT UWP sample should be built together with OCCT.")
|
||||
|
||||
@@ -203,30 +215,7 @@ set (USE_XLIB_DESCR "Indicates whether X11 is used or not")
|
||||
|
||||
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
|
||||
|
||||
# Documentation variables
|
||||
set (BUILD_DOC_Overview_DESCR
|
||||
"Build OCCT overview documentation using Doxygen")
|
||||
|
||||
set (BUILD_DOC_RefMan_DESCR
|
||||
"Build OCCT reference manual documentation using Doxygen")
|
||||
|
||||
set (INSTALL_DOC_Overview_DESCR
|
||||
"Install OCCT overview documentation")
|
||||
|
||||
set (INSTALL_DOC_RefMan_DESCR
|
||||
"Install OCCT reference manual documentation")
|
||||
|
||||
macro (BUILD_MODULE MODULE_NAME)
|
||||
set (ENABLE_MODULE TRUE)
|
||||
set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
|
||||
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/TOOLKITS)
|
||||
set (${MODULE_NAME}_TOOLKITS ${OCCT_${MODULE_NAME}_LIST_OF_TOOLKITS})
|
||||
foreach (TOOLKIT ${OCCT_${MODULE_NAME}_LIST_OF_TOOLKITS})
|
||||
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/PACKAGES)
|
||||
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/EXTERNLIB)
|
||||
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/FILES)
|
||||
foreach (PACKAGE ${OCCT_${TOOLKIT}_LIST_OF_PACKAGES})
|
||||
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/${PACKAGE}/FILES)
|
||||
endforeach()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
@@ -1,22 +0,0 @@
|
||||
#======================================================================
|
||||
#
|
||||
# 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 8 )
|
||||
set (OCC_VERSION_MINOR 0 )
|
||||
set (OCC_VERSION_MAINTENANCE 0 )
|
||||
set (OCC_VERSION_DEVELOPMENT "rc1" )
|
@@ -2,20 +2,8 @@
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package(VTK REQUIRED
|
||||
COMPONENTS
|
||||
CommonCore
|
||||
RenderingUI
|
||||
RenderingOpenGL2
|
||||
OPTIONAL_COMPONENTS
|
||||
mpi
|
||||
utf8
|
||||
eigen
|
||||
doubleconversion
|
||||
lz4
|
||||
lzma
|
||||
expat
|
||||
)
|
||||
find_package(VTK REQUIRED)
|
||||
set(CSF_VTK VTK::CommonCore)
|
||||
set(IS_VTK_9XX 1)
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_VTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
|
||||
@@ -38,7 +26,7 @@ endif()
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
# specify VTK folder in connection with 3RDPARTY_DIR
|
||||
# specify VTK folder in connectin with 3RDPARTY_DIR
|
||||
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
|
||||
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_VTK_DIR PATH "The directory containing VTK")
|
||||
|
||||
@@ -86,20 +74,7 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
||||
set (ENV{VTK_DIR} "${3RDPARTY_VTK_DIR}")
|
||||
endif()
|
||||
|
||||
find_package(VTK QUIET
|
||||
COMPONENTS
|
||||
CommonCore
|
||||
RenderingUI
|
||||
RenderingOpenGL2
|
||||
OPTIONAL_COMPONENTS
|
||||
mpi
|
||||
utf8
|
||||
eigen
|
||||
doubleconversion
|
||||
lz4
|
||||
lzma
|
||||
expat
|
||||
)
|
||||
find_package(VTK QUIET)
|
||||
|
||||
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
|
||||
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
|
||||
@@ -341,7 +316,6 @@ if (NOT INSTALL_VTK)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# hide some variables
|
||||
mark_as_advanced (VTK_INCLUDE_DIRS)
|
||||
mark_as_advanced (VTK_LIBRARY_DIRS)
|
||||
mark_as_advanced (VTK_DIR)
|
||||
OCCT_CHECK_AND_UNSET (VTK_INCLUDE_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (VTK_LIBRARY_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (VTK_DIR)
|
||||
|
19
adm/gendoc
Normal file
19
adm/gendoc
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Helper script to run generation of OCCT documentation on Linux.
|
||||
# Running it requires that Tcl, Doxygen, and MikTex (for PDF generation) should be in the PATH
|
||||
|
||||
anArgs=$*
|
||||
anOldPath="$PATH"
|
||||
anOldLd="$LD_LIBRARY_PATH"
|
||||
anOldDyLd="$DYLD_LIBRARY_PATH"
|
||||
|
||||
# go to the script directory
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
if [ -e "${aScriptPath}/../env.sh" ]; then source "${aScriptPath}/../env.sh"; fi
|
||||
|
||||
tclsh "${aScriptPath}/start.tcl" gendoc $anArgs
|
||||
|
||||
export PATH="$anOldPath"
|
||||
export LD_LIBRARY_PATH="$anOldLd"
|
||||
export DYLD_LIBRARY_PATH="$anOldDyLd"
|
23
adm/gendoc.bat
Normal file
23
adm/gendoc.bat
Normal file
@@ -0,0 +1,23 @@
|
||||
@echo off
|
||||
|
||||
rem Helper script to run generation of OCCT documentation on Windows.
|
||||
rem Running it requires that Tcl, Doxygen, and MikTex (for PDF generation)
|
||||
rem should be in the PATH
|
||||
|
||||
SET "OLD_PATH=%PATH%"
|
||||
|
||||
if exist "%~dp0../env.bat" (
|
||||
call "%~dp0../env.bat"
|
||||
)
|
||||
|
||||
set "TCL_EXEC=tclsh.exe"
|
||||
|
||||
for %%X in (%TCL_EXEC%) do (set TCL_FOUND=%%~$PATH:X)
|
||||
|
||||
if defined TCL_FOUND (
|
||||
%TCL_EXEC% %~dp0start.tcl gendoc %*
|
||||
) else (
|
||||
echo "Error. %TCL_EXEC% is not found. Please update PATH variable"
|
||||
)
|
||||
|
||||
SET "PATH=%OLD_PATH%"
|
906
adm/gendoc.tcl
Normal file
906
adm/gendoc.tcl
Normal file
@@ -0,0 +1,906 @@
|
||||
# =======================================================================
|
||||
# Created on: 2014-03-21
|
||||
# Created by: OMY
|
||||
# Copyright (c) 1996-1999 Matra Datavision
|
||||
# Copyright (c) 1999-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.
|
||||
|
||||
# =======================================================================
|
||||
# This script defines command gendoc compiling OCCT documents
|
||||
# from *.md files to HTML pages
|
||||
# =======================================================================
|
||||
|
||||
# load auxiliary tools
|
||||
source [file join [file dirname [info script]] occaux.tcl]
|
||||
|
||||
# ======================================
|
||||
# Common functions
|
||||
# ======================================
|
||||
|
||||
# Prints help message
|
||||
proc OCCDoc_PrintHelpMessage {} {
|
||||
puts "\nUsage: gendoc \[-h\] {-refman|-overview} \[-html|-pdf|-chm\] \[-m=<list of modules>|-ug=<list of docs>\] \[-v\] \[-s=<search_mode>\] \[-mathjax=<path>\]"
|
||||
puts ""
|
||||
puts "Options are:"
|
||||
puts ""
|
||||
puts "choice of documentation to be generated:"
|
||||
puts " -overview : To generate Overview and User Guides"
|
||||
puts " (cannot be used with -refman)"
|
||||
puts " -refman : To generate class Reference Manual"
|
||||
puts " (cannot be used with -overview)"
|
||||
puts ""
|
||||
puts "choice of output format:"
|
||||
puts " -html : To generate HTML files"
|
||||
puts " (default, cannot be used with -pdf or -chm)"
|
||||
puts " -pdf : To generate PDF files"
|
||||
puts " (cannot be used with -refman, -html, or -chm)"
|
||||
puts " -chm : To generate CHM files"
|
||||
puts " (cannot be used with -html or -pdf)"
|
||||
puts ""
|
||||
puts "additional options:"
|
||||
puts " -m=<modules_list> : List of OCCT modules (separated with comma),"
|
||||
puts " for generation of Reference Manual"
|
||||
puts " -ug=<docs_list> : List of MarkDown documents (separated with comma),"
|
||||
puts " to use for generation of Overview / User Guides"
|
||||
puts " -mathjax=<path> : To use local or alternative copy of MathJax"
|
||||
puts " -s=<search_mode> : Specifies the Search mode of HTML documents"
|
||||
puts " Can be: none | local | server | external"
|
||||
puts " -h : Prints this help message"
|
||||
puts " -v : Enables more verbose output"
|
||||
}
|
||||
|
||||
# A command for User Documentation compilation
|
||||
proc gendoc {args} {
|
||||
|
||||
# Parameters
|
||||
set DOC_TYPE "REFMAN"
|
||||
set GEN_MODE "HTML_ONLY"
|
||||
set DOCFILES {}
|
||||
set MODULES {}
|
||||
set DOCLABEL ""
|
||||
set VERB_MODE "NO"
|
||||
set SEARCH_MODE "none"
|
||||
set MATHJAX_LOCATION "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1"
|
||||
set mathjax_js_name "MathJax.js"
|
||||
set DOCTYPE_COMBO_FLAG 0
|
||||
set GENMODE_COMBO_FLAG 0
|
||||
set GENERATE_PRODUCTS_REFMAN "NO"
|
||||
|
||||
global available_docfiles; # The full list of md files for HTML or CHM generation
|
||||
global available_pdf; # The full list of md files for PDF generation
|
||||
global tcl_platform
|
||||
global args_names
|
||||
global args_values
|
||||
global env
|
||||
|
||||
# Load list of docfiles
|
||||
if { [OCCDoc_LoadFilesList] != 0 } {
|
||||
puts "Error: File FILES_HTML.txt or FILES_PDF.txt was not found on this computer.\nAborting..."
|
||||
return -1
|
||||
}
|
||||
|
||||
# Parse CL arguments
|
||||
if {[OCCDoc_ParseArguments $args] == 1} {
|
||||
return -1
|
||||
}
|
||||
|
||||
# Print help message if no arguments provided
|
||||
if {[llength $args_names] == 0} {
|
||||
OCCDoc_PrintHelpMessage
|
||||
return 0
|
||||
}
|
||||
|
||||
foreach arg_n $args_names {
|
||||
if {$arg_n == "h"} {
|
||||
OCCDoc_PrintHelpMessage
|
||||
return 0
|
||||
} elseif {$arg_n == "html"} {
|
||||
if { ([ lsearch $args_names "refman" ] == -1) &&
|
||||
([ lsearch $args_names "overview" ] == -1) } {
|
||||
puts "Warning: Please specify -refman or -overview argument."
|
||||
return -1
|
||||
}
|
||||
if { [ lsearch $args_names "refman" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if { $GENMODE_COMBO_FLAG != 1 } {
|
||||
set GEN_MODE "HTML_ONLY"
|
||||
set GENMODE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -html, -pdf and -chm can not be combined."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "chm"} {
|
||||
if { ([ lsearch $args_names "refman" ] == -1) &&
|
||||
([ lsearch $args_names "overview" ] == -1) } {
|
||||
puts "Warning: Please specify -refman or -overview argument."
|
||||
return -1
|
||||
}
|
||||
if { [ lsearch $args_names "refman" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if { $GENMODE_COMBO_FLAG != 1 } {
|
||||
set GEN_MODE "CHM_ONLY"
|
||||
set GENMODE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -html, -pdf and -chm cannot be combined."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "pdf"} {
|
||||
if { ([ lsearch $args_names "refman" ] == -1) &&
|
||||
([ lsearch $args_names "overview" ] == -1) } {
|
||||
puts "Warning: Please specify -refman or -overview argument."
|
||||
return -1
|
||||
}
|
||||
if { [ lsearch $args_names "refman" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if { $GENMODE_COMBO_FLAG != 1 } {
|
||||
set GEN_MODE "PDF_ONLY"
|
||||
set GENMODE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -html, -pdf and -chm cannot be combined."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "overview"} {
|
||||
if { $DOCTYPE_COMBO_FLAG != 1 } {
|
||||
set DOC_TYPE "OVERVIEW"
|
||||
set DOCTYPE_COMBO_FLAG 1
|
||||
} else {
|
||||
puts "Error: Options -refman and -overview cannot be combined."
|
||||
return -1
|
||||
}
|
||||
|
||||
# Print ignored options
|
||||
if { [ lsearch $args_names "m" ] != -1 } {
|
||||
puts "\nInfo: The following options will be ignored: \n"
|
||||
puts " * -m"
|
||||
}
|
||||
puts ""
|
||||
} elseif {$arg_n == "refman"} {
|
||||
if { $DOCTYPE_COMBO_FLAG != 1 } {
|
||||
set DOC_TYPE "REFMAN"
|
||||
set DOCTYPE_COMBO_FLAG 1
|
||||
if { [file exists [OCCDoc_GetProdRootDir]/src/VAS/Products.tcl] } {
|
||||
set GENERATE_PRODUCTS_REFMAN "YES"
|
||||
}
|
||||
} else {
|
||||
puts "Error: Options -refman and -overview cannot be combined."
|
||||
return -1
|
||||
}
|
||||
# Print ignored options
|
||||
if { ([ lsearch $args_names "pdf" ] != -1) ||
|
||||
([ lsearch $args_names "chm" ] != -1) ||
|
||||
([ lsearch $args_names "ug" ] != -1) } {
|
||||
puts "\nInfo: The following options will be ignored: \n"
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts " * -pdf"
|
||||
}
|
||||
if { [ lsearch $args_names "chm" ] != -1 } {
|
||||
puts " * -chm"
|
||||
}
|
||||
if { [ lsearch $args_names "ug" ] != -1 } {
|
||||
puts " * -ug"
|
||||
}
|
||||
puts ""
|
||||
}
|
||||
|
||||
} elseif {$arg_n == "v"} {
|
||||
set VERB_MODE "YES"
|
||||
} elseif {$arg_n == "ug"} {
|
||||
if { ([ lsearch $args_names "refman" ] != -1) } {
|
||||
continue
|
||||
}
|
||||
if {$args_values(ug) != "NULL"} {
|
||||
set DOCFILES $args_values(ug)
|
||||
} else {
|
||||
puts "Error in argument ug."
|
||||
return -1
|
||||
}
|
||||
# Check if all chosen docfiles are correct
|
||||
foreach docfile $DOCFILES {
|
||||
if { [ lsearch $args_names "pdf" ] == -1 } {
|
||||
# Check to generate HTMLs
|
||||
if { [lsearch $available_docfiles $docfile] == -1 } {
|
||||
puts "Error: File \"$docfile\" is not presented in the list of available docfiles."
|
||||
puts " Please specify the correct docfile name."
|
||||
return -1
|
||||
}
|
||||
} else {
|
||||
# Check to generate PDFs
|
||||
if { [lsearch $available_pdf $docfile] == -1 } {
|
||||
puts "Error: File \"$docfile\" is not presented in the list of generic PDFs."
|
||||
puts " Please specify the correct pdf name."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif {$arg_n == "m"} {
|
||||
if { [ lsearch $args_names "overview" ] != -1 } {
|
||||
continue
|
||||
}
|
||||
if {$args_values(m) != "NULL"} {
|
||||
set MODULES $args_values(m)
|
||||
} else {
|
||||
puts "Error in argument m."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "s"} {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts "Warning: search is not used with PDF and will be ignored."
|
||||
continue
|
||||
}
|
||||
|
||||
if {$args_values(s) != "NULL"} {
|
||||
set SEARCH_MODE $args_values(s)
|
||||
} else {
|
||||
puts "Error in argument s."
|
||||
return -1
|
||||
}
|
||||
} elseif {$arg_n == "mathjax"} {
|
||||
if { [ lsearch $args_names "pdf" ] != -1 } {
|
||||
puts "Warning: MathJax is not used with PDF and will be ignored."
|
||||
}
|
||||
|
||||
set possible_mathjax_loc $args_values(mathjax)
|
||||
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
|
||||
set MATHJAX_LOCATION $args_values(mathjax)
|
||||
puts "$MATHJAX_LOCATION"
|
||||
} else {
|
||||
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
|
||||
puts " MathJax will be used from $MATHJAX_LOCATION"
|
||||
}
|
||||
} else {
|
||||
puts "\nWrong argument: $arg_n"
|
||||
OCCDoc_PrintHelpMessage
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
# Check the existence of the necessary tools
|
||||
set DOXYGEN_PATH ""
|
||||
set GRAPHVIZ_PATH ""
|
||||
set INKSCAPE_PATH ""
|
||||
set PDFLATEX_PATH ""
|
||||
set HHC_PATH ""
|
||||
|
||||
OCCDoc_DetectNecessarySoftware $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH $PDFLATEX_PATH
|
||||
|
||||
if {$DOXYGEN_PATH == ""} {
|
||||
puts " Aborting..."
|
||||
return -1
|
||||
}
|
||||
|
||||
if {"$::tcl_platform(platform)" == "windows"} {
|
||||
if { ($GEN_MODE == "CHM_ONLY") && ($HHC_PATH == "") } {
|
||||
puts " Aborting..."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
if { ($PDFLATEX_PATH == "") && ($GEN_MODE == "PDF_ONLY") } {
|
||||
puts " Aborting..."
|
||||
return -1
|
||||
}
|
||||
|
||||
# If we do not specify list for docfiles with -m argument,
|
||||
# we assume that we have to generate all docfiles
|
||||
if { [llength $DOCFILES] == 0 } {
|
||||
if { $GEN_MODE != "PDF_ONLY" } {
|
||||
set DOCFILES $available_docfiles
|
||||
} else {
|
||||
set DOCFILES $available_pdf
|
||||
}
|
||||
}
|
||||
|
||||
puts ""
|
||||
|
||||
# Start main activities
|
||||
if { $GEN_MODE != "PDF_ONLY" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
} else {
|
||||
if { $DOC_TYPE == "REFMAN" } {
|
||||
if { $MODULES != "" } {
|
||||
foreach module $MODULES {
|
||||
OCCDoc_Main $DOC_TYPE $DOCFILES $module $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
} else {
|
||||
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
} else {
|
||||
foreach md $DOCFILES {
|
||||
OCCDoc_Main $DOC_TYPE $md $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
puts "Generating OCCT User Guides in PDF format..."
|
||||
foreach pdf $DOCFILES {
|
||||
|
||||
puts "\nInfo: Processing file $pdf"
|
||||
|
||||
# Some values are hardcoded because they are related only to PDF generation
|
||||
OCCDoc_Main "OVERVIEW" [list $pdf] {} "PDF_ONLY" $VERB_MODE "none" $MATHJAX_LOCATION "NO" $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
puts "\n[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
|
||||
}
|
||||
}
|
||||
|
||||
# Main procedure for documents compilation
|
||||
proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode searchMode mathjaxLocation generateProductsRefman DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH} {
|
||||
|
||||
global available_docfiles
|
||||
global available_pdf
|
||||
|
||||
set ROOTDIR [OCCDoc_GetRootDir [OCCDoc_GetProdRootDir]]
|
||||
set INDIR [OCCDoc_GetDoxDir]
|
||||
set OUTDIR $ROOTDIR/doc
|
||||
set PDFDIR $OUTDIR/pdf
|
||||
set UGDIR $PDFDIR/user_guides
|
||||
set DGDIR $PDFDIR/dev_guides
|
||||
set TAGFILEDIR $OUTDIR/refman
|
||||
set HTMLDIR $OUTDIR/overview/html
|
||||
set LATEXDIR $OUTDIR/overview/latex
|
||||
set DOXYFILE $OUTDIR/OCCT.cfg
|
||||
|
||||
# OUTDIR for products documentation should be separate directories for each components
|
||||
if { [OCCDoc_GetProdRootDir] != ""} {
|
||||
if { $docType == "REFMAN" } {
|
||||
if { "$modules" != "" } {
|
||||
source "[OCCDoc_GetSourceDir [OCCDoc_GetProdRootDir]]/VAS/${modules}.tcl"
|
||||
set doc_component_name [${modules}:documentation_name]
|
||||
set OUTDIR $OUTDIR/$doc_component_name
|
||||
}
|
||||
} else {
|
||||
if {[regexp {([^/]+)/([^/]+)/([^/]+)} $docfiles dump doc_type doc_component doc_name]} {
|
||||
set PDFNAME [file rootname $doc_name]
|
||||
set OUTDIR $OUTDIR/$doc_component
|
||||
} else {
|
||||
error "Could not parse input path to *.md file: \"${docfiles}\""
|
||||
}
|
||||
}
|
||||
set HTMLDIR $OUTDIR/html
|
||||
set LATEXDIR $OUTDIR/latex
|
||||
set DOXYFILE $OUTDIR/OCCT.cfg
|
||||
set TAGFILEDIR $OUTDIR/refman
|
||||
}
|
||||
|
||||
# Create or cleanup the output folders
|
||||
if { [string compare -nocase $generateProductsRefman "YES"] != 0 } {
|
||||
if { ![file exists $OUTDIR] } {
|
||||
file mkdir $OUTDIR
|
||||
}
|
||||
if { ![file exists $HTMLDIR] } {
|
||||
file mkdir $HTMLDIR
|
||||
}
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
if { ![file exists $PDFDIR] } {
|
||||
file mkdir $PDFDIR
|
||||
}
|
||||
if { ![file exists $UGDIR] } {
|
||||
file mkdir $UGDIR
|
||||
}
|
||||
if { ![file exists $DGDIR] } {
|
||||
file mkdir $DGDIR
|
||||
}
|
||||
}
|
||||
|
||||
if { $generatorMode == "PDF_ONLY" } {
|
||||
if { [file exists $LATEXDIR] } {
|
||||
file delete -force $LATEXDIR
|
||||
}
|
||||
file mkdir $LATEXDIR
|
||||
}
|
||||
}
|
||||
if { $docType == "REFMAN" } {
|
||||
if { ![file exists $TAGFILEDIR] } {
|
||||
file mkdir $TAGFILEDIR
|
||||
}
|
||||
}
|
||||
|
||||
# is MathJax HLink?
|
||||
set mathjax_relative_location $mathjaxLocation
|
||||
if { [file isdirectory "$mathjaxLocation"] } {
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
# related path
|
||||
set mathjax_relative_location [OCCDoc_GetRelPath $HTMLDIR $mathjaxLocation]
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
# absolute path
|
||||
set mathjax_relative_location [file normalize $mathjaxLocation]
|
||||
}
|
||||
}
|
||||
|
||||
if { $generateProductsRefman == "YES" } {
|
||||
set DOCDIR "$OUTDIR/refman"
|
||||
puts "\nGenerating OCC Products Reference Manual\n"
|
||||
} else {
|
||||
if { $docType == "REFMAN"} {
|
||||
set DOCDIR "$OUTDIR/refman"
|
||||
puts "\nGenerating Open CASCADE Reference Manual\n"
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
set DOCDIR "$OUTDIR/overview"
|
||||
} else {
|
||||
set DOCDIR "$OUTDIR"
|
||||
}
|
||||
set FORMAT ""
|
||||
if { ($generatorMode == "HTML_ONLY") || ($generatorMode == "CHM_ONLY") } {
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
set FORMAT " in HTML format..."
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
set FORMAT " in CHM format..."
|
||||
}
|
||||
puts "Generating OCCT User Guides$FORMAT\n"
|
||||
}
|
||||
} else {
|
||||
puts "Error: Invalid documentation type: $docType. Can not process."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
# Generate Doxyfile
|
||||
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating Doxyfile..."
|
||||
|
||||
if { [OCCDoc_MakeDoxyfile $docType $DOCDIR $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $modules $verboseMode $searchMode $HHC_PATH $mathjax_relative_location $GRAPHVIZ_PATH [OCCDoc_GetProdRootDir]] == -1 } {
|
||||
return -1
|
||||
}
|
||||
|
||||
# Run doxygen tool
|
||||
set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
|
||||
|
||||
if { ($generatorMode == "HTML_ONLY") || ($docType == "REFMAN") } {
|
||||
set LOGPREFIX "html_"
|
||||
puts "$starttimestamp Generating HTML files..."
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file copy -force $INDIR/resources/index.html $DOCDIR/index.html
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
set LOGPREFIX "chm_"
|
||||
puts "$starttimestamp Generating CHM file..."
|
||||
} elseif { $generatorMode == "PDF_ONLY" } {
|
||||
set LOGPREFIX "[file rootname [file tail [lindex $docfiles 0]]]_"
|
||||
puts "$starttimestamp Generating PDF file..."
|
||||
}
|
||||
|
||||
# Clean logfiles
|
||||
set DOXYLOG $OUTDIR/${LOGPREFIX}doxygen_err.log
|
||||
set DOXYOUT $OUTDIR/${LOGPREFIX}doxygen_out.log
|
||||
file delete -force $DOXYLOG
|
||||
file delete -force $DOXYOUT
|
||||
|
||||
set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $DOXYOUT} DOX_ERROR]
|
||||
if {$RESULT != 0} {
|
||||
set NbErrors [regexp -all -line {^\s*[^\s]+} $DOX_ERROR]
|
||||
if {$NbErrors > 0} {
|
||||
puts "Warning: Doxygen reported $NbErrors messages."
|
||||
puts "See log in $DOXYLOG"
|
||||
set DOX_ERROR_FILE [open $DOXYLOG "a"]
|
||||
if {$generatorMode == "PDF_ONLY"} {
|
||||
puts $DOX_ERROR_FILE "\n===================================================="
|
||||
puts $DOX_ERROR_FILE "Logfile for $docfiles"
|
||||
puts $DOX_ERROR_FILE "====================================================\n"
|
||||
}
|
||||
puts $DOX_ERROR_FILE $DOX_ERROR
|
||||
close $DOX_ERROR_FILE
|
||||
}
|
||||
}
|
||||
|
||||
# Close the Doxygen application
|
||||
after 300
|
||||
|
||||
# Start Post Processing
|
||||
set curtime [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
|
||||
if { $docType == "REFMAN" } {
|
||||
# Post Process generated HTML pages and draw dependency graphs
|
||||
if {[OCCDoc_PostProcessor $DOCDIR] == 0} {
|
||||
puts "$curtime Generation completed."
|
||||
puts "\nInfo: doxygen log file is located in:"
|
||||
puts "${DOXYOUT}."
|
||||
puts "\nReference Manual is generated in \n$DOCDIR"
|
||||
}
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
# Start PDF generation routine
|
||||
if { $generatorMode == "PDF_ONLY" } {
|
||||
set OS $::tcl_platform(platform)
|
||||
if { $OS == "unix" } {
|
||||
set PREFIX ".sh"
|
||||
} elseif { $OS == "windows" } {
|
||||
set PREFIX ".bat"
|
||||
}
|
||||
|
||||
# Prepare a list of TeX files, generated by Doxygen
|
||||
cd $LATEXDIR
|
||||
|
||||
set TEXFILES [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
|
||||
foreach path $TEXFILES {
|
||||
if { [string compare -nocase $path $LATEXDIR] == 0 } {
|
||||
set DEL_IDX [lsearch $TEXFILES $path]
|
||||
if { $DEL_IDX != -1 } {
|
||||
set TEXFILES [lreplace $TEXFILES $DEL_IDX $DEL_IDX]
|
||||
}
|
||||
}
|
||||
}
|
||||
set TEXFILES [string map [list refman.tex ""] $TEXFILES]
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Preprocessing generated TeX files..."
|
||||
}
|
||||
OCCDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Converting SVG images to PNG format..."
|
||||
}
|
||||
|
||||
if { $INKSCAPE_PATH != "" } {
|
||||
OCCDoc_ProcessSvg $LATEXDIR $verboseMode
|
||||
} else {
|
||||
puts "Warning: SVG images will be lost in PDF documents."
|
||||
}
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Generating PDF file from TeX files..."
|
||||
}
|
||||
foreach TEX $TEXFILES {
|
||||
# Rewrite existing REFMAN.tex file...
|
||||
set TEX [lindex [split $TEX "."] 0]
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Generating PDF file from $TEX..."
|
||||
}
|
||||
|
||||
OCCDoc_MakeRefmanTex $TEX $LATEXDIR $verboseMode $available_pdf
|
||||
|
||||
if {"$::tcl_platform(platform)" == "windows"} {
|
||||
set is_win "yes"
|
||||
} else {
|
||||
set is_win "no"
|
||||
}
|
||||
if {$verboseMode == "YES"} {
|
||||
# ...and use it to generate PDF from TeX...
|
||||
if {$is_win == "yes"} {
|
||||
puts "Info: Executing $LATEXDIR/make.bat..."
|
||||
} else {
|
||||
puts "Info: Executing $LATEXDIR/Makefile..."
|
||||
}
|
||||
}
|
||||
|
||||
set PDFLOG $OUTDIR/${LOGPREFIX}pdflatex_err.log
|
||||
set PDFOUT $OUTDIR/${LOGPREFIX}pdflatex_out.log
|
||||
file delete -force $PDFLOG
|
||||
file delete -force $PDFOUT
|
||||
|
||||
if {"$is_win" == "yes"} {
|
||||
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$PDFOUT"} LaTeX_ERROR]
|
||||
} else {
|
||||
set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$PDFOUT"} LaTeX_ERROR]
|
||||
|
||||
# Small workaround for *nix stations
|
||||
set prev_loc [pwd]
|
||||
cd $LATEXDIR
|
||||
set RESULT [catch {eval exec "pdflatex refman.tex" >> "$PDFOUT"} LaTeX_ERROR]
|
||||
cd $prev_loc
|
||||
}
|
||||
|
||||
if {$RESULT != 0} {
|
||||
set NbErrors [regexp -all -line {^\s*[^\s]+} $LaTeX_ERROR]
|
||||
if {$NbErrors > 0} {
|
||||
puts "Warning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG"
|
||||
set LaTeX_ERROR_FILE [open $PDFLOG "a+"]
|
||||
puts $LaTeX_ERROR_FILE "\n===================================================="
|
||||
puts $LaTeX_ERROR_FILE "Logfile of file $TEX:"
|
||||
puts $LaTeX_ERROR_FILE "====================================================\n"
|
||||
puts $LaTeX_ERROR_FILE $LaTeX_ERROR
|
||||
close $LaTeX_ERROR_FILE
|
||||
}
|
||||
}
|
||||
|
||||
# ...and place it to the specific folder
|
||||
if {![file exists "$LATEXDIR/refman.pdf"]} {
|
||||
puts "Fatal: PDFLaTeX failed to create output file, stopping!"
|
||||
return -1
|
||||
}
|
||||
|
||||
set destFolder $PDFDIR
|
||||
set parsed_string [split $TEX "_"]
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
if { [lsearch $parsed_string "tutorial"] != -1 } {
|
||||
set TEX [string map [list occt__ occt_] $TEX]
|
||||
set destFolder $PDFDIR
|
||||
} elseif { [lsearch $parsed_string "user"] != -1 } {
|
||||
set TEX [string map [list user_guides__ ""] $TEX]
|
||||
set destFolder $UGDIR
|
||||
} elseif { [lsearch $parsed_string "dev"] != -1 } {
|
||||
set TEX [string map [list dev_guides__ ""] $TEX]
|
||||
set destFolder $DGDIR
|
||||
}
|
||||
} else {
|
||||
set destFolder $OUTDIR
|
||||
set TEX "$PDFNAME"
|
||||
}
|
||||
file rename -force $LATEXDIR/refman.pdf "$destFolder/$TEX.pdf"
|
||||
puts "Generated $destFolder/$TEX.pdf"
|
||||
}
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
file rename $OUTDIR/overview.chm $OUTDIR/occt_overview.chm
|
||||
} else {
|
||||
file rename -force $ROOTDIR/doc/overview.chm $OUTDIR/occt_overview.chm
|
||||
}
|
||||
}
|
||||
cd $INDIR
|
||||
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
puts "HTML documentation is generated in \n$DOCDIR"
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
puts "Generated CHM documentation is in \n$OUTDIR/overview.chm"
|
||||
}
|
||||
}
|
||||
|
||||
# Remove temporary Doxygen files
|
||||
set deleteList [glob -nocomplain -type f "*.tmp"]
|
||||
foreach file $deleteList {
|
||||
file delete $file
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Generates Doxygen configuration file for Overview documentation
|
||||
proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMode ""} {DocFilesList {}} {ModulesList {}} verboseMode searchMode hhcPath mathjaxLocation graphvizPath productsPath} {
|
||||
global module_dependency
|
||||
|
||||
set inputDir [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
|
||||
|
||||
set TEMPLATES_DIR [OCCDoc_GetDoxDir]/resources
|
||||
set occt_version [OCCDoc_DetectCasVersion]
|
||||
|
||||
# Delete existent doxyfile
|
||||
file delete $doxyFileName
|
||||
|
||||
# Copy specific template to the target folder
|
||||
if { $docType == "REFMAN" } {
|
||||
file copy "$TEMPLATES_DIR/occt_rm.doxyfile" $doxyFileName
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
if { $generatorMode == "HTML_ONLY" || $generatorMode == "CHM_ONLY" } {
|
||||
file copy "$TEMPLATES_DIR/occt_ug_html.doxyfile" $doxyFileName
|
||||
} elseif { $generatorMode == "PDF_ONLY"} {
|
||||
file copy "$TEMPLATES_DIR/occt_ug_pdf.doxyfile" $doxyFileName
|
||||
} else {
|
||||
puts "Error: Unknown generation mode"
|
||||
return -1
|
||||
}
|
||||
} else {
|
||||
puts "Error: Cannot generate unknown document type"
|
||||
return -1
|
||||
}
|
||||
|
||||
set doxyFile [open $doxyFileName "a"]
|
||||
# Write specific options
|
||||
if { $docType == "REFMAN" } {
|
||||
|
||||
# always include optional components
|
||||
set aHaveD3dBack ""
|
||||
set aHaveGlesBack ""
|
||||
set aHaveVtkBack ""
|
||||
if { [info exists ::env(HAVE_D3D)] } { set aHaveD3dBack "$::env(HAVE_D3D)" }
|
||||
if { [info exists ::env(HAVE_GLES2)] } { set aHaveGlesBack "$::env(HAVE_GLES2)" }
|
||||
if { [info exists ::env(HAVE_VTK)] } { set aHaveVtkBack "$::env(HAVE_VTK)" }
|
||||
set ::env(HAVE_D3D) "true"
|
||||
set ::env(HAVE_GLES2) "true"
|
||||
set ::env(HAVE_VTK) "true"
|
||||
|
||||
# Load lists of modules scripts
|
||||
if { $productsPath == "" } {
|
||||
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
|
||||
} else {
|
||||
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/VAS/" *.tcl]
|
||||
}
|
||||
if { [llength $modules_scripts] != 0} {
|
||||
foreach module_file $modules_scripts {
|
||||
source $module_file
|
||||
}
|
||||
}
|
||||
|
||||
set ALL_MODULES [OCCDoc_GetModulesList $productsPath]
|
||||
if { [llength $ModulesList] == 0 } {
|
||||
# by default take all modules
|
||||
set modules $ALL_MODULES
|
||||
} else {
|
||||
set modules $ModulesList
|
||||
}
|
||||
|
||||
# Detect invalid names of modules
|
||||
foreach module $modules {
|
||||
if { $module == "" } {
|
||||
continue
|
||||
}
|
||||
if {[lsearch $ALL_MODULES $module] == -1 } {
|
||||
puts "Error: No module $module is known. Aborting..."
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
# Set context
|
||||
set one_module [expr [llength $modules] == 1]
|
||||
if { $one_module } {
|
||||
set title "OCCT [$modules:name]"
|
||||
set name $modules
|
||||
} else {
|
||||
set title "Open CASCADE Technology"
|
||||
set name OCCT
|
||||
}
|
||||
|
||||
OCCDoc_LoadData "${productsPath}"
|
||||
|
||||
# Add all dependencies of modules to the graph
|
||||
set additional_modules {}
|
||||
foreach module $modules {
|
||||
set additional_modules [list {*}$additional_modules {*}$module_dependency($module)]
|
||||
}
|
||||
set modules [list {*}$modules {*}$additional_modules]
|
||||
set modules [lsort -unique $modules]
|
||||
|
||||
# Get list of header files in the specified modules
|
||||
set filelist {}
|
||||
foreach module $modules {
|
||||
if { $module == "" } {
|
||||
continue
|
||||
}
|
||||
foreach tk [$module:toolkits] {
|
||||
foreach pk [split [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $productsPath]]] {
|
||||
if { [llength $pk] != "{}" } {
|
||||
lappend filelist [OCCDoc_GetHeadersList "p" "$pk" "$productsPath"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Filter out files Handle_*.hxx and *.lxx
|
||||
set hdrlist {}
|
||||
foreach fileset $filelist {
|
||||
set hdrset {}
|
||||
foreach hdr $fileset {
|
||||
if { ! [regexp {Handle_.*[.]hxx} $hdr] && ! [regexp {.*[.]lxx} $hdr] } {
|
||||
lappend hdrset $hdr
|
||||
}
|
||||
}
|
||||
lappend hdrlist $hdrset
|
||||
}
|
||||
set filelist $hdrlist
|
||||
|
||||
set doxyFile [open $doxyFileName "a"]
|
||||
|
||||
puts $doxyFile "PROJECT_NAME = \"$title\""
|
||||
puts $doxyFile "PROJECT_NUMBER = $occt_version"
|
||||
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
|
||||
puts $doxyFile "GENERATE_TAGFILE = $outDir/${name}.tag"
|
||||
|
||||
if { [string tolower $searchMode] == "none" } {
|
||||
puts $doxyFile "SEARCHENGINE = NO"
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} else {
|
||||
puts $doxyFile "SEARCHENGINE = YES"
|
||||
if { [string tolower $searchMode] == "local" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "server" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "external" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = YES"
|
||||
} else {
|
||||
puts "Error: Wrong search engine type: $searchMode."
|
||||
close $doxyFile
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
puts $doxyFile "DOTFILE_DIRS = $outDir/html"
|
||||
puts $doxyFile "DOT_PATH = $graphvizPath"
|
||||
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetSourceDir $productsPath]"
|
||||
|
||||
# list of files to generate
|
||||
set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]
|
||||
puts $doxyFile ""
|
||||
puts $doxyFile "INPUT = $mainpage \\"
|
||||
foreach header $filelist {
|
||||
puts $doxyFile " $header \\"
|
||||
}
|
||||
|
||||
puts $doxyFile "MATHJAX_FORMAT = HTML-CSS"
|
||||
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
|
||||
|
||||
puts $doxyFile ""
|
||||
|
||||
# restore environment variables
|
||||
set ::env(HAVE_D3D) "$aHaveD3dBack"
|
||||
set ::env(HAVE_GLES2) "$aHaveGlesBack"
|
||||
set ::env(HAVE_VTK) "$aHaveVtkBack"
|
||||
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
|
||||
# Add common options for generation of Overview and User Guides
|
||||
puts $doxyFile "PROJECT_NUMBER = $occt_version"
|
||||
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
|
||||
puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png"
|
||||
puts $doxyFile "EXAMPLE_PATH = [OCCDoc_GetSourceDir $productsPath]"
|
||||
|
||||
set PARAM_INPUT "INPUT ="
|
||||
set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ "
|
||||
foreach docFile $DocFilesList {
|
||||
set NEW_IMG_PATH "$inputDir/$docFile"
|
||||
if { [string compare $NEW_IMG_PATH [OCCDoc_GetRootDir $productsPath]] != 0 } {
|
||||
set img_string [file dirname $NEW_IMG_PATH]/images
|
||||
if { [file exists $img_string] } {
|
||||
append PARAM_IMAGEPATH " $img_string"
|
||||
}
|
||||
}
|
||||
append PARAM_INPUT " " $inputDir/$docFile
|
||||
}
|
||||
puts $doxyFile $PARAM_INPUT
|
||||
puts $doxyFile $PARAM_IMAGEPATH
|
||||
|
||||
# Add document type-specific options
|
||||
if { $generatorMode == "HTML_ONLY"} {
|
||||
# generate tree view
|
||||
puts $doxyFile "GENERATE_TREEVIEW = YES"
|
||||
|
||||
# Set a reference to a TAGFILE
|
||||
if { $tagFileDir != "" } {
|
||||
if {[file exists $tagFileDir/OCCT.tag] == 1} {
|
||||
#set tagPath [OCCDoc_GetRelPath $tagFileDir $outDir/html]
|
||||
set tagPath $tagFileDir
|
||||
puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=../../refman/html"
|
||||
}
|
||||
}
|
||||
# HTML Search engine options
|
||||
if { [string tolower $searchMode] == "none" } {
|
||||
puts $doxyFile "SEARCHENGINE = NO"
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} else {
|
||||
puts $doxyFile "SEARCHENGINE = YES"
|
||||
if { [string tolower $searchMode] == "local" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "server" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
} elseif { [string tolower $searchMode] == "external" } {
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = YES"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = YES"
|
||||
} else {
|
||||
puts "Error: Wrong search engine type: $searchMode."
|
||||
close $doxyFile
|
||||
return -1
|
||||
}
|
||||
}
|
||||
} elseif { $generatorMode == "CHM_ONLY"} {
|
||||
# specific options for CHM file generation
|
||||
puts $doxyFile "GENERATE_TREEVIEW = NO"
|
||||
puts $doxyFile "SEARCHENGINE = NO"
|
||||
puts $doxyFile "GENERATE_HTMLHELP = YES"
|
||||
puts $doxyFile "CHM_FILE = ../../overview.chm"
|
||||
puts $doxyFile "HHC_LOCATION = \"$hhcPath\""
|
||||
puts $doxyFile "DISABLE_INDEX = YES"
|
||||
}
|
||||
|
||||
# Formula options
|
||||
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
|
||||
}
|
||||
|
||||
close $doxyFile
|
||||
return 0
|
||||
}
|
918
adm/occaux.tcl
Normal file
918
adm/occaux.tcl
Normal file
@@ -0,0 +1,918 @@
|
||||
# =======================================================================
|
||||
# Created on: 2014-03-21
|
||||
# Created by: OMY
|
||||
# Copyright (c) 1996-1999 Matra Datavision
|
||||
# Copyright (c) 1999-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.
|
||||
|
||||
# =======================================================================
|
||||
# This script contains auxiliary functions which can be used
|
||||
# in documentation generation process
|
||||
# =======================================================================
|
||||
|
||||
# ==============================================
|
||||
# Commonly used functions
|
||||
# ==============================================
|
||||
|
||||
# Parses arguments line like "-arg1=val1 -arg2=val2 ..." to array args_names and map args_values
|
||||
proc OCCDoc_ParseArguments {arguments} {
|
||||
global args_names
|
||||
global args_values
|
||||
set args_names {}
|
||||
array set args_values {}
|
||||
|
||||
foreach arg $arguments {
|
||||
if {[regexp {^(-)[a-z_]+$} $arg] == 1} {
|
||||
set name [string range $arg 1 [string length $arg]-1]
|
||||
lappend args_names $name
|
||||
set args_values($name) "NULL"
|
||||
continue
|
||||
} elseif {[regexp {^(-)[a-z_]+=.+$} $arg] == 1} {
|
||||
set equal_symbol_position [string first "=" $arg]
|
||||
set name [string range $arg 1 $equal_symbol_position-1]
|
||||
lappend args_names $name
|
||||
set value [string range $arg $equal_symbol_position+1 [string length $arguments]-1]
|
||||
|
||||
# To parse a list of values for -m parameter
|
||||
if { [string first "," $value] != -1 } {
|
||||
set value [split $value ","];
|
||||
}
|
||||
|
||||
set args_values($name) $value
|
||||
|
||||
} else {
|
||||
puts "Error in argument $arg."
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Returns script parent folder
|
||||
proc OCCDoc_GetDoxDir { {theProductsPath ""} } {
|
||||
if { $theProductsPath == "" } {
|
||||
return [file normalize [file dirname [info script]]/../dox]
|
||||
} else {
|
||||
return [file normalize $theProductsPath]/dox
|
||||
}
|
||||
}
|
||||
|
||||
# Returns products root folder
|
||||
proc OCCDoc_GetProdRootDir {} {
|
||||
if {[info exists ::env(PRODROOT)]} {
|
||||
return [file normalize $::env(PRODROOT)]
|
||||
}
|
||||
}
|
||||
|
||||
# Returns OCCT root dir
|
||||
proc OCCDoc_GetOCCTRootDir {} {
|
||||
set path [OCCDoc_GetDoxDir]
|
||||
return [file normalize $path/..]
|
||||
}
|
||||
|
||||
# Returns root dir
|
||||
proc OCCDoc_GetRootDir { {theProductsPath ""} } {
|
||||
if { $theProductsPath == "" } {
|
||||
return [OCCDoc_GetOCCTRootDir]
|
||||
} else {
|
||||
return [file normalize $theProductsPath]
|
||||
}
|
||||
}
|
||||
|
||||
# Returns OCCT include dir
|
||||
proc OCCDoc_GetIncDir { {theProductsPath ""} } {
|
||||
set path [OCCDoc_GetRootDir $theProductsPath]
|
||||
return "$path/inc"
|
||||
}
|
||||
|
||||
# Returns OCCT source dir
|
||||
proc OCCDoc_GetSourceDir { {theProductsPath ""} } {
|
||||
set path [OCCDoc_GetRootDir $theProductsPath]
|
||||
return "$path/src"
|
||||
}
|
||||
|
||||
# Returns name of the package from the current toolkit
|
||||
proc OCCDoc_GetNameFromPath { thePath } {
|
||||
|
||||
set splitted_path [split $thePath "/" ]
|
||||
set package_name [lindex $splitted_path end]
|
||||
|
||||
return $package_name
|
||||
}
|
||||
|
||||
# Returns the relative path between two folders
|
||||
proc OCCDoc_GetRelPath {thePathFrom thePathTo} {
|
||||
if { [file isdirectory "$thePathFrom"] == 0 } {
|
||||
return ""
|
||||
}
|
||||
|
||||
set aPathFrom [file normalize "$thePathFrom"]
|
||||
set aPathTo [file normalize "$thePathTo"]
|
||||
|
||||
set aCutedPathFrom "${aPathFrom}/dummy"
|
||||
set aRelatedDeepPath ""
|
||||
|
||||
while { "$aCutedPathFrom" != [file normalize "$aCutedPathFrom/.."] } {
|
||||
set aCutedPathFrom [file normalize "$aCutedPathFrom/.."]
|
||||
# does aPathTo contain aCutedPathFrom?
|
||||
regsub -all $aCutedPathFrom $aPathTo "" aPathFromAfterCut
|
||||
if { "$aPathFromAfterCut" != "$aPathTo" } { # if so
|
||||
if { "$aCutedPathFrom" == "$aPathFrom" } { # just go higher, for example, ./somefolder/someotherfolder
|
||||
set aPathTo ".${aPathTo}"
|
||||
} elseif { "$aCutedPathFrom" == "$aPathTo" } { # remove the last "/"
|
||||
set aRelatedDeepPath [string replace $aRelatedDeepPath end end ""]
|
||||
}
|
||||
regsub -all $aCutedPathFrom $aPathTo $aRelatedDeepPath aPathToAfterCut
|
||||
regsub -all "//" $aPathToAfterCut "/" aPathToAfterCut
|
||||
return $aPathToAfterCut
|
||||
}
|
||||
set aRelatedDeepPath "$aRelatedDeepPath../"
|
||||
}
|
||||
|
||||
return $thePathTo
|
||||
}
|
||||
|
||||
# Returns OCCT version string from file Standard_Version.hxx (if available)
|
||||
proc OCCDoc_DetectCasVersion {} {
|
||||
set occt_ver 6.7.0
|
||||
set occt_ver_add ""
|
||||
set filename "[OCCDoc_GetSourceDir]/Standard/Standard_Version.hxx"
|
||||
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
|
||||
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
|
||||
}
|
||||
return $occt_ver
|
||||
}
|
||||
|
||||
# Checks if the necessary tools exist
|
||||
proc OCCDoc_DetectNecessarySoftware { DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH PDFLATEX_PATH } {
|
||||
|
||||
upvar 1 DOXYGEN_PATH doxy_path
|
||||
upvar 1 GRAPHVIZ_PATH graph_path
|
||||
upvar 1 INKSCAPE_PATH inkscape_path
|
||||
upvar 1 HHC_PATH hhc_path
|
||||
upvar 1 PDFLATEX_PATH latex_path
|
||||
|
||||
set doxy_path ""
|
||||
set graph_path ""
|
||||
set inkscape_path ""
|
||||
set latex_path ""
|
||||
set hhc_path ""
|
||||
|
||||
set is_win "no"
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
set is_win "yes"
|
||||
}
|
||||
if {"$is_win" == "yes"} {
|
||||
set exe ".exe"
|
||||
set com ".com"
|
||||
} else {
|
||||
set exe ""
|
||||
set com ""
|
||||
}
|
||||
|
||||
set g_flag "no"
|
||||
set d_flag "no"
|
||||
set i_flag "no"
|
||||
set h_flag "no"
|
||||
set l_flag "no"
|
||||
|
||||
puts ""
|
||||
set envPath $::env(PATH)
|
||||
if { $is_win == "yes" } {
|
||||
set searchPathsList [split $envPath ";"]
|
||||
} else {
|
||||
set searchPathsList [split $envPath ":"]
|
||||
}
|
||||
|
||||
foreach path $searchPathsList {
|
||||
if { ($is_win == "no") &&
|
||||
(($path == "/usr/bin") || ($path == "/usr/local/bin")) } {
|
||||
# Avoid searching in default bin location
|
||||
continue
|
||||
}
|
||||
if {$d_flag == "no"} {
|
||||
if { [file exists $path/doxygen$exe] } {
|
||||
catch { exec $path/doxygen -V } version_string
|
||||
set version [lindex [split $version_string "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set doxy_path "$path/doxygen$exe"
|
||||
set d_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$g_flag == "no"} {
|
||||
if { [file exists $path/dot$exe] } {
|
||||
catch { exec $path/dot -V } version
|
||||
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set graph_path "$path/dot$exe"
|
||||
set g_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$i_flag == "no"} {
|
||||
if { [file exists $path/inkscape$com] } {
|
||||
catch { exec $path/inkscape -V } version
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set inkscape_path "$path/inkscape$com"
|
||||
set i_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$l_flag == "no"} {
|
||||
if { [file exists $path/pdflatex$exe] } {
|
||||
catch { exec $path/pdflatex -version } version
|
||||
set version [lindex [split $version "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set latex_path "$path/pdflatex$exe"
|
||||
set l_flag "yes"
|
||||
}
|
||||
}
|
||||
if { ("$is_win" == "yes") && ($h_flag == "no") } {
|
||||
if { [file exists $path/hhc.exe] } {
|
||||
puts "Info: hhc "
|
||||
puts " found in $path."
|
||||
set hhc_path "hhc$exe"
|
||||
set h_flag "yes"
|
||||
}
|
||||
}
|
||||
if { ($d_flag == "yes") &&
|
||||
($i_flag == "yes") &&
|
||||
($g_flag == "yes") &&
|
||||
($l_flag == "yes") &&
|
||||
(($is_win == "yes") &&
|
||||
($h_flag == "yes")) } {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# On Windows search for hhc.exe in the default location
|
||||
# if it has not been found yet
|
||||
if { ("$is_win" == "yes") && ($h_flag == "no") } {
|
||||
if { [info exists ::env(ProgramFiles\(x86\))] } {
|
||||
set h_flag "yes"
|
||||
set path "$::env(ProgramFiles\(x86\))\\HTML Help Workshop"
|
||||
set hhc_path "$path\\hhc.exe"
|
||||
puts "Info: hhc "
|
||||
puts " found in $path."
|
||||
} else {
|
||||
if { [info exists ::env(ProgramFiles)] } {
|
||||
set h_flag "yes"
|
||||
set path "$::env(ProgramFiles)\\HTML Help Workshop"
|
||||
set hhc_path "$path\\hhc.exe"
|
||||
puts "Info: hhc"
|
||||
puts " found in $path."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# On *nix-like platforms,
|
||||
# check the default binary locations if the tools had not been found yet
|
||||
if { $is_win == "no" &&
|
||||
(($d_flag == "no") ||
|
||||
($i_flag == "no") ||
|
||||
($g_flag == "no") ||
|
||||
($l_flag == "no")) } {
|
||||
|
||||
set default_path { "/usr/bin" "/usr/local/bin" }
|
||||
foreach path $default_path {
|
||||
if {$d_flag == "no"} {
|
||||
if { [file exists $path/doxygen$exe] } {
|
||||
catch { exec $path/doxygen -V } version_string
|
||||
set version [lindex [split $version_string "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set doxy_path "$path/doxygen$exe"
|
||||
set d_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$g_flag == "no"} {
|
||||
if { [file exists $path/dot$exe] } {
|
||||
catch { exec $path/dot -V } version
|
||||
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set graph_path "$path/dot$exe"
|
||||
set g_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$i_flag == "no"} {
|
||||
if { [file exists $path/inkscape$exe] } {
|
||||
catch { exec $path/inkscape -V } version
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set inkscape_path "$path/inkscape$exe"
|
||||
set i_flag "yes"
|
||||
}
|
||||
}
|
||||
if {$l_flag == "no"} {
|
||||
if { [file exists $path/pdflatex$exe] } {
|
||||
catch { exec $path/pdflatex -version } version
|
||||
set version [lindex [split $version "\n"] 0]
|
||||
puts "Info: $version "
|
||||
puts " found in $path."
|
||||
set latex_path "$path/pdflatex$exe"
|
||||
set l_flag "yes"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Check if tools have been found
|
||||
if { $d_flag == "no" } {
|
||||
puts "Warning: Could not find doxygen installed."
|
||||
return -1
|
||||
}
|
||||
if { $g_flag == "no" } {
|
||||
puts "Warning: Could not find graphviz installed."
|
||||
}
|
||||
if { $i_flag == "no" } {
|
||||
puts "Warning: Could not find inkscape installed."
|
||||
}
|
||||
if { $l_flag == "no" } {
|
||||
puts "Warning: Could not find pdflatex installed."
|
||||
}
|
||||
if { ("$::tcl_platform(platform)" == "windows") && ($h_flag == "no") } {
|
||||
puts "Warning: Could not find hhc installed."
|
||||
}
|
||||
|
||||
puts ""
|
||||
}
|
||||
|
||||
# Convert SVG files to PDF format to allow including them to PDF
|
||||
# (requires InkScape to be in PATH)
|
||||
proc OCCDoc_ProcessSvg {latexDir verboseMode} {
|
||||
set anSvgList [glob -nocomplain $latexDir/*.svg]
|
||||
if { $anSvgList == {} } {
|
||||
return
|
||||
}
|
||||
|
||||
catch { exec inkscape -V } anInkVer
|
||||
set isOldSyntax 0
|
||||
if {[string match "Inkscape 0.*" $anInkVer]} { set isOldSyntax 1 }
|
||||
foreach file $anSvgList {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Converting file $file..."
|
||||
}
|
||||
set pdffile "[file rootname $file].pdf"
|
||||
if { $isOldSyntax == 1 } {
|
||||
if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } {
|
||||
#puts "Error: $res."
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if { [catch {exec inkscape $file --export-area-drawing --export-type=pdf --export-filename=$pdffile} res] } {
|
||||
#puts "Error: $res."
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ==============================================
|
||||
# Reference Manual-specific functions
|
||||
# ==============================================
|
||||
|
||||
# Finds dependencies between all modules
|
||||
proc OCCDoc_CreateModulesDependencyGraph {dir filename modules mpageprefix} {
|
||||
global module_dependency
|
||||
|
||||
if {![catch {open $dir/$filename.dot "w"} file]} {
|
||||
puts $file "digraph $filename"
|
||||
puts $file "\{"
|
||||
|
||||
foreach mod $modules {
|
||||
if { $mod == "" } {
|
||||
continue
|
||||
}
|
||||
puts $file "\t$mod \[ URL = \"[string tolower $mpageprefix$mod.html]\" \]"
|
||||
foreach mod_depend $module_dependency($mod) {
|
||||
puts $file "\t$mod_depend -> $mod \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
|
||||
}
|
||||
}
|
||||
|
||||
puts $file "\}"
|
||||
close $file
|
||||
|
||||
return $filename
|
||||
}
|
||||
}
|
||||
|
||||
# Finds dependencies between all toolkits in module
|
||||
proc OCCDoc_CreateModuleToolkitsDependencyGraph {dir filename modulename tpageprefix} {
|
||||
global toolkits_in_module
|
||||
global toolkit_dependency
|
||||
global toolkit_parent_module
|
||||
|
||||
if {![catch {open $dir/$filename.dot "w"} file]} {
|
||||
puts $file "digraph $filename"
|
||||
puts $file "\{"
|
||||
|
||||
foreach tk $toolkits_in_module($modulename) {
|
||||
puts $file "\t$tk \[ URL = \"[string tolower $tpageprefix$tk.html]\"\ ]"
|
||||
foreach tkd $toolkit_dependency($tk) {
|
||||
if { [info exists toolkit_parent_module($tkd)] } {
|
||||
if {$toolkit_parent_module($tkd) == $modulename} {
|
||||
puts $file "\t$tkd -> $tk \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
puts $file "\}"
|
||||
close $file
|
||||
|
||||
return $filename
|
||||
}
|
||||
}
|
||||
|
||||
# Finds dependencies between the current toolkit and other toolkits
|
||||
proc OCCDoc_CreateToolkitDependencyGraph {dir filename toolkitname tpageprefix} {
|
||||
global toolkit_dependency
|
||||
|
||||
if {![catch {open $dir/$filename.dot "w"} file]} {
|
||||
puts $file "digraph $filename"
|
||||
puts $file "\{"
|
||||
|
||||
puts $file "\t$toolkitname \[ URL = \"[string tolower $tpageprefix$toolkitname.html]\"\, shape = box ]"
|
||||
foreach tkd $toolkit_dependency($toolkitname) {
|
||||
puts $file "\t$tkd \[ URL = \"[string tolower $tpageprefix$tkd.html]\"\ , shape = box ]"
|
||||
puts $file "\t$toolkitname -> $tkd \[ color = \"midnightblue\", style = \"solid\" \]"
|
||||
}
|
||||
|
||||
if {[llength $toolkit_dependency($toolkitname)] > 1} {
|
||||
puts $file "\taspect = 1"
|
||||
}
|
||||
|
||||
puts $file "\}"
|
||||
close $file
|
||||
|
||||
return $filename
|
||||
}
|
||||
}
|
||||
|
||||
# Fills arrays of modules, toolkits, dependency of modules/toolkits etc
|
||||
proc OCCDoc_LoadData { {theProductsDir ""} } {
|
||||
global toolkits_in_module
|
||||
global toolkit_dependency
|
||||
global toolkit_parent_module
|
||||
global module_dependency
|
||||
|
||||
if { $theProductsDir == ""} {
|
||||
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/OS/" *.tcl]
|
||||
} else {
|
||||
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/VAS/" *.tcl]
|
||||
}
|
||||
|
||||
foreach module_file $modules_files {
|
||||
source $module_file
|
||||
}
|
||||
|
||||
set modules [OCCDoc_GetModulesList $theProductsDir]
|
||||
foreach mod $modules {
|
||||
|
||||
if { $mod == "" } {
|
||||
continue
|
||||
}
|
||||
# Get toolkits of current module
|
||||
set toolkits_in_module($mod) [$mod:toolkits]
|
||||
# Get all dependence of current toolkit
|
||||
foreach tk $toolkits_in_module($mod) {
|
||||
# set parent module of current toolkit
|
||||
set toolkit_parent_module($tk) $mod
|
||||
set exlibfile [open "[OCCDoc_GetSourceDir $theProductsDir]/$tk/EXTERNLIB" r]
|
||||
set exlibfile_data [read $exlibfile]
|
||||
set exlibfile_data [split $exlibfile_data "\n"]
|
||||
|
||||
set toolkit_dependency($tk) {}
|
||||
foreach dtk $exlibfile_data {
|
||||
if { ([string first "TK" $dtk 0] == 0) ||
|
||||
([string first "P" $dtk 0] == 0) } {
|
||||
lappend toolkit_dependency($tk) $dtk
|
||||
}
|
||||
}
|
||||
close $exlibfile
|
||||
}
|
||||
}
|
||||
|
||||
# Get modules dependency
|
||||
foreach mod $modules {
|
||||
set module_dependency($mod) {}
|
||||
foreach tk $toolkits_in_module($mod) {
|
||||
foreach tkd $toolkit_dependency($tk) {
|
||||
if { [info exists toolkit_parent_module($tkd)] } {
|
||||
if { $toolkit_parent_module($tkd) != $mod &&
|
||||
[lsearch $module_dependency($mod) $toolkit_parent_module($tkd)] == -1} {
|
||||
lappend module_dependency($mod) $toolkit_parent_module($tkd)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Returns list of packages of the given toolkit
|
||||
proc OCCDoc_GetPackagesList { theToolKitPath } {
|
||||
|
||||
set packages_list {}
|
||||
|
||||
# Open file with list of packages of the given toolkit
|
||||
set fileid [open "$theToolKitPath/PACKAGES" "r"]
|
||||
|
||||
while { [eof $fileid] == 0 } {
|
||||
set str [gets $fileid]
|
||||
if { $str != "" } {
|
||||
lappend packages_list $str
|
||||
}
|
||||
}
|
||||
|
||||
close $fileid
|
||||
|
||||
return $packages_list
|
||||
}
|
||||
|
||||
# Returns list of modules from UDLIST
|
||||
proc OCCDoc_GetModulesList { {theProductsDir ""} } {
|
||||
|
||||
if { $theProductsDir == "" } {
|
||||
source "[OCCDoc_GetSourceDir $theProductsDir]/OS/Modules.tcl"
|
||||
# load a command from this file
|
||||
set modules [OS:Modules]
|
||||
} else {
|
||||
source "[OCCDoc_GetSourceDir $theProductsDir]/VAS/Products.tcl"
|
||||
# load a command from this file
|
||||
set modules [VAS:Products]
|
||||
set modules [lsearch -not -all -inline $modules "VAS"]
|
||||
}
|
||||
|
||||
return $modules
|
||||
}
|
||||
|
||||
# Returns list of desired files in the specified location
|
||||
proc OCCDoc_GetHeadersList { theDesiredContent thePackageName {theProductsDir ""} } {
|
||||
|
||||
# Get list of header files with path
|
||||
set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/$thePackageName" "${thePackageName}.hxx" "${thePackageName}_*.hxx"]]
|
||||
|
||||
# Get content according to desired type ('p' for path and 'f' for filenames only)
|
||||
if { $theDesiredContent == "p" } {
|
||||
return $files_list
|
||||
} elseif { $theDesiredContent == "f" } {
|
||||
|
||||
# Cut paths from filenames
|
||||
foreach file $files_list {
|
||||
set elem_index [lsearch $files_list $file]
|
||||
lset files_list $elem_index [OCCDoc_GetNameFromPath [lindex $files_list $elem_index]]
|
||||
}
|
||||
return $files_list
|
||||
}
|
||||
}
|
||||
|
||||
# Returns location of the toolkit
|
||||
proc OCCDoc_Locate { theToolKitName {theProductsDir ""} } {
|
||||
set tk_dir "[OCCDoc_GetSourceDir $theProductsDir]/[OCCDoc_GetNameFromPath $theToolKitName]"
|
||||
return $tk_dir
|
||||
}
|
||||
|
||||
# Gets contents of the given html node (for Post-processing)
|
||||
proc OCCDoc_GetNodeContents {node props html} {
|
||||
set openTag "<$node$props>"
|
||||
set closingTag "</$node>"
|
||||
set start [string first $openTag $html]
|
||||
if {$start == -1} {
|
||||
return ""
|
||||
}
|
||||
set start [expr $start + [string length $openTag]]
|
||||
set end [string length $html]
|
||||
set html [string range $html $start $end]
|
||||
set start [string first $closingTag $html]
|
||||
set end [string length $html]
|
||||
if {$start == -1} {
|
||||
return ""
|
||||
}
|
||||
set start [expr $start - 1]
|
||||
return [string range $html 0 $start]
|
||||
}
|
||||
|
||||
# Generates main page file describing module structure
|
||||
proc OCCDoc_MakeMainPage {outDir outFile modules {theProductsDir ""} } {
|
||||
global env
|
||||
|
||||
set one_module [expr [llength $modules] == 1]
|
||||
set fd [open $outFile "w"]
|
||||
|
||||
set module_prefix "module_"
|
||||
set toolkit_prefix "toolkit_"
|
||||
set package_prefix "package_"
|
||||
|
||||
if { ! [file exists "$outDir/html"] } {
|
||||
file mkdir "$outDir/html"
|
||||
}
|
||||
|
||||
OCCDoc_LoadData $theProductsDir
|
||||
|
||||
# Main page: list of modules
|
||||
if { ! $one_module } {
|
||||
puts $fd "/**"
|
||||
puts $fd "\\mainpage Open CASCADE Technology"
|
||||
|
||||
foreach mod $modules {
|
||||
puts $fd "\\li \\subpage [string tolower $module_prefix$mod]"
|
||||
}
|
||||
# insert modules relationship diagram
|
||||
puts $fd "\\dotfile [OCCDoc_CreateModulesDependencyGraph $outDir/html schema_all_modules $modules $module_prefix]"
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
# One page per module: list of toolkits
|
||||
set toolkits {}
|
||||
foreach mod $modules {
|
||||
if { $mod == "" } {
|
||||
continue
|
||||
}
|
||||
puts $fd "/**"
|
||||
if { $one_module } {
|
||||
puts $fd "\\mainpage OCCT Module [$mod:name]"
|
||||
} else {
|
||||
puts $fd "\\page [string tolower module_$mod] Module [$mod:name]"
|
||||
}
|
||||
foreach tk [lsort [$mod:toolkits]] {
|
||||
lappend toolkits $tk
|
||||
puts $fd "\\li \\subpage [string tolower $toolkit_prefix$tk]"
|
||||
}
|
||||
puts $fd "\\dotfile [OCCDoc_CreateModuleToolkitsDependencyGraph $outDir/html schema_$mod $mod $toolkit_prefix]"
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
# One page per toolkit: list of packages
|
||||
set packages {}
|
||||
foreach tk $toolkits {
|
||||
puts $fd "/**"
|
||||
puts $fd "\\page [string tolower toolkit_$tk] Toolkit $tk"
|
||||
foreach pk [lsort [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $theProductsDir]]] {
|
||||
lappend packages $pk
|
||||
set u [OCCDoc_GetNameFromPath $pk]
|
||||
puts $fd "\\li \\subpage [string tolower $package_prefix$u]"
|
||||
}
|
||||
puts $fd "\\dotfile [OCCDoc_CreateToolkitDependencyGraph $outDir/html schema_$tk $tk $toolkit_prefix]"
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
# One page per package: list of classes
|
||||
foreach pk $packages {
|
||||
set u [OCCDoc_GetNameFromPath $pk]
|
||||
puts $fd "/**"
|
||||
puts $fd "\\page [string tolower $package_prefix$u] Package $u"
|
||||
foreach hdr [lsort [OCCDoc_GetHeadersList "f" "$pk" "$theProductsDir"]] {
|
||||
if { ! [regexp {^Handle_} $hdr] && [regexp {(.*)[.]hxx} $hdr str obj] } {
|
||||
puts $fd "\\li \\subpage $obj"
|
||||
}
|
||||
}
|
||||
puts $fd "**/\n"
|
||||
}
|
||||
|
||||
close $fd
|
||||
|
||||
return $outFile
|
||||
}
|
||||
|
||||
# Parses generated files to add a navigation path
|
||||
proc OCCDoc_PostProcessor {outDir} {
|
||||
puts "[clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Post-process is started ..."
|
||||
append outDir "/html"
|
||||
set files [glob -nocomplain -type f $outDir/package_*]
|
||||
if { $files != {} } {
|
||||
foreach f [lsort $files] {
|
||||
set packageFilePnt [open $f r]
|
||||
set packageFile [read $packageFilePnt]
|
||||
set navPath [OCCDoc_GetNodeContents "div" " id=\"nav-path\" class=\"navpath\"" $packageFile]
|
||||
set packageName [OCCDoc_GetNodeContents "div" " class=\"title\"" $packageFile]
|
||||
regsub -all {<[^<>]*>} $packageName "" packageName
|
||||
|
||||
# add package link to nav path
|
||||
set first [expr 1 + [string last "/" $f]]
|
||||
set last [expr [string length $f] - 1]
|
||||
set packageFileName [string range $f $first $last]
|
||||
set end [string first "</ul>" $navPath]
|
||||
set end [expr $end - 1]
|
||||
set navPath [string range $navPath 0 $end]
|
||||
append navPath " <li class=\"navelem\"><a class=\"el\" href=\"$packageFileName\">$packageName</a> </li>\n </ul>"
|
||||
|
||||
# get list of files to update
|
||||
set listContents [OCCDoc_GetNodeContents "div" " class=\"textblock\"" $packageFile]
|
||||
set listContents [OCCDoc_GetNodeContents "ul" "" $listContents]
|
||||
set lines [split $listContents "\n"]
|
||||
foreach line $lines {
|
||||
if {[regexp {href=\"([^\"]*)\"} $line tmpLine classFileName]} {
|
||||
# check if anchor is there
|
||||
set anchorPos [string first "#" $classFileName]
|
||||
if {$anchorPos != -1} {
|
||||
set classFileName [string range $classFileName 0 [expr $anchorPos - 1]]
|
||||
}
|
||||
|
||||
# read class file
|
||||
set classFilePnt [open $outDir/$classFileName r+]
|
||||
set classFile [read $classFilePnt]
|
||||
|
||||
# find position of content block
|
||||
set contentPos [string first "<div class=\"header\">" $classFile]
|
||||
set navPart [string range $classFile 0 [expr $contentPos - 1]]
|
||||
|
||||
# position where to insert nav path
|
||||
set posToInsert [string last "</div>" $navPart]
|
||||
set prePart [string range $classFile 0 [expr $posToInsert - 1]]
|
||||
set postPart [string range $classFile $posToInsert [string length $classFile]]
|
||||
set newClassFile ""
|
||||
append newClassFile $prePart " <div id=\"nav-path\" class=\"navpath\">" $navPath \n " </div>" \n $postPart
|
||||
|
||||
# write updated content
|
||||
seek $classFilePnt 0
|
||||
puts $classFilePnt $newClassFile
|
||||
close $classFilePnt
|
||||
}
|
||||
}
|
||||
close $packageFilePnt
|
||||
}
|
||||
return 0
|
||||
} else {
|
||||
puts "no files found"
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
# ======================================
|
||||
# User Guides-specific functions
|
||||
# ======================================
|
||||
|
||||
# Loads a list of docfiles from file FILES.txt
|
||||
proc OCCDoc_LoadFilesList {} {
|
||||
set INPUTDIR [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
|
||||
|
||||
global available_docfiles
|
||||
set available_docfiles {}
|
||||
|
||||
# Read data from file
|
||||
if { [file exists "$INPUTDIR/FILES_HTML.txt"] == 1 } {
|
||||
set FILE [open "$INPUTDIR/FILES_HTML.txt" r]
|
||||
while {1} {
|
||||
set line [string trim [gets $FILE]]
|
||||
|
||||
# trim possible comments starting with '#'
|
||||
set line [regsub {\#.*} $line {}]
|
||||
if {$line != ""} {
|
||||
lappend available_docfiles $line
|
||||
}
|
||||
if {[eof $FILE]} {
|
||||
close $FILE
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return -1
|
||||
}
|
||||
|
||||
global available_pdf
|
||||
set available_pdf {}
|
||||
|
||||
# Read data from file
|
||||
if { [file exists "$INPUTDIR/FILES_PDF.txt"] } {
|
||||
set FILE [open "$INPUTDIR/FILES_PDF.txt" r]
|
||||
while {1} {
|
||||
set line [string trim [gets $FILE]]
|
||||
|
||||
# Trim possible comments starting with '#'
|
||||
set line [regsub {\#.*} $line {}]
|
||||
if {$line != ""} {
|
||||
lappend available_pdf $line
|
||||
}
|
||||
if {[eof $FILE]} {
|
||||
close $FILE
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Writes new TeX file for conversion from tex to pdf for a specific doc
|
||||
proc OCCDoc_MakeRefmanTex {fileName latexDir verboseMode latexFilesList} {
|
||||
|
||||
if { $verboseMode == "YES" } {
|
||||
puts "Info: Making refman.tex file for $fileName..."
|
||||
}
|
||||
set DOCNAME "$latexDir/refman.tex"
|
||||
if {[file exists $DOCNAME] == 1} {
|
||||
file delete -force $DOCNAME
|
||||
}
|
||||
|
||||
# Copy template file to latex folder
|
||||
if { "[OCCDoc_GetProdRootDir]" != "" } {
|
||||
file copy "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex" $DOCNAME
|
||||
} else {
|
||||
file copy "[OCCDoc_GetDoxDir]/resources/occt_pdf_template.tex" $DOCNAME
|
||||
}
|
||||
|
||||
# Get templatized data
|
||||
set texfile [open $DOCNAME "r"]
|
||||
set texfile_loaded [read $texfile]
|
||||
close $texfile
|
||||
|
||||
# Replace dummy values
|
||||
set year [clock format [clock seconds] -format {%Y}]
|
||||
set month [clock format [clock seconds] -format {%B}]
|
||||
set texfile [open $DOCNAME "w"]
|
||||
set casVersion [OCCDoc_DetectCasVersion]
|
||||
|
||||
# Get name of the document
|
||||
set docLabel ""
|
||||
foreach aFileName $latexFilesList {
|
||||
# Find the file in FILES_PDF.txt
|
||||
set parsedFileName [file rootname [lindex [split $aFileName "/" ] end]]
|
||||
if { [regexp "${parsedFileName}$" $fileName] } {
|
||||
set filepath "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/$aFileName"
|
||||
if { [file exists $filepath] } {
|
||||
set MDFile [open $filepath "r"]
|
||||
set label [split [gets $MDFile] "\{"]
|
||||
set docLabel [lindex $label 0]
|
||||
close $MDFile
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set occtlogo_path "[OCCDoc_GetDoxDir]/resources/occt_logo.png"
|
||||
set occlogo_path "[OCCDoc_GetDoxDir]/resources/occ_logo.png"
|
||||
set copyright_path "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex"
|
||||
set texfile_loaded [string map [list DEFDOCLABEL "$docLabel" DEFCASVERSION "$casVersion" DEFFILENAME "$fileName" DEFYEAR "$year" DEFMONTH "$month" DEFCOPYRIGHT "$copyright_path" DEFLOGO "$occtlogo_path" DEFOCCLOGO "$occlogo_path" DEFTITLE ""] $texfile_loaded]
|
||||
|
||||
# Get data
|
||||
puts $texfile $texfile_loaded
|
||||
|
||||
close $texfile
|
||||
}
|
||||
|
||||
# Postprocesses generated TeX files
|
||||
proc OCCDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
|
||||
|
||||
foreach TEX $texFiles {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Info: Preprocessing file $TEX..."
|
||||
}
|
||||
|
||||
if {![file exists $TEX]} {
|
||||
puts "Error: file $TEX does not exist."
|
||||
return -1
|
||||
}
|
||||
|
||||
set IN_F [open "$TEX" "r"]
|
||||
set TMPFILENAME "$latexDir/temp.tex"
|
||||
set OUT_F [open $TMPFILENAME w]
|
||||
|
||||
while {1} {
|
||||
set line [gets $IN_F]
|
||||
if { [string first "\\includegraphics" $line] != -1 } {
|
||||
# replace svg extension by pdf
|
||||
set line [regsub {[.]svg} $line ".pdf"]
|
||||
# Center images in TeX files
|
||||
set line "\\begin{center}\n $line\n\\end{center}"
|
||||
} elseif { [string first "\\subsection" $line] != -1 } {
|
||||
# Replace \subsection with \section tag
|
||||
regsub -all "\\\\subsection" $line "\\\\section" line
|
||||
} elseif { [string first "\\subsubsection" $line] != -1 } {
|
||||
# Replace \subsubsection with \subsection tag
|
||||
regsub -all "\\\\subsubsection" $line "\\\\subsection" line
|
||||
} elseif { [string first "\\paragraph" $line] != -1 } {
|
||||
# Replace \paragraph with \subsubsection tag
|
||||
regsub -all "\\\\paragraph" $line "\\\\subsubsection" line
|
||||
}
|
||||
puts $OUT_F $line
|
||||
|
||||
if {[eof $IN_F]} {
|
||||
close $IN_F
|
||||
close $OUT_F
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
file delete -force $TEX
|
||||
file rename $TMPFILENAME $TEX
|
||||
}
|
||||
}
|
@@ -33,6 +33,7 @@ set "BUILD_ModelingAlgorithms=ON"
|
||||
set "BUILD_Visualization=ON"
|
||||
set "BUILD_ApplicationFramework=ON"
|
||||
set "BUILD_DataExchange=ON"
|
||||
set "BUILD_DETools=OFF"
|
||||
|
||||
rem Optional 3rd-party libraries to enable
|
||||
set "USE_FREETYPE=ON"
|
||||
@@ -66,9 +67,8 @@ if ["%toCMake%"] == ["1"] (
|
||||
set "anOcctVerSuffix="
|
||||
set "anOcctVersion=0.0.0"
|
||||
set "aGitBranch="
|
||||
rem Get OCCT version
|
||||
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" )
|
||||
|
||||
for %%s in (%anNdkAbiList%) do (
|
||||
@@ -167,6 +167,7 @@ if ["%toCMake%"] == ["1"] (
|
||||
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
|
||||
-D BUILD_MODULE_DETools:BOOL="OFF" ^
|
||||
-D BUILD_MODULE_Draw:BOOL="OFF" ^
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" ^
|
||||
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
|
||||
|
@@ -27,6 +27,7 @@ rem set "BUILD_ModelingAlgorithms=ON"
|
||||
rem set "BUILD_Visualization=ON"
|
||||
rem set "BUILD_ApplicationFramework=ON"
|
||||
rem set "BUILD_DataExchange=ON"
|
||||
rem set "BUILD_MODULE_DETools=OFF"
|
||||
|
||||
rem Optional 3rd-party libraries to enable
|
||||
rem set "USE_RAPIDJSON=ON"
|
||||
|
@@ -1,8 +0,0 @@
|
||||
@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%"
|
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure script dir is defined
|
||||
if [ -z "$aScriptDir" ]; then
|
||||
aScriptDir=$(dirname "$0")
|
||||
fi
|
||||
|
||||
# Check if version file exists
|
||||
versionFile="$aScriptDir/../cmake/version.cmake"
|
||||
if [ ! -f "$versionFile" ]; then
|
||||
echo "Error: version.cmake not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract version info from version.cmake
|
||||
OCC_VERSION_MAJOR=$(awk '/set.*OCC_VERSION_MAJOR/ {print $3}' "$versionFile")
|
||||
OCC_VERSION_MINOR=$(awk '/set.*OCC_VERSION_MINOR/ {print $3}' "$versionFile")
|
||||
OCC_VERSION_MAINTENANCE=$(awk '/set.*OCC_VERSION_MAINTENANCE/ {print $3}' "$versionFile")
|
||||
anOcctVerSuffix=$(awk '/set.*OCC_VERSION_DEVELOPMENT/ {
|
||||
if (NF > 2) {
|
||||
gsub(/[)" ]/, "", $3)
|
||||
print $3
|
||||
} else {
|
||||
print ""
|
||||
}
|
||||
}' "$versionFile")
|
||||
|
||||
# Combine version string
|
||||
anOcctVersion="${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}"
|
||||
|
@@ -16,6 +16,7 @@ rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
|
||||
rem set "INSTALL_DIR=%SrcRoot%\install"
|
||||
|
||||
rem set BUILD_DOC_Overview=OFF
|
||||
rem set BUILD_Inspector=OFF
|
||||
rem set BUILD_LIBRARY_TYPE=Shared
|
||||
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
rem set BUILD_WITH_DEBUG=OFF
|
||||
@@ -27,8 +28,12 @@ rem Use semicolon-separated list of toolkits if you want to disable all modules
|
||||
rem and build only some toolkits.
|
||||
rem set BUILD_ADDITIONAL_TOOLKITS=
|
||||
|
||||
rem Set a directory recognized as a patch for OCCT.
|
||||
rem set BUILD_PATCH=
|
||||
|
||||
rem set BUILD_MODULE_ApplicationFramework=ON
|
||||
rem set BUILD_MODULE_DataExchange=ON
|
||||
rem set BUILD_MODULE_DETools=OFF
|
||||
rem set BUILD_MODULE_Draw=ON
|
||||
rem set BUILD_MODULE_ModelingAlgorithms=ON
|
||||
rem set BUILD_MODULE_ModelingData=ON
|
||||
|
@@ -11,6 +11,7 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
|
||||
#INSTALL_DIR="$SrcRoot/install"
|
||||
|
||||
#BUILD_DOC_Overview=OFF
|
||||
#BUILD_Inspector=OFF
|
||||
#BUILD_LIBRARY_TYPE=Shared
|
||||
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
#BUILD_WITH_DEBUG=OFF
|
||||
@@ -20,8 +21,12 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
|
||||
# and build only some toolkits.
|
||||
#BUILD_ADDITIONAL_TOOLKITS=
|
||||
|
||||
# Set a directory recognized as a patch for OCCT.
|
||||
#BUILD_PATCH=
|
||||
|
||||
#BUILD_MODULE_ApplicationFramework=ON
|
||||
#BUILD_MODULE_DataExchange=ON
|
||||
#BUILD_MODULE_DETools=OFF
|
||||
#BUILD_MODULE_Draw=ON
|
||||
#BUILD_MODULE_ModelingAlgorithms=ON
|
||||
#BUILD_MODULE_ModelingData=ON
|
||||
|
@@ -17,7 +17,9 @@ set "INSTALL_DIR=%SrcRoot%\install"
|
||||
|
||||
set BUILD_ADDITIONAL_TOOLKITS=
|
||||
set BUILD_DOC_Overview=OFF
|
||||
set BUILD_Inspector=OFF
|
||||
set BUILD_LIBRARY_TYPE=Shared
|
||||
set BUILD_PATCH=
|
||||
set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
set BUILD_WITH_DEBUG=OFF
|
||||
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
|
||||
@@ -26,6 +28,7 @@ set BUILD_FORCE_RelWithDebInfo=OFF
|
||||
|
||||
set BUILD_MODULE_ApplicationFramework=ON
|
||||
set BUILD_MODULE_DataExchange=ON
|
||||
set BUILD_MODULE_DETools=OFF
|
||||
set BUILD_MODULE_Draw=ON
|
||||
set BUILD_MODULE_ModelingAlgorithms=ON
|
||||
set BUILD_MODULE_ModelingData=ON
|
||||
@@ -56,14 +59,17 @@ cmake -G "%arch_compile%" ^
|
||||
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
|
||||
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
|
||||
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
|
||||
-D BUILD_Inspector:BOOL=%BUILD_Inspector% ^
|
||||
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
|
||||
-D BUILD_MODULE_DETools:BOOL=%BUILD_MODULE_DETools% ^
|
||||
-D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
|
||||
-D BUILD_MODULE_FoundationClasses:BOOL=ON ^
|
||||
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^
|
||||
-D BUILD_MODULE_ModelingData:BOOL=%BUILD_MODULE_ModelingData% ^
|
||||
-D BUILD_MODULE_Visualization:BOOL=%BUILD_MODULE_Visualization% ^
|
||||
-D BUILD_PATCH:PATH="%BUILD_PATCH%" ^
|
||||
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=%BUILD_RELEASE_DISABLE_EXCEPTIONS% ^
|
||||
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
|
||||
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^
|
||||
|
@@ -22,13 +22,16 @@ INSTALL_DIR_LIB=lin64/gcc/lib$DEB
|
||||
|
||||
BUILD_ADDITIONAL_TOOLKITS=
|
||||
BUILD_DOC_Overview=OFF
|
||||
BUILD_Inspector=OFF
|
||||
BUILD_LIBRARY_TYPE=Shared
|
||||
BUILD_PATCH=
|
||||
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
|
||||
BUILD_WITH_DEBUG=OFF
|
||||
BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
|
||||
|
||||
BUILD_MODULE_ApplicationFramework=ON
|
||||
BUILD_MODULE_DataExchange=ON
|
||||
BUILD_MODULE_DETools=OFF
|
||||
BUILD_MODULE_Draw=ON
|
||||
BUILD_MODULE_ModelingAlgorithms=ON
|
||||
BUILD_MODULE_ModelingData=ON
|
||||
@@ -57,14 +60,17 @@ cmake -G "Unix Makefiles" \
|
||||
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \
|
||||
-D BUILD_ADDITIONAL_TOOLKITS:STRING="$BUILD_ADDITIONAL_TOOLKITS" \
|
||||
-D BUILD_DOC_Overview:BOOL=$BUILD_DOC_Overview \
|
||||
-D BUILD_Inspector:BOOL=$BUILD_Inspector \
|
||||
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
|
||||
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
|
||||
-D BUILD_MODULE_DETools:BOOL=$BUILD_MODULE_DETools \
|
||||
-D BUILD_MODULE_Draw:BOOL=$BUILD_MODULE_Draw \
|
||||
-D BUILD_MODULE_FoundationClasses:BOOL=ON \
|
||||
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \
|
||||
-D BUILD_MODULE_ModelingData:BOOL=$BUILD_MODULE_ModelingData \
|
||||
-D BUILD_MODULE_Visualization:BOOL=$BUILD_MODULE_Visualization \
|
||||
-D BUILD_PATCH:PATH="$BUILD_PATCH" \
|
||||
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=$BUILD_RELEASE_DISABLE_EXCEPTIONS \
|
||||
-D BUILD_WITH_DEBUG:BOOL=$BUILD_WITH_DEBUG \
|
||||
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=$BUILD_ENABLE_FPE_SIGNAL_HANDLER \
|
||||
|
@@ -34,6 +34,7 @@ export BUILD_ModelingAlgorithms=ON
|
||||
export BUILD_Visualization=ON
|
||||
export BUILD_ApplicationFramework=ON
|
||||
export BUILD_DataExchange=ON
|
||||
export BUILD_DETools=OFF
|
||||
|
||||
export USE_FREETYPE=ON
|
||||
export USE_FREEIMAGE=OFF
|
||||
@@ -48,7 +49,8 @@ if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
|
||||
source "${aScriptDir}/ios_custom.sh"
|
||||
fi
|
||||
|
||||
source "${aScriptDir}/build_common.sh"
|
||||
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`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
@@ -147,6 +149,7 @@ function buildArch {
|
||||
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
|
||||
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
|
||||
-D BUILD_MODULE_Draw:BOOL="OFF" \
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" \
|
||||
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
|
||||
|
@@ -20,6 +20,7 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
|
||||
#export BUILD_Visualization=ON
|
||||
#export BUILD_ApplicationFramework=ON
|
||||
#export BUILD_DataExchange=ON
|
||||
#export BUILD_DETools=OFF
|
||||
|
||||
#export USE_RAPIDJSON=ON
|
||||
#export USE_DRACO=ON
|
||||
|
@@ -34,6 +34,7 @@ export BUILD_ModelingAlgorithms=ON
|
||||
export BUILD_Visualization=ON
|
||||
export BUILD_ApplicationFramework=ON
|
||||
export BUILD_DataExchange=ON
|
||||
export BUILD_DETools=OFF
|
||||
export BUILD_Draw=ON
|
||||
|
||||
export USE_FREETYPE=ON
|
||||
@@ -50,7 +51,8 @@ if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
|
||||
source "${aScriptDir}/macos_custom.sh"
|
||||
fi
|
||||
|
||||
source "${aScriptDir}/build_common.sh"
|
||||
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`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
@@ -144,6 +146,7 @@ function buildArch {
|
||||
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
|
||||
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
|
||||
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" \
|
||||
"$aCasSrc" 2>&1 | tee -a "$aLogFile"
|
||||
|
@@ -19,6 +19,7 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
|
||||
#export BUILD_Visualization=ON
|
||||
#export BUILD_ApplicationFramework=ON
|
||||
#export BUILD_DataExchange=ON
|
||||
#export BUILD_DETools=OFF
|
||||
#export BUILD_Draw=ON
|
||||
|
||||
#export USE_RAPIDJSON=ON
|
||||
|
@@ -32,6 +32,7 @@ set "BUILD_ModelingAlgorithms=ON"
|
||||
set "BUILD_Visualization=ON"
|
||||
set "BUILD_ApplicationFramework=ON"
|
||||
set "BUILD_DataExchange=ON"
|
||||
set "BUILD_DETools=OFF"
|
||||
set "BUILD_Draw=ON"
|
||||
|
||||
rem Optional 3rd-party libraries to enable
|
||||
@@ -52,8 +53,9 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
|
||||
|
||||
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"
|
||||
@@ -154,6 +156,7 @@ if ["%toCMake%"] == ["1"] (
|
||||
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
|
||||
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
|
||||
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
|
||||
-D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
|
||||
-D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
|
||||
|
@@ -22,6 +22,7 @@ rem set "BUILD_ModelingAlgorithms=ON"
|
||||
rem set "BUILD_Visualization=ON"
|
||||
rem set "BUILD_ApplicationFramework=ON"
|
||||
rem set "BUILD_DataExchange=ON"
|
||||
rem set "BUILD_DETools=OFF"
|
||||
rem set "BUILD_Draw=ON"
|
||||
|
||||
rem set "USE_RAPIDJSON=ON"
|
||||
|
@@ -32,6 +32,7 @@ set "BUILD_ModelingAlgorithms=ON"
|
||||
set "BUILD_Visualization=ON"
|
||||
set "BUILD_ApplicationFramework=ON"
|
||||
set "BUILD_DataExchange=ON"
|
||||
set "BUILD_DETools=OFF"
|
||||
set "BUILD_Draw=OFF"
|
||||
|
||||
rem Optional 3rd-party libraries to enable
|
||||
@@ -54,8 +55,8 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
|
||||
set "anOcctVerSuffix="
|
||||
set "anOcctVersion=0.0.0"
|
||||
set "aGitBranch="
|
||||
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"
|
||||
@@ -175,6 +176,7 @@ if ["%toCMake%"] == ["1"] (
|
||||
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
|
||||
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
|
||||
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" ^
|
||||
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
|
||||
|
@@ -20,6 +20,7 @@ export BUILD_ModelingAlgorithms=ON
|
||||
export BUILD_Visualization=ON
|
||||
export BUILD_ApplicationFramework=ON
|
||||
export BUILD_DataExchange=ON
|
||||
export BUILD_DETools=OFF
|
||||
|
||||
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
|
||||
. "${aScriptDir}/wasm_custom.sh"
|
||||
@@ -74,6 +75,7 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
|
||||
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
|
||||
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
|
||||
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
|
||||
-DBUILD_MODULE_Draw:BOOL="OFF" \
|
||||
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
|
||||
|
||||
@@ -92,6 +94,7 @@ cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
|
||||
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
|
||||
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
|
||||
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
|
||||
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
|
||||
-DBUILD_MODULE_Draw:BOOL="OFF" \
|
||||
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
|
||||
|
||||
|
@@ -23,6 +23,7 @@ rem set "BUILD_ModelingAlgorithms=ON"
|
||||
rem set "BUILD_Visualization=ON"
|
||||
rem set "BUILD_ApplicationFramework=ON"
|
||||
rem set "BUILD_DataExchange=ON"
|
||||
rem set "BUILD_DETools=OFF"
|
||||
|
||||
rem set "USE_RAPIDJSON=ON"
|
||||
rem set "USE_DRACO=ON"
|
||||
|
@@ -14,3 +14,4 @@ export EMSDK_ROOT="$aSrcRoot/../emsdk"
|
||||
#export BUILD_Visualization=ON
|
||||
#export BUILD_ApplicationFramework=ON
|
||||
#export BUILD_DataExchange=ON
|
||||
#export BUILD_DETools=OFF
|
||||
|
30
adm/start.tcl
Normal file
30
adm/start.tcl
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/tclsh
|
||||
|
||||
# =======================================================================
|
||||
# Created on: 2014-03-21
|
||||
# Created by: OMY
|
||||
# Copyright (c) 1996-1999 Matra Datavision
|
||||
# Copyright (c) 1999-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.
|
||||
|
||||
if { [llength $argv] < 1 } {
|
||||
puts "Command-line starter for Tcl command defined in same-named file."
|
||||
puts "Use it as follows:"
|
||||
puts "\> tclsh start.tcl command \[arguments\]"
|
||||
return
|
||||
}
|
||||
|
||||
set cmdname [lindex $argv 0]
|
||||
source [file join [file dirname [info script]] $cmdname.tcl]
|
||||
|
||||
eval $cmdname [lrange $argv 1 end]
|
@@ -1,41 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@OCCT_ROOT_DIR@
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
|
||||
CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources
|
||||
DRAWHOME=@OCCT_ROOT_DIR@/resources/DrawResources
|
||||
CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data
|
||||
CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples
|
||||
CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests
|
||||
CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
|
||||
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
|
||||
CSF_OCCTDocPath=@CMAKE_SOURCE_DIR@/doc
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@OCCT_ROOT_DIR@
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
|
||||
CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources
|
||||
CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data
|
||||
CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples
|
||||
CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests
|
||||
CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
|
||||
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
|
||||
CSF_OCCTDocPath=@CMAKE_SOURCE_DIR@/doc
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@OCCT_ROOT_DIR@
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
|
||||
DRAWHOME=@OCCT_ROOT_DIR@/resources/DrawResources
|
||||
CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources
|
||||
CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data
|
||||
CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples
|
||||
CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests
|
||||
CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
|
||||
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
|
||||
CSF_OCCTDocPath=@CMAKE_SOURCE_DIR@/doc
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
|
@@ -17,21 +17,17 @@ set (OpenCASCADE_MAINTENANCE_VERSION "@OCC_VERSION_MAINTENANCE@")
|
||||
set (OpenCASCADE_DEVELOPMENT_VERSION "@OCC_VERSION_DEVELOPMENT@")
|
||||
|
||||
# Compute the installation prefix from this OpenCASCADEConfig.cmake file
|
||||
# location, by going up one level + one level if "cmake" + one level if "lib" + one level if "share".
|
||||
# location, by going up one level + one level if "cmake" + one level if "lib".
|
||||
# This is made to support different locations of CMake files:
|
||||
# - in UNIX style: $INSTALL_DIR/lib/cmake/@OCCT_PROJECT_NAME@-<version>
|
||||
# - in UNIX style: $INSTALL_DIR/lib/cmake/opencascade-<version>
|
||||
# - in Windows style: $INSTALL_DIR/cmake
|
||||
# - in vcpkg style: $INSTALL_DIR/share/@OCCT_PROJECT_NAME@
|
||||
# - in Android style: $INSTALL_DIR/libs/$CMAKE_ANDROID_ARCH_ABI/cmake/@OCCT_PROJECT_NAME@-<version>
|
||||
# - in Android style: $INSTALL_DIR/libs/$CMAKE_ANDROID_ARCH_ABI/cmake/opencascade-<version>
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$")
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
endif()
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib(32|64)?$")
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
endif()
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/share$")
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$")
|
||||
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
|
||||
endif()
|
||||
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$")
|
||||
|
@@ -1,65 +0,0 @@
|
||||
// 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 */
|
30
adm/templates/TInspectorEXE.vcxproj.user.in
Normal file
30
adm/templates/TInspectorEXE.vcxproj.user.in
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@i;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;@OpenCASCADE_BINARY_DIR@d;%PATH%
|
||||
</LocalDebuggerEnvironment>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerWorkingDirectory>@CMAKE_BINARY_DIR@</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@@ -25,16 +25,23 @@ if /I "%VCVER%" == "@COMPILER@" (
|
||||
|
||||
rem CSF_OCCTBinPath and CSF_OCCTLibPath are defined differently for
|
||||
rem multiple and single configuration builds
|
||||
@OCCT_CUSTOM_BUILD_BIN_LIB_PATHS@
|
||||
set "CSF_OCCTBinPath=@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
|
||||
if ["@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"] == [""] (
|
||||
set "CSF_OCCTBinPath=@CMAKE_BINARY_DIR@/win%ARCH%/%VCVER%/bin%3"
|
||||
)
|
||||
set "CSF_OCCTLibPath=@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"
|
||||
if ["@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"] == [""] (
|
||||
set "CSF_OCCTLibPath=@CMAKE_BINARY_DIR@/win%ARCH%/%VCVER%/lib%3"
|
||||
)
|
||||
|
||||
set "CSF_OCCTIncludePath=@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@"
|
||||
set "CSF_OCCTResourcePath=@OCCT_ROOT_DIR@/resources"
|
||||
set "CSF_OCCTDataPath=@OCCT_ROOT_DIR@/data"
|
||||
set "CSF_OCCTSamplesPath=@OCCT_ROOT_DIR@/samples"
|
||||
set "CSF_OCCTTestsPath=@OCCT_ROOT_DIR@/tests"
|
||||
set "CSF_OCCTDocPath=@OCCT_ROOT_DIR@/doc"
|
||||
set "CSF_OCCTIncludePath=@CMAKE_BINARY_DIR@/inc"
|
||||
set "CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src"
|
||||
set "CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data"
|
||||
set "CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples"
|
||||
set "CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests"
|
||||
set "CSF_OCCTDocPath=@CMAKE_SOURCE_DIR@/doc"
|
||||
|
||||
rem for compatibility with external application using CASROOT
|
||||
set "CASROOT=@OCCT_ROOT_DIR@"
|
||||
set "CASROOT=@CMAKE_SOURCE_DIR@"
|
||||
)
|
||||
)
|
||||
|
@@ -14,25 +14,24 @@ if [ "$1" == "@BIN_LETTER@" ]; then
|
||||
export FFMPEG_DIR="@3RDPARTY_FFMPEG_LIBRARY_DIR@"
|
||||
export JEMALLOC_DIR="@3RDPARTY_JEMALLOC_LIBRARY_DIR@"
|
||||
|
||||
if [ "x@3RDPARTY_QT_DIR@" != "x" ]; then
|
||||
if [ "x@3RDPARTY_QT_DIR" != "x" ]; then
|
||||
export QTDIR="@3RDPARTY_QT_DIR@"
|
||||
fi
|
||||
|
||||
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
|
||||
# CSF_OCCTBinPath and CSF_OCCTLibPath are defined differently for
|
||||
# multiple and single configuration builds
|
||||
@OCCT_CUSTOM_BUILD_BIN_LIB_PATHS@
|
||||
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@"
|
||||
export CSF_OCCTResourcePath="@OCCT_ROOT_DIR@/resources"
|
||||
export CSF_OCCTDataPath="@OCCT_ROOT_DIR@/data"
|
||||
export CSF_OCCTSamplesPath="@OCCT_ROOT_DIR@/samples"
|
||||
export CSF_OCCTTestsPath="@OCCT_ROOT_DIR@/tests"
|
||||
export CSF_OCCTDocPath="@OCCT_ROOT_DIR@/doc"
|
||||
export CSF_OCCTBinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
|
||||
export CSF_OCCTLibPath="@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"
|
||||
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/inc"
|
||||
export CSF_OCCTResourcePath="@CMAKE_SOURCE_DIR@/src"
|
||||
export CSF_OCCTDataPath="@CMAKE_SOURCE_DIR@/data"
|
||||
export CSF_OCCTSamplesPath="@CMAKE_SOURCE_DIR@/samples"
|
||||
export CSF_OCCTTestsPath="@CMAKE_SOURCE_DIR@/tests"
|
||||
export CSF_OCCTDocPath="@CMAKE_SOURCE_DIR@/doc"
|
||||
|
||||
# for compatibility with external application using CASROOT
|
||||
export CASROOT="@OCCT_ROOT_DIR@"
|
||||
export CASROOT="@CMAKE_SOURCE_DIR@"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -25,9 +25,15 @@ if /I "%VCVER%" == "@COMPILER@" (
|
||||
set "TCL_VERSION_WITH_DOT=@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
set "TK_VERSION_WITH_DOT=@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
|
||||
@OCCT_CUSTOM_BIN_LIB_PATHS@
|
||||
set "CSF_OCCTBinPath=%CASROOT%/@INSTALL_DIR_BIN@%3"
|
||||
set "CSF_OCCTLibPath=%CASROOT%/@INSTALL_DIR_LIB@%3"
|
||||
|
||||
@OCCT_CUSTOM_ADDITIONAL_PATHS@
|
||||
set "CSF_OCCTIncludePath=%CASROOT%/@INSTALL_DIR_INCLUDE@"
|
||||
set "CSF_OCCTResourcePath=%CASROOT%/@INSTALL_DIR_RESOURCE@"
|
||||
set "CSF_OCCTDataPath=%CASROOT%/@INSTALL_DIR_DATA@"
|
||||
set "CSF_OCCTSamplesPath=%CASROOT%/@INSTALL_DIR_SAMPLES@"
|
||||
set "CSF_OCCTTestsPath=%CASROOT%/@INSTALL_DIR_TESTS@"
|
||||
set "CSF_OCCTDocPath=%CASROOT%/@INSTALL_DIR_DOC@"
|
||||
)
|
||||
)
|
||||
|
||||
|
@@ -21,10 +21,14 @@ if [ "$1" == "@BIN_LETTER@" ]; then
|
||||
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
|
||||
# Set paths based on layout
|
||||
@OCCT_CUSTOM_BIN_LIB_PATHS@
|
||||
|
||||
@OCCT_CUSTOM_ADDITIONAL_PATHS@
|
||||
export CSF_OCCTBinPath="${CASROOT}/@INSTALL_DIR_BIN@"
|
||||
export CSF_OCCTLibPath="${CASROOT}/@INSTALL_DIR_LIB@"
|
||||
export CSF_OCCTIncludePath="${CASROOT}/@INSTALL_DIR_INCLUDE@"
|
||||
export CSF_OCCTResourcePath="${CASROOT}/@INSTALL_DIR_RESOURCE@"
|
||||
export CSF_OCCTDataPath="${CASROOT}/@INSTALL_DIR_DATA@"
|
||||
export CSF_OCCTSamplesPath="${CASROOT}/@INSTALL_DIR_SAMPLES@"
|
||||
export CSF_OCCTTestsPath="${CASROOT}/@INSTALL_DIR_TESTS@"
|
||||
export CSF_OCCTDocPath="${CASROOT}/@INSTALL_DIR_DOC@"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -141,8 +141,8 @@ if /I ["%1"] == ["vc141"] set "VCVER=vc14"
|
||||
if /I ["%1"] == ["vc142"] set "VCVER=vc14"
|
||||
if /I ["%1"] == ["vc143"] set "VCVER=vc14"
|
||||
|
||||
if exist "@OCCT_CUSTOM_SCRIPT_PREFIX@@OCCT_CUSTOM_SCRIPT_PATH@" (
|
||||
call "@OCCT_CUSTOM_SCRIPT_PREFIX@@OCCT_CUSTOM_SCRIPT_PATH@" %VCVER% %ARCH% %CASDEB%
|
||||
if exist "%CASROOT%\custom.bat" (
|
||||
call "%CASROOT%\custom.bat" %VCVER% %ARCH% %CASDEB%
|
||||
)
|
||||
|
||||
if not ["%QTDIR%"] == [""] (
|
||||
@@ -166,8 +166,10 @@ if not "%CSF_OCCTBinPath%" == "" (
|
||||
set "PATH=%CSF_OCCTBinPath%;%PATH%"
|
||||
)
|
||||
|
||||
if not ["%TK_DIR%"] == ["%TCL_DIR%"] (
|
||||
if not ["%TK_DIR%"] == [""] set "TK_LIBRARY=%TK_DIR%/../lib/tk%TK_VERSION_WITH_DOT%"
|
||||
if not ["%TCL_DIR%"] == [""] set "TCL_LIBRARY=%TCL_DIR%/../lib/tcl%TCL_VERSION_WITH_DOT%"
|
||||
)
|
||||
|
||||
rem ----- Set envoronment variables used by OCCT -----
|
||||
set CSF_LANGUAGE=us
|
||||
|
@@ -1,22 +1,11 @@
|
||||
#!/bin/bash
|
||||
aCurrentPath="$PWD"
|
||||
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
cd ${aCurrentPath}
|
||||
|
||||
# ----- For compatibility with external application using CASROOT -----
|
||||
if [ "${CASROOT}" == "" ]; then
|
||||
# Get the last directory name from the path
|
||||
lastDir=$(basename "$aScriptPath")
|
||||
# Check if last directory is exactly bin, bind, or bini
|
||||
if [ "$lastDir" = "bin" ] || [ "$lastDir" = "bind" ] || [ "$lastDir" = "bini" ]; then
|
||||
# If path contains binary folder, go one level up
|
||||
export CASROOT=$(cd "$aScriptPath/.." && pwd)
|
||||
else
|
||||
# Keep current location
|
||||
export CASROOT="${aScriptPath}"
|
||||
fi
|
||||
cd ${aCurrentPath}
|
||||
fi
|
||||
|
||||
# ----- Define path to 3rdparty products -----
|
||||
export THIRDPARTY_DIR="@3RDPARTY_DIR@"
|
||||
|
@@ -1,21 +1,10 @@
|
||||
#!/bin/bash
|
||||
aCurrentPath="$PWD"
|
||||
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
cd ${aCurrentPath}
|
||||
|
||||
# ----- For compatibility with external application using CASROOT -----
|
||||
if [ "${CASROOT}" == "" ]; then
|
||||
# Get the last directory name from the path
|
||||
lastDir=$(basename "$aScriptPath")
|
||||
# Check if last directory is exactly bin, bind, or bini
|
||||
if [ "$lastDir" = "bin" ] || [ "$lastDir" = "bind" ] || [ "$lastDir" = "bini" ]; then
|
||||
# If path contains binary folder, go one level up
|
||||
export CASROOT=$(cd "$aScriptPath/.." && pwd)
|
||||
else
|
||||
# Keep current location
|
||||
export CASROOT="${aScriptPath}"
|
||||
fi
|
||||
cd ${aCurrentPath}
|
||||
export CASROOT="@INSTALL_DIR@"
|
||||
fi
|
||||
|
||||
# ----- Define path to 3rdparty products -----
|
||||
@@ -34,7 +23,7 @@ shopt -u nocasematch
|
||||
|
||||
# ----- Set path to 3rd party and OCCT libraries -----
|
||||
anArch=`uname -m`
|
||||
if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ] && [ "$anArch" != "aarch64" ] && [ "$anArch" != "arm64" ]; then
|
||||
if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ] && [ "$anArch" != "aarch64"]; then
|
||||
export ARCH="32";
|
||||
else
|
||||
export ARCH="64";
|
||||
@@ -43,13 +32,14 @@ fi
|
||||
aSystem=`uname -s`
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export WOKSTATION="mac";
|
||||
export ARCH="64";
|
||||
else
|
||||
export WOKSTATION="lin";
|
||||
fi
|
||||
|
||||
# ----- Set local settings -----
|
||||
if [ -e "@OCCT_CUSTOM_SCRIPT_PREFIX@@OCCT_CUSTOM_SCRIPT_PATH@" ]; then
|
||||
source "@OCCT_CUSTOM_SCRIPT_PREFIX@@OCCT_CUSTOM_SCRIPT_PATH@" "${CASDEB}" "${ARCH}"
|
||||
if [ -e "${CASROOT}/@INSTALL_DIR_SCRIPT@/custom.sh" ]; then
|
||||
source "${CASROOT}/@INSTALL_DIR_SCRIPT@/custom.sh" "${CASDEB}" "${ARCH}"
|
||||
fi
|
||||
|
||||
THRDPARTY_PATH=""
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user