mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
Compare commits
1 Commits
CR0-gltfpa
...
CR0_fix_se
Author | SHA1 | Date | |
---|---|---|---|
|
dff941292a |
62
.github/actions/build-docs/action.yml
vendored
62
.github/actions/build-docs/action.yml
vendored
@@ -10,59 +10,37 @@ runs:
|
||||
choco install -y doxygen.install
|
||||
shell: pwsh
|
||||
|
||||
- name: Download and extract 3rdparty dependencies
|
||||
- name: Build refman documentation
|
||||
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: Configure OCCT
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -T host=x64 `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_TK=OFF `
|
||||
-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 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-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=ON `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
-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
|
||||
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: build/doc/refman
|
||||
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: build/doc/overview
|
||||
path: doc/overview
|
||||
retention-days: 90
|
||||
|
234
.github/actions/build-occt/action.yml
vendored
234
.github/actions/build-occt/action.yml
vendored
@@ -1,234 +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'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download and extract 3rdparty dependencies (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
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 (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 Ninja (Windows Clang)
|
||||
if: ${{ inputs.platform == 'windows' && inputs.compiler == 'clang' }}
|
||||
run: |
|
||||
choco install ninja -y
|
||||
ninja --version
|
||||
shell: pwsh
|
||||
|
||||
- name: Install dependencies (macOS)
|
||||
if: ${{ inputs.platform == 'macos' }}
|
||||
run: |
|
||||
brew update
|
||||
brew install tcl-tk tbb gl2ps xerces-c \
|
||||
libxmu libxi libxft libxpm \
|
||||
glew freeimage draco glfw
|
||||
shell: bash
|
||||
|
||||
- name: Install dependencies (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake ${{ inputs.compiler == 'clang' && '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
|
||||
shell: bash
|
||||
|
||||
- name: Install rapidjson (macOS/Linux)
|
||||
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
|
||||
run: |
|
||||
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
|
||||
unzip rapidjson.zip
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT (Windows MSVC)
|
||||
if: ${{ inputs.platform == 'windows' && inputs.compiler == 'msvc' }}
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -T host=x64 `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_TK=OFF `
|
||||
-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 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-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 }} ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure OCCT (Windows Clang)
|
||||
if: ${{ inputs.platform == 'windows' && inputs.compiler == 'clang' }}
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Ninja" `
|
||||
-D CMAKE_C_COMPILER=clang `
|
||||
-D CMAKE_CXX_COMPILER=clang++ `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_TK=OFF `
|
||||
-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 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-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 }} ..
|
||||
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 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
|
||||
-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 }} ..
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
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_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} \
|
||||
-D USE_TK=OFF \
|
||||
-D CMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} \
|
||||
-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=ON \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=${{ inputs.use-vtk }} \
|
||||
-D USE_TBB=OFF \
|
||||
-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 }} ..
|
||||
shell: bash
|
||||
|
||||
- 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.4.3
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: install
|
||||
retention-days: 7
|
23
.github/actions/build-tinspector/action.yml
vendored
23
.github/actions/build-tinspector/action.yml
vendored
@@ -35,18 +35,11 @@ runs:
|
||||
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 6da9ba776ef72a17dca3331974df4200024c7f34
|
||||
|
||||
- name: Configure TInspector - Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd inspector
|
||||
cd tools
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "Visual Studio 17 2022" -A x64 `
|
||||
@@ -54,42 +47,40 @@ runs:
|
||||
-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 `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/tools/install `
|
||||
..
|
||||
|
||||
- name: Configure TInspector - Linux
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
cd inspector
|
||||
cd tools
|
||||
mkdir build
|
||||
cd build
|
||||
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 INSTALL_DIR=${{ github.workspace }}/tools/install \
|
||||
..
|
||||
|
||||
- name: Build TInspector - Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
run: |
|
||||
cd inspector/build
|
||||
cd tools/build
|
||||
cmake --build . --config Release --target install
|
||||
|
||||
- name: Build TInspector - Linux
|
||||
if: inputs.platform == 'linux'
|
||||
shell: bash
|
||||
run: |
|
||||
cd inspector/build
|
||||
cd tools/build
|
||||
make install -j$(nproc)
|
||||
|
||||
- name: Upload TInspector installation
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: inspector-${{ inputs.platform }}-x64
|
||||
path: inspector/install
|
||||
path: tools/install
|
||||
retention-days: 7
|
||||
|
@@ -8,7 +8,7 @@ inputs:
|
||||
file-pattern:
|
||||
description: 'Pattern to match files for formatting check'
|
||||
required: false
|
||||
default: '^(src)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
|
||||
default: '^(src|tools)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
|
||||
clang-format-version:
|
||||
description: 'Required clang-format version'
|
||||
required: false
|
||||
@@ -39,9 +39,7 @@ runs:
|
||||
shell: pwsh
|
||||
run: |
|
||||
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
|
||||
Where-Object { $_ -match '${{ inputs.file-pattern }}' } |
|
||||
Where-Object { Test-Path $_ }
|
||||
|
||||
Where-Object { $_ -match '${{ inputs.file-pattern }}' }
|
||||
$changedFiles | Set-Content "changed_files.txt"
|
||||
if ($changedFiles.Count -gt 0) {
|
||||
echo "has_files=true" >> $env:GITHUB_OUTPUT
|
||||
@@ -51,7 +49,7 @@ runs:
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$files = Get-Content "changed_files.txt" | Where-Object { Test-Path $_ }
|
||||
$files = Get-Content "changed_files.txt"
|
||||
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
|
||||
clang-format -i -style=file $_
|
||||
}
|
||||
|
321
.github/actions/retest-failures/action.yml
vendored
321
.github/actions/retest-failures/action.yml
vendored
@@ -1,321 +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.1.7
|
||||
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.1.7
|
||||
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 and extract 3rdparty dependencies (Windows)
|
||||
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: pwsh
|
||||
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
|
||||
|
||||
- name: Install dependencies (macOS)
|
||||
if: ${{ inputs.platform == 'macos' && steps.check_failures.outputs.failed_count > 0 }}
|
||||
shell: bash
|
||||
run: |
|
||||
brew update
|
||||
brew install tcl-tk tbb gl2ps xerces-c \
|
||||
libxmu libxi libxft libxpm \
|
||||
glew freeimage draco glfw
|
||||
|
||||
- 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 tcl-dev tk-dev cmake ${{ inputs.compiler == 'clang' && '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 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.1.7
|
||||
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 ${{ inputs.compiler == 'clang' && 'clang' || '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 ${{ inputs.compiler == 'clang' && 'clang' || '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
|
||||
if: steps.check_failures.outputs.failed_count > 0
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: ${{ inputs.results-artifact-name }}-retest
|
||||
path: install/${{ (inputs.platform == 'windows') && '' || '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 ${{ inputs.compiler == 'clang' && 'clang' || '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
|
145
.github/actions/run-gtest/action.yml
vendored
145
.github/actions/run-gtest/action.yml
vendored
@@ -1,145 +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.1.7
|
||||
with:
|
||||
name: ${{ inputs.install-artifact-name }}
|
||||
path: install
|
||||
|
||||
- name: Download and extract 3rdparty dependencies for Windows
|
||||
if: inputs.platform == 'windows'
|
||||
shell: pwsh
|
||||
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
|
||||
|
||||
- name: Install macOS dependencies
|
||||
if: inputs.platform == 'macos'
|
||||
shell: bash
|
||||
run: |
|
||||
brew update
|
||||
brew install tcl-tk tbb gl2ps xerces-c \
|
||||
libxmu libxi libxft libxpm \
|
||||
glew freeimage draco glfw
|
||||
|
||||
- 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 ${{ inputs.compiler == 'msvc' && 'vc14' || 'clang' }} win64 release
|
||||
cd bin
|
||||
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.4.3
|
||||
with:
|
||||
name: gtest-results-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.artifact-suffix }}
|
||||
path: |
|
||||
install/bin/gtest_results.xml
|
||||
install/bin/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/bin
|
||||
$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
|
178
.github/actions/run-tests/action.yml
vendored
178
.github/actions/run-tests/action.yml
vendored
@@ -1,178 +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 and extract 3rdparty dependencies (Windows)
|
||||
if: ${{ inputs.platform == 'windows' }}
|
||||
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: Install dependencies (macOS)
|
||||
if: ${{ inputs.platform == 'macos' }}
|
||||
run: |
|
||||
brew update
|
||||
brew install tcl-tk tbb gl2ps xerces-c \
|
||||
libxmu libxi libxft libxpm \
|
||||
glew freeimage draco glfw
|
||||
shell: bash
|
||||
|
||||
- name: Install dependencies (Linux)
|
||||
if: ${{ inputs.platform == 'linux' }}
|
||||
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake ${{ inputs.compiler == 'gcc' && 'gcc g++' || '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 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.1.7
|
||||
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 ${{ inputs.compiler == 'msvc' && 'vc14' || 'clang' }} 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 ${{ inputs.compiler == 'msvc' && 'vc14' || 'clang' }} 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.4.3
|
||||
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.4.3
|
||||
with:
|
||||
name: results-${{ inputs.test-directory-name }}
|
||||
path: |
|
||||
install/bin/results/**/*.log
|
||||
install/bin/results/**/*.png
|
||||
install/bin/results/**/*.html
|
||||
retention-days: 15
|
96
.github/actions/test-summary/action.yml
vendored
96
.github/actions/test-summary/action.yml
vendored
@@ -1,96 +0,0 @@
|
||||
name: 'Test Summary'
|
||||
description: 'Compare test results between current branch and master'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- 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 tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-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.1.7
|
||||
with:
|
||||
name: install-linux-gcc-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 windows-clang-x64 macos-x64 macos-gcc-x64 linux-clang-x64 linux-gcc-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 windows-clang-x64 macos-x64 macos-gcc-x64 linux-clang-x64 linux-gcc-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 windows-clang-x64 macos-x64 macos-gcc-x64 linux-clang-x64 linux-gcc-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.4.3
|
||||
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
|
1735
.github/workflows/build-and-test-multiplatform.yml
vendored
1735
.github/workflows/build-and-test-multiplatform.yml
vendored
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@ concurrency:
|
||||
jobs:
|
||||
main_job:
|
||||
name: Windows MinGW validation
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
2
.github/workflows/build-multiconfig-msvc.yml
vendored
2
.github/workflows/build-multiconfig-msvc.yml
vendored
@@ -16,7 +16,7 @@ concurrency:
|
||||
jobs:
|
||||
main_job:
|
||||
name: Windows MSVC/Clang validation
|
||||
runs-on: windows-2025
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
3
.github/workflows/build-occt-with-vcpkg.yml
vendored
3
.github/workflows/build-occt-with-vcpkg.yml
vendored
@@ -25,7 +25,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2025, macos-15, macos-14, macos-13, ubuntu-24.04-arm, ubuntu-22.04-arm]
|
||||
os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2019, macos-15, macos-14, macos-13]
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
@@ -114,7 +114,6 @@ jobs:
|
||||
-DUSE_TK=OFF \
|
||||
-DBUILD_USE_PCH=ON \
|
||||
-DBUILD_INCLUDE_SYMLINK=ON \
|
||||
-DBUILD_LIBRARY_TYPE="Static" \
|
||||
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
|
||||
-DUSE_DRACO=ON \
|
||||
-DUSE_FFMPEG=ON \
|
||||
|
173
CMakeLists.txt
173
CMakeLists.txt
@@ -65,28 +65,32 @@ 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)
|
||||
else ()
|
||||
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 (${CMAKE_SOURCE_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
|
||||
@@ -225,15 +229,6 @@ 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()
|
||||
@@ -327,6 +322,9 @@ elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
set (BIN_LETTER "i")
|
||||
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}")
|
||||
separate_arguments (BUILD_ADDITIONAL_TOOLKITS)
|
||||
@@ -336,6 +334,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")
|
||||
@@ -390,11 +390,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})
|
||||
@@ -408,13 +407,17 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND BUILD_MODULE_Draw)
|
||||
message (STATUS "Info. Draw module is turned off due to it is not supported on UWP")
|
||||
set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
|
||||
endif()
|
||||
if (EMSCRIPTEN AND BUILD_MODULE_DETools)
|
||||
message (STATUS "Info. DETools module is turned off due to it is not supported on Emscripten")
|
||||
set (BUILD_MODULE_DETools OFF CACHE BOOL "${BUILD_MODULE_DETools_DESCR}" FORCE)
|
||||
endif()
|
||||
|
||||
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
|
||||
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()
|
||||
|
||||
@@ -449,10 +452,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)
|
||||
@@ -484,18 +483,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()
|
||||
OCCT_ADD_VCPKG_FEATURE ("tcl")
|
||||
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/tcl")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
|
||||
@@ -506,6 +497,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)
|
||||
@@ -513,6 +505,7 @@ else()
|
||||
endif()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
|
||||
OCCT_UNSET_VCPKG_FEATURE ("tk")
|
||||
endif()
|
||||
|
||||
# Xlib
|
||||
@@ -722,7 +715,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()
|
||||
@@ -730,7 +723,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()
|
||||
@@ -759,8 +752,8 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC")
|
||||
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")
|
||||
@@ -785,6 +778,9 @@ file(COPY ${CMAKE_SOURCE_DIR}/.clang-format DESTINATION ${CMAKE_SOURCE_DIR})
|
||||
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)
|
||||
@@ -916,7 +912,7 @@ 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
|
||||
# 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})
|
||||
@@ -1032,6 +1028,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}")
|
||||
@@ -1074,8 +1092,14 @@ 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 "${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)
|
||||
# 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}")
|
||||
@@ -1157,9 +1181,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()
|
||||
|
||||
@@ -1188,36 +1212,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)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/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()
|
||||
else()
|
||||
# Disable GTest integration if not enabled
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GTEST")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("GTest")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_GTEST")
|
||||
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
|
||||
@@ -1237,10 +1236,17 @@ 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)
|
||||
@@ -1262,7 +1268,7 @@ endif()
|
||||
|
||||
OCCT_MODULES_AND_TOOLKITS (SAMPLES "SAMPLES_TOOLKITS" OCCT_SAMPLES)
|
||||
|
||||
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)
|
||||
@@ -1291,6 +1297,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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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")
|
||||
|
@@ -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")
|
||||
|
||||
# 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()
|
||||
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")
|
||||
|
||||
# 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 "${CMAKE_SOURCE_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 "${CMAKE_SOURCE_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 "${CMAKE_SOURCE_DIR}/dox/resources/occt_ug_html.doxyfile")
|
||||
else()
|
||||
set(TEMPLATE_DOXYFILE "${CMAKE_SOURCE_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 = ${CMAKE_SOURCE_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 = ${CMAKE_SOURCE_DIR}/dox\n")
|
||||
endif()
|
||||
|
||||
# Collect image directories for overview
|
||||
set(OVERVIEW_INPUT_DIRS ${CMAKE_SOURCE_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} ${CMAKE_SOURCE_DIR}/dox/resources\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_DIR}/dox/resources\n")
|
||||
endif()
|
||||
|
||||
# Example paths
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXAMPLE_PATH = ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_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 = ${CMAKE_SOURCE_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 = ${CMAKE_SOURCE_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 "${CMAKE_SOURCE_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 ${CMAKE_SOURCE_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} ${CMAKE_SOURCE_DIR}/dox/resources\n")
|
||||
else()
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_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 "${CMAKE_SOURCE_DIR}/dox/resources/custom.css")
|
||||
file(APPEND ${DOXYGEN_CONFIG_FILE} "HTML_EXTRA_STYLESHEET = ${CMAKE_SOURCE_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 "${CMAKE_SOURCE_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 ${CMAKE_SOURCE_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 ${CMAKE_SOURCE_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file(COPY "${CMAKE_SOURCE_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 "${CMAKE_SOURCE_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=${CMAKE_SOURCE_DIR}/resources/SHMessage"
|
||||
"CSF_MDTVTexturesDirectory=${CMAKE_SOURCE_DIR}/resources/Textures"
|
||||
"CSF_ShadersDirectory=${CMAKE_SOURCE_DIR}/resources/Shaders"
|
||||
"CSF_XSMessage=${CMAKE_SOURCE_DIR}/resources/XSMessage"
|
||||
"CSF_TObjMessage=${CMAKE_SOURCE_DIR}/resources/TObj"
|
||||
"CSF_StandardDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
|
||||
"CSF_PluginDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
|
||||
"CSF_XCAFDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
|
||||
"CSF_TObjDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
|
||||
"CSF_StandardLiteDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
|
||||
"CSF_IGESDefaults=${CMAKE_SOURCE_DIR}/resources/XSTEPResource"
|
||||
"CSF_STEPDefaults=${CMAKE_SOURCE_DIR}/resources/XSTEPResource"
|
||||
"CSF_XmlOcafResource=${CMAKE_SOURCE_DIR}/resources/XmlOcafResource"
|
||||
"CSF_MIGRATION_TYPES=${CMAKE_SOURCE_DIR}/resources/StdResource/MigrationSheet.txt"
|
||||
"CSF_OCCTResourcePath=${CMAKE_SOURCE_DIR}/resources"
|
||||
"CSF_OCCTDataPath=${CMAKE_SOURCE_DIR}/data"
|
||||
"CSF_OCCTDocPath=${CMAKE_SOURCE_DIR}/doc"
|
||||
"CSF_OCCTSamplesPath=${CMAKE_SOURCE_DIR}/samples"
|
||||
"CSF_OCCTTestsPath=${CMAKE_SOURCE_DIR}/tests"
|
||||
"CSF_OCCTBinPath=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
|
||||
"CSF_OCCTLibPath=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}"
|
||||
"CSF_OCCTIncludePath=${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}"
|
||||
"CASROOT=${CMAKE_SOURCE_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 "${CMAKE_SOURCE_DIR}/resources/DrawResources")
|
||||
list(APPEND TEST_ENVIRONMENT "DRAWHOME=${CMAKE_SOURCE_DIR}/resources/DrawResources")
|
||||
list(APPEND TEST_ENVIRONMENT "CSF_DrawPluginDefaults=${CMAKE_SOURCE_DIR}/resources/DrawResources")
|
||||
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/resources/DrawResources/DrawDefault")
|
||||
list(APPEND TEST_ENVIRONMENT "DRAWDEFAULT=${CMAKE_SOURCE_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()
|
@@ -34,7 +34,9 @@ endmacro()
|
||||
|
||||
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
|
||||
set (LOCAL_FILE_CONTENT)
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
|
||||
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()
|
||||
|
||||
@@ -42,7 +44,9 @@ function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
|
||||
endfunction()
|
||||
|
||||
function(FIND_FOLDER_OR_FILE FILE_OR_FOLDER_NAME RESULT_PATH)
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
|
||||
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)
|
||||
@@ -72,9 +76,24 @@ endmacro()
|
||||
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")
|
||||
message (AUTHOR_WARNING "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
|
||||
@@ -84,28 +103,28 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
||||
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")
|
||||
message (AUTHOR_WARNING "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")
|
||||
message (AUTHOR_WARNING "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")
|
||||
message (AUTHOR_WARNING "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")
|
||||
message (AUTHOR_WARNING "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")
|
||||
message (AUTHOR_WARNING "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
|
||||
endif()
|
||||
set (COMPILER icc)
|
||||
else()
|
||||
@@ -156,8 +175,25 @@ function (FIND_SUBDIRECTORY ROOT_DIRECTORY DIRECTORY_SUFFIX SUBDIRECTORY_NAME)
|
||||
endfunction()
|
||||
|
||||
function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
|
||||
|
||||
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}")
|
||||
set (${RESULT} ${ORIGIN_FILES} PARENT_SCOPE)
|
||||
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 +249,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 "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
|
||||
install (DIRECTORY "${CMAKE_SOURCE_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 "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
endif()
|
||||
else()
|
||||
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
|
||||
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("${CMAKE_SOURCE_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 +314,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 +348,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 +359,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 +368,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 +380,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 +391,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,7 +412,9 @@ endfunction()
|
||||
|
||||
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
|
||||
set (LOCAL_FILE_CONTENT)
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
|
||||
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()
|
||||
|
||||
@@ -355,6 +426,9 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
|
||||
|
||||
# consider patched header.in template
|
||||
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 +437,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,7 +477,7 @@ 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()
|
||||
|
||||
@@ -428,12 +497,10 @@ 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()
|
||||
|
||||
@@ -442,14 +509,25 @@ macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT 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("${CMAKE_SOURCE_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 "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
|
||||
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")
|
||||
@@ -684,7 +762,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}\")
|
||||
@@ -828,12 +906,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 "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}")
|
||||
file (STRINGS "${CMAKE_SOURCE_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: ${CMAKE_SOURCE_DIR}/resources/${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")
|
||||
# read resource file
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${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")
|
||||
# Save generated content to header file
|
||||
set (HEADER_FILE "${OCCT_${CurrentResource_Directory}_FILES_LOCATION}/${HEADER_FILE_NAME}")
|
||||
if (EXISTS "${HEADER_FILE}")
|
||||
file (REMOVE "${HEADER_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 src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
|
||||
|
||||
# read resource file
|
||||
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};")
|
||||
|
||||
# Save generated content to header file
|
||||
set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")
|
||||
if (EXISTS "${HEADER_FILE}")
|
||||
file (REMOVE "${HEADER_FILE}")
|
||||
endif()
|
||||
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
|
||||
endif()
|
||||
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
@@ -63,13 +63,13 @@ 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("${CMAKE_SOURCE_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)
|
||||
@@ -129,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()
|
||||
@@ -189,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}")
|
||||
@@ -277,18 +281,19 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(IS_VTK_9XX)
|
||||
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
|
||||
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()
|
||||
endif()
|
||||
|
||||
target_link_libraries (${PROJECT_NAME} PUBLIC ${USED_TOOLKITS_BY_CURRENT_PROJECT} PRIVATE ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
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()
|
||||
|
||||
|
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 "")
|
@@ -31,26 +31,13 @@ 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)
|
||||
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)
|
||||
else()
|
||||
set (3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
|
||||
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)
|
||||
|
@@ -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()
|
||||
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
||||
|
||||
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()
|
||||
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
||||
|
||||
separate_arguments (CSF_TBB)
|
||||
foreach (LIB IN LISTS CSF_TBB)
|
||||
|
@@ -273,12 +273,13 @@ if (TK_FOUND AND 3RDPARTY_TCL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# hide all redundant variables
|
||||
# TCL
|
||||
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)
|
||||
|
||||
|
@@ -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,5 +1,13 @@
|
||||
# variable description
|
||||
|
||||
#
|
||||
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
|
||||
are linked dynamically and loaded at runtime. 'Static' libraries
|
||||
@@ -113,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")
|
||||
@@ -136,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.")
|
||||
|
||||
@@ -199,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()
|
||||
|
@@ -16,7 +16,7 @@
|
||||
# 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_MAJOR 7 )
|
||||
set (OCC_VERSION_MINOR 9 )
|
||||
set (OCC_VERSION_MAINTENANCE 0 )
|
||||
set (OCC_VERSION_DEVELOPMENT "rc1" )
|
||||
set (OCC_VERSION_DEVELOPMENT "beta2" )
|
||||
|
@@ -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")
|
||||
@@ -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
|
||||
}
|
940
adm/occaux.tcl
Normal file
940
adm/occaux.tcl
Normal file
@@ -0,0 +1,940 @@
|
||||
# =======================================================================
|
||||
# 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 version.cmake (if available)
|
||||
proc OCCDoc_DetectCasVersion {} {
|
||||
# Default version in case the file is not found or readable
|
||||
set occt_ver "7.8.0"
|
||||
set occt_ver_add ""
|
||||
|
||||
# Construct path to version.cmake relative to script location
|
||||
set filename "[file normalize [file dirname [info script]]/cmake/version.cmake]"
|
||||
|
||||
if { [file exists $filename] && [file readable $filename] } {
|
||||
if {[catch {
|
||||
set fh [open $filename "r"]
|
||||
set fh_loaded [read $fh]
|
||||
close $fh
|
||||
|
||||
# Use more robust regular expressions
|
||||
regexp {OCC_VERSION_MAJOR\s+(\d+)} $fh_loaded -> major
|
||||
regexp {OCC_VERSION_MINOR\s+(\d+)} $fh_loaded -> minor
|
||||
regexp {OCC_VERSION_MAINTENANCE\s+(\d+)} $fh_loaded -> maint
|
||||
regexp {OCC_VERSION_DEVELOPMENT\s+\"([^\"]+)\"} $fh_loaded -> occt_ver_add
|
||||
|
||||
if {[info exists major] && [info exists minor] && [info exists maint]} {
|
||||
puts "Info: Open CASCADE Technology version $major.$minor.$maint"
|
||||
set occt_ver "$major.$minor.$maint"
|
||||
if { [info exists occt_ver_add] && $occt_ver_add != "" } {
|
||||
set occt_ver ${occt_ver}.$occt_ver_add
|
||||
}
|
||||
}
|
||||
} err]} {
|
||||
puts "Warning: Error reading version from $filename: $err"
|
||||
}
|
||||
} else {
|
||||
puts "Warning: Version file $filename not found or not readable"
|
||||
}
|
||||
|
||||
return $occt_ver
|
||||
}
|
||||
|
||||
# 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"
|
||||
@@ -167,6 +168,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"
|
||||
|
@@ -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
|
||||
@@ -147,6 +148,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
|
||||
@@ -144,6 +145,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
|
||||
@@ -154,6 +155,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
|
||||
@@ -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]
|
@@ -3,8 +3,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resources
|
||||
DRAWHOME=@CMAKE_SOURCE_DIR@/resources/DrawResources
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
|
||||
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
|
||||
@@ -17,7 +16,7 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resources
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
|
||||
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
|
||||
@@ -30,8 +29,7 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
|
||||
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
|
||||
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
|
||||
DRAWHOME=@CMAKE_SOURCE_DIR@/resources/DrawResources
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resources
|
||||
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
|
||||
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
|
||||
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
|
||||
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
|
||||
|
@@ -27,7 +27,7 @@ get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX
|
||||
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)?$")
|
||||
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}$")
|
||||
|
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>
|
@@ -35,7 +35,7 @@ if /I "%VCVER%" == "@COMPILER@" (
|
||||
)
|
||||
|
||||
set "CSF_OCCTIncludePath=@CMAKE_BINARY_DIR@/inc"
|
||||
set "CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resources"
|
||||
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"
|
||||
|
@@ -24,7 +24,7 @@ if [ "$1" == "@BIN_LETTER@" ]; then
|
||||
export CSF_OCCTBinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
|
||||
export CSF_OCCTLibPath="@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"
|
||||
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@"
|
||||
export CSF_OCCTResourcePath="@CMAKE_SOURCE_DIR@/resources"
|
||||
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"
|
||||
|
@@ -166,8 +166,10 @@ if not "%CSF_OCCTBinPath%" == "" (
|
||||
set "PATH=%CSF_OCCTBinPath%;%PATH%"
|
||||
)
|
||||
|
||||
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%"
|
||||
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,2 +1 @@
|
||||
// clang-format off
|
||||
@OCCT_HEADER_FILE_CONTENT@// clang-format on
|
||||
@OCCT_HEADER_FILE_CONTENT@
|
||||
|
17
adm/templates/inspector.bat
Normal file
17
adm/templates/inspector.bat
Normal file
@@ -0,0 +1,17 @@
|
||||
@echo off
|
||||
|
||||
rem Use:
|
||||
rem - first argument specifies version of Visual Studio (vc8, vc9, or vc10),
|
||||
rem - second argument specifies architecture (win32 or win64),
|
||||
rem - third argument specifies build mode (Debug or Release)
|
||||
rem - fourth and next arguments specify loaded tool plugins
|
||||
rem The arguments are: dfbrowser shapeview vinspector
|
||||
rem If there are no tool plugins are specified, all plugins will be loaded
|
||||
rem Default options are:
|
||||
rem vc8 win32 Release
|
||||
|
||||
rem Setup environment and launch TInspector
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
TInspectorEXE.exe %*
|
||||
|
9
adm/templates/inspector.sh
Normal file
9
adm/templates/inspector.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
aCurrentPath="$PWD"
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
|
||||
source "${aScriptPath}/env.sh" "$1"
|
||||
|
||||
cd ${aCurrentPath}
|
||||
TInspectorEXE
|
25
adm/vcpkg/ports/ffmpeg/0001-create-lib-libraries.patch
Normal file
25
adm/vcpkg/ports/ffmpeg/0001-create-lib-libraries.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
diff --git a/configure b/configure
|
||||
index 89af70d..405680e 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5480,15 +5480,17 @@ case $target_os in
|
||||
;;
|
||||
win32|win64)
|
||||
disable symver
|
||||
- if enabled shared; then
|
||||
+# if enabled shared; then
|
||||
# Link to the import library instead of the normal static library
|
||||
# for shared libs.
|
||||
LD_LIB='%.lib'
|
||||
# Cannot build both shared and static libs with MSVC or icl.
|
||||
- disable static
|
||||
- fi
|
||||
+# disable static
|
||||
+# fi
|
||||
enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
|
||||
shlibdir_default="$bindir_default"
|
||||
+ LIBPREF=""
|
||||
+ LIBSUF=".lib"
|
||||
SLIBPREF=""
|
||||
SLIBSUF=".dll"
|
||||
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
|
13
adm/vcpkg/ports/ffmpeg/0003-fix-windowsinclude.patch
Normal file
13
adm/vcpkg/ports/ffmpeg/0003-fix-windowsinclude.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
|
||||
index fe424b6..2df70df 100644
|
||||
--- a/fftools/cmdutils.c
|
||||
+++ b/fftools/cmdutils.c
|
||||
@@ -60,6 +60,8 @@
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
+#define _WIN32_WINNT 0x0502
|
||||
+#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
40
adm/vcpkg/ports/ffmpeg/0004-fix-debug-build.patch
Normal file
40
adm/vcpkg/ports/ffmpeg/0004-fix-debug-build.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
diff --git a/configure b/configure
|
||||
index 405680e..cc5bf29 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -4111,6 +4111,9 @@ for opt do
|
||||
--libfuzzer=*)
|
||||
libfuzzer_path="$optval"
|
||||
;;
|
||||
+ --debug)
|
||||
+ enable debug_configure
|
||||
+ ;;
|
||||
*)
|
||||
optname="${opt%%=*}"
|
||||
optname="${optname#--}"
|
||||
@@ -6316,7 +6319,11 @@ fi
|
||||
|
||||
enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
|
||||
check_lib zlib zlib.h zlibVersion -lz; }
|
||||
-enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
|
||||
+if enabled debug_configure; then
|
||||
+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d
|
||||
+else
|
||||
+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
|
||||
+fi
|
||||
enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
|
||||
|
||||
# On some systems dynamic loading requires no extra linker flags
|
||||
@@ -6434,7 +6441,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8
|
||||
enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
|
||||
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
|
||||
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
|
||||
-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
|
||||
+if enabled debug_configure; then
|
||||
+ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
|
||||
+else
|
||||
+ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
|
||||
+fi
|
||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
||||
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
|
||||
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
|
49
adm/vcpkg/ports/ffmpeg/0006-fix-StaticFeatures.patch
Normal file
49
adm/vcpkg/ports/ffmpeg/0006-fix-StaticFeatures.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
diff --git a/configure b/configure
|
||||
index cc5bf29..ee26559 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6406,7 +6406,8 @@ if enabled libmfx; then
|
||||
fi
|
||||
|
||||
enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
|
||||
-enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
|
||||
+enabled libmp3lame && { check_lib libmp3lame lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs ||
|
||||
+ require libmp3lame lame/lame.h lame_set_VBR_quality -llibmp3lame-static -llibmpghip-static $libm_extralibs; }
|
||||
enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
|
||||
require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
|
||||
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei ||
|
||||
@@ -6446,7 +6447,7 @@ if enabled debug_configure; then
|
||||
else
|
||||
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
|
||||
fi
|
||||
-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
||||
+enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -lm
|
||||
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
|
||||
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
|
||||
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
|
||||
@@ -6527,6 +6528,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal"
|
||||
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
|
||||
check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
|
||||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
|
||||
+ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -lAdvapi32 -lOle32 -lCfgmgr32||
|
||||
+ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -pthread -ldl ||
|
||||
die "ERROR: opencl not found"; } &&
|
||||
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
|
||||
test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
|
||||
@@ -6550,6 +6553,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
|
||||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
|
||||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
|
||||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
|
||||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lws2_32 -lgdi32 -lcrypt32 -lAdvapi32 -lUser32||
|
||||
die "ERROR: openssl not found"; }
|
||||
enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
|
||||
enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
|
||||
@@ -6811,7 +6815,7 @@ enabled amf &&
|
||||
if enabled libc_iconv; then
|
||||
check_func_headers iconv.h iconv
|
||||
elif enabled iconv; then
|
||||
- check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
|
||||
+ check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv || check_lib iconv iconv.h iconv -liconv -llibcharset
|
||||
fi
|
||||
|
||||
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
|
15
adm/vcpkg/ports/ffmpeg/0007-fix-lib-naming.patch
Normal file
15
adm/vcpkg/ports/ffmpeg/0007-fix-lib-naming.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
diff --git a/configure b/configure
|
||||
index ee26559..f2c83b7 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -4496,6 +4496,10 @@ msvc_common_flags(){
|
||||
-march=*) ;;
|
||||
-lz) echo zlib.lib ;;
|
||||
-lx264) echo libx264.lib ;;
|
||||
+ -lx265) echo libx265.lib ;;
|
||||
+ -lmp3lame) echo libmp3lame.lib ;;
|
||||
+ -liconv) echo iconv.lib ;;
|
||||
+ -lm) ;;
|
||||
-lstdc++) ;;
|
||||
-l*) echo ${flag#-l}.lib ;;
|
||||
-LARGEADDRESSAWARE) echo $flag ;;
|
13
adm/vcpkg/ports/ffmpeg/0009-Fix-fdk-detection.patch
Normal file
13
adm/vcpkg/ports/ffmpeg/0009-Fix-fdk-detection.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/configure b/configure
|
||||
index f2c83b7..5e42b12 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6379,7 +6379,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.
|
||||
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
|
||||
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
|
||||
enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
|
||||
- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
|
||||
+ { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac -lm -lstdc++ &&
|
||||
warn "using libfdk without pkg-config"; } }
|
||||
flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
|
||||
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
|
13
adm/vcpkg/ports/ffmpeg/0010-Fix-x264-detection.patch
Normal file
13
adm/vcpkg/ports/ffmpeg/0010-Fix-x264-detection.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/configure b/configure
|
||||
index 5e42b12..d8f059f 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6497,7 +6497,7 @@ enabled libwebp && {
|
||||
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
|
||||
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
|
||||
enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
|
||||
- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
|
||||
+ { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" &&
|
||||
warn "using libx264 without pkg-config"; } } &&
|
||||
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
|
||||
check_cpp_condition libx262 x264.h "X264_MPEG2"
|
16
adm/vcpkg/ports/ffmpeg/0011-Fix-x265-detection.patch
Normal file
16
adm/vcpkg/ports/ffmpeg/0011-Fix-x265-detection.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff --git a/configure b/configure
|
||||
index d8f059f..f3688ad 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6501,7 +6501,10 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x
|
||||
warn "using libx264 without pkg-config"; } } &&
|
||||
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
|
||||
check_cpp_condition libx262 x264.h "X264_MPEG2"
|
||||
-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
|
||||
+enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get ||
|
||||
+ { { check_lib libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" ||
|
||||
+ require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++"; } &&
|
||||
+ warn "using libx265 without pkg-config"; } } &&
|
||||
require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
|
||||
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
|
||||
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
|
12
adm/vcpkg/ports/ffmpeg/0012-Fix-ssl-110-detection.patch
Normal file
12
adm/vcpkg/ports/ffmpeg/0012-Fix-ssl-110-detection.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/configure b/configure
|
||||
index f3688ad..26e512e 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6556,6 +6556,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
|
||||
enabled omx && require_headers OMX_Core.h
|
||||
enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
|
||||
check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
|
||||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto $pthreads_extralibs -ldl ||
|
||||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
|
||||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
|
||||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
|
16
adm/vcpkg/ports/ffmpeg/0013-define-WINVER.patch
Normal file
16
adm/vcpkg/ports/ffmpeg/0013-define-WINVER.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff --git a/libavcodec/mf_utils.c b/libavcodec/mf_utils.c
|
||||
index eeabd0c..ea3a03b 100644
|
||||
--- a/libavcodec/mf_utils.c
|
||||
+++ b/libavcodec/mf_utils.c
|
||||
@@ -22,6 +22,11 @@
|
||||
#define _WIN32_WINNT 0x0602
|
||||
#endif
|
||||
|
||||
+#if !defined(WINVER) || WINVER < 0x0602
|
||||
+#undef WINVER
|
||||
+#define WINVER 0x0602
|
||||
+#endif
|
||||
+
|
||||
#include "mf_utils.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
|
23
adm/vcpkg/ports/ffmpeg/0014-avfilter-dependency-fix.patch
Normal file
23
adm/vcpkg/ports/ffmpeg/0014-avfilter-dependency-fix.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git a/configure b/configure
|
||||
index 26e512e..c0377b6 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -3674,6 +3674,18 @@ vpp_qsv_filter_select="qsvvpp"
|
||||
xfade_opencl_filter_deps="opencl"
|
||||
yadif_cuda_filter_deps="ffnvcodec"
|
||||
yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
|
||||
+ametadata_filter_deps="avformat"
|
||||
+metadata_filter_deps="avformat"
|
||||
+headphone_filter_deps="avcodec"
|
||||
+headphone_filter_select="fft"
|
||||
+showspatial_filter_deps="avcodec"
|
||||
+showspatial_filter_select="fft"
|
||||
+superequalizer_filter_deps="avcodec"
|
||||
+superequalizer_filter_select="rdft"
|
||||
+surround_filter_deps="avcodec"
|
||||
+surround_filter_select="rdft"
|
||||
+sinc_filter_deps="avcodec"
|
||||
+sinc_filter_select="rdft"
|
||||
|
||||
# examples
|
||||
avio_list_dir_deps="avformat avutil"
|
13
adm/vcpkg/ports/ffmpeg/0015-Fix-xml2-detection.patch
Normal file
13
adm/vcpkg/ports/ffmpeg/0015-Fix-xml2-detection.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/configure b/configure
|
||||
index c0377b6..62753ef 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6526,7 +6526,7 @@ enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h z
|
||||
enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
|
||||
{ test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
|
||||
enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
|
||||
-enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
|
||||
+enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml/xmlversion.h xmlCheckVersion
|
||||
enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
|
||||
check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
|
||||
check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
|
@@ -0,0 +1,30 @@
|
||||
diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
|
||||
index 48452379c2..1c486dc30e 100755
|
||||
--- a/compat/cuda/ptx2c.sh
|
||||
+++ b/compat/cuda/ptx2c.sh
|
||||
@@ -26,9 +26,10 @@ OUT="$1"
|
||||
IN="$2"
|
||||
NAME="$(basename "$IN" | sed 's/\..*//')"
|
||||
|
||||
-printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
|
||||
+printf "const char %s_ptx[] = {\\" "$NAME" > "$OUT"
|
||||
echo >> "$OUT"
|
||||
-sed -e "$(printf 's/\r//g')" -e 's/["\\]/\\&/g' -e "$(printf 's/^/\t"/')" -e 's/$/\\n"/' < "$IN" >> "$OUT"
|
||||
-echo ";" >> "$OUT"
|
||||
+xxd -i < "$IN" >> "$OUT"
|
||||
+echo " ,0x00" >> "$OUT"
|
||||
+echo "};" >> "$OUT"
|
||||
|
||||
exit 0
|
||||
diff --git a/configure b/configure
|
||||
index 6190d06b0b..48fb73738e 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1046,6 +1046,7 @@ test_nvcc(){
|
||||
tmpo_=$TMPO
|
||||
[ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
|
||||
test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
|
||||
+ test_cmd xxd
|
||||
}
|
||||
|
||||
check_nvcc() {
|
@@ -0,0 +1,13 @@
|
||||
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
|
||||
index 1fc0a00..06b2ff0 100644
|
||||
--- a/libavcodec/libaomdec.c
|
||||
+++ b/libavcodec/libaomdec.c
|
||||
@@ -224,7 +224,7 @@ static av_cold int aom_free(AVCodecContext *avctx)
|
||||
|
||||
static av_cold int av1_init(AVCodecContext *avctx)
|
||||
{
|
||||
- return aom_init(avctx, &aom_codec_av1_dx_algo);
|
||||
+ return aom_init(avctx, aom_codec_av1_dx());
|
||||
}
|
||||
|
||||
AVCodec ff_libaom_av1_decoder = {
|
@@ -0,0 +1,33 @@
|
||||
diff --git a/configure b/configure
|
||||
index 62753ef..018764e 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6508,11 +6508,8 @@ enabled libvpx && {
|
||||
enabled libwebp && {
|
||||
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
|
||||
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
|
||||
-enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
|
||||
- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" &&
|
||||
- warn "using libx264 without pkg-config"; } } &&
|
||||
- require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
|
||||
- check_cpp_condition libx262 x264.h "X264_MPEG2"
|
||||
+enabled libx264 && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
|
||||
+ require_cpp_condition libx264 x264.h "X264_BUILD >= 158"
|
||||
enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get ||
|
||||
{ { check_lib libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" ||
|
||||
require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++"; } &&
|
||||
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
|
||||
index 4ddc497..0152d30 100644
|
||||
--- a/libavcodec/libx264.c
|
||||
+++ b/libavcodec/libx264.c
|
||||
@@ -32,10 +32,6 @@
|
||||
#include "packet_internal.h"
|
||||
#include "atsc_a53.h"
|
||||
|
||||
-#if defined(_MSC_VER)
|
||||
-#define X264_API_IMPORTS 1
|
||||
-#endif
|
||||
-
|
||||
#include <x264.h>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
28
adm/vcpkg/ports/ffmpeg/0020-fix-aarch64-libswscale.patch
Normal file
28
adm/vcpkg/ports/ffmpeg/0020-fix-aarch64-libswscale.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S
|
||||
index f4b220f..af677af 100644
|
||||
--- a/libswscale/aarch64/yuv2rgb_neon.S
|
||||
+++ b/libswscale/aarch64/yuv2rgb_neon.S
|
||||
@@ -169,19 +169,19 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
|
||||
sqdmulh v26.8H, v26.8H, v0.8H // ((Y1*(1<<3) - y_offset) * y_coeff) >> 15
|
||||
sqdmulh v27.8H, v27.8H, v0.8H // ((Y2*(1<<3) - y_offset) * y_coeff) >> 15
|
||||
|
||||
-.ifc \ofmt,argb // 1 2 3 0
|
||||
+.ifc \ofmt,argb
|
||||
compute_rgba v5.8B,v6.8B,v7.8B,v4.8B, v17.8B,v18.8B,v19.8B,v16.8B
|
||||
.endif
|
||||
|
||||
-.ifc \ofmt,rgba // 0 1 2 3
|
||||
+.ifc \ofmt,rgba
|
||||
compute_rgba v4.8B,v5.8B,v6.8B,v7.8B, v16.8B,v17.8B,v18.8B,v19.8B
|
||||
.endif
|
||||
|
||||
-.ifc \ofmt,abgr // 3 2 1 0
|
||||
+.ifc \ofmt,abgr
|
||||
compute_rgba v7.8B,v6.8B,v5.8B,v4.8B, v19.8B,v18.8B,v17.8B,v16.8B
|
||||
.endif
|
||||
|
||||
-.ifc \ofmt,bgra // 2 1 0 3
|
||||
+.ifc \ofmt,bgra
|
||||
compute_rgba v6.8B,v5.8B,v4.8B,v7.8B, v18.8B,v17.8B,v16.8B,v19.8B
|
||||
.endif
|
||||
|
@@ -0,0 +1,43 @@
|
||||
From c534d9f72a89542ed639071b1ae15893aadf1f18 Mon Sep 17 00:00:00 2001
|
||||
From: rcombs <rcombs@rcombs.me>
|
||||
Date: Sat, 16 Apr 2022 03:41:29 -0500
|
||||
Subject: [PATCH] lavc/h264_ps: always include the stop bit in [s|p]ps->data
|
||||
|
||||
The VideoToolbox hwaccel needs the entire NAL (including the stop bit),
|
||||
but ff_h2645_packet_split may remove it. Detect this case by looking for
|
||||
bit counts divisible by 8 and insert a stop-bit-only 0x80 byte.
|
||||
|
||||
Signed-off-by: rcombs <rcombs@rcombs.me>
|
||||
---
|
||||
libavcodec/h264_ps.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
|
||||
index 051f06692c..e16da68dec 100644
|
||||
--- a/libavcodec/h264_ps.c
|
||||
+++ b/libavcodec/h264_ps.c
|
||||
@@ -351,6 +351,10 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
|
||||
}
|
||||
memcpy(sps->data, gb->buffer, sps->data_size);
|
||||
|
||||
+ // Re-add the removed stop bit (may be used by hwaccels).
|
||||
+ if (!(gb->size_in_bits & 7) && sps->data_size < sizeof(sps->data))
|
||||
+ sps->data[sps->data_size++] = 0x80;
|
||||
+
|
||||
profile_idc = get_bits(gb, 8);
|
||||
constraint_set_flags |= get_bits1(gb) << 0; // constraint_set0_flag
|
||||
constraint_set_flags |= get_bits1(gb) << 1; // constraint_set1_flag
|
||||
@@ -775,6 +779,10 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
|
||||
}
|
||||
memcpy(pps->data, gb->buffer, pps->data_size);
|
||||
|
||||
+ // Re-add the removed stop bit (may be used by hwaccels).
|
||||
+ if (!(bit_length & 7) && pps->data_size < sizeof(pps->data))
|
||||
+ pps->data[pps->data_size++] = 0x80;
|
||||
+
|
||||
pps->sps_id = get_ue_golomb_31(gb);
|
||||
if ((unsigned)pps->sps_id >= MAX_SPS_COUNT ||
|
||||
!ps->sps_list[pps->sps_id]) {
|
||||
--
|
||||
2.20.1
|
||||
|
22
adm/vcpkg/ports/ffmpeg/0023-fix-qsv-init.patch
Normal file
22
adm/vcpkg/ports/ffmpeg/0023-fix-qsv-init.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
Subject: [PATCH] fix d3d11
|
||||
---
|
||||
Index: qsv.c
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
|
||||
--- a/libavcodec/qsv.c
|
||||
+++ b/libavcodec/qsv.c
|
||||
@@ -383,7 +383,11 @@
|
||||
int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs,
|
||||
const char *load_plugins, int gpu_copy)
|
||||
{
|
||||
+#if CONFIG_D3D11VA
|
||||
+ mfxIMPL impl = MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_D3D11;
|
||||
+#else
|
||||
mfxIMPL impl = MFX_IMPL_AUTO_ANY;
|
||||
+#endif
|
||||
mfxVersion ver = { { QSV_VERSION_MINOR, QSV_VERSION_MAJOR } };
|
||||
mfxInitParam init_par = { MFX_IMPL_AUTO_ANY };
|
||||
|
165
adm/vcpkg/ports/ffmpeg/FindFFMPEG.cmake.in
Normal file
165
adm/vcpkg/ports/ffmpeg/FindFFMPEG.cmake.in
Normal file
@@ -0,0 +1,165 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License.
|
||||
#
|
||||
#.rst:
|
||||
# FindFFMPEG
|
||||
# --------
|
||||
#
|
||||
# Find the FFPMEG libraries
|
||||
#
|
||||
# Result Variables
|
||||
# ^^^^^^^^^^^^^^^^
|
||||
#
|
||||
# The following variables will be defined:
|
||||
#
|
||||
# ``FFMPEG_FOUND``
|
||||
# True if FFMPEG found on the local system
|
||||
#
|
||||
# ``FFMPEG_INCLUDE_DIRS``
|
||||
# Location of FFMPEG header files
|
||||
#
|
||||
# ``FFMPEG_LIBRARY_DIRS``
|
||||
# Location of FFMPEG libraries
|
||||
#
|
||||
# ``FFMPEG_LIBRARIES``
|
||||
# List of the FFMPEG libraries found
|
||||
#
|
||||
#
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include(SelectLibraryConfigurations)
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if(NOT FFMPEG_FOUND)
|
||||
|
||||
# Compute the installation path relative to this file.
|
||||
get_filename_component(SEARCH_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(SEARCH_PATH "${SEARCH_PATH}" PATH)
|
||||
get_filename_component(SEARCH_PATH "${SEARCH_PATH}" PATH)
|
||||
if(SEARCH_PATH STREQUAL "/")
|
||||
set(SEARCH_PATH "")
|
||||
endif()
|
||||
|
||||
set(FFMPEG_VERSION "@FFMPEG_VERSION@")
|
||||
|
||||
function(append_dependencies out)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 "arg" "DEBUG" "NAMES" "")
|
||||
if(${arg_DEBUG})
|
||||
set(config DEBUG)
|
||||
set(path "${CURRENT_INSTALLED_DIR}/debug/lib/")
|
||||
else()
|
||||
set(config RELEASE)
|
||||
set(path "${CURRENT_INSTALLED_DIR}/lib/")
|
||||
endif()
|
||||
foreach(lib_name ${arg_NAMES})
|
||||
if("${lib_name}" STREQUAL "-pthread")
|
||||
list(APPEND ${out} "-pthread")
|
||||
elseif("${lib_name}" STREQUAL "-pthreads")
|
||||
list(APPEND ${out} "-pthreads")
|
||||
elseif("${lib_name}" STREQUAL "gcc")
|
||||
list(APPEND ${out} "-lgcc")
|
||||
elseif("${lib_name}" STREQUAL "gcc_s")
|
||||
list(APPEND ${out} "-lgcc_s")
|
||||
elseif("${lib_name}" STREQUAL "stdc++")
|
||||
list(APPEND ${out} "-lstdc++")
|
||||
else()
|
||||
# first look in ${path} specifically to ensure we find the right release/debug variant
|
||||
find_library(FFMPEG_DEPENDENCY_${lib_name}_${config} NAMES "${lib_name}" PATHS "${path}" NO_DEFAULT_PATH)
|
||||
# if not found there, must be a system dependency, so look elsewhere
|
||||
find_library(FFMPEG_DEPENDENCY_${lib_name}_${config} NAMES "${lib_name}" REQUIRED)
|
||||
list(APPEND ${out} "${FFMPEG_DEPENDENCY_${lib_name}_${config}}")
|
||||
endif()
|
||||
endforeach()
|
||||
set("${out}" "${${out}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro(FFMPEG_FIND varname shortname headername)
|
||||
if(NOT FFMPEG_${varname}_INCLUDE_DIRS)
|
||||
find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATHS ${SEARCH_PATH}/include NO_DEFAULT_PATH)
|
||||
endif()
|
||||
if(NOT FFMPEG_${varname}_LIBRARY)
|
||||
find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATHS ${SEARCH_PATH}/lib/ NO_DEFAULT_PATH)
|
||||
find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS ${SEARCH_PATH}/debug/lib/ NO_DEFAULT_PATH)
|
||||
get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY)
|
||||
get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY)
|
||||
select_library_configurations(FFMPEG_${varname})
|
||||
set(FFMPEG_${varname}_LIBRARY ${FFMPEG_${varname}_LIBRARY} CACHE STRING "")
|
||||
endif()
|
||||
if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS)
|
||||
set(FFMPEG_${varname}_FOUND TRUE BOOL)
|
||||
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${varname}_INCLUDE_DIRS})
|
||||
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${varname}_LIBRARY})
|
||||
list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR})
|
||||
endif()
|
||||
endmacro(FFMPEG_FIND)
|
||||
|
||||
if(@ENABLE_AVDEVICE@)
|
||||
FFMPEG_FIND(libavdevice avdevice avdevice.h)
|
||||
endif()
|
||||
if(@ENABLE_AVFILTER@)
|
||||
FFMPEG_FIND(libavfilter avfilter avfilter.h)
|
||||
endif()
|
||||
if(@ENABLE_AVFORMAT@)
|
||||
FFMPEG_FIND(libavformat avformat avformat.h)
|
||||
endif()
|
||||
if(@ENABLE_AVCODEC@)
|
||||
FFMPEG_FIND(libavcodec avcodec avcodec.h)
|
||||
endif()
|
||||
if(@ENABLE_AVRESAMPLE@)
|
||||
FFMPEG_FIND(libavresample avresample avresample.h)
|
||||
endif()
|
||||
if(@ENABLE_POSTPROC@)
|
||||
FFMPEG_FIND(libpostproc postproc postprocess.h)
|
||||
endif()
|
||||
if(@ENABLE_SWRESAMPLE@)
|
||||
FFMPEG_FIND(libswresample swresample swresample.h)
|
||||
endif()
|
||||
if(@ENABLE_SWSCALE@)
|
||||
FFMPEG_FIND(libswscale swscale swscale.h)
|
||||
endif()
|
||||
FFMPEG_FIND(libavutil avutil avutil.h)
|
||||
|
||||
if (FFMPEG_libavutil_FOUND)
|
||||
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS)
|
||||
set(FFMPEG_libavutil_VERSION "@LIBAVUTIL_VERSION@" CACHE STRING "")
|
||||
|
||||
if(FFMPEG_libavcodec_FOUND)
|
||||
set(FFMPEG_libavcodec_VERSION "@LIBAVCODEC_VERSION@" CACHE STRING "")
|
||||
endif()
|
||||
if(FFMPEG_libavdevice_FOUND)
|
||||
set(FFMPEG_libavdevice_VERSION "@LIBAVDEVICE_VERSION@" CACHE STRING "")
|
||||
endif()
|
||||
if(FFMPEG_libavfilter_FOUND)
|
||||
set(FFMPEG_libavfilter_VERSION "@LIBAVFILTER_VERSION@" CACHE STRING "")
|
||||
endif()
|
||||
if(FFMPEG_libavformat_FOUND)
|
||||
set(FFMPEG_libavformat_VERSION "@LIBAVFORMAT_VERSION@" CACHE STRING "")
|
||||
endif()
|
||||
if(FFMPEG_libavresample_FOUND)
|
||||
set(FFMPEG_libavresample_VERSION "@LIBAVRESAMPLE_VERSION@" CACHE STRING "")
|
||||
endif()
|
||||
if(FFMPEG_libswresample_FOUND)
|
||||
set(FFMPEG_libswresample_VERSION "@LIBSWRESAMPLE_VERSION@" CACHE STRING "")
|
||||
endif()
|
||||
if(FFMPEG_libswscale_FOUND)
|
||||
set(FFMPEG_libswscale_VERSION "@LIBSWSCALE_VERSION@" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
append_dependencies(FFMPEG_DEPS_LIBRARY_RELEASE NAMES "@FFMPEG_DEPENDENCIES_RELEASE@")
|
||||
append_dependencies(FFMPEG_DEPS_LIBRARY_DEBUG NAMES "@FFMPEG_DEPENDENCIES_DEBUG@" DEBUG)
|
||||
if(FFMPEG_DEPS_LIBRARY_RELEASE OR FFMPEG_DEPS_LIBRARY_DEBUG)
|
||||
select_library_configurations(FFMPEG_DEPS)
|
||||
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_DEPS_LIBRARY})
|
||||
endif()
|
||||
|
||||
set(FFMPEG_LIBRARY ${FFMPEG_LIBRARIES})
|
||||
|
||||
set(FFMPEG_FOUND TRUE CACHE BOOL "")
|
||||
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "")
|
||||
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "")
|
||||
set(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBRARY_DIRS} CACHE STRING "")
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_LIBRARY_DIRS FFMPEG_INCLUDE_DIRS)
|
||||
|
||||
endif()
|
126
adm/vcpkg/ports/ffmpeg/build.sh.in
Normal file
126
adm/vcpkg/ports/ffmpeg/build.sh.in
Normal file
@@ -0,0 +1,126 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
export PATH="/usr/bin:$PATH"
|
||||
|
||||
command -v cygpath >/dev/null && have_cygpath=1
|
||||
|
||||
cygpath() {
|
||||
if [ -n "$have_cygpath" ]; then
|
||||
command cygpath "$@"
|
||||
else
|
||||
eval _p='$'$#
|
||||
printf '%s\n' "$_p"
|
||||
fi
|
||||
}
|
||||
|
||||
move_binary() {
|
||||
SOURCE=$1
|
||||
TARGET=$2
|
||||
BINARY=$3
|
||||
|
||||
# run lipo over the command to check whether it really
|
||||
# is a binary that we need to merge architectures
|
||||
lipo $SOURCE/$BINARY -info &> /dev/null || return 0
|
||||
|
||||
# get the directory name the file is in
|
||||
DIRNAME=$(dirname $BINARY)
|
||||
|
||||
# ensure the directory to move the binary to exists
|
||||
mkdir -p $TARGET/$DIRNAME
|
||||
|
||||
# now finally move the binary
|
||||
mv $SOURCE/$BINARY $TARGET/$BINARY
|
||||
}
|
||||
|
||||
move_binaries() {
|
||||
SOURCE=$1
|
||||
TARGET=$2
|
||||
|
||||
[ ! -d $SOURCE ] && return 0
|
||||
pushd $SOURCE
|
||||
|
||||
for BINARY in $(find . -type f); do
|
||||
move_binary $SOURCE $TARGET $BINARY
|
||||
done
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
merge_binaries() {
|
||||
TARGET=$1
|
||||
SOURCE=$2
|
||||
|
||||
shift
|
||||
shift
|
||||
|
||||
pushd $SOURCE/$1
|
||||
BINARIES=$(find . -type f)
|
||||
popd
|
||||
|
||||
for BINARY in $BINARIES; do
|
||||
COMMAND="lipo -create -output $TARGET/$BINARY"
|
||||
|
||||
for ARCH in $@; do
|
||||
COMMAND="$COMMAND -arch $ARCH $SOURCE/$ARCH/$BINARY"
|
||||
done
|
||||
|
||||
$($COMMAND)
|
||||
done
|
||||
}
|
||||
|
||||
export PKG_CONFIG_PATH="$(cygpath -p "${PKG_CONFIG_PATH}")"
|
||||
|
||||
# Export HTTP(S)_PROXY as http(s)_proxy:
|
||||
[ -n "$HTTP_PROXY" ] && export http_proxy="$HTTP_PROXY"
|
||||
[ -n "$HTTPS_PROXY" ] && export https_proxy="$HTTPS_PROXY"
|
||||
|
||||
PATH_TO_BUILD_DIR=$( cygpath "@BUILD_DIR@")
|
||||
PATH_TO_SRC_DIR=$( cygpath "@SOURCE_PATH@")
|
||||
PATH_TO_PACKAGE_DIR=$(cygpath "@INST_PREFIX@")
|
||||
|
||||
JOBS=@VCPKG_CONCURRENCY@
|
||||
|
||||
OSX_ARCHS="@OSX_ARCHS@"
|
||||
OSX_ARCH_COUNT=0@OSX_ARCH_COUNT@
|
||||
|
||||
# Default to hardware concurrency if unset.
|
||||
: ${JOBS:=$(nproc)}
|
||||
|
||||
build_ffmpeg() {
|
||||
echo "=== CONFIGURING ==="
|
||||
|
||||
sh "$PATH_TO_SRC_DIR/configure" "--prefix=$PATH_TO_PACKAGE_DIR" "--cc=$CC" @CONFIGURE_OPTIONS@ $@
|
||||
|
||||
echo "=== BUILDING ==="
|
||||
|
||||
make -j${JOBS} V=1
|
||||
|
||||
echo "=== INSTALLING ==="
|
||||
|
||||
make install
|
||||
}
|
||||
|
||||
cd "$PATH_TO_BUILD_DIR"
|
||||
|
||||
if [ $OSX_ARCH_COUNT -gt 1 ]; then
|
||||
for ARCH in $OSX_ARCHS; do
|
||||
echo "=== CLEANING FOR $ARCH ==="
|
||||
|
||||
make clean && make distclean
|
||||
|
||||
build_ffmpeg --enable-cross-compile --arch=$ARCH --extra-cflags=-arch --extra-cflags=$ARCH --extra-ldflags=-arch --extra-ldflags=$ARCH
|
||||
|
||||
echo "=== COLLECTING BINARIES FOR $ARCH ==="
|
||||
|
||||
move_binaries $PATH_TO_PACKAGE_DIR/lib $PATH_TO_BUILD_DIR/stage/$ARCH/lib
|
||||
move_binaries $PATH_TO_PACKAGE_DIR/bin $PATH_TO_BUILD_DIR/stage/$ARCH/bin
|
||||
done
|
||||
|
||||
echo "=== MERGING ARCHITECTURES ==="
|
||||
|
||||
merge_binaries $PATH_TO_PACKAGE_DIR $PATH_TO_BUILD_DIR/stage $OSX_ARCHS
|
||||
else
|
||||
build_ffmpeg
|
||||
fi
|
826
adm/vcpkg/ports/ffmpeg/portfile.cmake
Normal file
826
adm/vcpkg/ports/ffmpeg/portfile.cmake
Normal file
@@ -0,0 +1,826 @@
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(PATCHES 0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch) # https://trac.ffmpeg.org/ticket/9019
|
||||
endif()
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO ffmpeg/ffmpeg
|
||||
REF n4.4.5
|
||||
SHA512 09338a10b31f0e551735b9aa57e2c22ceae15bbbca1ee04535587ff55f181e187a77ede4e70d8cd0e1e7c85fb27a7e513c93b91848013e997263d58780b8fa49
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0001-create-lib-libraries.patch
|
||||
0003-fix-windowsinclude.patch
|
||||
0004-fix-debug-build.patch
|
||||
0006-fix-StaticFeatures.patch
|
||||
0007-fix-lib-naming.patch
|
||||
0009-Fix-fdk-detection.patch
|
||||
0010-Fix-x264-detection.patch
|
||||
0011-Fix-x265-detection.patch
|
||||
#0012-Fix-ssl-110-detection.patch
|
||||
0013-define-WINVER.patch
|
||||
0014-avfilter-dependency-fix.patch # https://ffmpeg.org/pipermail/ffmpeg-devel/2021-February/275819.html
|
||||
0015-Fix-xml2-detection.patch
|
||||
${PATCHES}
|
||||
0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch
|
||||
0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch
|
||||
0020-fix-aarch64-libswscale.patch
|
||||
0022-fix-m1-hardware-decode-nal-bits.patch # remove in next version
|
||||
0023-fix-qsv-init.patch # remove in next version (5.x)
|
||||
)
|
||||
|
||||
if (SOURCE_PATH MATCHES " ")
|
||||
message(FATAL_ERROR "Error: ffmpeg will not build with spaces in the path. Please use a directory with no spaces")
|
||||
endif()
|
||||
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
# ffmpeg nasm build gives link error on x86, so fall back to yasm
|
||||
vcpkg_find_acquire_program(YASM)
|
||||
get_filename_component(YASM_EXE_PATH "${YASM}" DIRECTORY)
|
||||
vcpkg_add_to_path("${YASM_EXE_PATH}")
|
||||
else()
|
||||
vcpkg_find_acquire_program(NASM)
|
||||
get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY)
|
||||
vcpkg_add_to_path("${NASM_EXE_PATH}")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
#We're assuming that if we're building for Windows we're using MSVC
|
||||
set(INCLUDE_VAR "INCLUDE")
|
||||
set(LIB_PATH_VAR "LIB")
|
||||
else()
|
||||
set(INCLUDE_VAR "CPATH")
|
||||
set(LIB_PATH_VAR "LIBRARY_PATH")
|
||||
endif()
|
||||
|
||||
set(OPTIONS "--enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect")
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
||||
set(OPTIONS "${OPTIONS} --disable-asm --disable-x86asm")
|
||||
endif()
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
set(OPTIONS "${OPTIONS} --enable-asm --disable-x86asm")
|
||||
endif()
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(OPTIONS "${OPTIONS} --enable-asm --enable-x86asm")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_acquire_msys(MSYS_ROOT)
|
||||
set(SHELL "${MSYS_ROOT}/usr/bin/bash.exe")
|
||||
else()
|
||||
set(SHELL /bin/sh)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_MINGW)
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
string(APPEND OPTIONS " --target-os=mingw32")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
string(APPEND OPTIONS " --target-os=mingw64")
|
||||
endif()
|
||||
elseif(VCPKG_TARGET_IS_LINUX)
|
||||
string(APPEND OPTIONS " --target-os=linux")
|
||||
elseif(VCPKG_TARGET_IS_WINDOWS)
|
||||
string(APPEND OPTIONS " --target-os=win32")
|
||||
elseif(VCPKG_TARGET_IS_OSX)
|
||||
string(APPEND OPTIONS " --target-os=darwin")
|
||||
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
string(APPEND OPTIONS " --target-os=android")
|
||||
else()
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_get_vars(cmake_vars_file)
|
||||
include("${cmake_vars_file}")
|
||||
|
||||
if(VCPKG_DETECTED_MSVC)
|
||||
set(OPTIONS "--toolchain=msvc ${OPTIONS}")
|
||||
# This is required because ffmpeg depends upon optimizations to link correctly
|
||||
string(APPEND VCPKG_COMBINED_C_FLAGS_DEBUG " -O2")
|
||||
string(REGEX REPLACE "(^| )-RTC1( |$)" " " VCPKG_COMBINED_C_FLAGS_DEBUG "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
|
||||
string(REGEX REPLACE "(^| )-Od( |$)" " " VCPKG_COMBINED_C_FLAGS_DEBUG "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
|
||||
string(REGEX REPLACE "(^| )-Ob0( |$)" " " VCPKG_COMBINED_C_FLAGS_DEBUG "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
string(APPEND VCPKG_COMBINED_C_FLAGS_DEBUG " -I \"${CURRENT_INSTALLED_DIR}/include\"")
|
||||
string(APPEND VCPKG_COMBINED_C_FLAGS_RELEASE " -I \"${CURRENT_INSTALLED_DIR}/include\"")
|
||||
|
||||
set(_csc_PROJECT_PATH ffmpeg)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
|
||||
|
||||
set(FFMPEG_PKGCONFIG_MODULES libavutil)
|
||||
|
||||
if("nonfree" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-nonfree")
|
||||
endif()
|
||||
|
||||
if("gpl" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-gpl")
|
||||
endif()
|
||||
|
||||
if("version3" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-version3")
|
||||
endif()
|
||||
|
||||
if("amf" IN_LIST FEATURES)
|
||||
# Do nothing
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-amf")
|
||||
endif()
|
||||
|
||||
if("ffmpeg" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-ffmpeg")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-ffmpeg")
|
||||
endif()
|
||||
|
||||
if("ffplay" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-ffplay")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-ffplay")
|
||||
endif()
|
||||
|
||||
if("ffprobe" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-ffprobe")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-ffprobe")
|
||||
endif()
|
||||
|
||||
if (NOT "alsa" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --disable-alsa")
|
||||
endif()
|
||||
|
||||
if("avcodec" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-avcodec")
|
||||
set(ENABLE_AVCODEC ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libavcodec)
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-avcodec")
|
||||
set(ENABLE_AVCODEC OFF)
|
||||
endif()
|
||||
|
||||
if("avdevice" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-avdevice")
|
||||
set(ENABLE_AVDEVICE ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libavdevice)
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-avdevice")
|
||||
set(ENABLE_AVDEVICE OFF)
|
||||
endif()
|
||||
|
||||
if("avformat" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-avformat")
|
||||
set(ENABLE_AVFORMAT ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libavformat)
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-avformat")
|
||||
set(ENABLE_AVFORMAT OFF)
|
||||
endif()
|
||||
|
||||
if("avfilter" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-avfilter")
|
||||
set(ENABLE_AVFILTER ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libavfilter)
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-avfilter")
|
||||
set(ENABLE_AVFILTER OFF)
|
||||
endif()
|
||||
|
||||
if("postproc" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-postproc")
|
||||
set(ENABLE_POSTPROC ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libpostproc)
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-postproc")
|
||||
set(ENABLE_POSTPROC OFF)
|
||||
endif()
|
||||
|
||||
if("swresample" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-swresample")
|
||||
set(ENABLE_SWRESAMPLE ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libswresample)
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-swresample")
|
||||
set(ENABLE_SWRESAMPLE OFF)
|
||||
endif()
|
||||
|
||||
if("swscale" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-swscale")
|
||||
set(ENABLE_SWSCALE ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libswscale)
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-swscale")
|
||||
set(ENABLE_SWSCALE OFF)
|
||||
endif()
|
||||
|
||||
set(ENABLE_AVRESAMPLE OFF)
|
||||
if("avresample" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-avresample")
|
||||
set(ENABLE_AVRESAMPLE ON)
|
||||
list(APPEND FFMPEG_PKGCONFIG_MODULES libavresample)
|
||||
endif()
|
||||
|
||||
set(STATIC_LINKAGE OFF)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(STATIC_LINKAGE ON)
|
||||
endif()
|
||||
|
||||
if("aom" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libaom")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libaom")
|
||||
endif()
|
||||
|
||||
if("ass" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libass")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libass")
|
||||
endif()
|
||||
|
||||
if("avisynthplus" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-avisynth")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-avisynth")
|
||||
endif()
|
||||
|
||||
if("bzip2" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-bzlib")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-bzlib")
|
||||
endif()
|
||||
|
||||
if("dav1d" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libdav1d")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libdav1d")
|
||||
endif()
|
||||
|
||||
if("fdk-aac" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libfdk-aac")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libfdk-aac")
|
||||
endif()
|
||||
|
||||
if("fontconfig" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libfontconfig")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libfontconfig")
|
||||
endif()
|
||||
|
||||
if("freetype" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libfreetype")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libfreetype")
|
||||
endif()
|
||||
|
||||
if("fribidi" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libfribidi")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libfribidi")
|
||||
endif()
|
||||
|
||||
if("iconv" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-iconv")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-iconv")
|
||||
endif()
|
||||
|
||||
if("ilbc" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libilbc")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libilbc")
|
||||
endif()
|
||||
|
||||
if("lzma" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-lzma")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-lzma")
|
||||
endif()
|
||||
|
||||
if("mp3lame" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libmp3lame")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libmp3lame")
|
||||
endif()
|
||||
|
||||
if("modplug" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libmodplug")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libmodplug")
|
||||
endif()
|
||||
|
||||
if("nvcodec" IN_LIST FEATURES)
|
||||
#Note: the --enable-cuda option does not actually require the cuda sdk or toolset port dependency as ffmpeg uses runtime detection and dynamic loading
|
||||
set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid --enable-ffnvcodec")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid --disable-ffnvcodec")
|
||||
endif()
|
||||
|
||||
if("opencl" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-opencl")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-opencl")
|
||||
endif()
|
||||
|
||||
if("opengl" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-opengl")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-opengl")
|
||||
endif()
|
||||
|
||||
if("openh264" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libopenh264")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libopenh264")
|
||||
endif()
|
||||
|
||||
if("openjpeg" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libopenjpeg")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libopenjpeg")
|
||||
endif()
|
||||
|
||||
if("openmpt" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libopenmpt")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libopenmpt")
|
||||
endif()
|
||||
|
||||
if("openssl" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-openssl")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-openssl")
|
||||
endif()
|
||||
|
||||
if("opus" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libopus")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libopus")
|
||||
endif()
|
||||
|
||||
if("sdl2" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-sdl2")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-sdl2")
|
||||
endif()
|
||||
|
||||
if("snappy" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libsnappy")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libsnappy")
|
||||
endif()
|
||||
|
||||
if("soxr" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libsoxr")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libsoxr")
|
||||
endif()
|
||||
|
||||
if("speex" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libspeex")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libspeex")
|
||||
endif()
|
||||
|
||||
if("ssh" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libssh")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libssh")
|
||||
endif()
|
||||
|
||||
if("tensorflow" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libtensorflow")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libtensorflow")
|
||||
endif()
|
||||
|
||||
if("tesseract" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libtesseract")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libtesseract")
|
||||
endif()
|
||||
|
||||
if("theora" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libtheora")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libtheora")
|
||||
endif()
|
||||
|
||||
if("vorbis" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libvorbis")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libvorbis")
|
||||
endif()
|
||||
|
||||
if("vpx" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libvpx")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libvpx")
|
||||
endif()
|
||||
|
||||
if("webp" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libwebp")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libwebp")
|
||||
endif()
|
||||
|
||||
if("x264" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libx264")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libx264")
|
||||
endif()
|
||||
|
||||
if("x265" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libx265")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libx265")
|
||||
endif()
|
||||
|
||||
if("xml2" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libxml2")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libxml2")
|
||||
endif()
|
||||
|
||||
if("zlib" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-zlib")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-zlib")
|
||||
endif()
|
||||
|
||||
if ("srt" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libsrt")
|
||||
else()
|
||||
set(OPTIONS "${OPTIONS} --disable-libsrt")
|
||||
endif()
|
||||
|
||||
if ("qsv" IN_LIST FEATURES)
|
||||
set(OPTIONS "${OPTIONS} --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv")
|
||||
endif()
|
||||
|
||||
if (VCPKG_TARGET_IS_OSX)
|
||||
set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_IOS)
|
||||
set(OPTIONS "${OPTIONS} --disable-audiotoolbox") # disable AudioToolbox on iOS
|
||||
endif()
|
||||
|
||||
set(OPTIONS_CROSS " --enable-cross-compile")
|
||||
|
||||
# ffmpeg needs --cross-prefix option to use appropriate tools for cross-compiling.
|
||||
if(VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "([^\/]*-)gcc$")
|
||||
string(APPEND OPTIONS_CROSS " --cross-prefix=${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
string(APPEND OPTIONS_CROSS " --arch=x86_64")
|
||||
else()
|
||||
string(APPEND OPTIONS_CROSS " --arch=${VCPKG_TARGET_ARCHITECTURE}")
|
||||
endif()
|
||||
|
||||
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_find_acquire_program(GASPREPROCESSOR)
|
||||
foreach(GAS_PATH ${GASPREPROCESSOR})
|
||||
get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY)
|
||||
set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${GAS_ITEM_PATH}")
|
||||
endforeach(GAS_PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_UWP)
|
||||
set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
|
||||
string(APPEND OPTIONS " --disable-programs")
|
||||
string(APPEND OPTIONS " --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00")
|
||||
string(APPEND OPTIONS " --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib")
|
||||
endif()
|
||||
|
||||
# Note: --disable-optimizations can't be used due to https://ffmpeg.org/pipermail/libav-user/2013-March/003945.html
|
||||
set(OPTIONS_DEBUG "--debug")
|
||||
set(OPTIONS_RELEASE "")
|
||||
|
||||
set(OPTIONS "${OPTIONS} ${OPTIONS_CROSS}")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
set(OPTIONS "${OPTIONS} --disable-static --enable-shared")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_MINGW)
|
||||
set(OPTIONS "${OPTIONS} --extra_cflags=-D_WIN32_WINNT=0x0601")
|
||||
elseif(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0")
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(OPTIONS "${OPTIONS} --pkg-config-flags=--static")
|
||||
endif()
|
||||
|
||||
set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}")
|
||||
|
||||
get_filename_component(CC_path "${VCPKG_DETECTED_CMAKE_C_COMPILER}" DIRECTORY)
|
||||
get_filename_component(CC_filename "${VCPKG_DETECTED_CMAKE_C_COMPILER}" NAME)
|
||||
set(ENV{CC} "${CC_filename}")
|
||||
if(CC_path)
|
||||
vcpkg_add_to_path(PREPEND "${CC_path}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Building Options: ${OPTIONS}")
|
||||
|
||||
# Release build
|
||||
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
message(STATUS "Building Release Options: ${OPTIONS_RELEASE}")
|
||||
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}")
|
||||
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")
|
||||
message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
|
||||
file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
# We use response files here as the only known way to handle spaces in paths
|
||||
set(crsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/cflags.rsp")
|
||||
file(WRITE "${crsp}" "${VCPKG_COMBINED_C_FLAGS_RELEASE}")
|
||||
set(ldrsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/ldflags.rsp")
|
||||
file(WRITE "${ldrsp}" "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE}")
|
||||
set(ENV{CFLAGS} "@${crsp}")
|
||||
# All tools except the msvc arm{,64} assembler accept @... as response file syntax.
|
||||
# For that assembler, there is no known way to pass in flags. We must hope that not passing flags will work acceptably.
|
||||
if(NOT VCPKG_DETECTED_MSVC OR NOT VCPKG_TARGET_ARCHITECTURE MATCHES "^arm")
|
||||
set(ENV{ASFLAGS} "@${crsp}")
|
||||
endif()
|
||||
set(ENV{LDFLAGS} "@${ldrsp}")
|
||||
|
||||
set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
|
||||
set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_RELEASE}")
|
||||
set(INST_PREFIX "${CURRENT_PACKAGES_DIR}")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY)
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "${SHELL}" ./build.sh
|
||||
WORKING_DIRECTORY "${BUILD_DIR}"
|
||||
LOGNAME "build-${TARGET_TRIPLET}-rel"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Debug build
|
||||
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
message(STATUS "Building Debug Options: ${OPTIONS_DEBUG}")
|
||||
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}")
|
||||
set(ENV{LDFLAGS} "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG}")
|
||||
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig")
|
||||
message(STATUS "Building ${_csc_PROJECT_PATH} for Debug")
|
||||
file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
set(crsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/cflags.rsp")
|
||||
file(WRITE "${crsp}" "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
|
||||
set(ldrsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/ldflags.rsp")
|
||||
file(WRITE "${ldrsp}" "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG}")
|
||||
set(ENV{CFLAGS} "@${crsp}")
|
||||
if(NOT VCPKG_DETECTED_MSVC OR NOT VCPKG_TARGET_ARCHITECTURE MATCHES "^arm")
|
||||
set(ENV{ASFLAGS} "@${crsp}")
|
||||
endif()
|
||||
set(ENV{LDFLAGS} "@${ldrsp}")
|
||||
|
||||
set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
|
||||
set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_DEBUG}")
|
||||
set(INST_PREFIX "${CURRENT_PACKAGES_DIR}/debug")
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY)
|
||||
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "${SHELL}" ./build.sh
|
||||
WORKING_DIRECTORY "${BUILD_DIR}"
|
||||
LOGNAME "build-${TARGET_TRIPLET}-dbg"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
file(GLOB DEF_FILES "${CURRENT_PACKAGES_DIR}/lib/*.def" "${CURRENT_PACKAGES_DIR}/debug/lib/*.def")
|
||||
|
||||
if(NOT VCPKG_TARGET_IS_MINGW)
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
||||
set(LIB_MACHINE_ARG /machine:ARM)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
set(LIB_MACHINE_ARG /machine:ARM64)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(LIB_MACHINE_ARG /machine:x86)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(LIB_MACHINE_ARG /machine:x64)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported target architecture")
|
||||
endif()
|
||||
|
||||
foreach(DEF_FILE ${DEF_FILES})
|
||||
get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY)
|
||||
get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME)
|
||||
string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}")
|
||||
file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE)
|
||||
file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE)
|
||||
message(STATUS "Generating ${OUT_FILE_NATIVE}")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND lib.exe "/def:${DEF_FILE_NATIVE}" "/out:${OUT_FILE_NATIVE}" ${LIB_MACHINE_ARG}
|
||||
WORKING_DIRECTORY "${CURRENT_PACKAGES_DIR}"
|
||||
LOGNAME "libconvert-${TARGET_TRIPLET}"
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
file(GLOB EXP_FILES "${CURRENT_PACKAGES_DIR}/lib/*.exp" "${CURRENT_PACKAGES_DIR}/debug/lib/*.exp")
|
||||
file(GLOB LIB_FILES "${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" "${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
|
||||
if(VCPKG_TARGET_IS_MINGW)
|
||||
file(GLOB LIB_FILES_2 "${CURRENT_PACKAGES_DIR}/bin/*.lib" "${CURRENT_PACKAGES_DIR}/debug/bin/*.lib")
|
||||
endif()
|
||||
set(files_to_remove ${EXP_FILES} ${LIB_FILES} ${LIB_FILES_2} ${DEF_FILES})
|
||||
if(files_to_remove)
|
||||
file(REMOVE ${files_to_remove})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if("ffmpeg" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(TOOL_NAMES ffmpeg AUTO_CLEAN)
|
||||
endif()
|
||||
if("ffprobe" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(TOOL_NAMES ffprobe AUTO_CLEAN)
|
||||
endif()
|
||||
if("ffplay" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(TOOL_NAMES ffplay AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
set(_dirs "/")
|
||||
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
||||
list(APPEND _dirs "/debug/")
|
||||
endif()
|
||||
foreach(_debug IN LISTS _dirs)
|
||||
foreach(PKGCONFIG_MODULE IN LISTS FFMPEG_PKGCONFIG_MODULES)
|
||||
set(PKGCONFIG_FILE "${CURRENT_PACKAGES_DIR}${_debug}lib/pkgconfig/${PKGCONFIG_MODULE}.pc")
|
||||
# remove redundant cygwin style -libpath entries
|
||||
execute_process(
|
||||
COMMAND "${MSYS_ROOT}/usr/bin/cygpath.exe" -u "${CURRENT_INSTALLED_DIR}"
|
||||
OUTPUT_VARIABLE CYG_INSTALLED_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
vcpkg_replace_string("${PKGCONFIG_FILE}" "-libpath:${CYG_INSTALLED_DIR}${_debug}lib/pkgconfig/../../lib " "")
|
||||
# transform libdir, includedir, and prefix paths from cygwin style to windows style
|
||||
file(READ "${PKGCONFIG_FILE}" PKGCONFIG_CONTENT)
|
||||
foreach(PATH_NAME prefix libdir includedir)
|
||||
string(REGEX MATCH "${PATH_NAME}=[^\n]*" PATH_VALUE "${PKGCONFIG_CONTENT}")
|
||||
string(REPLACE "${PATH_NAME}=" "" PATH_VALUE "${PATH_VALUE}")
|
||||
if(NOT PATH_VALUE)
|
||||
message(FATAL_ERROR "failed to find pkgconfig variable ${PATH_NAME}")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND "${MSYS_ROOT}/usr/bin/cygpath.exe" -w "${PATH_VALUE}"
|
||||
OUTPUT_VARIABLE FIXED_PATH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
file(TO_CMAKE_PATH "${FIXED_PATH}" FIXED_PATH)
|
||||
vcpkg_replace_string("${PKGCONFIG_FILE}" "${PATH_NAME}=${PATH_VALUE}" "${PATH_NAME}=${FIXED_PATH}")
|
||||
endforeach()
|
||||
# list libraries with -l flag (so pkgconf knows they are libraries and not just linker flags)
|
||||
foreach(LIBS_ENTRY Libs Libs.private)
|
||||
string(REGEX MATCH "${LIBS_ENTRY}: [^\n]*" LIBS_VALUE "${PKGCONFIG_CONTENT}")
|
||||
if(NOT LIBS_VALUE)
|
||||
message(FATAL_ERROR "failed to find pkgconfig entry ${LIBS_ENTRY}")
|
||||
endif()
|
||||
string(REPLACE "${LIBS_ENTRY}: " "" LIBS_VALUE "${LIBS_VALUE}")
|
||||
if(LIBS_VALUE)
|
||||
set(LIBS_VALUE_OLD "${LIBS_VALUE}")
|
||||
string(REGEX REPLACE "([^ ]+)[.]lib" "-l\\1" LIBS_VALUE "${LIBS_VALUE}")
|
||||
set(LIBS_VALUE_NEW "${LIBS_VALUE}")
|
||||
vcpkg_replace_string("${PKGCONFIG_FILE}" "${LIBS_ENTRY}: ${LIBS_VALUE_OLD}" "${LIBS_ENTRY}: ${LIBS_VALUE_NEW}")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# Handle dependencies
|
||||
|
||||
x_vcpkg_pkgconfig_get_modules(PREFIX FFMPEG_PKGCONFIG MODULES ${FFMPEG_PKGCONFIG_MODULES} LIBS)
|
||||
|
||||
function(append_dependencies_from_libs out)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 "arg" "" "LIBS" "")
|
||||
string(REGEX REPLACE "[ ]+" ";" contents "${arg_LIBS}")
|
||||
list(FILTER contents EXCLUDE REGEX "^-framework$")
|
||||
list(FILTER contents EXCLUDE REGEX "^-L.+")
|
||||
list(FILTER contents EXCLUDE REGEX "^-libpath:.+")
|
||||
list(TRANSFORM contents REPLACE "^-Wl,-framework," "-l")
|
||||
list(FILTER contents EXCLUDE REGEX "^-Wl,.+")
|
||||
list(TRANSFORM contents REPLACE "^-l" "")
|
||||
list(FILTER contents EXCLUDE REGEX "^avresample$")
|
||||
list(FILTER contents EXCLUDE REGEX "^avutil$")
|
||||
list(FILTER contents EXCLUDE REGEX "^avcodec$")
|
||||
list(FILTER contents EXCLUDE REGEX "^avdevice$")
|
||||
list(FILTER contents EXCLUDE REGEX "^avfilter$")
|
||||
list(FILTER contents EXCLUDE REGEX "^avformat$")
|
||||
list(FILTER contents EXCLUDE REGEX "^postproc$")
|
||||
list(FILTER contents EXCLUDE REGEX "^swresample$")
|
||||
list(FILTER contents EXCLUDE REGEX "^swscale$")
|
||||
list(FILTER contents EXCLUDE REGEX "^atomic$")
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
list(TRANSFORM contents TOLOWER)
|
||||
endif()
|
||||
if(contents)
|
||||
list(APPEND "${out}" "${contents}")
|
||||
set("${out}" "${${out}}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
append_dependencies_from_libs(FFMPEG_DEPENDENCIES_RELEASE LIBS "${FFMPEG_PKGCONFIG_LIBS_RELEASE}")
|
||||
append_dependencies_from_libs(FFMPEG_DEPENDENCIES_DEBUG LIBS "${FFMPEG_PKGCONFIG_LIBS_DEBUG}")
|
||||
|
||||
# must remove duplicates from the front to respect link order so reverse first
|
||||
list(REVERSE FFMPEG_DEPENDENCIES_RELEASE)
|
||||
list(REVERSE FFMPEG_DEPENDENCIES_DEBUG)
|
||||
list(REMOVE_DUPLICATES FFMPEG_DEPENDENCIES_RELEASE)
|
||||
list(REMOVE_DUPLICATES FFMPEG_DEPENDENCIES_DEBUG)
|
||||
list(REVERSE FFMPEG_DEPENDENCIES_RELEASE)
|
||||
list(REVERSE FFMPEG_DEPENDENCIES_DEBUG)
|
||||
|
||||
message(STATUS "Dependencies (release): ${FFMPEG_DEPENDENCIES_RELEASE}")
|
||||
message(STATUS "Dependencies (debug): ${FFMPEG_DEPENDENCIES_DEBUG}")
|
||||
|
||||
# Handle version strings
|
||||
|
||||
function(extract_regex_from_file out)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 "arg" "" "FILE;REGEX" "")
|
||||
file(READ "${arg_FILE}" contents)
|
||||
if (contents MATCHES "${arg_REGEX}")
|
||||
if(NOT CMAKE_MATCH_COUNT EQUAL 1)
|
||||
message(FATAL_ERROR "Could not identify match group in regular expression \"${arg_REGEX}\"")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find line matching \"${arg_REGEX}\" in file \"${arg_FILE}\"")
|
||||
endif()
|
||||
set("${out}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(extract_version_from_component out)
|
||||
cmake_parse_arguments(PARSE_ARGV 1 "arg" "" "COMPONENT" "")
|
||||
string(TOLOWER "${arg_COMPONENT}" component_lower)
|
||||
string(TOUPPER "${arg_COMPONENT}" component_upper)
|
||||
extract_regex_from_file(major_version
|
||||
FILE "${SOURCE_PATH}/${component_lower}/version.h"
|
||||
REGEX "#define ${component_upper}_VERSION_MAJOR[ ]+([0-9]+)"
|
||||
)
|
||||
extract_regex_from_file(minor_version
|
||||
FILE "${SOURCE_PATH}/${component_lower}/version.h"
|
||||
REGEX "#define ${component_upper}_VERSION_MINOR[ ]+([0-9]+)"
|
||||
)
|
||||
extract_regex_from_file(micro_version
|
||||
FILE "${SOURCE_PATH}/${component_lower}/version.h"
|
||||
REGEX "#define ${component_upper}_VERSION_MICRO[ ]+([0-9]+)"
|
||||
)
|
||||
set("${out}" "${major_version}.${minor_version}.${micro_version}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
extract_regex_from_file(FFMPEG_VERSION
|
||||
FILE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/libavutil/ffversion.h"
|
||||
REGEX "#define FFMPEG_VERSION[ ]+\"(.+)\""
|
||||
)
|
||||
|
||||
extract_version_from_component(LIBAVUTIL_VERSION
|
||||
COMPONENT libavutil)
|
||||
extract_version_from_component(LIBAVCODEC_VERSION
|
||||
COMPONENT libavcodec)
|
||||
extract_version_from_component(LIBAVDEVICE_VERSION
|
||||
COMPONENT libavdevice)
|
||||
extract_version_from_component(LIBAVFILTER_VERSION
|
||||
COMPONENT libavfilter)
|
||||
extract_version_from_component( LIBAVFORMAT_VERSION
|
||||
COMPONENT libavformat)
|
||||
extract_version_from_component(LIBAVRESAMPLE_VERSION
|
||||
COMPONENT libavresample)
|
||||
extract_version_from_component(LIBSWRESAMPLE_VERSION
|
||||
COMPONENT libswresample)
|
||||
extract_version_from_component(LIBSWSCALE_VERSION
|
||||
COMPONENT libswscale)
|
||||
|
||||
# Handle copyright
|
||||
file(STRINGS "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-out.log" LICENSE_STRING REGEX "License: .*" LIMIT_COUNT 1)
|
||||
if(LICENSE_STRING STREQUAL "License: LGPL version 2.1 or later")
|
||||
set(LICENSE_FILE "COPYING.LGPLv2.1")
|
||||
elseif(LICENSE_STRING STREQUAL "License: LGPL version 3 or later")
|
||||
set(LICENSE_FILE "COPYING.LGPLv3")
|
||||
elseif(LICENSE_STRING STREQUAL "License: GPL version 2 or later")
|
||||
set(LICENSE_FILE "COPYING.GPLv2")
|
||||
elseif(LICENSE_STRING STREQUAL "License: GPL version 3 or later")
|
||||
set(LICENSE_FILE "COPYING.GPLv3")
|
||||
elseif(LICENSE_STRING STREQUAL "License: nonfree and unredistributable")
|
||||
set(LICENSE_FILE "COPYING.NONFREE")
|
||||
file(WRITE "${SOURCE_PATH}/${LICENSE_FILE}" "${LICENSE_STRING}")
|
||||
else()
|
||||
message(FATAL_ERROR "Failed to identify license (${LICENSE_STRING})")
|
||||
endif()
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/FindFFMPEG.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/FindFFMPEG.cmake" @ONLY)
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/${LICENSE_FILE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
6
adm/vcpkg/ports/ffmpeg/usage
Normal file
6
adm/vcpkg/ports/ffmpeg/usage
Normal file
@@ -0,0 +1,6 @@
|
||||
To use ffmpeg add the following to your CMake project:
|
||||
|
||||
find_package(FFMPEG REQUIRED)
|
||||
target_include_directories(main PRIVATE ${FFMPEG_INCLUDE_DIRS})
|
||||
target_link_directories(main PRIVATE ${FFMPEG_LIBRARY_DIRS})
|
||||
target_link_libraries(main PRIVATE ${FFMPEG_LIBRARIES})
|
8
adm/vcpkg/ports/ffmpeg/vcpkg-cmake-wrapper.cmake
Normal file
8
adm/vcpkg/ports/ffmpeg/vcpkg-cmake-wrapper.cmake
Normal file
@@ -0,0 +1,8 @@
|
||||
set(FFMPEG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
|
||||
_find_package(${ARGS})
|
||||
|
||||
set(CMAKE_MODULE_PATH ${FFMPEG_PREV_MODULE_PATH})
|
676
adm/vcpkg/ports/ffmpeg/vcpkg.json
Normal file
676
adm/vcpkg/ports/ffmpeg/vcpkg.json
Normal file
@@ -0,0 +1,676 @@
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"version": "4.4.5",
|
||||
"port-version": 0,
|
||||
"description": [
|
||||
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
|
||||
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
|
||||
],
|
||||
"homepage": "https://ffmpeg.org",
|
||||
"license": null,
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake-get-vars",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-pkgconfig-get-modules",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"avcodec",
|
||||
"avdevice",
|
||||
"avfilter",
|
||||
"avformat",
|
||||
"swresample",
|
||||
"swscale"
|
||||
],
|
||||
"features": {
|
||||
"all": {
|
||||
"description": "Build with all allowed dependencies selected that are compatible with the lgpl license",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avcodec",
|
||||
"avdevice",
|
||||
"avfilter",
|
||||
"avformat",
|
||||
"avresample",
|
||||
"bzip2",
|
||||
"freetype",
|
||||
"iconv",
|
||||
"lzma",
|
||||
"mp3lame",
|
||||
"openjpeg",
|
||||
"opus",
|
||||
"snappy",
|
||||
"soxr",
|
||||
"speex",
|
||||
"swresample",
|
||||
"swscale",
|
||||
"theora",
|
||||
"vorbis",
|
||||
"vpx",
|
||||
"webp",
|
||||
"xml2",
|
||||
"zlib"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"alsa"
|
||||
],
|
||||
"platform": "linux"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"sdl2"
|
||||
],
|
||||
"platform": "!osx"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ass"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"fontconfig"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"fribidi"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"modplug"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"opencl"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"openh264"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"srt"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ilbc"
|
||||
],
|
||||
"platform": "!(arm & uwp)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ssh"
|
||||
],
|
||||
"platform": "!(uwp | arm)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"tensorflow"
|
||||
],
|
||||
"platform": "x64 & !static & !uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"aom"
|
||||
],
|
||||
"platform": "!(windows & arm & !uwp)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"dav1d"
|
||||
],
|
||||
"platform": "!(uwp | arm | x86 | osx)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"opengl"
|
||||
],
|
||||
"platform": "!uwp & !(arm64 & windows)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"tesseract"
|
||||
],
|
||||
"platform": "!(windows & arm) & !static & !uwp"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"nvcodec"
|
||||
],
|
||||
"platform": "linux | (!osx & !uwp & !(arm64 & windows))"
|
||||
}
|
||||
]
|
||||
},
|
||||
"all-gpl": {
|
||||
"description": "Build with all allowed dependencies selected that are compatible with the gpl license",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"all",
|
||||
"gpl",
|
||||
"postproc"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"x264"
|
||||
],
|
||||
"platform": "!(arm & windows)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"x265"
|
||||
],
|
||||
"platform": "!uwp & !(arm & windows)"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avisynthplus"
|
||||
],
|
||||
"platform": "windows & !arm & !uwp & !static"
|
||||
}
|
||||
]
|
||||
},
|
||||
"all-nonfree": {
|
||||
"description": "Build with all allowed dependencies selected with a non-redistributable license",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"all-gpl",
|
||||
"fdk-aac",
|
||||
"nonfree",
|
||||
"openssl"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"alsa": {
|
||||
"description": "Enable ALSA support",
|
||||
"dependencies": [
|
||||
"alsa"
|
||||
]
|
||||
},
|
||||
"amf": {
|
||||
"description": "AMD AMF codec support",
|
||||
"dependencies": [
|
||||
"amd-amf"
|
||||
]
|
||||
},
|
||||
"aom": {
|
||||
"description": "AV1 video encoding/decoding via libaom support in ffmpeg",
|
||||
"dependencies": [
|
||||
"aom"
|
||||
]
|
||||
},
|
||||
"ass": {
|
||||
"description": "Libass subtitles rendering, needed for subtitles and ass filter support in ffmpeg",
|
||||
"dependencies": [
|
||||
"libass"
|
||||
]
|
||||
},
|
||||
"avcodec": {
|
||||
"description": "Build the avcodec library"
|
||||
},
|
||||
"avdevice": {
|
||||
"description": "Build the avdevice library",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avcodec",
|
||||
"avformat"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"avfilter": {
|
||||
"description": "Build the avfilter library"
|
||||
},
|
||||
"avformat": {
|
||||
"description": "Build the avformat library",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avcodec"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"avisynthplus": {
|
||||
"description": "Reading of AviSynth script files",
|
||||
"supports": "windows & !static",
|
||||
"dependencies": [
|
||||
"avisynthplus",
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gpl"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"avresample": {
|
||||
"description": "Build the avresample library"
|
||||
},
|
||||
"bzip2": {
|
||||
"description": "Bzip2 support",
|
||||
"dependencies": [
|
||||
"bzip2"
|
||||
]
|
||||
},
|
||||
"dav1d": {
|
||||
"description": "AV1 decoding via libdav1d",
|
||||
"supports": "!osx",
|
||||
"dependencies": [
|
||||
"dav1d"
|
||||
]
|
||||
},
|
||||
"fdk-aac": {
|
||||
"description": "AAC de/encoding via libfdk-aac, **including GPL-incompatible patent-encumbered HE-AAC**. If you do not require HE-AAC, use the built-in FFmpeg AAC codec.",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "fdk-aac",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"he-aac"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"nonfree"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"ffmpeg": {
|
||||
"description": "Build the ffmpeg application",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avcodec",
|
||||
"avfilter",
|
||||
"avformat"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"ffplay": {
|
||||
"description": "Build the ffplay application",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avcodec",
|
||||
"avfilter",
|
||||
"avformat",
|
||||
"sdl2",
|
||||
"swresample",
|
||||
"swscale"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"ffprobe": {
|
||||
"description": "Build the ffprobe application",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"avcodec",
|
||||
"avformat"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"fontconfig": {
|
||||
"description": "Useful for drawtext filter",
|
||||
"dependencies": [
|
||||
"fontconfig"
|
||||
]
|
||||
},
|
||||
"freetype": {
|
||||
"description": "Needed for drawtext filter",
|
||||
"dependencies": [
|
||||
"freetype"
|
||||
]
|
||||
},
|
||||
"fribidi": {
|
||||
"description": "Improves drawtext filter",
|
||||
"dependencies": [
|
||||
"fribidi"
|
||||
]
|
||||
},
|
||||
"gpl": {
|
||||
"description": "Allow use of GPL code, the resulting libs and binaries will be under GPL"
|
||||
},
|
||||
"iconv": {
|
||||
"description": "Iconv support",
|
||||
"dependencies": [
|
||||
"libiconv"
|
||||
]
|
||||
},
|
||||
"ilbc": {
|
||||
"description": "iLBC de/encoding via libilbc",
|
||||
"dependencies": [
|
||||
"libilbc"
|
||||
]
|
||||
},
|
||||
"lzma": {
|
||||
"description": "lzma support",
|
||||
"dependencies": [
|
||||
"liblzma"
|
||||
]
|
||||
},
|
||||
"modplug": {
|
||||
"description": "ModPlug via libmodplug",
|
||||
"dependencies": [
|
||||
"libmodplug"
|
||||
]
|
||||
},
|
||||
"mp3lame": {
|
||||
"description": "MP3 encoding via libmp3lame",
|
||||
"dependencies": [
|
||||
"mp3lame"
|
||||
]
|
||||
},
|
||||
"nonfree": {
|
||||
"description": "Allow use of nonfree code, the resulting libs and binaries will be unredistributable"
|
||||
},
|
||||
"nvcodec": {
|
||||
"description": "Nvidia video decoding/encoding acceleration",
|
||||
"supports": "linux | (!osx & !uwp & !(arm64 & windows))",
|
||||
"dependencies": [
|
||||
"ffnvcodec"
|
||||
]
|
||||
},
|
||||
"opencl": {
|
||||
"description": "OpenCL processing",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"opencl"
|
||||
]
|
||||
},
|
||||
"opengl": {
|
||||
"description": "OpenGL rendering",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"opengl",
|
||||
"opengl-registry"
|
||||
]
|
||||
},
|
||||
"openh264": {
|
||||
"description": "H.264 de/encoding via openh264",
|
||||
"dependencies": [
|
||||
"openh264"
|
||||
]
|
||||
},
|
||||
"openjpeg": {
|
||||
"description": "JPEG 2000 de/encoding via OpenJPEG",
|
||||
"dependencies": [
|
||||
"openjpeg"
|
||||
]
|
||||
},
|
||||
"openmpt": {
|
||||
"description": "Decoding tracked files via libopenmpt",
|
||||
"dependencies": [
|
||||
"libopenmpt"
|
||||
]
|
||||
},
|
||||
"openssl": {
|
||||
"description": "Needed for https support if gnutls, libtls or mbedtls is not used",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"nonfree"
|
||||
]
|
||||
},
|
||||
"openssl"
|
||||
]
|
||||
},
|
||||
"opus": {
|
||||
"description": "Opus de/encoding via libopus",
|
||||
"dependencies": [
|
||||
"opus"
|
||||
]
|
||||
},
|
||||
"postproc": {
|
||||
"description": "Build the postproc library",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gpl"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"qsv": {
|
||||
"description": "Intel QSV Codec",
|
||||
"dependencies": [
|
||||
"mfx-dispatch"
|
||||
]
|
||||
},
|
||||
"sdl2": {
|
||||
"description": "Sdl2 support",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "sdl2",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"x11"
|
||||
],
|
||||
"platform": "linux"
|
||||
},
|
||||
{
|
||||
"name": "sdl2",
|
||||
"platform": "!linux"
|
||||
}
|
||||
]
|
||||
},
|
||||
"snappy": {
|
||||
"description": "Snappy compression, needed for hap encoding",
|
||||
"dependencies": [
|
||||
"snappy"
|
||||
]
|
||||
},
|
||||
"soxr": {
|
||||
"description": "Include libsoxr resampling",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"swresample"
|
||||
]
|
||||
},
|
||||
"soxr"
|
||||
]
|
||||
},
|
||||
"speex": {
|
||||
"description": "Speex de/encoding via libspeex",
|
||||
"dependencies": [
|
||||
"speex"
|
||||
]
|
||||
},
|
||||
"srt": {
|
||||
"description": "Haivision SRT protocol",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"libsrt"
|
||||
]
|
||||
},
|
||||
"ssh": {
|
||||
"description": "SFTP protocol via libssh",
|
||||
"dependencies": [
|
||||
"libssh"
|
||||
]
|
||||
},
|
||||
"swresample": {
|
||||
"description": "Build the swresample library"
|
||||
},
|
||||
"swscale": {
|
||||
"description": "Build the swscale library"
|
||||
},
|
||||
"tensorflow": {
|
||||
"description": "TensorFlow as a DNN module backend for DNN based filters like sr",
|
||||
"supports": "!static",
|
||||
"dependencies": [
|
||||
"tensorflow"
|
||||
]
|
||||
},
|
||||
"tesseract": {
|
||||
"description": "Tesseract, needed for ocr filter",
|
||||
"supports": "!static",
|
||||
"dependencies": [
|
||||
"tesseract"
|
||||
]
|
||||
},
|
||||
"theora": {
|
||||
"description": "Theora encoding via libtheora",
|
||||
"dependencies": [
|
||||
"libtheora"
|
||||
]
|
||||
},
|
||||
"version3": {
|
||||
"description": "Upgrade (L)GPL to version 3"
|
||||
},
|
||||
"vorbis": {
|
||||
"description": "Vorbis en/decoding via libvorbis, native implementation exists",
|
||||
"dependencies": [
|
||||
"libvorbis"
|
||||
]
|
||||
},
|
||||
"vpx": {
|
||||
"description": "VP8 and VP9 de/encoding via libvpx",
|
||||
"dependencies": [
|
||||
"libvpx"
|
||||
]
|
||||
},
|
||||
"webp": {
|
||||
"description": "WebP encoding via libwebp",
|
||||
"dependencies": [
|
||||
"libwebp"
|
||||
]
|
||||
},
|
||||
"x264": {
|
||||
"description": "H.264 encoding via x264",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gpl"
|
||||
]
|
||||
},
|
||||
"x264"
|
||||
]
|
||||
},
|
||||
"x265": {
|
||||
"description": "HEVC encoding via x265",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gpl"
|
||||
]
|
||||
},
|
||||
"x265"
|
||||
]
|
||||
},
|
||||
"xml2": {
|
||||
"description": "XML parsing using the C library libxml2, needed for dash demuxing support",
|
||||
"dependencies": [
|
||||
"libxml2"
|
||||
]
|
||||
},
|
||||
"zlib": {
|
||||
"description": "zlib support",
|
||||
"dependencies": [
|
||||
"zlib"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
13
adm/vcpkg/ports/jemalloc/fix-configure-ac.patch
Normal file
13
adm/vcpkg/ports/jemalloc/fix-configure-ac.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f6d25f334..3115504e2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1592,7 +1592,7 @@ fi
|
||||
[enable_uaf_detection="0"]
|
||||
)
|
||||
if test "x$enable_uaf_detection" = "x1" ; then
|
||||
- AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ])
|
||||
+ AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ], ["enable UAF"])
|
||||
fi
|
||||
AC_SUBST([enable_uaf_detection])
|
||||
|
58
adm/vcpkg/ports/jemalloc/portfile.cmake
Normal file
58
adm/vcpkg/ports/jemalloc/portfile.cmake
Normal file
@@ -0,0 +1,58 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO jemalloc/jemalloc
|
||||
REF 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c
|
||||
SHA512 527bfbf5db9a5c2b7b04df4785b6ae9d445cff8cb17298bf3e550c88890d2bd7953642d8efaa417580610508279b527d3a3b9e227d17394fd2013c88cb7ae75a
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-configure-ac.patch
|
||||
preprocessor.patch
|
||||
)
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(opts "ac_cv_search_log=none required" "--without-private-namespace")
|
||||
endif()
|
||||
|
||||
set (opts "${opts}" "--disable-initial-exec-tls")
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
AUTOCONFIG
|
||||
NO_WRAPPERS
|
||||
OPTIONS ${opts}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
file(COPY "${SOURCE_PATH}/include/msvc_compat/strings.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/jemalloc/msvc_compat")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/jemalloc/jemalloc.h" "<strings.h>" "\"msvc_compat/strings.h\"")
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/bin/jemalloc.dll")
|
||||
endif()
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/jemalloc.dll")
|
||||
endif()
|
||||
endif()
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools")
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
12
adm/vcpkg/ports/jemalloc/preprocessor.patch
Normal file
12
adm/vcpkg/ports/jemalloc/preprocessor.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 3115504e2..ffb504b08 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -749,6 +749,7 @@ case "${host}" in
|
||||
so="dll"
|
||||
if test "x$je_cv_msvc" = "xyes" ; then
|
||||
importlib="lib"
|
||||
+ JE_APPEND_VS(CPPFLAGS, -DJEMALLOC_NO_PRIVATE_NAMESPACE)
|
||||
DSO_LDFLAGS="-LD"
|
||||
EXTRA_LDFLAGS="-link -DEBUG"
|
||||
CTARGET='-Fo$@'
|
8
adm/vcpkg/ports/jemalloc/vcpkg.json
Normal file
8
adm/vcpkg/ports/jemalloc/vcpkg.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "jemalloc",
|
||||
"version": "5.3.0",
|
||||
"port-version": 1,
|
||||
"description": "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support",
|
||||
"homepage": "https://jemalloc.net/",
|
||||
"license": "BSD-2-Clause"
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
diff --git a/win/makefile.vc b/win/makefile.vc
|
||||
index c88c0ec3dc..6c9dd624d7 100644
|
||||
--- a/win/makefile.vc
|
||||
+++ b/win/makefile.vc
|
||||
@@ -466,13 +466,13 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
|
||||
# release - Everything that builds as part of a release
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
-release: setup $(TCLSH) $(TCLSTUBLIB) dlls pkgs
|
||||
+release: setup $(TCLSH) $(TCLSTUBLIB) dlls pkgs tk-build
|
||||
all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) pkgs
|
||||
core: setup $(TCLLIB) $(TCLSTUBLIB)
|
||||
shell: setup $(TCLSH)
|
||||
dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll
|
||||
tcltest: setup $(TCLTEST) dlls $(CAT32)
|
||||
-install: install-binaries install-libraries install-docs install-pkgs
|
||||
+install: install-binaries install-libraries install-docs install-pkgs tk-build tk-install
|
||||
!if $(SYMBOLS)
|
||||
install: install-pdbs
|
||||
!endif
|
||||
@@ -569,6 +569,24 @@ pkgs:
|
||||
popd \
|
||||
)
|
||||
|
||||
+tk-build:
|
||||
+!if defined(TKDIR) && defined(INSTALLDIR)
|
||||
+ @if exist "$(TKDIR)\win\makefile.vc" ( \
|
||||
+ pushd "$(TKDIR)\win" & \
|
||||
+ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) INSTALLDIR=$(INSTALLDIR) OPTS=$(OPTS) STATS=$(STATS) CHECKS=$(CHECKS) MACHINE=$(MACHINE) &\
|
||||
+ popd \
|
||||
+ )
|
||||
+!endif
|
||||
+
|
||||
+tk-install:
|
||||
+!if defined(TKDIR) && defined(INSTALLDIR)
|
||||
+ @if exist "$(TKDIR)\win\makefile.vc" ( \
|
||||
+ pushd "$(TKDIR)\win" & \
|
||||
+ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) INSTALLDIR=$(INSTALLDIR) OPTS=$(OPTS) STATS=$(STATS) CHECKS=$(CHECKS) MACHINE=$(MACHINE) install &\
|
||||
+ popd \
|
||||
+ )
|
||||
+!endif
|
||||
+
|
||||
test-pkgs:
|
||||
@for /d %d in ($(PKGSDIR)\*) do \
|
||||
@if exist "%~fd\win\makefile.vc" ( \
|
||||
--
|
||||
2.47.1.windows.2
|
||||
|
@@ -1,51 +0,0 @@
|
||||
diff --git a/win/makefile.vc b/win/makefile.vc
|
||||
index 6c9dd624d7..d29185feed 100644
|
||||
--- a/win/makefile.vc
|
||||
+++ b/win/makefile.vc
|
||||
@@ -420,6 +420,7 @@ TCLSTUBOBJS = \
|
||||
### the left side of implicit rules.
|
||||
TOMMATHDIR = $(ROOT)\libtommath
|
||||
PKGSDIR = $(ROOT)\pkgs
|
||||
+WINDIR = $(ROOT)\win
|
||||
|
||||
# Additional include and C macro definitions for the implicit rules
|
||||
# defined in rules.vc
|
||||
@@ -438,6 +439,7 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
|
||||
!endif
|
||||
|
||||
|
||||
+
|
||||
#---------------------------------------------------------------------
|
||||
# Project specific targets
|
||||
# There are 4 primary build configurations to consider from the combination
|
||||
@@ -466,18 +468,24 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
|
||||
# release - Everything that builds as part of a release
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
-release: setup $(TCLSH) $(TCLSTUBLIB) dlls pkgs tk-build
|
||||
-all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) pkgs
|
||||
+release: setup $(TCLSH) $(TCLSTUBLIB) dlls setpath pkgs tk-build
|
||||
+all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) setpath pkgs
|
||||
core: setup $(TCLLIB) $(TCLSTUBLIB)
|
||||
shell: setup $(TCLSH)
|
||||
dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll
|
||||
tcltest: setup $(TCLTEST) dlls $(CAT32)
|
||||
-install: install-binaries install-libraries install-docs install-pkgs tk-build tk-install
|
||||
+install: setpath install-binaries install-libraries install-docs install-pkgs tk-build tk-install
|
||||
!if $(SYMBOLS)
|
||||
install: install-pdbs
|
||||
!endif
|
||||
setup: default-setup
|
||||
|
||||
+# Add TCL win directory to PATH for current session
|
||||
+setpath:
|
||||
+ @echo Adding $(WINDIR) to PATH
|
||||
+ @set PATH=$(WINDIR);$(PATH)
|
||||
+ @echo PATH updated for current session
|
||||
+
|
||||
test: test-core test-pkgs
|
||||
test-core: setup $(TCLTEST) dlls $(CAT32)
|
||||
set TCL_LIBRARY=$(ROOT:\=/)/library
|
||||
--
|
||||
2.47.1.windows.2
|
||||
|
@@ -1,119 +0,0 @@
|
||||
From 34a5ac55260871875c3ad678df8c21ef31500d21 Mon Sep 17 00:00:00 2001
|
||||
From: dpasukhi <dpasukhi@opencascade.com>
|
||||
Date: Sun, 22 Jun 2025 14:18:19 +0100
|
||||
Subject: [PATCH] Add Tk build and install support to Makefile; include
|
||||
automatic clean and distclean steps
|
||||
|
||||
---
|
||||
unix/Makefile.in | 69 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 69 insertions(+)
|
||||
|
||||
diff --git a/unix/Makefile.in b/unix/Makefile.in
|
||||
index bc743b3892..7464e3f930 100644
|
||||
--- a/unix/Makefile.in
|
||||
+++ b/unix/Makefile.in
|
||||
@@ -95,6 +95,12 @@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
|
||||
# Tcl Module default path roots (TIP189).
|
||||
TCL_MODULE_PATH = @TCL_MODULE_PATH@
|
||||
|
||||
+# Tk-related directories and settings
|
||||
+# These can be overridden on the command line or set via environment
|
||||
+TKDIR = @TKDIR@
|
||||
+TK_BUILD_TOP = $(TKDIR)/unix
|
||||
+TK_SRC_DIR = $(TKDIR)
|
||||
+
|
||||
# warning flags
|
||||
CFLAGS_WARNING = @CFLAGS_WARNING@
|
||||
|
||||
@@ -623,6 +629,34 @@ SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
all: binaries libraries doc packages
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \
|
||||
+ echo "TKDIR detected - automatically building Tk..."; \
|
||||
+ echo "========== TK BUILD PARAMETERS =========="; \
|
||||
+ echo "TKDIR=$(TKDIR)"; \
|
||||
+ echo "TCLDIR=$(TOP_DIR)"; \
|
||||
+ echo "prefix=$(prefix)"; \
|
||||
+ echo "exec_prefix=$(exec_prefix)"; \
|
||||
+ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"; \
|
||||
+ echo "=========================================="; \
|
||||
+ if test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "Building Tk using existing Makefile..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE)) || exit $$?; \
|
||||
+ elif test -f "$(TK_SRC_DIR)/unix/configure"; then \
|
||||
+ echo "Configuring and building Tk..."; \
|
||||
+ mkdir -p "$(TK_BUILD_TOP)"; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && \
|
||||
+ "$(TK_SRC_DIR)/unix/configure" \
|
||||
+ --prefix="$(prefix)" \
|
||||
+ --exec-prefix="$(exec_prefix)" \
|
||||
+ --with-tcl="$(CONFIG_INSTALL_DIR)" && \
|
||||
+ $(MAKE)) || exit $$?; \
|
||||
+ else \
|
||||
+ echo "ERROR: Tk configure script not found at $(TK_SRC_DIR)/unix/configure"; \
|
||||
+ exit 1; \
|
||||
+ fi; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set or directory does not exist - skipping Tk build"; \
|
||||
+ fi
|
||||
|
||||
binaries: ${LIB_FILE} ${TCL_EXE}
|
||||
|
||||
@@ -671,11 +705,25 @@ clean: clean-packages
|
||||
errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@ \
|
||||
minizip${HOST_EXEEXT} *.${HOST_OBJEXT} *.zip *.vfs
|
||||
(cd dltest ; $(MAKE) clean)
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "TKDIR detected - automatically cleaning Tk..."; \
|
||||
+ echo "Cleaning Tk build..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) clean) || exit $$?; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set, directory does not exist, or no Tk build to clean"; \
|
||||
+ fi
|
||||
|
||||
distclean: distclean-packages clean
|
||||
rm -rf Makefile config.status config.cache config.log tclConfig.sh \
|
||||
tclConfig.h *.plist Tcl.framework tcl.pc tclUuid.h
|
||||
(cd dltest ; $(MAKE) distclean)
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "TKDIR detected - automatically distcleaning Tk..."; \
|
||||
+ echo "Distcleaning Tk build..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) distclean) || exit $$?; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set, directory does not exist, or no Tk build to distclean"; \
|
||||
+ fi
|
||||
|
||||
depend:
|
||||
makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
|
||||
@@ -796,6 +844,27 @@ INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_T
|
||||
$(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS)
|
||||
|
||||
install: $(INSTALL_TARGETS)
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \
|
||||
+ echo "TKDIR detected - automatically installing Tk..."; \
|
||||
+ echo "========== TK INSTALL PARAMETERS =========="; \
|
||||
+ echo "TKDIR=$(TKDIR)"; \
|
||||
+ echo "TCLDIR=$(TOP_DIR)"; \
|
||||
+ echo "prefix=$(prefix)"; \
|
||||
+ echo "exec_prefix=$(exec_prefix)"; \
|
||||
+ echo "DESTDIR=$(INSTALL_ROOT)"; \
|
||||
+ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"; \
|
||||
+ echo "==========================================="; \
|
||||
+ if test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "Installing Tk..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) install DESTDIR="$(INSTALL_ROOT)") || exit $$?; \
|
||||
+ else \
|
||||
+ echo "ERROR: Tk Makefile not found at $(TK_BUILD_TOP)/Makefile"; \
|
||||
+ echo "Please run 'make all' first to build Tk"; \
|
||||
+ exit 1; \
|
||||
+ fi; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set or directory does not exist - skipping Tk install"; \
|
||||
+ fi
|
||||
|
||||
install-strip:
|
||||
$(MAKE) $(INSTALL_TARGETS) \
|
||||
--
|
||||
2.47.1.windows.2
|
||||
|
@@ -1,117 +0,0 @@
|
||||
From bf55f8558b8ca6603f6539c6421391f26ab6139a Mon Sep 17 00:00:00 2001
|
||||
From: dpasukhi <dpasukhi@opencascade.com>
|
||||
Date: Sun, 22 Jun 2025 15:20:03 +0100
|
||||
Subject: [PATCH] Add Tk build and install automation to Makefile; include
|
||||
clean and distclean targets
|
||||
|
||||
---
|
||||
win/Makefile.in | 68 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 68 insertions(+)
|
||||
|
||||
diff --git a/win/Makefile.in b/win/Makefile.in
|
||||
index 8dd107670f..f0cf267329 100644
|
||||
--- a/win/Makefile.in
|
||||
+++ b/win/Makefile.in
|
||||
@@ -129,6 +129,11 @@ ROOT_DIR_WIN_NATIVE = $(shell cd '$(ROOT_DIR)' ; pwd -W 2>/dev/null || pwd -P)
|
||||
ZLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ZLIB_DIR)')
|
||||
TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)')
|
||||
|
||||
+# Tk-related directories (TKDIR can be set by user)
|
||||
+TK_SRC_DIR = $(TKDIR)
|
||||
+TK_BUILD_TOP = $(TKDIR)/win
|
||||
+CONFIG_INSTALL_DIR = $(LIB_INSTALL_DIR)
|
||||
+
|
||||
# Fully qualify library path so that `make test`
|
||||
# does not depend on the current directory.
|
||||
LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd -P)
|
||||
@@ -432,6 +437,34 @@ TCL_OBJS = ${GENERIC_OBJS} ${WIN_OBJS} @ZLIB_OBJS@ $(TOMMATH_OBJS)
|
||||
TCL_DOCS = "$(ROOT_DIR_NATIVE)"/doc/*.[13n]
|
||||
|
||||
all: binaries libraries doc packages
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \
|
||||
+ echo "TKDIR detected - automatically building Tk..."; \
|
||||
+ echo "========== TK BUILD PARAMETERS =========="; \
|
||||
+ echo "TKDIR=$(TKDIR)"; \
|
||||
+ echo "TCLDIR=$(TOP_DIR)"; \
|
||||
+ echo "prefix=$(prefix)"; \
|
||||
+ echo "exec_prefix=$(exec_prefix)"; \
|
||||
+ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VER)${EXESUFFIX}"; \
|
||||
+ echo "=========================================="; \
|
||||
+ if test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "Building Tk using existing Makefile..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE)) || exit $$?; \
|
||||
+ elif test -f "$(TK_SRC_DIR)/win/configure"; then \
|
||||
+ echo "Configuring and building Tk..."; \
|
||||
+ mkdir -p "$(TK_BUILD_TOP)"; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && \
|
||||
+ "$(TK_SRC_DIR)/win/configure" \
|
||||
+ --prefix="$(prefix)" \
|
||||
+ --exec-prefix="$(exec_prefix)" \
|
||||
+ --with-tcl="$(CONFIG_INSTALL_DIR)" && \
|
||||
+ $(MAKE)) || exit $$?; \
|
||||
+ else \
|
||||
+ echo "ERROR: Tk configure script not found at $(TK_SRC_DIR)/win/configure"; \
|
||||
+ exit 1; \
|
||||
+ fi; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set or directory does not exist - skipping Tk build"; \
|
||||
+ fi
|
||||
|
||||
# Test-suite helper (can be used to test Tcl from build directory with all expected modules).
|
||||
# To start from windows shell use:
|
||||
@@ -648,6 +681,27 @@ gentommath_h:
|
||||
> "$(GENERIC_DIR_NATIVE)/tclTomMath.h"
|
||||
|
||||
install: all install-binaries install-libraries install-doc install-packages
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \
|
||||
+ echo "TKDIR detected - automatically installing Tk..."; \
|
||||
+ echo "========== TK INSTALL PARAMETERS =========="; \
|
||||
+ echo "TKDIR=$(TKDIR)"; \
|
||||
+ echo "TCLDIR=$(TOP_DIR)"; \
|
||||
+ echo "prefix=$(prefix)"; \
|
||||
+ echo "exec_prefix=$(exec_prefix)"; \
|
||||
+ echo "DESTDIR=$(INSTALL_ROOT)"; \
|
||||
+ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VER)${EXESUFFIX}"; \
|
||||
+ echo "==========================================="; \
|
||||
+ if test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "Installing Tk..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) install DESTDIR="$(INSTALL_ROOT)") || exit $$?; \
|
||||
+ else \
|
||||
+ echo "ERROR: Tk Makefile not found at $(TK_BUILD_TOP)/Makefile"; \
|
||||
+ echo "Please run 'make all' first to build Tk"; \
|
||||
+ exit 1; \
|
||||
+ fi; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set or directory does not exist - skipping Tk install"; \
|
||||
+ fi
|
||||
|
||||
install-binaries: binaries
|
||||
@for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)"; \
|
||||
@@ -848,10 +902,24 @@ clean: cleanhelp clean-packages
|
||||
$(RM) $(TCLSH) $(CAT32) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd tcltest.sh
|
||||
$(RM) *.pch *.ilk *.pdb *.zip
|
||||
$(RMDIR) *.vfs
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "TKDIR detected - automatically cleaning Tk..."; \
|
||||
+ echo "Cleaning Tk build..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) clean) || exit $$?; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set, directory does not exist, or no Tk build to clean"; \
|
||||
+ fi
|
||||
|
||||
distclean: distclean-packages clean
|
||||
$(RM) Makefile config.status config.cache config.log tclConfig.sh \
|
||||
tcl.hpj config.status.lineno tclsh.exe.manifest tclUuid.h
|
||||
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \
|
||||
+ echo "TKDIR detected - automatically distcleaning Tk..."; \
|
||||
+ echo "Distcleaning Tk build..."; \
|
||||
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) distclean) || exit $$?; \
|
||||
+ else \
|
||||
+ echo "TKDIR not set, directory does not exist, or no Tk build to distclean"; \
|
||||
+ fi
|
||||
|
||||
#
|
||||
# Bundled package targets
|
||||
--
|
||||
2.47.1.windows.2
|
||||
|
@@ -1,56 +1,20 @@
|
||||
vcpkg_from_sourceforge(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO tcl/Tcl
|
||||
REF 8.6.16
|
||||
FILENAME tcl8.6.16-src.tar.gz
|
||||
SHA512 434c92f8181fb8dca6bc065b0f1f5078779086f19adf008818c90a3108596c63465ef43e9f3c1cfb3d4151a9de244d0bf0e6ee5b40e714b1ddca4a78eb43050b
|
||||
PATCHES
|
||||
0001-Add-tk-build.patch
|
||||
0002-Add-setpath-target.patch
|
||||
0003-Update-unix-build.patch
|
||||
0004-Update-mingw-build.patch
|
||||
REF 8.6.15
|
||||
FILENAME tcl8.6.15-src.tar.gz
|
||||
SHA512 9ae652823084899091467744da5a35d0fdfb453c055baea96af1bb181d161abe58b83382315cc3abee5fd57acc4ad5028df486a3e53645a28d1467e9c8d1d23e
|
||||
)
|
||||
|
||||
set(USE_TCL_TK OFF)
|
||||
|
||||
if ("tk" IN_LIST FEATURES)
|
||||
vcpkg_from_sourceforge(
|
||||
OUT_SOURCE_PATH TK_SOURCE_PATH
|
||||
REPO tcl/Tcl
|
||||
REF 8.6.16
|
||||
FILENAME tk8.6.16-src.tar.gz
|
||||
SHA512 b7d37bee25f826f156137a04859ac756c682f1dd155ec9629119dc3690509ce1b6e308e23b291f2debbc10f3b1650993fea66463e5445c505860a10acac901d0
|
||||
)
|
||||
|
||||
# Copy TK to TCL package source path (SOURCE_PATH/extra/tk) if TK is used
|
||||
if (NOT EXISTS "${SOURCE_PATH}/extra/tk.8.6.16-src")
|
||||
file(MAKE_DIRECTORY "${SOURCE_PATH}/extra/tk.8.6.16-src")
|
||||
file(COPY ${TK_SOURCE_PATH}/ DESTINATION "${SOURCE_PATH}/extra/tk.8.6.16-src")
|
||||
endif()
|
||||
set (USE_TCL_TK ON)
|
||||
endif()
|
||||
|
||||
# Copy TK to TCL package source path if TK is used
|
||||
|
||||
# Use Windows NMAKE build for MSVC, but Unix build for MinGW
|
||||
if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
||||
set(TCL_BUILD_MACHINE_STR MACHINE=AMD64)
|
||||
set(TCL_BUILD_ARCH_STR ARCH=AMD64)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
|
||||
set(TCL_BUILD_MACHINE_STR MACHINE=ARM64)
|
||||
set(TCL_BUILD_ARCH_STR ARCH=ARM64)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
|
||||
set(TCL_BUILD_MACHINE_STR MACHINE=IX86)
|
||||
set(TCL_BUILD_ARCH_STR ARCH=IX86)
|
||||
else()
|
||||
# Default fallback for unknown architectures
|
||||
set(TCL_BUILD_MACHINE_STR MACHINE=IX86)
|
||||
set(TCL_BUILD_ARCH_STR ARCH=IX86)
|
||||
endif()
|
||||
|
||||
# Handle features
|
||||
set(TCL_BUILD_OPTS OPTS=)
|
||||
set(TCL_BUILD_OPTS OPTS=pdbs)
|
||||
set(TCL_BUILD_STATS STATS=none)
|
||||
set(TCL_BUILD_CHECKS CHECKS=none)
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
@@ -78,47 +42,109 @@ if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
||||
PROJECT_SUBPATH win
|
||||
OPTIONS
|
||||
${TCL_BUILD_MACHINE_STR}
|
||||
${TCL_BUILD_ARCH_STR}
|
||||
${TCL_BUILD_STATS}
|
||||
${TCL_BUILD_CHECKS}
|
||||
TKDIR=../extra/tk.8.6.16-src
|
||||
OPTIONS_DEBUG
|
||||
${TCL_BUILD_OPTS},symbols,pdbs
|
||||
${TCL_BUILD_OPTS},symbols
|
||||
INSTALLDIR=${CURRENT_PACKAGES_DIR}/debug
|
||||
SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib/tcl9.0
|
||||
OPTIONS_RELEASE
|
||||
release
|
||||
${TCL_BUILD_OPTS}
|
||||
INSTALLDIR=${CURRENT_PACKAGES_DIR}
|
||||
SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/tools/tcl/lib/tcl9.0
|
||||
)
|
||||
|
||||
# Install
|
||||
# Note: tcl shell requires it to be in a folder adjacent to the /lib/ folder, i.e. in a /bin/ folder
|
||||
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release)
|
||||
file(GLOB_RECURSE TOOL_BIN
|
||||
"${CURRENT_PACKAGES_DIR}/bin/*.exe"
|
||||
"${CURRENT_PACKAGES_DIR}/bin/*.dll"
|
||||
)
|
||||
file(COPY ${TOOL_BIN} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/tcl/bin/")
|
||||
|
||||
# Remove .exes only after copying
|
||||
file(GLOB_RECURSE TOOL_EXES
|
||||
${CURRENT_PACKAGES_DIR}/bin/*.exe
|
||||
)
|
||||
file(REMOVE ${TOOL_EXES})
|
||||
|
||||
file(GLOB_RECURSE TOOLS
|
||||
"${CURRENT_PACKAGES_DIR}/lib/dde1.4/*"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/nmake/*"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/reg1.3/*"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/tcl8/*"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/tcl8.6/*"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/tdbcsqlite31.1.0/*"
|
||||
)
|
||||
|
||||
foreach(TOOL ${TOOLS})
|
||||
get_filename_component(DST_DIR ${TOOL} PATH)
|
||||
file(COPY "${TOOL}" DESTINATION ${DST_DIR})
|
||||
endforeach()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/dde1.4"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/nmake"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/reg1.3"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/tcl8"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/tcl8.6"
|
||||
"${CURRENT_PACKAGES_DIR}/lib/tdbcsqlite31.1.0"
|
||||
)
|
||||
file(CHMOD_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/tools/tcl/lib/tcl9.0/msgs" "${CURRENT_PACKAGES_DIR}/tools/tcl/lib/tcl9.0/tzdata"
|
||||
PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_WRITE
|
||||
WORLD_READ WORLD_WRITE
|
||||
)
|
||||
endif()
|
||||
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
|
||||
file(GLOB_RECURSE TOOL_BIN
|
||||
"${CURRENT_PACKAGES_DIR}/debug/bin/*.exe"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/bin/*.dll"
|
||||
)
|
||||
file(COPY ${TOOL_BIN} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/tcl/debug/bin/")
|
||||
|
||||
# Remove .exes only after copying
|
||||
file(GLOB_RECURSE EXES
|
||||
"${CURRENT_PACKAGES_DIR}/debug/bin/*.exe"
|
||||
)
|
||||
file(REMOVE ${EXES})
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/dde1.4"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/nmake"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/reg1.3"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/tcl8"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/tcl8.6"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/lib/tdbcsqlite31.1.0"
|
||||
)
|
||||
|
||||
file(CHMOD_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib/tcl9.0/msgs" "${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib/tcl9.0/tzdata"
|
||||
PERMISSIONS
|
||||
OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_WRITE
|
||||
WORLD_READ WORLD_WRITE
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif()
|
||||
|
||||
file (REMOVE ${CURRENT_PACKAGES_DIR}/bin/zlib1.dll)
|
||||
file (REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/zlib1.dll)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
else()
|
||||
set (TCL_PROJECT_SUBPATH unix)
|
||||
if (VCPKG_TARGET_IS_MINGW)
|
||||
set (TCL_PROJECT_SUBPATH win)
|
||||
endif()
|
||||
file(REMOVE "${SOURCE_PATH}/${TCL_PROJECT_SUBPATH}/configure")
|
||||
# For MinGW and other Unix-like environments on Windows, use unix build path
|
||||
# MinGW can use either win/ (with MinGW-compatible Makefiles) or unix/ (with autotools)
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
PROJECT_SUBPATH ${TCL_PROJECT_SUBPATH}
|
||||
OPTIONS
|
||||
TKDIR=${SOURCE_PATH}/extra/tk.8.6.16-src
|
||||
PROJECT_SUBPATH unix
|
||||
)
|
||||
|
||||
vcpkg_install_make(
|
||||
OPTIONS
|
||||
TKDIR=${SOURCE_PATH}/extra/tk.8.6.16-src
|
||||
)
|
||||
|
||||
|
||||
vcpkg_install_make()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif()
|
||||
@@ -127,9 +153,4 @@ endif()
|
||||
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/tclConfig.sh" "${CURRENT_PACKAGES_DIR}/debug/lib/tclConfig.sh")
|
||||
|
||||
# Remove TK configuration files if TK was built
|
||||
if(USE_TCL_TK)
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/tkConfig.sh" "${CURRENT_PACKAGES_DIR}/debug/lib/tkConfig.sh")
|
||||
endif()
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.terms")
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user