mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
de18daf279 |
@@ -1,41 +0,0 @@
|
||||
# clang-format configuration file trying to apply OCCT coding style
|
||||
#
|
||||
# Clang formatting rules: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
# The clang-format npm package (https://github.com/angular/clang-format) uses
|
||||
# a pre-built clang-format.exe from http://llvm.org/builds/
|
||||
#
|
||||
# We use defaults from the Microsoft style
|
||||
BasedOnStyle: Microsoft
|
||||
#
|
||||
# Style options
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: Consecutive
|
||||
AlignConsecutiveDeclarations: Consecutive
|
||||
AlignTrailingComments: true
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeTernaryOperators: true
|
||||
ColumnLimit: 100
|
||||
ContinuationIndentWidth: 2
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: BeforeHash
|
||||
IndentWidth: 2
|
||||
IndentWrappedFunctionNames: true
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
SeparateDefinitionBlocks: Always
|
||||
SortIncludes: false
|
||||
UseTab: Never
|
||||
#
|
||||
# OCCT specific settings
|
||||
StatementMacros:
|
||||
- Standard_FALLTHROUGH
|
||||
- Standard_DEPRECATED
|
||||
TypenameMacros:
|
||||
- Handle
|
@@ -1,2 +0,0 @@
|
||||
# Global formatting with new rules using clang-format 18.1.8
|
||||
a5a7b3185b83c39d5b26cfaf138b9b87b5776e59
|
52
.github/ISSUE_TEMPLATE/Bug Report.yaml
vendored
52
.github/ISSUE_TEMPLATE/Bug Report.yaml
vendored
@@ -1,11 +1,46 @@
|
||||
name: "Bug Report"
|
||||
description: "Report a bug related to the OCCT"
|
||||
labels: ["2. Bug", "0. New"]
|
||||
labels: ["2. Bug"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Please provide the following information:**
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Category
|
||||
description: "Select the bug category"
|
||||
options:
|
||||
- Application Framework
|
||||
- Build
|
||||
- Coding
|
||||
- Configuration
|
||||
- Data Exchange
|
||||
- Documentation
|
||||
- DRAW
|
||||
- Foundation Classes
|
||||
- Mesh
|
||||
- Modeling
|
||||
- Samples
|
||||
- Shape Healing
|
||||
- Testing
|
||||
- Visualization
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: severity
|
||||
attributes:
|
||||
label: Severity
|
||||
description: "Select the bug severity"
|
||||
options:
|
||||
- Crash
|
||||
- Critical
|
||||
- Major
|
||||
- Minor
|
||||
- Trivial
|
||||
default: 2
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
@@ -58,6 +93,11 @@ body:
|
||||
default: 0
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: compiler_version
|
||||
attributes:
|
||||
label: Compiler Version
|
||||
description: "Specify the compiler version (optional)"
|
||||
- type: dropdown
|
||||
id: bitness
|
||||
attributes:
|
||||
@@ -85,6 +125,16 @@ body:
|
||||
default: 6
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: precise_occt_version
|
||||
attributes:
|
||||
label: Precise OCCT Version or Branch
|
||||
description: "Specify the precise OCCT version, branch, or SSH (optional)"
|
||||
- type: input
|
||||
id: environment
|
||||
attributes:
|
||||
label: Environment
|
||||
description: "Details about your environment (OS, compiler, etc.)"
|
||||
- type: textarea
|
||||
id: additional_files
|
||||
attributes:
|
||||
|
23
.github/ISSUE_TEMPLATE/Feature Request.yaml
vendored
23
.github/ISSUE_TEMPLATE/Feature Request.yaml
vendored
@@ -1,11 +1,32 @@
|
||||
name: "Feature Request"
|
||||
description: "Request a new feature or enhancement for the OCCT"
|
||||
labels: ["2. Enhancement", "0. New"]
|
||||
labels: ["2. Enhancement"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Please provide the following information:**
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Category
|
||||
description: "Select the bug category"
|
||||
options:
|
||||
- Application Framework
|
||||
- Build
|
||||
- Coding
|
||||
- Configuration
|
||||
- Data Exchange
|
||||
- Documentation
|
||||
- DRAW
|
||||
- Foundation Classes
|
||||
- Mesh
|
||||
- Modeling
|
||||
- Samples
|
||||
- Shape Healing
|
||||
- Testing
|
||||
- Visualization
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
|
18
.github/actions/setup-xvfb-mesa/action.yml
vendored
18
.github/actions/setup-xvfb-mesa/action.yml
vendored
@@ -1,18 +0,0 @@
|
||||
name: 'Setup Xvfb and Mesa'
|
||||
description: 'Installs and configures Xvfb and Mesa for graphical testing on Linux'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install Xvfb and Mesa
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri
|
||||
shell: bash
|
||||
|
||||
- name: Start Xvfb
|
||||
run: |
|
||||
Xvfb :99 -screen 0 1920x1080x24 &
|
||||
echo "DISPLAY=:99" >> $GITHUB_ENV
|
||||
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
|
||||
shell: bash
|
32
.github/actions/testgrid/testlinuxclang.tcl
vendored
32
.github/actions/testgrid/testlinuxclang.tcl
vendored
@@ -1,32 +0,0 @@
|
||||
set exclude_list [list \
|
||||
"bugs caf bug31075" \
|
||||
"bugs caf bug31546" \
|
||||
"bugs fclasses bug6143" \
|
||||
"bugs fclasses bug25574" \
|
||||
"bugs fclasses bug29064" \
|
||||
"bugs fclasses bug7287_3" \
|
||||
"bugs fclasses bug7287_5" \
|
||||
"bugs moddata_2 bug712_2" \
|
||||
"bugs moddata_1 bug20627" \
|
||||
"collections n arrayMove" \
|
||||
"lowalgos intss bug565" \
|
||||
"lowalgos intss bug567_1" \
|
||||
"lowalgos intss bug23972" \
|
||||
"lowalgos intss bug29910_2" \
|
||||
"opengl background bug27836" \
|
||||
"opengl text C4" \
|
||||
"opengles3 background bug27836" \
|
||||
"opengles3 general msaa" \
|
||||
"opengles3 geom interior1" \
|
||||
"opengles3 geom interior2" \
|
||||
"opengles3 raytrace msaa" \
|
||||
"opengles3 text C4" \
|
||||
"opengles3 textures alpha_mask" \
|
||||
"boolean bopfuse_simple ZP6" \
|
||||
"boolean gdml_private B5" \
|
||||
"bugs modalg_1 bug19071" \
|
||||
"bugs modalg_5 bug25199"
|
||||
]
|
||||
|
||||
set exclude_str [join $exclude_list ,]
|
||||
testgrid -exclude {*}$exclude_str -outdir results/linux-clang-x64
|
28
.github/actions/testgrid/testlinuxgcc.tcl
vendored
28
.github/actions/testgrid/testlinuxgcc.tcl
vendored
@@ -1,28 +0,0 @@
|
||||
set exclude_list [list \
|
||||
"bugs caf bug31075" \
|
||||
"bugs caf bug31546" \
|
||||
"bugs fclasses bug6143" \
|
||||
"bugs moddata_2 bug712_2" \
|
||||
"bugs moddata_1 bug20627" \
|
||||
"bugs modalg_6 bug27884" \
|
||||
"lowalgos intss bug565" \
|
||||
"lowalgos intss bug567_1" \
|
||||
"lowalgos intss bug23972" \
|
||||
"lowalgos intss bug29910_2" \
|
||||
"opengl background bug27836" \
|
||||
"opengl text C4" \
|
||||
"opengles3 background bug27836" \
|
||||
"opengles3 general msaa" \
|
||||
"opengles3 geom interior1" \
|
||||
"opengles3 geom interior2" \
|
||||
"opengles3 raytrace msaa" \
|
||||
"opengles3 text C4" \
|
||||
"opengles3 textures alpha_mask" \
|
||||
"boolean bopfuse_simple ZP6" \
|
||||
"boolean gdml_private B5" \
|
||||
"bugs modalg_1 bug19071" \
|
||||
"bugs modalg_5 bug25199"
|
||||
]
|
||||
|
||||
set exclude_str [join $exclude_list ,]
|
||||
testgrid -exclude {*}$exclude_str -outdir results/linux-gcc-x64
|
1
.github/actions/testgrid/testmacos.tcl
vendored
1
.github/actions/testgrid/testmacos.tcl
vendored
@@ -1 +0,0 @@
|
||||
testgrid -outdir results/macos-x64 caf basic
|
1
.github/actions/testgrid/testmacosgcc.tcl
vendored
1
.github/actions/testgrid/testmacosgcc.tcl
vendored
@@ -1 +0,0 @@
|
||||
testgrid -outdir results/macos-gcc-x64 caf basic
|
24
.github/actions/testgrid/testwindows.tcl
vendored
24
.github/actions/testgrid/testwindows.tcl
vendored
@@ -1,24 +0,0 @@
|
||||
set exclude_list [list \
|
||||
"bugs fclasses bug6143" \
|
||||
"bugs modalg_5 bug24639" \
|
||||
"bugs modalg_7 bug83" \
|
||||
"bugs caf bug31918_1" \
|
||||
"chamfer dist_angle_sequence A5" \
|
||||
"opengl background bug27836" \
|
||||
"opengl drivers d3dhost" \
|
||||
"opengl background srgb" \
|
||||
"opengl text C4" \
|
||||
"opengles2 text C4" \
|
||||
"opengles3 text C4" \
|
||||
"boolean gdml_private B5" \
|
||||
"chamfer dist_angle A3" \
|
||||
"chamfer dist_angle E5" \
|
||||
"chamfer dist_angle_complex A1" \
|
||||
"chamfer dist_angle_complex A4" \
|
||||
"chamfer dist_angle_complex A5" \
|
||||
"chamfer dist_angle_sequence A1" \
|
||||
"chamfer dist_angle_sequence A4"
|
||||
]
|
||||
|
||||
set exclude_str [join $exclude_list ,]
|
||||
testgrid -exclude {*}$exclude_str -outdir results/windows-x64
|
25
.github/actions/testgrid/testwindowsclang.tcl
vendored
25
.github/actions/testgrid/testwindowsclang.tcl
vendored
@@ -1,25 +0,0 @@
|
||||
set exclude_list [list \
|
||||
"bugs caf bug31918_1" \
|
||||
"bugs fclasses bug6143" \
|
||||
"bugs fclasses bug25574" \
|
||||
"bugs fclasses bug29064" \
|
||||
"chamfer dist_angle_sequence A5" \
|
||||
"collections n arrayMove" \
|
||||
"opengl background bug27836" \
|
||||
"opengl drivers d3dhost" \
|
||||
"opengl background srgb" \
|
||||
"opengl text C4" \
|
||||
"opengles2 text C4" \
|
||||
"opengles3 text C4" \
|
||||
"boolean gdml_private B5" \
|
||||
"chamfer dist_angle A3" \
|
||||
"chamfer dist_angle E5" \
|
||||
"chamfer dist_angle_complex A1" \
|
||||
"chamfer dist_angle_complex A4" \
|
||||
"chamfer dist_angle_complex A5" \
|
||||
"chamfer dist_angle_sequence A1" \
|
||||
"chamfer dist_angle_sequence A4"
|
||||
]
|
||||
|
||||
set exclude_str [join $exclude_list ,]
|
||||
testgrid -exclude {*}$exclude_str -outdir results/windows-clang-x64
|
1229
.github/workflows/build-and-test-multiplatform.yml
vendored
1229
.github/workflows/build-and-test-multiplatform.yml
vendored
File diff suppressed because it is too large
Load Diff
20
.github/workflows/build-docs.yml
vendored
20
.github/workflows/build-docs.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# This workflow builds the OCCT reference manual and overview documentations.
|
||||
# This workflow builds the OCCT reference manual documentation.
|
||||
# It is triggered on pushes to the 'master' branch.
|
||||
# The workflow includes steps to checkout the repository, install dependencies, build the documentation, and upload the generated documentation and logs as artifacts.
|
||||
|
||||
@@ -23,15 +23,15 @@ jobs:
|
||||
choco install -y graphviz
|
||||
choco install -y doxygen.install
|
||||
|
||||
- name: Build refman documentation
|
||||
- name: Build documentation
|
||||
run: |
|
||||
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
|
||||
cd adm
|
||||
bash gendoc -refman
|
||||
shell: cmd
|
||||
|
||||
- name: Upload refman documentation
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
id: artifact-upload-step
|
||||
with:
|
||||
name: refman-doc
|
||||
path: doc/refman
|
||||
@@ -43,17 +43,3 @@ jobs:
|
||||
name: doxygen.log
|
||||
path: doc/html_doxygen_err.log
|
||||
retention-days: 90
|
||||
|
||||
- name: Build documentation Overview
|
||||
run: |
|
||||
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
|
||||
cd adm
|
||||
bash gendoc -overview
|
||||
shell: cmd
|
||||
|
||||
- name: Upload overview documentation
|
||||
uses: actions/upload-artifact@v4.4.3
|
||||
with:
|
||||
name: overview-doc
|
||||
path: doc/overview
|
||||
retention-days: 90
|
||||
|
216
.github/workflows/build-multiconfig-mingw.yml
vendored
216
.github/workflows/build-multiconfig-mingw.yml
vendored
@@ -1,216 +0,0 @@
|
||||
# This workflow validates the build on Windows using MinGW and MSYS2.
|
||||
# It is triggered on pushes to the master branch.
|
||||
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
|
||||
|
||||
name: MinGW build validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main_job:
|
||||
name: Windows MinGW validation
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "GCC",
|
||||
cc: "x86_64-w64-mingw32-gcc",
|
||||
cxx: "x86_64-w64-mingw32-g++",
|
||||
package: "mingw-w64-x86_64-toolchain",
|
||||
thirdparty_dir: "/mingw64",
|
||||
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
package: "mingw-w64-clang-x86_64-toolchain",
|
||||
thirdparty_dir: "/clang64",
|
||||
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
- {
|
||||
name: "UCRT",
|
||||
cc: "x86_64-w64-mingw32-gcc",
|
||||
cxx: "x86_64-w64-mingw32-g++",
|
||||
package: "mingw-w64-ucrt-x86_64-toolchain",
|
||||
thirdparty_dir: "/ucrt64",
|
||||
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.config.name == 'Clang' && 'CLANG64' || matrix.config.name == 'UCRT' && 'UCRT64' || 'MINGW64' }}
|
||||
update: true
|
||||
install: ${{ matrix.config.package }} ${{ matrix.config.dependencies }}
|
||||
|
||||
- name: Setup environment
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
echo "Checking compiler version:"
|
||||
${{ matrix.config.cc }} --version
|
||||
echo "Checking CMake version:"
|
||||
cmake --version
|
||||
echo "Setting up environment variables..."
|
||||
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
|
||||
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure basic
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
|
||||
|
||||
- name: Build basic
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
|
||||
- name: Configure full shared
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR="${{ github.workspace }}/install" \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=OFF \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
|
||||
|
||||
- name: Build full shared
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full static
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Static \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR="${{ github.workspace }}/install" \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=OFF \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Wall -Wextra" ..
|
||||
|
||||
- name: Build full static
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full with DEBUG define
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
|
||||
-D BUILD_WITH_DEBUG=ON \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D INSTALL_DIR="${{ github.workspace }}/install" \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=OFF \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON ..
|
||||
|
||||
- name: Build full with DEBUG define
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
shell: pwsh
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
213
.github/workflows/build-multiconfig-msvc.yml
vendored
213
.github/workflows/build-multiconfig-msvc.yml
vendored
@@ -1,213 +0,0 @@
|
||||
# This workflow validates the build on Windows using MSVC and Clang compilers.
|
||||
# It is triggered on pushes to the master branch.
|
||||
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
|
||||
|
||||
name: MSVC build validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main_job:
|
||||
name: Windows MSVC/Clang validation
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "MSVC",
|
||||
cc: "cl",
|
||||
cxx: "cl",
|
||||
generator: "Visual Studio 17 2022",
|
||||
toolset: "host=x64",
|
||||
c_flags: "/W4 /WX",
|
||||
cxx_flags: "/W4 /WX"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++",
|
||||
generator: "Ninja",
|
||||
toolset: "",
|
||||
c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option",
|
||||
cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option"
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Set up MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Download and extract 3rdparty dependencies
|
||||
run: |
|
||||
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
|
||||
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
|
||||
Remove-Item 3rdparty-vc14-64.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Download and extract Mesa3D
|
||||
run: |
|
||||
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
|
||||
7z x mesa3d.7z -omesa3d
|
||||
|
||||
- name: Run system-wide deployment
|
||||
run: |
|
||||
cd mesa3d
|
||||
.\systemwidedeploy.cmd 1
|
||||
.\systemwidedeploy.cmd 5
|
||||
shell: cmd
|
||||
|
||||
- name: Configure basic
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
|
||||
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build basic
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --config Release
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure full shared
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D BUILD_USE_PCH=OFF `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_LIBRARY_TYPE=Shared `
|
||||
-D CMAKE_BUILD_TYPE=Debug `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D USE_MMGR_TYPE=JEMALLOC `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
|
||||
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build full shared
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure full static
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D BUILD_USE_PCH=OFF `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_LIBRARY_TYPE=Static `
|
||||
-D CMAKE_BUILD_TYPE=Debug `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D USE_MMGR_TYPE=JEMALLOC `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=OFF `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON `
|
||||
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
|
||||
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build full static
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
shell: pwsh
|
||||
|
||||
- name: Configure full with DEBUG define
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
|
||||
-D BUILD_WITH_DEBUG=ON `
|
||||
-D BUILD_USE_PCH=OFF `
|
||||
-D BUILD_INCLUDE_SYMLINK=ON `
|
||||
-D BUILD_OPT_PROFILE=Production `
|
||||
-D BUILD_LIBRARY_TYPE=Shared `
|
||||
-D CMAKE_BUILD_TYPE=Debug `
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install `
|
||||
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
|
||||
-D USE_FREETYPE=ON `
|
||||
-D USE_DRACO=ON `
|
||||
-D USE_FFMPEG=ON `
|
||||
-D USE_FREEIMAGE=ON `
|
||||
-D USE_GLES2=ON `
|
||||
-D USE_OPENVR=ON `
|
||||
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
|
||||
-D USE_TBB=ON `
|
||||
-D USE_RAPIDJSON=ON `
|
||||
-D USE_OPENGL=ON ` ..
|
||||
shell: pwsh
|
||||
|
||||
- name: Build full with DEBUG define
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug
|
||||
shell: pwsh
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
Remove-Item -Recurse -Force build
|
||||
Remove-Item -Recurse -Force ${{ github.workspace }}/install
|
||||
shell: pwsh
|
179
.github/workflows/build-multiconfig-ubuntu.yml
vendored
179
.github/workflows/build-multiconfig-ubuntu.yml
vendored
@@ -1,179 +0,0 @@
|
||||
# This workflow validates the build on the latest Ubuntu version (24.04) using multiple configurations.
|
||||
# It is triggered on pushes to the master branch.
|
||||
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
|
||||
|
||||
name: Ubuntu build validation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main_job:
|
||||
name: Latest ubuntu validation
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: "GCC",
|
||||
cc: "gcc",
|
||||
cxx: "g++"
|
||||
}
|
||||
- {
|
||||
name: "Clang",
|
||||
cc: "clang",
|
||||
cxx: "clang++"
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev
|
||||
|
||||
- name: Install rapidjson
|
||||
run: |
|
||||
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
|
||||
unzip rapidjson.zip
|
||||
|
||||
- name: Configure basic
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
|
||||
|
||||
- name: Build basic
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
|
||||
- name: Configure full shared
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=ON \
|
||||
-D USE_TBB=ON \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
|
||||
|
||||
- name: Build full shared
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
rm -rf ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full static
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Static \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D USE_MMGR_TYPE=JEMALLOC \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=OFF \
|
||||
-D USE_TBB=ON \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON \
|
||||
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
|
||||
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
|
||||
|
||||
- name: Build full static
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
rm -rf ${{ github.workspace }}/install
|
||||
|
||||
- name: Configure full with DEBUG define
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Ninja" \
|
||||
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-D BUILD_WITH_DEBUG=ON \
|
||||
-D BUILD_USE_PCH=OFF \
|
||||
-D BUILD_INCLUDE_SYMLINK=ON \
|
||||
-D BUILD_OPT_PROFILE=Production \
|
||||
-D BUILD_LIBRARY_TYPE=Shared \
|
||||
-D USE_TK=ON \
|
||||
-D CMAKE_BUILD_TYPE=Debug \
|
||||
-D INSTALL_DIR=${{ github.workspace }}/install \
|
||||
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
|
||||
-D USE_FREETYPE=ON \
|
||||
-D USE_DRACO=ON \
|
||||
-D USE_FFMPEG=OFF \
|
||||
-D USE_FREEIMAGE=ON \
|
||||
-D USE_GLES2=ON \
|
||||
-D USE_OPENVR=ON \
|
||||
-D USE_VTK=ON \
|
||||
-D USE_TBB=ON \
|
||||
-D USE_RAPIDJSON=ON \
|
||||
-D USE_OPENGL=ON ..
|
||||
|
||||
- name: Build full with DEBUG define
|
||||
run: |
|
||||
cd build
|
||||
cmake --build . --target install --config Debug -- -j 4
|
||||
|
||||
- name: Clear up after build
|
||||
run: |
|
||||
rm -rf build
|
||||
rm -rf ${{ github.workspace }}/install
|
169
.github/workflows/build-occt-with-vcpkg.yml
vendored
169
.github/workflows/build-occt-with-vcpkg.yml
vendored
@@ -1,169 +0,0 @@
|
||||
# This workflow builds OCCT using vcpkg on multiple platforms (Windows, macOS, Linux).
|
||||
# It builds in both Debug and Release modes.
|
||||
# All dependencies except the compiler are installed using vcpkg.
|
||||
# The workflow includes steps to clone vcpkg, install dependencies, configure and build.
|
||||
|
||||
name: Build OCCT with vcpkg
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
USERNAME: Open-Cascade-SAS
|
||||
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
|
||||
FEED_URL: https://nuget.pkg.github.com/Open-Cascade-SAS/index.json
|
||||
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019, macos-15, macos-14, macos-13]
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Install required packages (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete
|
||||
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
|
||||
|
||||
- name: Install required packages (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
brew update || true
|
||||
brew install cmake ninja nasm autoconf mono || true
|
||||
# temporary workaround for missing tcl-tk
|
||||
brew install tcl-tk || true
|
||||
# Force link any conflicting packages
|
||||
brew link --overwrite python@3.12 || true
|
||||
brew link --overwrite python@3.13 || true
|
||||
|
||||
- name: Install required packages (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Set up vcpkg (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
./vcpkg/bootstrap-vcpkg.sh
|
||||
shell: bash
|
||||
|
||||
- name: Set up vcpkg (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
.\vcpkg\bootstrap-vcpkg.bat
|
||||
shell: cmd
|
||||
|
||||
- name: Add NuGet sources
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
.$(${{ env.VCPKG_EXE }} fetch nuget) `
|
||||
sources add `
|
||||
-Source "${{ env.FEED_URL }}" `
|
||||
-StorePasswordInClearText `
|
||||
-Name GitHubPackages `
|
||||
-UserName "${{ env.USERNAME }}" `
|
||||
-Password "${{ secrets.GITHUB_TOKEN }}"
|
||||
.$(${{ env.VCPKG_EXE }} fetch nuget) `
|
||||
setapikey "${{ secrets.GITHUB_TOKEN }}" `
|
||||
-Source "${{ env.FEED_URL }}"
|
||||
shell: pwsh
|
||||
|
||||
- name: Add NuGet sources
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
|
||||
sources add \
|
||||
-Source "${{ env.FEED_URL }}" \
|
||||
-StorePasswordInClearText \
|
||||
-Name GitHubPackages \
|
||||
-UserName "${{ env.USERNAME }}" \
|
||||
-Password "${{ secrets.GITHUB_TOKEN }}"
|
||||
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
|
||||
setapikey "${{ secrets.GITHUB_TOKEN }}" \
|
||||
-Source "${{ env.FEED_URL }}"
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT ${{ matrix.build_type }} (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
mkdir build-${{ matrix.build_type }}
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake -G Ninja \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
||||
-DBUILD_USE_VCPKG=ON \
|
||||
-DUSE_MMGR_TYPE=NATIVE \
|
||||
-DUSE_FREETYPE=ON \
|
||||
-DUSE_TK=OFF \
|
||||
-DBUILD_USE_PCH=ON \
|
||||
-DBUILD_INCLUDE_SYMLINK=ON \
|
||||
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
|
||||
-DUSE_DRACO=ON \
|
||||
-DUSE_FFMPEG=ON \
|
||||
-DUSE_FREEIMAGE=ON \
|
||||
-DUSE_GLES2=OFF \
|
||||
-DUSE_VTK=ON \
|
||||
-DUSE_TBB=ON \
|
||||
-DUSE_RAPIDJSON=ON \
|
||||
-DUSE_OPENGL=ON \
|
||||
-DBUILD_MODULE_Draw=OFF \
|
||||
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build \
|
||||
${{ runner.os != 'macOS' && '-DUSE_OPENVR=ON' || '' }} ..
|
||||
shell: bash
|
||||
|
||||
- name: Configure OCCT ${{ matrix.build_type }} (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
mkdir build-${{ matrix.build_type }}
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ^
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
|
||||
-DBUILD_USE_VCPKG=ON ^
|
||||
-DUSE_MMGR_TYPE=JEMALLOC ^
|
||||
-DUSE_FREETYPE=ON ^
|
||||
-DUSE_TK=OFF ^
|
||||
-DBUILD_USE_PCH=ON ^
|
||||
-DBUILD_INCLUDE_SYMLINK=ON ^
|
||||
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} ^
|
||||
-DUSE_DRACO=ON ^
|
||||
-DUSE_FFMPEG=OFF ^
|
||||
-DUSE_FREEIMAGE=ON ^
|
||||
-DUSE_GLES2=ON ^
|
||||
-DUSE_OPENVR=ON ^
|
||||
-DUSE_VTK=ON ^
|
||||
-DUSE_TBB=ON ^
|
||||
-DUSE_RAPIDJSON=ON ^
|
||||
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build ^
|
||||
-DUSE_OPENGL=ON ..
|
||||
shell: cmd
|
||||
|
||||
- name: Build OCCT ${{ matrix.build_type }} (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
run: |
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake --build . --target install --config ${{ matrix.build_type }}
|
||||
shell: bash
|
||||
|
||||
- name: Build OCCT ${{ matrix.build_type }} (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
cd build-${{ matrix.build_type }}
|
||||
cmake --build . --target install --config ${{ matrix.build_type }}
|
||||
shell: cmd
|
84
.github/workflows/clang-format-check.yml
vendored
84
.github/workflows/clang-format-check.yml
vendored
@@ -1,84 +0,0 @@
|
||||
# This workflow checks the code formatting of changed files in a pull request using clang-format.
|
||||
# It is triggered on pull requests to the master branch.
|
||||
# The workflow verifies that the clang-format version matches 18.1.8,
|
||||
# checks formatting of modified files, and if formatting issues are found,
|
||||
# creates a patch file that can be applied to fix the formatting.
|
||||
|
||||
name: Clang-Format Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
format-check:
|
||||
name: Check code formatting
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check clang-format version
|
||||
run: |
|
||||
$version = clang-format --version
|
||||
Write-Output "Detected clang-format version: $version"
|
||||
$version | Select-String "18.1.8" >$null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
echo "::error::Wrong clang-format version. Expected 18.1.8"
|
||||
Write-Output "Error: Version mismatch - expected 18.1.8"
|
||||
exit 1
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
run: |
|
||||
$changedFiles = git diff --name-only origin/${{ github.base_ref }} HEAD |
|
||||
Where-Object { $_ -match '^(src|tools)/' -and $_ -match '\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$' }
|
||||
$changedFiles | Set-Content "changed_files.txt"
|
||||
if ($changedFiles.Count -gt 0) {
|
||||
echo "has_files=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Check formatting
|
||||
id: check
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
run: |
|
||||
$files = Get-Content "changed_files.txt"
|
||||
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
|
||||
clang-format -i -style=file $_
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Check git status
|
||||
id: git-check
|
||||
if: steps.changed-files.outputs.has_files == 'true'
|
||||
run: |
|
||||
git diff > format.patch
|
||||
if ((Get-Item format.patch).length -gt 0) {
|
||||
echo "has_changes=true" >> $env:GITHUB_OUTPUT
|
||||
}
|
||||
shell: pwsh
|
||||
|
||||
- name: Upload patch
|
||||
if: steps.git-check.outputs.has_changes == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: format-patch
|
||||
path: format.patch
|
||||
|
||||
- name: Fail with instructions
|
||||
if: steps.git-check.outputs.has_changes == 'true'
|
||||
run: |
|
||||
echo "::error::Files need formatting. To fix: 1. Download format.patch 2. "git apply format.patch" 3. Commit and push"
|
||||
exit 1
|
||||
shell: pwsh
|
959
CMakeLists.txt
959
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
13
README.md
13
README.md
@@ -28,27 +28,26 @@ You can also find OCCT pre-installed on your system or install it from packages
|
||||
|
||||
Documentation is available at the following links:
|
||||
- [Latest version](https://dev.opencascade.org/doc/overview)
|
||||
- [Version 7.8](https://dev.opencascade.org/doc/occt-7.8.0/overview)
|
||||
- [Version 7.7](https://dev.opencascade.org/doc/occt-7.7.0/overview)
|
||||
|
||||
Documentation can be part of the package. To preview documentation as part of the package, open the file `doc/html/index.html` to browse HTML documentation.
|
||||
|
||||
If HTML documentation is not available in your package, you can:
|
||||
|
||||
- **Generate it from sources:** You need to have Tcl and Doxygen 1.8.4 (or above) installed on your system and accessible in your environment (check the environment variable PATH). Use the batch file `adm/gendoc.bat` on Windows or the Bash script `adm/gendoc` on Linux or OS X to (re)generate documentation.
|
||||
- **Generate together with sources:** You need to have CMake and 1.8.4 (or above) installed on your system. Enable `BUILD_DOC_Overview` CMake parameter and set the path to Doxygen `3RDPARTY_DOXYGEN_EXECUTABLE`. Then build ALL or only `Overview`.
|
||||
- **Read documentation in source plain text (Markdown) format** found in the subfolder `dox` or [GitHub Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki).
|
||||
- **Generate it from sources:** You need to have Tcl and Doxygen 1.8.4 (or above) installed on your system and accessible in your environment (check the environment variable PATH). Use the batch file `gendoc.bat` on Windows or the Bash script `gendoc` on Linux or OS X to (re)generate documentation.
|
||||
- **Read documentation in source plain text (Markdown) format** found in the subfolder `dox`.
|
||||
|
||||
See [dox/build/build_documentation/building_documentation.md](dox/build/build_documentation/building_documentation.md) or [Building Documentation](https://dev.opencascade.org/doc/occt-7.8.0/overview/html/build_upgrade__building_documentation.html) for details.
|
||||
See `dox/dev_guides/documentation/documentation.md` or [Building Documentation](https://dev.opencascade.org/doc/occt-7.7.0/overview/html/build_upgrade__building_documentation.html) for details.
|
||||
|
||||
## Building
|
||||
|
||||
In most cases, you need to rebuild OCCT on your platform (OS, compiler) before using it in your project to ensure binary compatibility.
|
||||
|
||||
Consult the file [dox/build/build_occt/building_occt.md](dox/build/build_occt/building_occt.md) or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) or [Building OCCT Wiki](https://github.com/Open-Cascade-SAS/OCCT/wiki/build_upgrade) for instructions on building OCCT from sources on supported platforms.
|
||||
Consult the file `dox/dev_guides/building/building.md` or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) for instructions on building OCCT from sources on supported platforms.
|
||||
|
||||
## Version
|
||||
|
||||
The current version of OCCT can be found in the file [`adm/cmake/version.cmake`](adm/cmake/version.cmake).
|
||||
The current version of OCCT can be found in the file `src/Standard/Standard_Version.hxx`.
|
||||
|
||||
## Development
|
||||
|
||||
|
@@ -121,7 +121,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
|
||||
# if (BUILD_SHARED_LIBS)
|
||||
# library
|
||||
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}")
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll.a .lib .so .dylib .a)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
|
||||
|
||||
set (${PRODUCT_NAME}_PATH_SUFFIXES lib)
|
||||
if (WIN32)
|
||||
@@ -364,3 +364,25 @@ macro (COMPLIANCE_PRODUCT_CONSISTENCY LIBNAME)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(CONFIGURE_DRACO_DEPS)
|
||||
if (USE_DRACO)
|
||||
set (USED_LIB_RELEASE ${3RDPARTY_DRACO_LIBRARY})
|
||||
if (WIN32)
|
||||
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY_DEBUG})
|
||||
else()
|
||||
set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY})
|
||||
endif()
|
||||
set (USED_LIB_CONF)
|
||||
if (EXISTS ${USED_LIB_DEBUG})
|
||||
set (USED_LIB_CONF "$<$<CONFIG:DEBUG>:${USED_LIB_DEBUG}>;${USED_LIB_CONF}")
|
||||
endif()
|
||||
if (EXISTS ${USED_LIB_RELEASE})
|
||||
set (USED_LIB_CONF "$<$<CONFIG:RELEASE>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
|
||||
set (USED_LIB_CONF "$<$<CONFIG:RELWITHDEBINFO>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
|
||||
endif()
|
||||
if (DEFINED USED_LIB_CONF)
|
||||
set_property (TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_LIBRARIES "${USED_LIB_CONF}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -1,51 +1,6 @@
|
||||
# Draco - a library for a lossy vertex data compression, used as extension to glTF format.
|
||||
# https://github.com/google/draco
|
||||
|
||||
macro (SEARCH_DRACO_LIB)
|
||||
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
|
||||
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
|
||||
|
||||
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
|
||||
PATHS "${3RDPARTY_DRACO_DIR}"
|
||||
PATH_SUFFIXES lib
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
if (3RDPARTY_DRACO_LIBRARY AND EXISTS "${3RDPARTY_DRACO_LIBRARY}")
|
||||
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY}" PATH)
|
||||
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32 AND (NOT 3RDPARTY_DRACO_LIBRARY_DEBUG OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}"))
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
set (3RDPARTY_DRACO_LIBRARY_DEBUG "3RDPARTY_DRACO_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "The path to debug Draco library" FORCE)
|
||||
|
||||
find_library (3RDPARTY_DRACO_LIBRARY_DEBUG NAMES ${CSF_Draco}
|
||||
PATHS "${3RDPARTY_DRACO_DIR}"
|
||||
PATH_SUFFIXES libd debug/lib
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
if (3RDPARTY_DRACO_LIBRARY_DEBUG AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}")
|
||||
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DEBUG}" PATH)
|
||||
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DIR_DEBUG}" CACHE FILEPATH "The directory containing debug Draco library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package (draco CONFIG REQUIRED)
|
||||
|
||||
set (3RDPARTY_DRACO_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
|
||||
SEARCH_DRACO_LIB()
|
||||
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/draco")
|
||||
return()
|
||||
endif()
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_DRACO_DIR)
|
||||
@@ -110,4 +65,34 @@ else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_DRACO_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
SEARCH_DRACO_LIB()
|
||||
if (3RDPARTY_DRACO_DIR AND EXISTS "${3RDPARTY_DRACO_DIR}")
|
||||
if (NOT 3RDPARTY_DRACO_LIBRARY OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY}")
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
set (3RDPARTY_DRACO_LIBRARY "3RDPARTY_DRACO_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to Draco library" FORCE)
|
||||
|
||||
find_library (3RDPARTY_DRACO_LIBRARY NAMES ${CSF_Draco}
|
||||
PATHS "${3RDPARTY_DRACO_DIR}"
|
||||
PATH_SUFFIXES lib
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
if (3RDPARTY_DRACO_LIBRARY AND EXISTS "${3RDPARTY_DRACO_LIBRARY}")
|
||||
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY}" PATH)
|
||||
set (3RDPARTY_DRACO_LIBRARY_DIR "${3RDPARTY_DRACO_LIBRARY_DIR}" CACHE FILEPATH "The directory containing Draco library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32 AND (NOT 3RDPARTY_DRACO_LIBRARY_DEBUG OR NOT EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}"))
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
|
||||
set (3RDPARTY_DRACO_LIBRARY_DEBUG "3RDPARTY_DRACO_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "The path to debug Draco library" FORCE)
|
||||
|
||||
find_library (3RDPARTY_DRACO_LIBRARY_DEBUG NAMES ${CSF_Draco}
|
||||
PATHS "${3RDPARTY_DRACO_DIR}"
|
||||
PATH_SUFFIXES libd
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
if (3RDPARTY_DRACO_LIBRARY_DEBUG AND EXISTS "${3RDPARTY_DRACO_LIBRARY_DEBUG}")
|
||||
get_filename_component (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DEBUG}" PATH)
|
||||
set (3RDPARTY_DRACO_LIBRARY_DIR_DEBUG "${3RDPARTY_DRACO_LIBRARY_DIR_DEBUG}" CACHE FILEPATH "The directory containing debug Draco library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -1,15 +1,4 @@
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package(FFMPEG REQUIRED)
|
||||
set(CSF_FFmpeg ${FFMPEG_LIBRARIES})
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
|
||||
else()
|
||||
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
|
||||
endif()
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${FFMPEG_INCLUDE_DIRS}")
|
||||
return()
|
||||
endif()
|
||||
# FFmpeg
|
||||
|
||||
if (NOT DEFINED INSTALL_FFMPEG)
|
||||
set (INSTALL_FFMPEG OFF CACHE BOOL "${INSTALL_FFMPEG_DESCR}")
|
||||
|
@@ -1,16 +1,3 @@
|
||||
#freeimage
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package(freeimage CONFIG REQUIRED)
|
||||
set(CSF_FreeImagePlus freeimage::FreeImagePlus)
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
|
||||
else()
|
||||
set (USED_3RDPARTY_FREEIMAGE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
|
||||
endif()
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/")
|
||||
return()
|
||||
endif()
|
||||
|
||||
THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "CSF_FreeImagePlus" "d")
|
||||
|
@@ -1,18 +1,5 @@
|
||||
# freetype
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package (Freetype MODULE REQUIRED)
|
||||
set (CSF_FREETYPE Freetype::Freetype)
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_FREETYPE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
|
||||
else()
|
||||
set (USED_3RDPARTY_FREETYPE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
|
||||
endif()
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED INSTALL_FREETYPE AND BUILD_SHARED_LIBS)
|
||||
set (INSTALL_FREETYPE OFF CACHE BOOL "${INSTALL_FREETYPE_DESCR}")
|
||||
endif()
|
||||
@@ -177,14 +164,6 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
|
||||
set (3RDPARTY_FREETYPE_LIBRARY_DIR "" CACHE PATH "The directory containing freetype library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# In case of MinGW some libraries can have .dll.a extension, so we should check it and use instead of .a
|
||||
if (MINGW AND 3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
|
||||
string (REPLACE ".a" ".dll.a" 3RDPARTY_FREETYPE_LIBRARY_TEST "${3RDPARTY_FREETYPE_LIBRARY}")
|
||||
if (EXISTS "${3RDPARTY_FREETYPE_LIBRARY_TEST}")
|
||||
set (3RDPARTY_FREETYPE_LIBRARY "${3RDPARTY_FREETYPE_LIBRARY_TEST}" CACHE FILEPATH "The path to freetype library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# the SECOND step in search for freetype library and header folders (additional search algorithms)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# JeMalloc
|
||||
|
||||
function (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
|
||||
macro (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
|
||||
if (NOT 3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
|
||||
set (JEMALLOC_PATH_SUFFIXES "lib" "bin")
|
||||
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}-NOTFOUND")
|
||||
@@ -23,25 +23,20 @@ function (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
|
||||
endif()
|
||||
endif()
|
||||
if (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}" PARENT_SCOPE)
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
|
||||
set (3RDPARTY_JEMALLOC_LIBRARY_DIR "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}" CACHE PATH "The directory containing JEMALLOC libraries" FORCE)
|
||||
elseif("${PREFIX}" STREQUAL "SHARED")
|
||||
return()
|
||||
else()
|
||||
message(STATUS "Cannot find ${MMGR_LIB} library in jemalloc 3rdparty")
|
||||
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} PARENT_SCOPE)
|
||||
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "" PARENT_SCOPE)
|
||||
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
|
||||
set (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} "")
|
||||
endif()
|
||||
|
||||
set(JEMALLOC_IS_STATIC_LIB FALSE)
|
||||
if ("${PREFIX}" STREQUAL "STATIC")
|
||||
set(JEMALLOC_IS_STATIC_LIB TRUE)
|
||||
endif()
|
||||
|
||||
if (${JEMALLOC_IS_STATIC_LIB})
|
||||
set (OLD_CSF_MMGR ${CSF_MMGR})
|
||||
list (APPEND OLD_CSF_MMGR "${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}}")
|
||||
set (CSF_MMGR "${OLD_CSF_MMGR}" PARENT_SCOPE)
|
||||
set (JEMALLOC_IS_STATIC_LIB FALSE)
|
||||
if (((${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} MATCHES "\.lib$")) OR ((${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} MATCHES "\.a$")))
|
||||
get_filename_component(STATIC_LIB_NAME ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} NAME)
|
||||
list(APPEND CSF_MMGR "${STATIC_LIB_NAME}")
|
||||
set (JEMALLOC_IS_STATIC_LIB TRUE)
|
||||
endif()
|
||||
# install instructions
|
||||
if (INSTALL_JEMALLOC AND NOT JEMALLOC_IS_STATIC_LIB)
|
||||
@@ -62,18 +57,18 @@ function (JEMALLOC_LIB_SEARCH MMGR_LIB PREFIX)
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}i")
|
||||
endif()
|
||||
set (USED_3RDPARTY_JEMALLOC_DIR "" PARENT_SCOPE)
|
||||
set (USED_3RDPARTY_JEMALLOC_DIR "")
|
||||
elseif(NOT JEMALLOC_IS_STATIC_LIB)
|
||||
# the library directory for using by the executable
|
||||
set (USED_3RDPARTY_JEMALLOC_DIR ${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}} PARENT_SCOPE)
|
||||
set (USED_3RDPARTY_JEMALLOC_DIR ${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}})
|
||||
endif()
|
||||
unset(3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} CACHE)
|
||||
unset(3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} CACHE)
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
macro (SEARCH_JEMALLOC)
|
||||
# find static jemalloc lib
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".lib" ".a")
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
|
||||
if (WIN32)
|
||||
JEMALLOC_LIB_SEARCH ("jemalloc" "STATIC")
|
||||
elseif(NOT WIN32)
|
||||
@@ -90,16 +85,6 @@ endmacro()
|
||||
# Reset CSF variable
|
||||
set (CSF_MMGR "")
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
set (3RDPARTY_JEMALLOC_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
|
||||
OCCT_CHECK_AND_UNSET_GROUP (3RDPARTY_JEMALLOC_LIBRARY_SHARED)
|
||||
OCCT_CHECK_AND_UNSET_GROUP (3RDPARTY_JEMALLOC_LIBRARY_STATIC)
|
||||
SEARCH_JEMALLOC()
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/jemalloc")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED INSTALL_JEMALLOC)
|
||||
set (INSTALL_JEMALLOC OFF CACHE BOOL "${INSTALL_INSTALL_JEMALLOC_DESCR}")
|
||||
endif()
|
||||
|
@@ -38,10 +38,6 @@ else()
|
||||
else()
|
||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
if (APPLE)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
|
||||
endif()
|
||||
add_definitions(-DOCC_CONVERT_SIGNALS)
|
||||
endif()
|
||||
|
||||
@@ -156,14 +152,9 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
|
||||
|
||||
# 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")
|
||||
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")
|
||||
endif()
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
|
||||
@@ -172,7 +163,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 -Wl,-Bsymbolic ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -182,10 +173,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
|
||||
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
|
||||
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
if (NOT WIN32)
|
||||
# Optimize size of binaries
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
||||
endif()
|
||||
# Optimize size of binaries
|
||||
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
|
||||
endif()
|
||||
if(MINGW)
|
||||
add_definitions(-D_WIN32_WINNT=0x0601)
|
||||
@@ -193,10 +182,8 @@ if(MINGW)
|
||||
#set (CMAKE_SYSTEM_VERSION "6.1")
|
||||
# workaround bugs in mingw with vtable export
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wattributes")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wattributes")
|
||||
endif()
|
||||
if (CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
|
||||
if (DEFINED CMAKE_COMPILER_IS_GNUCXX)
|
||||
# Optimize size of binaries
|
||||
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
|
||||
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
||||
|
@@ -75,10 +75,6 @@ endmacro()
|
||||
# COMPILER variable
|
||||
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
||||
if (MSVC)
|
||||
if (MSVC_VERSION LESS 1914)
|
||||
message (AUTHOR_WARNING "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
|
||||
endif()
|
||||
|
||||
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
|
||||
set (COMPILER vc7)
|
||||
elseif (MSVC_VERSION EQUAL 1400)
|
||||
@@ -96,39 +92,20 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
|
||||
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
|
||||
# Since Visual Studio 15 (2017), its version diverged from version of
|
||||
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
|
||||
# we keep its id as "vc14" to be compatible
|
||||
# we keep its id as "vc14" to be compatibille
|
||||
set (COMPILER vc14)
|
||||
else()
|
||||
message (FATAL_ERROR "Unrecognized MSVC_VERSION")
|
||||
endif()
|
||||
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
|
||||
message (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 (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 (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 (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 (AUTHOR_WARNING "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
|
||||
endif()
|
||||
set (COMPILER icc)
|
||||
else()
|
||||
message (AUTHOR_WARNING "Unknown compiler - please verify C++17 support")
|
||||
set (COMPILER ${CMAKE_GENERATOR})
|
||||
string (REGEX REPLACE " " "" COMPILER ${COMPILER})
|
||||
endif()
|
||||
@@ -437,7 +414,7 @@ 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)")
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|lxx)")
|
||||
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
|
||||
endforeach()
|
||||
endforeach()
|
||||
@@ -476,23 +453,9 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set (OCCT_HEADER_FILES_INSTALLATION ${OCCT_HEADER_FILES_COMPLETE})
|
||||
list (FILTER OCCT_HEADER_FILES_INSTALLATION INCLUDE REGEX ".*[.](h|lxx)")
|
||||
install (FILES ${OCCT_HEADER_FILES_INSTALLATION} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
|
||||
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
|
||||
endfunction()
|
||||
|
||||
# Macro to configure and install Standard_Version.hxx file
|
||||
macro (CONFIGURE_AND_INSTALL_VERSION_HEADER)
|
||||
if (DEFINED BUILD_OCCT_VERSION_EXT AND "${BUILD_OCCT_VERSION_EXT}" STREQUAL "${OCC_VERSION_STRING_EXT}" AND EXISTS "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx")
|
||||
install(FILES "${OCCT_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
|
||||
else()
|
||||
set(BUILD_OCCT_VERSION_EXT "${OCC_VERSION_STRING_EXT}" CACHE STRING "OCCT Version string. Used only for caching, can't impact on build. For modification of version, please check adm/cmake/version.cmake" FORCE)
|
||||
mark_as_advanced(BUILD_OCCT_VERSION_EXT)
|
||||
string(TIMESTAMP OCCT_VERSION_DATE "%Y-%m-%d" UTC)
|
||||
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/Standard_Version.hxx.in" "${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" "Standard_Version.hxx" "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER THE_IS_PRIVATE)
|
||||
if (NOT BUILD_USE_PCH)
|
||||
return()
|
||||
@@ -585,69 +548,42 @@ function (OCCT_MODULES_AND_TOOLKITS FILE_NAME TOOLKITS_NAME_SUFFIX MODULE_LIST)
|
||||
set (${MODULE_LIST} ${${MODULE_LIST}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
# Macro to extract git hash from the source directory
|
||||
# and store it in the variable GIT_HASH
|
||||
# in case if git is not found or error occurs, GIT_HASH is set to empty string
|
||||
macro(OCCT_GET_GIT_HASH)
|
||||
set(GIT_HASH "")
|
||||
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
ERROR_VARIABLE GIT_ERROR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT GIT_ERROR)
|
||||
# Check if working directory is clean
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} status --porcelain
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_STATUS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(NOT "${GIT_STATUS}" STREQUAL "")
|
||||
message(DEBUG "Git working directory is not clean. Git hash may be incorrect.")
|
||||
endif()
|
||||
else()
|
||||
set(GIT_HASH "")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Returns OCC version string
|
||||
# Returns OCC version string from file Standard_Version.hxx (if available)
|
||||
function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT)
|
||||
|
||||
include (version)
|
||||
set (OCC_VERSION_COMPLETE "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}")
|
||||
set (OCC_VERSION_MAJOR 7)
|
||||
set (OCC_VERSION_MINOR 0)
|
||||
set (OCC_VERSION_MAINTENANCE 0)
|
||||
set (OCC_VERSION_DEVELOPMENT dev)
|
||||
set (OCC_VERSION_COMPLETE "7.0.0")
|
||||
|
||||
set (STANDARD_VERSION_FILE "${CMAKE_SOURCE_DIR}/src/Standard/Standard_Version.hxx")
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
|
||||
set (STANDARD_VERSION_FILE "${BUILD_PATCH}/src/Standard/Standard_Version.hxx")
|
||||
endif()
|
||||
|
||||
if (EXISTS "${STANDARD_VERSION_FILE}")
|
||||
foreach (SOUGHT_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE)
|
||||
file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
|
||||
string (REGEX REPLACE ".*${SOUGHT_VERSION} .*([^ ]+).*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
|
||||
endforeach()
|
||||
|
||||
foreach (SOUGHT_VERSION OCC_VERSION_DEVELOPMENT OCC_VERSION_COMPLETE)
|
||||
file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*")
|
||||
string (REGEX REPLACE ".*${SOUGHT_VERSION} .*\"([^ ]+)\".*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" )
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set (OCC_VERSION_MAJOR "${OCC_VERSION_MAJOR}" PARENT_SCOPE)
|
||||
set (OCC_VERSION_MINOR "${OCC_VERSION_MINOR}" PARENT_SCOPE)
|
||||
set (OCC_VERSION_MAINTENANCE "${OCC_VERSION_MAINTENANCE}" PARENT_SCOPE)
|
||||
set (OCCT_ON_DEVELOPMENT OFF)
|
||||
if (NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "" AND NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "OCC_VERSION_DEVELOPMENT")
|
||||
set (OCCT_ON_DEVELOPMENT ON)
|
||||
endif()
|
||||
if (${OCCT_ON_DEVELOPMENT})
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
endif()
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
|
||||
set (SET_OCC_VERSION_DEVELOPMENT "")
|
||||
if (${OCCT_ON_DEVELOPMENT})
|
||||
OCCT_GET_GIT_HASH()
|
||||
if (NOT "${GIT_HASH}" STREQUAL "")
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}-${GIT_HASH}")
|
||||
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
endif()
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}")
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
|
||||
set (SET_OCC_VERSION_DEVELOPMENT "#define OCC_VERSION_DEVELOPMENT \"${OCC_VERSION_DEVELOPMENT}\"")
|
||||
if (OCC_VERSION_DEVELOPMENT AND OCC_VERSION_COMPLETE)
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
|
||||
else()
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}" PARENT_SCOPE)
|
||||
endif()
|
||||
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME THE_VAR_TYPE THE_MESSAGE_OF_BEING_CHECKED_PATH)
|
||||
@@ -791,126 +727,3 @@ macro (OCCT_CREATE_SYMLINK_TO_FILE LIBRARY_NAME LINK_NAME)
|
||||
")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Function to process CSF libraries and append their file names to a specified list.
|
||||
# Additionally, handle library directories for different build configurations.
|
||||
# Arguments:
|
||||
# CURRENT_CSF - The current CSF libraries to process.
|
||||
# LIST_NAME - The name of the list to append the processed library file names to.
|
||||
# TARGET_NAME - The target to which the library directories will be added.
|
||||
function (PROCESS_CSF_LIBRARIES CURRENT_CSF LIST_NAME TARGET_NAME)
|
||||
separate_arguments (CURRENT_CSF)
|
||||
|
||||
# Local variables to collect found libraries and directories
|
||||
set(FOUND_LIBS "")
|
||||
set(FOUND_DEBUG_DIRS "")
|
||||
set(FOUND_RELEASE_DIRS "")
|
||||
|
||||
# Check if the result is already cached
|
||||
string(REPLACE ";" "_" CACHE_KEY "${CURRENT_CSF}")
|
||||
get_property(CACHED_LIBS GLOBAL PROPERTY "CACHED_LIBS_${CACHE_KEY}" SET)
|
||||
get_property(CACHED_DEBUG_DIRS GLOBAL PROPERTY "CACHED_DEBUG_DIRS_${CACHE_KEY}" SET)
|
||||
get_property(CACHED_RELEASE_DIRS GLOBAL PROPERTY "CACHED_RELEASE_DIRS_${CACHE_KEY}" SET)
|
||||
if (CACHED_LIBS AND NOT "${CACHED_LIBS}" STREQUAL "1")
|
||||
list (APPEND FOUND_LIBS ${CACHED_LIBS})
|
||||
if (CACHED_DEBUG_DIRS)
|
||||
list (APPEND FOUND_DEBUG_DIRS ${CACHED_DEBUG_DIRS})
|
||||
endif()
|
||||
if (CACHED_RELEASE_DIRS)
|
||||
list (APPEND FOUND_RELEASE_DIRS ${CACHED_RELEASE_DIRS})
|
||||
endif()
|
||||
else()
|
||||
foreach (CSF_LIBRARY ${CURRENT_CSF})
|
||||
set (LIBRARY_FROM_CACHE 0)
|
||||
set (CSF_LIBRARY_ORIGINAL ${CSF_LIBRARY})
|
||||
string (TOLOWER "${CSF_LIBRARY}" CSF_LIBRARY)
|
||||
string (REPLACE "+" "[+]" CSF_LIBRARY "${CSF_LIBRARY}")
|
||||
string (REPLACE "." "" CSF_LIBRARY "${CSF_LIBRARY}")
|
||||
get_cmake_property(ALL_CACHE_VARIABLES CACHE_VARIABLES)
|
||||
string (REGEX MATCHALL "(^|;)3RDPARTY_[^;]+_LIBRARY[^;]*" ALL_CACHE_VARIABLES "${ALL_CACHE_VARIABLES}")
|
||||
set (DEBUG_DIR "")
|
||||
set (RELEASE_DIR "")
|
||||
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
|
||||
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
|
||||
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
|
||||
if (NOT EXISTS "${CURRENT_CACHE_LIBRARY}" OR IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
|
||||
continue()
|
||||
endif()
|
||||
string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}")
|
||||
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
|
||||
string (REGEX MATCH "_${CSF_WO_VERSION}$" IS_ENDING_WO_VERSION "${CACHE_VARIABLE}")
|
||||
|
||||
if ("3rdparty_${CSF_LIBRARY}_library" STREQUAL "${CACHE_VARIABLE}" OR
|
||||
"3rdparty_${CSF_WO_VERSION}_library" STREQUAL "${CACHE_VARIABLE}" OR
|
||||
NOT "x${IS_ENDING}" STREQUAL "x" OR
|
||||
NOT "x${IS_ENDING_WO_VERSION}" STREQUAL "x")
|
||||
get_filename_component(LIBRARY_NAME "${CURRENT_CACHE_LIBRARY}" NAME)
|
||||
list (APPEND FOUND_LIBS "${LIBRARY_NAME}")
|
||||
get_filename_component(LIBRARY_DIR "${CURRENT_CACHE_LIBRARY}" DIRECTORY)
|
||||
set (RELEASE_DIR "${LIBRARY_DIR}")
|
||||
set (LIBRARY_FROM_CACHE 1)
|
||||
elseif ("3rdparty_${CSF_LIBRARY}_library_debug" STREQUAL "${CACHE_VARIABLE}" OR
|
||||
"3rdparty_${CSF_LIBRARY}_debug_library" STREQUAL "${CACHE_VARIABLE}")
|
||||
get_filename_component(LIBRARY_NAME "${CURRENT_CACHE_LIBRARY}" NAME)
|
||||
list (APPEND FOUND_LIBS "${LIBRARY_NAME}")
|
||||
get_filename_component(LIBRARY_DIR "${CURRENT_CACHE_LIBRARY}" DIRECTORY)
|
||||
set (DEBUG_DIR "${LIBRARY_DIR}")
|
||||
set (LIBRARY_FROM_CACHE 1)
|
||||
endif()
|
||||
|
||||
if (DEBUG_DIR AND RELEASE_DIR)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
if (NOT ${LIBRARY_FROM_CACHE} AND NOT "${CSF_LIBRARY}" STREQUAL "")
|
||||
list (APPEND FOUND_LIBS "${CSF_LIBRARY_ORIGINAL}")
|
||||
continue()
|
||||
endif()
|
||||
if (DEBUG_DIR AND RELEASE_DIR)
|
||||
list (APPEND FOUND_DEBUG_DIRS "${DEBUG_DIR}")
|
||||
list (APPEND FOUND_RELEASE_DIRS "${RELEASE_DIR}")
|
||||
elseif (DEBUG_DIR)
|
||||
list (APPEND FOUND_DEBUG_DIRS "${DEBUG_DIR}")
|
||||
list (APPEND FOUND_RELEASE_DIRS "${DEBUG_DIR}")
|
||||
message (WARNING "Debug directory found but no release directory found. Using debug directory for both configurations.")
|
||||
elseif (RELEASE_DIR)
|
||||
list (APPEND FOUND_DEBUG_DIRS "${RELEASE_DIR}")
|
||||
list (APPEND FOUND_RELEASE_DIRS "${RELEASE_DIR}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Cache the result
|
||||
set_property(GLOBAL PROPERTY "CACHED_LIBS_${CACHE_KEY}" "${FOUND_LIBS}")
|
||||
set_property(GLOBAL PROPERTY "CACHED_DEBUG_DIRS_${CACHE_KEY}" "${FOUND_DEBUG_DIRS}")
|
||||
set_property(GLOBAL PROPERTY "CACHED_RELEASE_DIRS_${CACHE_KEY}" "${FOUND_RELEASE_DIRS}")
|
||||
endif()
|
||||
|
||||
# Append found values to the external variable
|
||||
list(APPEND ${LIST_NAME} ${FOUND_LIBS})
|
||||
set(${LIST_NAME} "${${LIST_NAME}}" PARENT_SCOPE)
|
||||
|
||||
# Handle library directories for different build configurations
|
||||
list (REMOVE_DUPLICATES FOUND_RELEASE_DIRS)
|
||||
list (REMOVE_DUPLICATES FOUND_DEBUG_DIRS)
|
||||
|
||||
foreach (RELEASE_DIR ${FOUND_RELEASE_DIRS})
|
||||
get_filename_component(RELEASE_DIR_ABS "${RELEASE_DIR}" ABSOLUTE)
|
||||
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} PUBLIC "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
|
||||
endforeach()
|
||||
endfunction()
|
||||
macro(OCCT_ADD_VCPKG_FEATURE THE_FEATURE)
|
||||
if (BUILD_USE_VCPKG)
|
||||
list(APPEND VCPKG_MANIFEST_FEATURES "${THE_FEATURE}" PARENT_SCOPE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_UNSET_VCPKG_FEATURE THE_FEATURE)
|
||||
if (BUILD_USE_VCPKG)
|
||||
list (REMOVE_ITEM VCPKG_MANIFEST_FEATURES "${THE_FEATURE}" PARENT_SCOPE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -64,7 +64,7 @@ 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)")
|
||||
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|lxx)")
|
||||
|
||||
if(APPLE)
|
||||
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|mm)")
|
||||
@@ -243,7 +243,36 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
|
||||
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
|
||||
add_definitions (-DHAVE_GLES2)
|
||||
endif()
|
||||
PROCESS_CSF_LIBRARIES ("${CURRENT_CSF}" USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT "${PROJECT_NAME}")
|
||||
set (LIBRARY_FROM_CACHE 0)
|
||||
separate_arguments (CURRENT_CSF)
|
||||
foreach (CSF_LIBRARY ${CURRENT_CSF})
|
||||
string (TOLOWER "${CSF_LIBRARY}" CSF_LIBRARY)
|
||||
string (REPLACE "+" "[+]" CSF_LIBRARY "${CSF_LIBRARY}")
|
||||
string (REPLACE "." "" CSF_LIBRARY "${CSF_LIBRARY}")
|
||||
get_cmake_property(ALL_CACHE_VARIABLES CACHE_VARIABLES)
|
||||
string (REGEX MATCHALL "(^|;)3RDPARTY_[^;]+_LIBRARY[^;]*" ALL_CACHE_VARIABLES "${ALL_CACHE_VARIABLES}")
|
||||
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
|
||||
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
|
||||
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
|
||||
if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
|
||||
string (REGEX MATCH "_${CSF_LIBRARY}$" IS_ENDING "${CACHE_VARIABLE}")
|
||||
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
|
||||
string (REGEX MATCH "_${CSF_WO_VERSION}$" IS_ENDING_WO_VERSION "${CACHE_VARIABLE}")
|
||||
if ("3rdparty_${CSF_LIBRARY}_library" STREQUAL "${CACHE_VARIABLE}" OR
|
||||
"3rdparty_${CSF_WO_VERSION}_library" STREQUAL "${CACHE_VARIABLE}" OR
|
||||
NOT "x${IS_ENDING}" STREQUAL "x" OR
|
||||
NOT "x${IS_ENDING_WO_VERSION}" STREQUAL "x")
|
||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT "${CURRENT_CACHE_LIBRARY}")
|
||||
set (LIBRARY_FROM_CACHE 1)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
if (NOT ${LIBRARY_FROM_CACHE} AND NOT "${CURRENT_CSF}" STREQUAL "")
|
||||
# prepare a list from a string with whitespaces
|
||||
separate_arguments (CURRENT_CSF)
|
||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (APPLE)
|
||||
|
@@ -2,17 +2,4 @@
|
||||
# OpenVR is an API and runtime that allows access to VR hardware from multiple vendors without requiring that applications have specific knowledge of the hardware they are targeting.
|
||||
# https://github.com/ValveSoftware/openvr
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
set (USED_3RDPARTY_OPENVR_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
|
||||
find_library (FIND_OPENVR_LIB NAMES "${CSF_OpenVR}"
|
||||
PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib"
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
set (CSF_OpenVR "${FIND_OPENVR_LIB}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/")
|
||||
return()
|
||||
endif()
|
||||
|
||||
THIRDPARTY_PRODUCT("OPENVR" "openvr.h" "CSF_OpenVR" "")
|
||||
|
@@ -1,13 +1,5 @@
|
||||
# RapidJSON
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package(RapidJSON CONFIG REQUIRED)
|
||||
set(CSF_RapidJSON rapidjson)
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/rapidjson")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED INSTALL_RAPIDJSON)
|
||||
set (INSTALL_RAPIDJSON OFF CACHE BOOL "${INSTALL_RAPIDJSON_DESCR}")
|
||||
endif()
|
||||
|
@@ -1,18 +1,5 @@
|
||||
# tbb
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
find_package(TBB CONFIG REQUIRED)
|
||||
set(CSF_TBB TBB::tbb TBB::tbbmalloc)
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_TBB_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
|
||||
else()
|
||||
set (USED_3RDPARTY_TBB_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
|
||||
endif()
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/tbb")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
|
||||
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# tcl
|
||||
|
||||
if (NOT DEFINED INSTALL_TCL AND NOT BUILD_USE_VCPKG)
|
||||
if (NOT DEFINED INSTALL_TCL)
|
||||
set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
|
||||
endif()
|
||||
|
||||
@@ -14,10 +14,6 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
|
||||
endif()
|
||||
|
||||
if (BUILD_USE_VCPKG)
|
||||
set (3RDPARTY_TCL_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcl" FORCE)
|
||||
set (3RDPARTY_TCL_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tcl" FORCE)
|
||||
endif()
|
||||
|
||||
# tcl library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
|
@@ -18,12 +18,6 @@ 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_SHARED_LIBS)
|
||||
# tk library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
|
||||
@@ -196,8 +190,7 @@ if (BUILD_SHARED_LIBS)
|
||||
if (3RDPARTY_TK_LIBRARY AND EXISTS "${3RDPARTY_TK_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TK_LIBRARY_DIR}")
|
||||
else()
|
||||
set (USE_TK OFF)
|
||||
message(STATUS "Warning: TK library is not found. TK will be disabled.")
|
||||
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TK_LIBRARY_DIR)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
|
@@ -1,22 +0,0 @@
|
||||
#======================================================================
|
||||
#
|
||||
# Purpose: Defines macros identifying current version of Open CASCADE
|
||||
#
|
||||
# OCC_VERSION_MAJOR : (integer) number identifying major version
|
||||
# OCC_VERSION_MINOR : (integer) number identifying minor version
|
||||
# OCC_VERSION_MAINTENANCE : (integer) number identifying maintenance version
|
||||
# OCC_VERSION_DEVELOPMENT : (string) if defined, indicates development or modified version
|
||||
# in case of release, remove the value
|
||||
#
|
||||
# Sample values of OCC_VERSION_DEVELOPMENT:
|
||||
# - "dev" for development version between releases
|
||||
# - "beta..." or "rc..." for beta releases or release candidates
|
||||
# - "project..." for version containing project-specific fixes
|
||||
#
|
||||
# For development version git commit hash can be added to the version string
|
||||
#======================================================================
|
||||
|
||||
set (OCC_VERSION_MAJOR 7 )
|
||||
set (OCC_VERSION_MINOR 8 )
|
||||
set (OCC_VERSION_MAINTENANCE 2 )
|
||||
set (OCC_VERSION_DEVELOPMENT "dev" )
|
@@ -1,19 +1,5 @@
|
||||
# vtk
|
||||
|
||||
# vcpkg processing
|
||||
if (BUILD_USE_VCPKG)
|
||||
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")
|
||||
else()
|
||||
set (USED_3RDPARTY_VTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
|
||||
endif()
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED INSTALL_VTK)
|
||||
set (INSTALL_VTK OFF CACHE BOOL "${INSTALL_VTK_DESCR}")
|
||||
endif()
|
||||
|
@@ -142,20 +142,17 @@ proc OCCDoc_GetRelPath {thePathFrom thePathTo} {
|
||||
return $thePathTo
|
||||
}
|
||||
|
||||
# Returns OCCT version string from version.cmake (if available)
|
||||
# Returns OCCT version string from file Standard_Version.hxx (if available)
|
||||
proc OCCDoc_DetectCasVersion {} {
|
||||
set occt_ver "7.8.0"
|
||||
set occt_ver 6.7.0
|
||||
set occt_ver_add ""
|
||||
set filename "[OCCDoc_GetSourceDir]/../adm/cmake/version.cmake"
|
||||
set filename "[OCCDoc_GetSourceDir]/Standard/Standard_Version.hxx"
|
||||
if { [file exists $filename] } {
|
||||
set fh [open $filename "r"]
|
||||
set fh_loaded [read $fh]
|
||||
close $fh
|
||||
regexp {set\s+OCC_VERSION_MAJOR\s+([0-9]+)} $fh_loaded dummy major
|
||||
regexp {set\s+OCC_VERSION_MINOR\s+([0-9]+)} $fh_loaded dummy minor
|
||||
regexp {set\s+OCC_VERSION_MAINTENANCE\s+([0-9]+)} $fh_loaded dummy maint
|
||||
regexp {set\s+OCC_VERSION_DEVELOPMENT\s+\"([^\"]+)\"} $fh_loaded dummy occt_ver_add
|
||||
set occt_ver "$major.$minor.$maint"
|
||||
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
|
||||
regexp {[^/]\s*#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
|
||||
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
|
||||
}
|
||||
return $occt_ver
|
||||
|
5
adm/qmake/.gitignore
vendored
Normal file
5
adm/qmake/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/*/*.pro
|
||||
/*/*/*.pro
|
||||
*.pro.user
|
||||
custom.pri
|
||||
custom.auto.pri
|
165
adm/qmake/OccCppConfig.pri
Normal file
165
adm/qmake/OccCppConfig.pri
Normal file
@@ -0,0 +1,165 @@
|
||||
# This is project defines C++ compilation rules for building an OCCT Toolkit.
|
||||
|
||||
exists(custom.auto.pri) { include(custom.auto.pri) }
|
||||
exists(custom.pri) { include(custom.pri) }
|
||||
|
||||
# Disable some dummy Qt defaults
|
||||
QT -= core gui
|
||||
CONFIG -= qt app_bundle
|
||||
CONFIG -= qml_debug
|
||||
CONFIG -= debug_and_release
|
||||
|
||||
OccGitRoot = $$_PRO_FILE_PWD_/../../../..
|
||||
|
||||
# Define compilation flags
|
||||
CONFIG += warn_on
|
||||
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
|
||||
QMAKE_CXXFLAGS_WARN_ON = -Wall -Wextra
|
||||
win32 {
|
||||
QMAKE_CFLAGS_WARN_ON = -W4
|
||||
QMAKE_CXXFLAGS_WARN_ON = -W4
|
||||
QMAKE_CXXFLAGS_EXCEPTIONS_ON = /EHa
|
||||
QMAKE_CXXFLAGS_STL_ON = /EHa
|
||||
|
||||
QMAKE_CXXFLAGS += -fp:precise
|
||||
#QMAKE_CXXFLAGS -= -Zc:throwingNew
|
||||
#QMAKE_CXXFLAGS -= -Zc:rvalueCast
|
||||
|
||||
QMAKE_LFLAGS += -INCREMENTAL:NO
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
QMAKE_CXXFLAGS += -Od
|
||||
QMAKE_CXXFLAGS += -Ob1
|
||||
}
|
||||
|
||||
DEFINES -= WIN32
|
||||
DEFINES -= WIN64
|
||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||
DEFINES += _SCL_SECURE_NO_WARNINGS
|
||||
} else {
|
||||
CONFIG += c++11
|
||||
clang {
|
||||
QMAKE_CFLAGS_WARN_ON += -Wshorten-64-to-32
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wshorten-64-to-32
|
||||
}
|
||||
QMAKE_CFLAGS += -fexceptions
|
||||
QMAKE_CXXFLAGS += -fexceptions
|
||||
QMAKE_CXXFLAGS += -fvisibility=default
|
||||
DEFINES += OCC_CONVERT_SIGNALS
|
||||
mac {
|
||||
iphoneos {
|
||||
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
|
||||
} else {
|
||||
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
|
||||
}
|
||||
} else:gcc {
|
||||
# ask linker to report missing library dependencies
|
||||
QMAKE_LFLAGS += -Wl,-z,defs
|
||||
}
|
||||
}
|
||||
!CONFIG(debug, debug|release) {
|
||||
# disable exceptions in Release builds
|
||||
DEFINES += No_Exception
|
||||
HAVE_RelWithDebInfo {
|
||||
win32 {
|
||||
CONFIG += force_debug_info
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Define output folder depending on compiler name
|
||||
MY_BITNESS = 32
|
||||
|
||||
equals(QMAKE_TARGET.arch, x86_64) | equals(QMAKE_HOST.arch, x86_64) { MY_BITNESS = 64 }
|
||||
equals(ANDROID_TARGET_ARCH, arm64-v8a) { MY_BITNESS = 64 }
|
||||
has64Target = $$find(QMAKE_TARGET.arch, "x64")
|
||||
count(has64Target, 1) { MY_BITNESS = 64 }
|
||||
|
||||
MY_PLATFORM = platform
|
||||
CONFIG(iphonesimulator, iphoneos|iphonesimulator) { MY_PLATFORM = iphonesimulator
|
||||
} else:CONFIG(iphoneos, iphoneos|iphonesimulator) { MY_PLATFORM = iphoneos
|
||||
} else:android { MY_PLATFORM = android-$$ANDROID_TARGET_ARCH
|
||||
} else:win32 { MY_PLATFORM = win$$MY_BITNESS
|
||||
} else:mac { MY_PLATFORM = mac
|
||||
} else:linux { MY_PLATFORM = lin
|
||||
} else:unix { MY_PLATFORM = unix
|
||||
} else { warning (Unknown platform. "$$MY_PLATFORM" is used) }
|
||||
|
||||
MY_COMPILER = compiler
|
||||
MY_VC_VER = 0
|
||||
android-g++ {
|
||||
MY_COMPILER = gcc
|
||||
} else:clang {
|
||||
MY_COMPILER = clang
|
||||
} else:gcc {
|
||||
MY_COMPILER = gcc
|
||||
} else:win32-msvc2010 {
|
||||
MY_COMPILER = vc10
|
||||
MY_VC_VER = 10
|
||||
} else:win32-msvc2012 {
|
||||
MY_COMPILER = vc11
|
||||
MY_VC_VER = 11
|
||||
} else:win32-msvc2013 {
|
||||
MY_COMPILER = vc12
|
||||
MY_VC_VER = 12
|
||||
} else:win32-msvc2015 {
|
||||
MY_COMPILER = vc14
|
||||
MY_VC_VER = 14
|
||||
} else:win32-msvc2017 {
|
||||
MY_COMPILER = vc14
|
||||
MY_VC_VER = 14
|
||||
} else:win32-msvc {
|
||||
MY_COMPILER = vc14
|
||||
MY_VC_VER = 14
|
||||
aMsvcVer = $$(VisualStudioVersion)
|
||||
equals(aMsvcVer, 14.0){
|
||||
# VS2015, vc140
|
||||
} else:equals(aMsvcVer, 15.0){
|
||||
# VS2015, vc141
|
||||
} else:equals(aMsvcVer, 16.0){
|
||||
# VS2019, vc142
|
||||
} else:equals(aMsvcVer, 17.0){
|
||||
# VS2022, vc143
|
||||
} else {
|
||||
warning (Unknown msvc version. "$$MY_COMPILER" is used)
|
||||
}
|
||||
} else {
|
||||
warning (Unknown compiler. "$$MY_COMPILER" is used)
|
||||
}
|
||||
MY_PLATFORM_AND_COMPILER = $$MY_PLATFORM/$$MY_COMPILER
|
||||
#warning (The platform is "$$MY_PLATFORM"; bitness is "$$MY_BITNESS"; compiler is "$$MY_COMPILER")
|
||||
|
||||
CONFIG(debug, debug|release) { MY_BUILDTYPE = d }
|
||||
|
||||
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/lib$${MY_BUILDTYPE}
|
||||
win32 {
|
||||
DESTDIR = $$OccGitRoot/win$${MY_BITNESS}/vc$${MY_VC_VER}/bin$${MY_BUILDTYPE}
|
||||
aLibDest = $$DESTDIR/../lib$${MY_BUILDTYPE}
|
||||
#DLLDESTDIR = $$DESTDIR/../bin$${MY_BUILDTYPE}
|
||||
|
||||
# dummy target creating lib/libd folder
|
||||
occtkgen_libfolder.input = $$_PRO_FILE_PWD_/../../OcctDummy.in
|
||||
occtkgen_libfolder.output = $$aLibDest/dummy.tmp
|
||||
occtkgen_libfolder.config = verbatim
|
||||
QMAKE_SUBSTITUTES += occtkgen_libfolder
|
||||
|
||||
LIBS += -L$$aLibDest
|
||||
equals(TEMPLATE, lib) {
|
||||
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.dll
|
||||
QMAKE_CLEAN += $$aLibDest/$${TARGET}.lib
|
||||
QMAKE_CLEAN += $$aLibDest/$${TARGET}.exp
|
||||
} else {
|
||||
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.exe
|
||||
}
|
||||
QMAKE_CLEAN += $$DESTDIR/$${TARGET}.pdb
|
||||
QMAKE_LFLAGS += -PDB:"$$DESTDIR/$${TARGET}.pdb"
|
||||
QMAKE_LFLAGS += -IMPLIB:"$$aLibDest/$${TARGET}.lib"
|
||||
} else {
|
||||
LIBS += -L$$DESTDIR
|
||||
equals(TEMPLATE, app) {
|
||||
DESTDIR = $$OccGitRoot/$${MY_PLATFORM_AND_COMPILER}/bin$${MY_BUILDTYPE}
|
||||
}
|
||||
}
|
||||
|
||||
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
|
42
adm/qmake/OccModule.pri
Normal file
42
adm/qmake/OccModule.pri
Normal file
@@ -0,0 +1,42 @@
|
||||
# This is a project template file defining an OCCT Module.
|
||||
# This project should be included with predefined OCC_MODULE_NAME variable.
|
||||
TEMPLATE = subdirs
|
||||
exists(custom.auto.pri) { include(custom.auto.pri) }
|
||||
exists(custom.pri) { include(custom.pri) }
|
||||
|
||||
# Iterate over Toolkits within current Module and generate sub-project per Toolkit
|
||||
aModuleList = $$cat(../MODULES, lines)
|
||||
for (aModuleIter, aModuleList) {
|
||||
#aTkList = $$list($$aModuleIter) - this doesn't work, qmake bug?
|
||||
aModule = $$first($$list($$aModuleIter))
|
||||
equals (aModule, $$OCC_MODULE_NAME) {
|
||||
for (aToolKit, $$list($$aModuleIter)) {
|
||||
toSkipToolkit = 0
|
||||
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
|
||||
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
|
||||
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
|
||||
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGl") { toSkipToolkit = 1 }
|
||||
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGlTest") { toSkipToolkit = 1 }
|
||||
!HAVE_GLES2: equals (aToolKit, "TKOpenGles") { toSkipToolkit = 1 }
|
||||
!HAVE_GLES2: equals (aToolKit, "TKOpenGlesTest") { toSkipToolkit = 1 }
|
||||
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
|
||||
!win32: equals (aToolKit, "TKD3DHostTest") { toSkipToolkit = 1 }
|
||||
equals (toSkipToolkit, 0) {
|
||||
|
||||
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
|
||||
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
|
||||
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)
|
||||
eval(occtkgen_$${aToolKit}.config = verbatim)
|
||||
eval(QMAKE_SUBSTITUTES += occtkgen_$${aToolKit})
|
||||
SUBDIRS += $${aToolKit}
|
||||
|
||||
aModExtList = $$cat(../../src/$${aToolKit}/EXTERNLIB, lines)
|
||||
aTkDepends = $${aToolKit}.depends
|
||||
for (aModExtIter, aModExtList) {
|
||||
contains ($$list($$aModuleIter), $$aModExtIter) { eval ($${aTkDepends} += $$aModExtIter) }
|
||||
}
|
||||
#warning($$aToolKit depends on: $$reverse($${aTkDepends}))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
2
adm/qmake/OccModule.pro.in
Normal file
2
adm/qmake/OccModule.pro.in
Normal file
@@ -0,0 +1,2 @@
|
||||
OCC_MODULE_NAME = \$\$TARGET
|
||||
include(../OccModule.pri)
|
165
adm/qmake/OccToolkit.pri
Normal file
165
adm/qmake/OccToolkit.pri
Normal file
@@ -0,0 +1,165 @@
|
||||
# This is a project template file defining an OCCT Toolkit.
|
||||
# This project should be included with predefined OCC_TOOLKIT_NAME variable.
|
||||
|
||||
TEMPLATE = lib
|
||||
!exists(../../src/$$OCC_TOOLKIT_NAME/PACKAGES) {
|
||||
TEMPLATE = app
|
||||
CONFIG += console
|
||||
}
|
||||
win32 {
|
||||
# do not append version to DLL name
|
||||
CONFIG += skip_target_version_ext
|
||||
}
|
||||
|
||||
include(OccCppConfig.pri)
|
||||
|
||||
aSrcRoot = $$OccGitRoot/src
|
||||
aHxxRoot = $$OccGitRoot/inc
|
||||
INCLUDEPATH += $$aHxxRoot
|
||||
|
||||
# CSF variables
|
||||
HAVE_FREETYPE { CSF_FREETYPE = -lfreetype }
|
||||
CSF_TclLibs = -ltcl8.6
|
||||
CSF_TclTkLibs = -ltk8.6
|
||||
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
|
||||
HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
|
||||
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
|
||||
HAVE_ZLIB { CSF_ZLIB = -lzlib }
|
||||
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
|
||||
HAVE_DRACO { CSF_Draco = -ldraco }
|
||||
win32 {
|
||||
CSF_kernel32 = -lkernel32
|
||||
CSF_advapi32 = -ladvapi32
|
||||
CSF_gdi32 = -lgdi32
|
||||
CSF_user32 = -luser32 -lcomdlg32
|
||||
CSF_shell32 = -lShell32
|
||||
CSF_opengl32 = -lopengl32
|
||||
CSF_wsock32 = -lwsock32
|
||||
CSF_netapi32 = -lnetapi32
|
||||
CSF_OpenGlLibs = -lopengl32
|
||||
CSF_OpenGlesLibs = -llibEGL -llibGLESv2
|
||||
CSF_psapi = -lPsapi
|
||||
CSF_winmm = -lwinmm
|
||||
CSF_d3d9 = -ld3d9
|
||||
CSF_TclLibs = -ltcl86
|
||||
CSF_TclTkLibs = -ltk86
|
||||
CSF_TBB =
|
||||
} else:mac {
|
||||
CSF_dl = -ldl
|
||||
CSF_objc = -lobjc
|
||||
CSF_OpenGlLibs = -framework OpenGL
|
||||
CSF_OpenGlesLibs = -framework OpenGLES
|
||||
iphoneos {
|
||||
CSF_Appkit = -framework UIKit
|
||||
} else {
|
||||
CSF_Appkit = -framework AppKit
|
||||
}
|
||||
CSF_IOKit = -framework IOKit
|
||||
CSF_TclLibs = -framework Tcl
|
||||
CSF_TclTkLibs = -framework Tk
|
||||
} else {
|
||||
CSF_dl = -ldl
|
||||
CSF_ThreadLibs = -lpthread -lrt
|
||||
CSF_OpenGlesLibs = -lEGL -lGLESv2
|
||||
CSF_TclTkLibs = -ltk8.6
|
||||
HAVE_XLIB {
|
||||
CSF_OpenGlLibs = -lGL
|
||||
CSF_XwLibs = -lX11
|
||||
} else {
|
||||
CSF_OpenGlLibs = -lGL -lEGL
|
||||
}
|
||||
HAVE_FREETYPE { CSF_fontconfig = -lfontconfig }
|
||||
}
|
||||
|
||||
for (aCfgIter, CONFIG) {
|
||||
aRes = $$find(aCfgIter, "^HAVE_")
|
||||
!equals(aCfgIter, "HAVE_GLES2") {
|
||||
count(aRes, 1) {
|
||||
DEFINES += $$aCfgIter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Define the list of standard OCCT file extensions
|
||||
aHxxRegex = ^.*\.(hxx|h|lxx)$
|
||||
aCxxRegex = ^.*\.(cxx|cpp|c)$
|
||||
mac { aCxxRegex = ^.*\.(cxx|cpp|c|m|mm)$ }
|
||||
|
||||
# Auxiliary function for probing file extension
|
||||
defineTest (occCheckExtension) {
|
||||
aProbe = $$find(1, "$$2")
|
||||
count(aProbe, 1) { return(true) } else { return(false) }
|
||||
}
|
||||
|
||||
# Auxiliary function for probing compilable files
|
||||
defineTest (occIsCxxFile) { occCheckExtension ($$1, $$aCxxRegex) { return(true) } else { return(false) } }
|
||||
|
||||
# Auxiliary function for probing header files
|
||||
defineTest (occIsHxxFile) { occCheckExtension ($$1, $$aHxxRegex) { return(true) } else { return(false) } }
|
||||
|
||||
aTkFiles = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/FILES, lines)
|
||||
aTkFiles += CMakeLists.txt
|
||||
aPackages = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/PACKAGES, lines)
|
||||
anExternLibs = $$cat($$aSrcRoot/$$OCC_TOOLKIT_NAME/EXTERNLIB, lines)
|
||||
|
||||
for (aTkFileIter, aTkFiles) { OTHER_FILES += $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aTkFileIter }
|
||||
for (anExternLib, anExternLibs) {
|
||||
hasCsf = $$find(anExternLib, CSF_)
|
||||
count(hasCsf, 1) {
|
||||
aList = $$split($$anExternLib, "\n")
|
||||
LIBS += $$aList
|
||||
equals(anExternLib, "CSF_OpenGlLibs") {
|
||||
DEFINES += "HAVE_OPENGL"
|
||||
}
|
||||
equals(anExternLib, "CSF_OpenGlesLibs") {
|
||||
DEFINES += "HAVE_GLES2"
|
||||
}
|
||||
} else {
|
||||
LIBS += -l$$anExternLib
|
||||
}
|
||||
}
|
||||
|
||||
# Iterate over Packages and add compilable files into this project
|
||||
isEmpty (aPackages) { aPackages = $$OCC_TOOLKIT_NAME }
|
||||
for (aPackage, aPackages) {
|
||||
aPackageFolder = $$aSrcRoot/$$OCC_TOOLKIT_NAME/$$aPackage
|
||||
aPackageFiles = $$cat($$aSrcRoot/$$aPackage/FILES, lines)
|
||||
for (aFileIter, aPackageFiles) {
|
||||
occIsCxxFile($$aFileIter) {
|
||||
SOURCES += $$aSrcRoot/$$aPackage/$$aFileIter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
!win32 {
|
||||
aVerList = $$split(VERSION, ".")
|
||||
aVerMaj = $$member(aVerList, 0)
|
||||
aVerMin = $$member(aVerList, 1)
|
||||
aVerMic = $$member(aVerList, 2)
|
||||
|
||||
equals(TEMPLATE, app) {
|
||||
QMAKE_CLEAN += $$DESTDIR/$${TARGET}
|
||||
} else {
|
||||
mac {
|
||||
# override qmake soname versionong logic
|
||||
QMAKE_LFLAGS_SONAME =
|
||||
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.dylib.$${aVerMaj}.$${aVerMin}
|
||||
|
||||
# extend clean with versioned .dylib files
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.dylib
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
|
||||
} else {
|
||||
# override qmake soname versionong logic
|
||||
QMAKE_LFLAGS_SONAME =
|
||||
QMAKE_LFLAGS += -Wl,-soname=lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
|
||||
|
||||
# extend clean with versioned .so files
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}
|
||||
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}.$${aVerMic}
|
||||
}
|
||||
}
|
||||
}
|
2
adm/qmake/OccToolkit.pro.in
Normal file
2
adm/qmake/OccToolkit.pro.in
Normal file
@@ -0,0 +1,2 @@
|
||||
OCC_TOOLKIT_NAME = \$\$TARGET
|
||||
include(../../OccToolkit.pri)
|
45
adm/qmake/Occt.pro
Normal file
45
adm/qmake/Occt.pro
Normal file
@@ -0,0 +1,45 @@
|
||||
# This is an experimental Solution project for building entire OCCT framework using qmake.
|
||||
# It can be also used for just source code navigation in Qt Creator without actually building OCCT.
|
||||
# Note, as this is an experimental project, compiler flags might differ from official builds - use it on your own risk!
|
||||
# Building OCCT using CMake is a preferred solution.
|
||||
#
|
||||
# This project GENERATES sub-projects (OCCT modules) dynamically, so to start using it:
|
||||
# - Launch genconf, select Project Format "Qt Project" and configure dependencies; this will also generate "custom.auto.pri".
|
||||
# - Launch genproj to fill in "inc" folder with links to header files.
|
||||
# - Open project in Qt Creator, and call "Run qmake".
|
||||
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
|
||||
# - "Run qmake" and perform Build.
|
||||
#
|
||||
# Within Debian-based Linux repository Qt Creator can be installed like this:
|
||||
# > sudo apt-get install qtcreator qtbase5-dev
|
||||
|
||||
TEMPLATE = subdirs
|
||||
exists(custom.auto.pri) { include(custom.auto.pri) }
|
||||
exists(custom.pri) { include(custom.pri) }
|
||||
|
||||
OTHER_FILES += OccModule.pro.in \
|
||||
OcctHeaderLink.hxx.in \
|
||||
OccToolkit.pro.in \
|
||||
OccCppConfig.pri \
|
||||
OccModule.pri \
|
||||
OccToolkit.pri \
|
||||
custom.pri.template
|
||||
|
||||
# Iterate over Modules and generate sub-projects
|
||||
aSolModuleList = $$cat(../MODULES, lines)
|
||||
for (aSolModuleIter, aSolModuleList) {
|
||||
aSolModule = $$first($$list($$aSolModuleIter))
|
||||
eval(occtkgen_$${aSolModule}.input = $$_PRO_FILE_PWD_/OccModule.pro.in)
|
||||
eval(occtkgen_$${aSolModule}.output = $$_PRO_FILE_PWD_/$${aSolModule}/$${aSolModule}.pro)
|
||||
eval(occtkgen_$${aSolModule}.config = verbatim)
|
||||
eval(QMAKE_SUBSTITUTES += occtkgen_$${aSolModule})
|
||||
SUBDIRS += $${aSolModule}
|
||||
}
|
||||
|
||||
# These dependencies are manually defined
|
||||
ModelingData.depends = FoundationClasses
|
||||
ModelingAlgorithms.depends = FoundationClasses ModelingData
|
||||
Visualization.depends = FoundationClasses ModelingData ModelingAlgorithms
|
||||
ApplicationFramework.depends = FoundationClasses ModelingData ModelingAlgorithms Visualization
|
||||
DataExchange.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework
|
||||
Draw.depends = FoundationClasses ModelingData ModelingAlgorithms ApplicationFramework DataExchange Visualization
|
0
adm/qmake/OcctDummy.in
Normal file
0
adm/qmake/OcctDummy.in
Normal file
1
adm/qmake/OcctHeaderLink.hxx.in
Normal file
1
adm/qmake/OcctHeaderLink.hxx.in
Normal file
@@ -0,0 +1 @@
|
||||
#include \"../src/$${OCCT_PACKAGE}/$${OCCT_HEADER}\"
|
17
adm/qmake/custom.pri.template
Normal file
17
adm/qmake/custom.pri.template
Normal file
@@ -0,0 +1,17 @@
|
||||
PRODUCTS_PATH = c:/3rdparty/vc14
|
||||
|
||||
#CONFIG += HAVE_FREEIMAGE
|
||||
#CONFIG += HAVE_FFMPEG
|
||||
#CONFIG += HAVE_TBB
|
||||
#CONFIG += HAVE_GLES2
|
||||
#CONFIG += HAVE_D3D
|
||||
#CONFIG += HAVE_VTK
|
||||
|
||||
aFreeType = $$PRODUCTS_PATH/freetype-2.5.5-vc14-64
|
||||
aTclTk = $$PRODUCTS_PATH/tcltk-86-64
|
||||
|
||||
INCLUDEPATH += $$aFreeType/include
|
||||
LIBS += -L$$aFreeType/lib
|
||||
|
||||
INCLUDEPATH += $$aTclTk/include
|
||||
LIBS += -L$$aTclTk/lib
|
39
adm/qmake/qtcreator-occt-cpp.xml
Normal file
39
adm/qmake/qtcreator-occt-cpp.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.6.1, 2016-05-19T14:46:43. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">true</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">false</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">true</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">true</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">true</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">2</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">true</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">true</value>
|
||||
<value type="int" key="TabSize">2</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">occt</value>
|
||||
</data>
|
||||
</qtcreator>
|
@@ -67,9 +67,8 @@ if ["%toCMake%"] == ["1"] (
|
||||
set "anOcctVerSuffix="
|
||||
set "anOcctVersion=0.0.0"
|
||||
set "aGitBranch="
|
||||
rem Get OCCT version
|
||||
call "%~dp0build_common.bat"
|
||||
set "aGitBranch="
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
|
||||
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
|
||||
|
||||
for %%s in (%anNdkAbiList%) do (
|
||||
|
@@ -1,8 +0,0 @@
|
||||
@echo OFF
|
||||
|
||||
rem Extract version info from version.cmake
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr OCC_VERSION_DEVELOPMENT "%~dp0\..\cmake\version.cmake"') do ( set "anOcctVerSuffix=%%i" )
|
||||
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAJOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAJOR=%%i" )
|
||||
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MINOR "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MINOR=%%i" )
|
||||
for /f tokens^=3 %%i in ('findstr OCC_VERSION_MAINTENANCE "%~dp0\..\cmake\version.cmake"') do ( set "OCC_VERSION_MAINTENANCE=%%i" )
|
||||
set "anOcctVersion=%OCC_VERSION_MAJOR%.%OCC_VERSION_MINOR%.%OCC_VERSION_MAINTENANCE%"
|
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure script dir is defined
|
||||
if [ -z "$aScriptDir" ]; then
|
||||
aScriptDir=$(dirname "$0")
|
||||
fi
|
||||
|
||||
# Check if version file exists
|
||||
versionFile="$aScriptDir/../cmake/version.cmake"
|
||||
if [ ! -f "$versionFile" ]; then
|
||||
echo "Error: version.cmake not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract version info from version.cmake
|
||||
OCC_VERSION_MAJOR=$(awk '/set.*OCC_VERSION_MAJOR/ {print $3}' "$versionFile")
|
||||
OCC_VERSION_MINOR=$(awk '/set.*OCC_VERSION_MINOR/ {print $3}' "$versionFile")
|
||||
OCC_VERSION_MAINTENANCE=$(awk '/set.*OCC_VERSION_MAINTENANCE/ {print $3}' "$versionFile")
|
||||
anOcctVerSuffix=$(awk '/set.*OCC_VERSION_DEVELOPMENT/ {
|
||||
if (NF > 2) {
|
||||
gsub(/[)" ]/, "", $3)
|
||||
print $3
|
||||
} else {
|
||||
print ""
|
||||
}
|
||||
}' "$versionFile")
|
||||
|
||||
# Combine version string
|
||||
anOcctVersion="${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}"
|
||||
|
@@ -49,7 +49,8 @@ if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
|
||||
source "${aScriptDir}/ios_custom.sh"
|
||||
fi
|
||||
|
||||
source "${aScriptDir}/build_common.sh"
|
||||
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
|
@@ -51,7 +51,8 @@ if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
|
||||
source "${aScriptDir}/macos_custom.sh"
|
||||
fi
|
||||
|
||||
source "${aScriptDir}/build_common.sh"
|
||||
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
|
||||
aGitBranch=`git symbolic-ref --short HEAD`
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
|
@@ -53,8 +53,9 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
|
||||
|
||||
set "anOcctVerSuffix="
|
||||
set "anOcctVersion=0.0.0"
|
||||
call "%~dp0build_common.bat"
|
||||
set "aGitBranch="
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
|
||||
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
|
||||
|
||||
set "aBuildType=Release"
|
||||
|
@@ -55,8 +55,8 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
|
||||
set "anOcctVerSuffix="
|
||||
set "anOcctVersion=0.0.0"
|
||||
set "aGitBranch="
|
||||
call "%~dp0build_common.bat"
|
||||
set "aGitBranch="
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
|
||||
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
|
||||
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
|
||||
|
||||
set "aBuildType=Release"
|
||||
|
@@ -20,7 +20,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "\251 OPEN CASCADE SAS\000"
|
||||
VALUE "ProductName", "Open CASCADE Technology\000"
|
||||
VALUE "ProductVersion", OCC_VERSION_STRING_EXT "\000"
|
||||
VALUE "OfficialSite", "www.occt3d.com\000"
|
||||
VALUE "OfficialSite", "www.opencascade.com\000"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
@@ -1,25 +0,0 @@
|
||||
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)'
|
@@ -1,13 +0,0 @@
|
||||
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
|
||||
|
@@ -1,40 +0,0 @@
|
||||
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
|
@@ -1,49 +0,0 @@
|
||||
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"
|
@@ -1,15 +0,0 @@
|
||||
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 ;;
|
@@ -1,13 +0,0 @@
|
||||
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
|
@@ -1,13 +0,0 @@
|
||||
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"
|
@@ -1,16 +0,0 @@
|
||||
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
|
@@ -1,12 +0,0 @@
|
||||
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 ||
|
@@ -1,16 +0,0 @@
|
||||
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"
|
||||
|
@@ -1,23 +0,0 @@
|
||||
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"
|
@@ -1,13 +0,0 @@
|
||||
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 ||
|
@@ -1,30 +0,0 @@
|
||||
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() {
|
@@ -1,13 +0,0 @@
|
||||
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 = {
|
@@ -1,33 +0,0 @@
|
||||
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>
|
@@ -1,28 +0,0 @@
|
||||
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
|
||||
|
@@ -1,43 +0,0 @@
|
||||
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
|
||||
|
@@ -1,22 +0,0 @@
|
||||
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 };
|
||||
|
@@ -1,165 +0,0 @@
|
||||
# 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()
|
@@ -1,126 +0,0 @@
|
||||
#!/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
|
@@ -1,826 +0,0 @@
|
||||
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)
|
@@ -1,6 +0,0 @@
|
||||
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})
|
@@ -1,8 +0,0 @@
|
||||
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})
|
@@ -1,676 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
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])
|
||||
|
@@ -1,58 +0,0 @@
|
||||
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)
|
@@ -1,12 +0,0 @@
|
||||
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$@'
|
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"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,27 +0,0 @@
|
||||
From 85842ba83b70d99f90ee3fff8c956e82d17759f2 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Roszko <mark.roszko@gmail.com>
|
||||
Date: Tue, 18 Aug 2020 23:11:27 -0400
|
||||
Subject: [PATCH] Remove broken exist check for shell install
|
||||
|
||||
---
|
||||
win/makefile.vc | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/win/makefile.vc b/win/makefile.vc
|
||||
index f5d2f4a..6bffe32 100644
|
||||
--- a/win/makefile.vc
|
||||
+++ b/win/makefile.vc
|
||||
@@ -869,10 +869,8 @@ install-binaries:
|
||||
@$(CPY) "$(TCLLIB)" "$(BIN_INSTALL_DIR)\"
|
||||
!endif
|
||||
@$(CPY) "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\"
|
||||
-!if exist($(TCLSH))
|
||||
@echo Installing $(TCLSHNAME)
|
||||
@$(CPY) "$(TCLSH)" "$(BIN_INSTALL_DIR)\"
|
||||
-!endif
|
||||
@echo Installing $(TCLSTUBLIBNAME)
|
||||
@$(CPY) "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
|
||||
|
||||
--
|
||||
2.28.0.windows.1
|
||||
|
@@ -1,156 +0,0 @@
|
||||
vcpkg_from_sourceforge(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO tcl/Tcl
|
||||
REF 8.6.15
|
||||
FILENAME tcl8.6.15-src.tar.gz
|
||||
SHA512 9ae652823084899091467744da5a35d0fdfb453c055baea96af1bb181d161abe58b83382315cc3abee5fd57acc4ad5028df486a3e53645a28d1467e9c8d1d23e
|
||||
)
|
||||
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
|
||||
set(TCL_BUILD_MACHINE_STR MACHINE=AMD64)
|
||||
else()
|
||||
set(TCL_BUILD_MACHINE_STR MACHINE=IX86)
|
||||
endif()
|
||||
|
||||
# Handle features
|
||||
set(TCL_BUILD_OPTS OPTS=pdbs)
|
||||
set(TCL_BUILD_STATS STATS=none)
|
||||
set(TCL_BUILD_CHECKS CHECKS=none)
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
set(TCL_BUILD_OPTS ${TCL_BUILD_OPTS},static,staticpkg)
|
||||
endif()
|
||||
if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
||||
set(TCL_BUILD_OPTS ${TCL_BUILD_OPTS},msvcrt)
|
||||
endif()
|
||||
|
||||
if ("thrdalloc" IN_LIST FEATURES)
|
||||
set(TCL_BUILD_OPTS ${TCL_BUILD_OPTS},thrdalloc)
|
||||
endif()
|
||||
if ("profile" IN_LIST FEATURES)
|
||||
set(TCL_BUILD_OPTS ${TCL_BUILD_OPTS},profile)
|
||||
endif()
|
||||
if ("unchecked" IN_LIST FEATURES)
|
||||
set(TCL_BUILD_OPTS ${TCL_BUILD_OPTS},unchecked)
|
||||
endif()
|
||||
if ("utfmax" IN_LIST FEATURES)
|
||||
set(TCL_BUILD_OPTS ${TCL_BUILD_OPTS},time64bit)
|
||||
endif()
|
||||
|
||||
vcpkg_install_nmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PROJECT_SUBPATH win
|
||||
OPTIONS
|
||||
${TCL_BUILD_MACHINE_STR}
|
||||
${TCL_BUILD_STATS}
|
||||
${TCL_BUILD_CHECKS}
|
||||
OPTIONS_DEBUG
|
||||
${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")
|
||||
else()
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
PROJECT_SUBPATH unix
|
||||
)
|
||||
|
||||
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()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
endif()
|
||||
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/tclConfig.sh" "${CURRENT_PACKAGES_DIR}/debug/lib/tclConfig.sh")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.terms")
|
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "tcl",
|
||||
"version-string": "core-8-6-15",
|
||||
"port-version": 1,
|
||||
"description": "Tcl provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with the Tk toolkit, Tcl provides the fastest and most powerful way to create GUI applications that run on PCs, Unix, and Mac OS X. Tcl can also be used for a variety of web-related tasks and for creating powerful command languages for applications.",
|
||||
"homepage": "https://github.com/tcltk/tcl",
|
||||
"supports": "!android & !(windows & arm) & !uwp",
|
||||
"dependencies": [
|
||||
"zlib"
|
||||
],
|
||||
"features": {
|
||||
"profile": {
|
||||
"description": "Adds profiling hooks. Map file is assumed."
|
||||
},
|
||||
"thrdalloc": {
|
||||
"description": "Use the thread allocator (shared global free pool)."
|
||||
},
|
||||
"unchecked": {
|
||||
"description": "Allows a symbols build to not use the debug enabled runtime (msvcrt.dll not msvcrtd.dll or libcmt.lib not libcmtd.lib)."
|
||||
},
|
||||
"utfmax": {
|
||||
"description": "Forces Tcl_UniChar to be a 32-bit quantity in stead of 16-bits"
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json",
|
||||
"default-registry": {
|
||||
"kind": "git",
|
||||
"baseline": "2ddc10c8afa00a762a69f21f6427849fe906ede0",
|
||||
"repository": "https://github.com/microsoft/vcpkg"
|
||||
},
|
||||
"registries": [
|
||||
{
|
||||
"kind": "artifact",
|
||||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
|
||||
"name": "microsoft"
|
||||
}
|
||||
],
|
||||
"overlay-ports": [
|
||||
"./ports"
|
||||
]
|
||||
}
|
@@ -1,121 +0,0 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
||||
"name": "opencascade",
|
||||
"version": "7.8.1",
|
||||
"description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.",
|
||||
"homepage": "https://github.com/Open-Cascade-SAS/OCCT",
|
||||
"documentation": "https://github.com/Open-Cascade-SAS/OCCT/wiki",
|
||||
"license": "LGPL-2.1",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
{
|
||||
"name": "tcl"
|
||||
},
|
||||
{
|
||||
"name": "freetype",
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "angle",
|
||||
"platform": "uwp"
|
||||
},
|
||||
{
|
||||
"name": "opengl",
|
||||
"platform": "!(android | ios | uwp | wasm32)"
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"angle": {
|
||||
"description": "Enables optional usage of ANGLE. Part of the module-visualization.",
|
||||
"dependencies": [
|
||||
"angle"
|
||||
]
|
||||
},
|
||||
"opengl": {
|
||||
"description": "Enables optional usage of OpenGL. Part of the module-visualization.",
|
||||
"dependencies": [
|
||||
"opengl"
|
||||
]
|
||||
},
|
||||
"tcl": {
|
||||
"description": "Enables optional usage of Tcl. Part of the module-foundation-classes.",
|
||||
"dependencies": [
|
||||
"tcl"
|
||||
]
|
||||
},
|
||||
"freeimage": {
|
||||
"description": "Enables optional usage of FreeImage. Part of the module-visualization.",
|
||||
"dependencies": [
|
||||
"freeimage"
|
||||
]
|
||||
},
|
||||
"freetype": {
|
||||
"description": "Enables optional usage of FreeType. Part of the module-visualization.",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"fontconfig",
|
||||
{
|
||||
"name": "freetype",
|
||||
"default-features": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"rapidjson": {
|
||||
"description": "Enables optional usage of RapidJSON. Part of the module-data-exchange.",
|
||||
"dependencies": [
|
||||
"rapidjson"
|
||||
]
|
||||
},
|
||||
"tbb": {
|
||||
"description": "Enables optional usage of TBB. Part of the module-foundation-classes.",
|
||||
"dependencies": [
|
||||
"tbb"
|
||||
]
|
||||
},
|
||||
"vtk": {
|
||||
"description": "Enables optional usage of VTK. Part of the module-visualization.",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vtk",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"opengl"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"draco": {
|
||||
"description": "Enables optional usage of Draco. Part of the module-data-exchange.",
|
||||
"dependencies": [
|
||||
"draco"
|
||||
]
|
||||
},
|
||||
"ffmpeg": {
|
||||
"description": "Enables optional usage of FFmpeg. Part of the module-visualization.",
|
||||
"dependencies": [
|
||||
"ffmpeg"
|
||||
]
|
||||
},
|
||||
"openvr": {
|
||||
"description": "Enables optional usage of OpenVR. Part of the module-visualization.",
|
||||
"dependencies": [
|
||||
"openvr"
|
||||
]
|
||||
},
|
||||
"jemalloc": {
|
||||
"description": "Enables optional usage of jemalloc. Part of the module-foundation-classes.",
|
||||
"dependencies": [
|
||||
"jemalloc"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
To generate HTML documentation from sources contained in *dox* subdirectory,
|
||||
you need to have Tcl and Doxygen 1.8.5 (or above) installed on your system.
|
||||
|
||||
Use script **gendoc** (batch file on Windows, shell script on Linux / Mac OSX) located in `adm` directory to generate documentation.
|
||||
Use script **gendoc** (batch file on Windows, shell script on Linux / Mac OSX) to generate documentation.
|
||||
|
||||
To generate Overview documentation:
|
||||
|
||||
|
@@ -59,7 +59,7 @@ See \ref OCCT_DM_SECTION_A_9 for more details on inserting mathematical expressi
|
||||
|
||||
@section OCCT_DM_SECTION_2_1 Documentation Generation
|
||||
|
||||
Run command *gendoc* from command prompt (located in `adm` directory) to generate OCCT documentation.
|
||||
Run command *gendoc* from command prompt (with OCCT directory as current one) to generate OCCT documentation.
|
||||
The synopsis is:
|
||||
|
||||
gendoc \[-h\] {-refman|-overview} \[-html|-pdf|-chm\] \[-m=<list of modules>|-ug=<list of docs>\] \[-v\] \[-s=<search_mode>\] \[-mathjax=<path>\]
|
||||
|
@@ -200,7 +200,7 @@ All registered providers are set to the map with information about its vendor an
|
||||
It is nesessary to register only one ConfigurationNode for all needed formats.
|
||||
~~~~{.cpp}
|
||||
Handle(DE_Wrapper) aSession = DE_Wrapper::GlobalWrapper();
|
||||
Handle(DE_ConfigurationNode) aNode = new DESTEP_ConfigurationNode();
|
||||
Handle(DE_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
|
||||
aSession->Bind(aNode);
|
||||
~~~~
|
||||
@subsubsection occt_de_wrapper_3_3_2 Registering providers. DRAW Sample
|
||||
@@ -216,7 +216,7 @@ It is possible to change a parameter from code using a smart pointer.
|
||||
|
||||
~~~~{.cpp}
|
||||
// global variable
|
||||
static Handle(DESTEP_ConfigurationNode) THE_STEP_NODE;
|
||||
static Handle(STEPCAFControl_ConfigurationNode) THE_STEP_NODE;
|
||||
|
||||
static Handle(DE_ConfigurationNode) RegisterStepNode()
|
||||
{
|
||||
@@ -226,7 +226,7 @@ static Handle(DE_ConfigurationNode) RegisterStepNode()
|
||||
return THE_STEP_NODE;
|
||||
}
|
||||
|
||||
THE_STEP_NODE = new DESTEP_ConfigurationNode();
|
||||
THE_STEP_NODE = new STEPCAFControl_ConfigurationNode();
|
||||
aSession->Bind(THE_STEP_NODE);
|
||||
return THE_STEP_NODE;
|
||||
}
|
||||
@@ -351,7 +351,7 @@ It is possible to read and write CAD files directly from a special provider.
|
||||
|
||||
~~~~{.cpp}
|
||||
// Creating or getting node
|
||||
Handle(DESTEP_ConfigurationNode) aNode = new DESTEP_ConfigurationNode();
|
||||
Handle(STEPCAFControl_ConfigurationNode) aNode = new STEPCAFControl_ConfigurationNode();
|
||||
// Creating an one-time provider
|
||||
Handle(DE_Provider) aProvider = aNode->BuildProvider();
|
||||
// Setting configuration with all parameters
|
||||
|
@@ -825,7 +825,7 @@ DBRep::Set(char*,B);
|
||||
#### In DrawTrSurf package:
|
||||
|
||||
~~~~{.php}
|
||||
Handle(Geom_Geometry) Get(Standard_CString& Name) ;
|
||||
Handle_Geom_Geometry Get(Standard_CString& Name) ;
|
||||
~~~~
|
||||
|
||||
#### In DBRep package:
|
||||
|
@@ -137,7 +137,7 @@ This class is used to interpolate a BSplineCurve passing through an array of po
|
||||
This class may be instantiated as follows:
|
||||
~~~~{.cpp}
|
||||
Geom2dAPI_Interpolate
|
||||
(const Handle(TColgp_HArray1OfPnt2d)& Points,
|
||||
(const Handle_TColgp_HArray1OfPnt2d& Points,
|
||||
const Standard_Boolean PeriodicFlag,
|
||||
const Standard_Real Tolerance);
|
||||
|
||||
@@ -165,7 +165,7 @@ Geom2dAPI_Interpolate(Points,
|
||||
This class may be instantiated as follows:
|
||||
~~~~{.cpp}
|
||||
GeomAPI_Interpolate
|
||||
(const Handle(TColgp_HArray1OfPnt)& Points,
|
||||
(const Handle_TColgp_HArray1OfPnt& Points,
|
||||
const Standard_Boolean PeriodicFlag,
|
||||
const Standard_Real Tolerance);
|
||||
|
||||
|
4
adm/gendoc → gendoc
Normal file → Executable file
4
adm/gendoc → gendoc
Normal file → Executable file
@@ -10,9 +10,9 @@ 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
|
||||
if [ -e "${aScriptPath}/env.sh" ]; then source "${aScriptPath}/env.sh"; fi
|
||||
|
||||
tclsh "${aScriptPath}/start.tcl" gendoc $anArgs
|
||||
tclsh "${aScriptPath}/adm/start.tcl" gendoc $anArgs
|
||||
|
||||
export PATH="$anOldPath"
|
||||
export LD_LIBRARY_PATH="$anOldLd"
|
@@ -6,8 +6,8 @@ rem should be in the PATH
|
||||
|
||||
SET "OLD_PATH=%PATH%"
|
||||
|
||||
if exist "%~dp0../env.bat" (
|
||||
call "%~dp0../env.bat"
|
||||
if exist "%~dp0env.bat" (
|
||||
call "%~dp0env.bat"
|
||||
)
|
||||
|
||||
set "TCL_EXEC=tclsh.exe"
|
||||
@@ -15,7 +15,7 @@ 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 %*
|
||||
%TCL_EXEC% %~dp0adm/start.tcl gendoc %*
|
||||
) else (
|
||||
echo "Error. %TCL_EXEC% is not found. Please update PATH variable"
|
||||
)
|
@@ -21,64 +21,58 @@
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
|
||||
//! Application Interactive Services provide the means to create links between an application GUI
|
||||
//! viewer and the packages which are used to manage selection and presentation. The tools AIS
|
||||
//! defined in order to do this include different sorts of entities: both the selectable viewable
|
||||
//! objects themselves and the context and attribute managers to define their selection and display.
|
||||
//! To orient the user as he works in a modeling environment, views and selections must be
|
||||
//! comprehensible. There must be several different sorts of selectable and viewable object defined.
|
||||
//! These must also be interactive, that is, connecting graphic representation and the underlying
|
||||
//! reference geometry. These entities are called Interactive Objects, and are divided into four
|
||||
//! types:
|
||||
//! Application Interactive Services provide the means to create links between an application GUI viewer and
|
||||
//! the packages which are used to manage selection and presentation.
|
||||
//! The tools AIS defined in order to do this include different sorts of entities:
|
||||
//! both the selectable viewable objects themselves and the context and attribute managers to define their selection and display.
|
||||
//! To orient the user as he works in a modeling environment, views and selections must be comprehensible.
|
||||
//! There must be several different sorts of selectable and viewable object defined.
|
||||
//! These must also be interactive, that is, connecting graphic representation and the underlying reference geometry.
|
||||
//! These entities are called Interactive Objects, and are divided into four types:
|
||||
//! - the Datum
|
||||
//! - the Relation
|
||||
//! - the Object
|
||||
//! - None.
|
||||
//! The Datum groups together the construction elements such as lines, circles, points, trihedra,
|
||||
//! plane trihedra, planes and axes. The Relation is made up of constraints on one or more
|
||||
//! interactive shapes and the corresponding reference geometry. For example, you might want to
|
||||
//! constrain two edges in a parallel relation. This constraint is considered as an object in its
|
||||
//! own right, and is shown as a sensitive primitive. This takes the graphic form of a perpendicular
|
||||
//! arrow marked with the || symbol and lying between the two edges. The Object type includes
|
||||
//! topological shapes, and connections between shapes. None, in order not to eliminate the object,
|
||||
//! tells the application to look further until it finds an object definition in its generation
|
||||
//! which is accepted. Inside these categories, you have the possibility of an additional
|
||||
//! characterization by means of a signature. The signature provides an index to the further
|
||||
//! characterization. By default, the Interactive Object has a None type and a signature of 0
|
||||
//! (equivalent to None.) If you want to give a particular type and signature to your interactive
|
||||
//! object, you must redefine the two virtual methods: Type and Signature. In the C++ inheritance
|
||||
//! structure of the package, each class representing a specific Interactive Object inherits
|
||||
//! AIS_InteractiveObject. Among these inheriting classes, AIS_Relation functions as the abstract
|
||||
//! mother class for tinheriting classes defining display of specific relational constraints and
|
||||
//! types of dimension. Some of these include:
|
||||
//! - display of constraints based on relations of symmetry, tangency, parallelism and
|
||||
//! concentricity
|
||||
//! The Datum groups together the construction elements such as lines, circles, points, trihedra, plane trihedra, planes and axes.
|
||||
//! The Relation is made up of constraints on one or more interactive shapes and the corresponding reference geometry.
|
||||
//! For example, you might want to constrain two edges in a parallel relation.
|
||||
//! This constraint is considered as an object in its own right, and is shown as a sensitive primitive.
|
||||
//! This takes the graphic form of a perpendicular arrow marked with the || symbol and lying between the two edges.
|
||||
//! The Object type includes topological shapes, and connections between shapes.
|
||||
//! None, in order not to eliminate the object, tells the application to look further until it finds an object definition in its generation which is accepted.
|
||||
//! Inside these categories, you have the possibility of an additional characterization by means of a signature.
|
||||
//! The signature provides an index to the further characterization.
|
||||
//! By default, the Interactive Object has a None type and a signature of 0 (equivalent to None.)
|
||||
//! If you want to give a particular type and signature to your interactive object, you must redefine the two virtual methods: Type and Signature.
|
||||
//! In the C++ inheritance structure of the package, each class representing a specific Interactive Object inherits AIS_InteractiveObject.
|
||||
//! Among these inheriting classes, AIS_Relation functions as the abstract mother class for tinheriting classes defining display of specific relational constraints and types of dimension.
|
||||
//! Some of these include:
|
||||
//! - display of constraints based on relations of symmetry, tangency, parallelism and concentricity
|
||||
//! - display of dimensions for angles, offsets, diameters, radii and chamfers.
|
||||
//! No viewer can show everything at once with any coherence or clarity.
|
||||
//! Views must be managed carefully both sequentially and at any given instant.
|
||||
//! Another function of the view is that of a context to carry out design in.
|
||||
//! The design changes are applied to the objects in the view and then extended to the underlying
|
||||
//! reference geometry by a solver. To make sense of this complicated visual data, several display
|
||||
//! and selection tools are required. To facilitate management, each object and each construction
|
||||
//! element has a selection priority. There are also means to modify the default priority. To define
|
||||
//! an environment of dynamic detection, you can use standard filter classes or create your own. A
|
||||
//! filter questions the owner of the sensitive primitive to determine if it has the desired
|
||||
//! qualities. If it answers positively, it is kept. If not, it is rejected. The standard filters
|
||||
//! supplied in AIS include:
|
||||
//! The design changes are applied to the objects in the view and then extended to the underlying reference geometry by a solver.
|
||||
//! To make sense of this complicated visual data, several display and selection tools are required.
|
||||
//! To facilitate management, each object and each construction element has a selection priority.
|
||||
//! There are also means to modify the default priority.
|
||||
//! To define an environment of dynamic detection, you can use standard filter classes or create your own.
|
||||
//! A filter questions the owner of the sensitive primitive to determine if it has the desired qualities.
|
||||
//! If it answers positively, it is kept. If not, it is rejected.
|
||||
//! The standard filters supplied in AIS include:
|
||||
//! - AIS_AttributeFilter
|
||||
//! - AIS_SignatureFilter
|
||||
//! - AIS_TypeFilter.
|
||||
//! A set of functions allows you to choose the interactive objects which you want to act on, the
|
||||
//! selection modes which you want to activate. An interactive object can have a certain number of
|
||||
//! graphic attributes which are specific to it, such as visualization mode, color, and material. By
|
||||
//! the same token, the interactive context has a set of graphic attributes, the Drawer which is
|
||||
//! valid by default for the objects it controls. When an interactive object is visualized, the
|
||||
//! required graphic attributes are first taken from the object's own Drawer if one exists, or from
|
||||
//! the context drawer for the others.
|
||||
class AIS
|
||||
//! A set of functions allows you to choose the interactive objects which you want to act on, the selection modes which you want to activate.
|
||||
//! An interactive object can have a certain number of graphic attributes which are specific to it, such as visualization mode, color, and material.
|
||||
//! By the same token, the interactive context has a set of graphic attributes, the Drawer which is valid by default for the objects it controls.
|
||||
//! When an interactive object is visualized, the required graphic attributes are first taken from the object's own Drawer if one exists, or from the context drawer for the others.
|
||||
class AIS
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
};
|
||||
|
||||
#endif // _AIS_HeaderFile
|
||||
|
@@ -18,44 +18,51 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_Animation, Standard_Transient)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
AIS_Animation::AIS_Animation(const TCollection_AsciiString& theAnimationName)
|
||||
: myName(theAnimationName),
|
||||
myState(AnimationState_Stopped),
|
||||
myPtsStart(0.0),
|
||||
myOwnDuration(0.0),
|
||||
myChildrenDuration(0.0)
|
||||
//=============================================================================
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
AIS_Animation::AIS_Animation (const TCollection_AsciiString& theAnimationName)
|
||||
: myName (theAnimationName),
|
||||
myState (AnimationState_Stopped),
|
||||
myPtsStart (0.0),
|
||||
myOwnDuration (0.0),
|
||||
myChildrenDuration (0.0)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=============================================================================
|
||||
//function : ~AIS_Animation
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
AIS_Animation::~AIS_Animation()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=============================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::Clear()
|
||||
{
|
||||
myAnimations.Clear();
|
||||
myOwnDuration = 0.0;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void AIS_Animation::Add(const Handle(AIS_Animation)& theAnimation)
|
||||
//=============================================================================
|
||||
//function : Add
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::Add (const Handle(AIS_Animation)& theAnimation)
|
||||
{
|
||||
if (theAnimation.IsNull())
|
||||
{
|
||||
throw Standard_ProgramError("AIS_Animation::Add() - attempt to add a NULL animation!");
|
||||
}
|
||||
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value() == theAnimation)
|
||||
{
|
||||
@@ -64,16 +71,17 @@ void AIS_Animation::Add(const Handle(AIS_Animation)& theAnimation)
|
||||
}
|
||||
}
|
||||
|
||||
myAnimations.Append(theAnimation);
|
||||
myAnimations.Append (theAnimation);
|
||||
UpdateTotalDuration();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Handle(AIS_Animation) AIS_Animation::Find(const TCollection_AsciiString& theAnimationName) const
|
||||
//=============================================================================
|
||||
//function : Find
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Handle(AIS_Animation) AIS_Animation::Find (const TCollection_AsciiString& theAnimationName) const
|
||||
{
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value()->Name() == theAnimationName)
|
||||
{
|
||||
@@ -83,16 +91,17 @@ Handle(AIS_Animation) AIS_Animation::Find(const TCollection_AsciiString& theAnim
|
||||
return Handle(AIS_Animation)();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Standard_Boolean AIS_Animation::Remove(const Handle(AIS_Animation)& theAnimation)
|
||||
//=============================================================================
|
||||
//function : Remove
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Standard_Boolean AIS_Animation::Remove (const Handle(AIS_Animation)& theAnimation)
|
||||
{
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value() == theAnimation)
|
||||
{
|
||||
myAnimations.Remove(anIter);
|
||||
myAnimations.Remove (anIter);
|
||||
UpdateTotalDuration();
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -100,13 +109,14 @@ Standard_Boolean AIS_Animation::Remove(const Handle(AIS_Animation)& theAnimation
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Standard_Boolean AIS_Animation::Replace(const Handle(AIS_Animation)& theAnimationOld,
|
||||
const Handle(AIS_Animation)& theAnimationNew)
|
||||
//=============================================================================
|
||||
//function : Replace
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Standard_Boolean AIS_Animation::Replace (const Handle(AIS_Animation)& theAnimationOld,
|
||||
const Handle(AIS_Animation)& theAnimationNew)
|
||||
{
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
if (anIter.Value() == theAnimationOld)
|
||||
{
|
||||
@@ -118,59 +128,63 @@ Standard_Boolean AIS_Animation::Replace(const Handle(AIS_Animation)& theAnimatio
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void AIS_Animation::CopyFrom(const Handle(AIS_Animation)& theOther)
|
||||
//=============================================================================
|
||||
//function : CopyFrom
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::CopyFrom (const Handle(AIS_Animation)& theOther)
|
||||
{
|
||||
myAnimations.Clear();
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(theOther->myAnimations);
|
||||
anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (theOther->myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
myAnimations.Append(anIter.Value());
|
||||
myAnimations.Append (anIter.Value());
|
||||
}
|
||||
UpdateTotalDuration();
|
||||
myPtsStart = theOther->myPtsStart;
|
||||
myOwnDuration = theOther->myOwnDuration;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=============================================================================
|
||||
//function : UpdateTotalDuration
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::UpdateTotalDuration()
|
||||
{
|
||||
myChildrenDuration = 0.0;
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
myChildrenDuration =
|
||||
Max(myChildrenDuration, anIter.Value()->StartPts() + anIter.Value()->Duration());
|
||||
myChildrenDuration = Max (myChildrenDuration, anIter.Value()->StartPts() + anIter.Value()->Duration());
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void AIS_Animation::StartTimer(const Standard_Real theStartPts,
|
||||
const Standard_Real thePlaySpeed,
|
||||
const Standard_Boolean theToUpdate,
|
||||
const Standard_Boolean theToStopTimer)
|
||||
//=============================================================================
|
||||
//function : StartTimer
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::StartTimer (const Standard_Real theStartPts,
|
||||
const Standard_Real thePlaySpeed,
|
||||
const Standard_Boolean theToUpdate,
|
||||
const Standard_Boolean theToStopTimer)
|
||||
{
|
||||
if (myTimer.IsNull())
|
||||
{
|
||||
myTimer = new Media_Timer();
|
||||
}
|
||||
myTimer->Stop();
|
||||
myTimer->Seek(theStartPts);
|
||||
myTimer->SetPlaybackSpeed(thePlaySpeed);
|
||||
Start(theToUpdate);
|
||||
myTimer->Seek (theStartPts);
|
||||
myTimer->SetPlaybackSpeed (thePlaySpeed);
|
||||
Start (theToUpdate);
|
||||
if (theToStopTimer)
|
||||
{
|
||||
myTimer->Stop();
|
||||
myTimer->Seek(theStartPts);
|
||||
myTimer->Seek (theStartPts);
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=============================================================================
|
||||
//function : UpdateTimer
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Standard_Real AIS_Animation::UpdateTimer()
|
||||
{
|
||||
if (myTimer.IsNull())
|
||||
@@ -179,26 +193,29 @@ Standard_Real AIS_Animation::UpdateTimer()
|
||||
}
|
||||
|
||||
const Standard_Real anElapsedTime = myTimer->ElapsedTime();
|
||||
Update(anElapsedTime);
|
||||
Update (anElapsedTime);
|
||||
return anElapsedTime;
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void AIS_Animation::Start(const Standard_Boolean theToUpdate)
|
||||
//=============================================================================
|
||||
//function : Start
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::Start (const Standard_Boolean theToUpdate)
|
||||
{
|
||||
UpdateTotalDuration();
|
||||
myState = AnimationState_Started;
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
anIter.ChangeValue()->Start(Standard_False);
|
||||
anIter.ChangeValue()->Start (Standard_False);
|
||||
}
|
||||
|
||||
if (theToUpdate)
|
||||
{
|
||||
const Standard_Real anElapsedTime = !myTimer.IsNull() ? myTimer->ElapsedTime() : 0.0;
|
||||
Update(anElapsedTime);
|
||||
const Standard_Real anElapsedTime = !myTimer.IsNull()
|
||||
? myTimer->ElapsedTime()
|
||||
: 0.0;
|
||||
Update (anElapsedTime);
|
||||
}
|
||||
|
||||
if (!myTimer.IsNull())
|
||||
@@ -207,8 +224,10 @@ void AIS_Animation::Start(const Standard_Boolean theToUpdate)
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=============================================================================
|
||||
//function : Pause
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::Pause()
|
||||
{
|
||||
myState = AnimationState_Paused;
|
||||
@@ -217,15 +236,16 @@ void AIS_Animation::Pause()
|
||||
myTimer->Pause();
|
||||
}
|
||||
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
anIter.ChangeValue()->Stop();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
//=============================================================================
|
||||
//function : Stop
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::Stop()
|
||||
{
|
||||
myState = AnimationState_Stopped;
|
||||
@@ -233,50 +253,56 @@ void AIS_Animation::Stop()
|
||||
{
|
||||
const Standard_Real anElapsedTime = ElapsedTime();
|
||||
myTimer->Stop();
|
||||
myTimer->Seek(Min(Duration(), anElapsedTime));
|
||||
myTimer->Seek (Min (Duration(), anElapsedTime));
|
||||
}
|
||||
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
anIter.ChangeValue()->Stop();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
Standard_Boolean AIS_Animation::Update(const Standard_Real thePts)
|
||||
//=============================================================================
|
||||
//function : Update
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Standard_Boolean AIS_Animation::Update (const Standard_Real thePts)
|
||||
{
|
||||
AIS_AnimationProgress aPosition;
|
||||
aPosition.Pts = thePts;
|
||||
aPosition.LocalPts = thePts - myPtsStart;
|
||||
aPosition.LocalNormalized = HasOwnDuration() ? (aPosition.LocalPts / myOwnDuration) : 0.0;
|
||||
aPosition.LocalNormalized = Max(0.0, aPosition.LocalNormalized);
|
||||
aPosition.LocalNormalized = Min(1.0, aPosition.LocalNormalized);
|
||||
updateWithChildren(aPosition);
|
||||
aPosition.LocalNormalized = HasOwnDuration()
|
||||
? (aPosition.LocalPts / myOwnDuration)
|
||||
: 0.0;
|
||||
aPosition.LocalNormalized = Max (0.0, aPosition.LocalNormalized);
|
||||
aPosition.LocalNormalized = Min (1.0, aPosition.LocalNormalized);
|
||||
updateWithChildren (aPosition);
|
||||
return thePts < myPtsStart + Duration();
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void AIS_Animation::updateWithChildren(const AIS_AnimationProgress& thePosition)
|
||||
//=============================================================================
|
||||
//function : updateWithChildren
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_Animation::updateWithChildren (const AIS_AnimationProgress& thePosition)
|
||||
{
|
||||
if (thePosition.LocalPts < 0.0 || IsStopped())
|
||||
if (thePosition.LocalPts < 0.0
|
||||
|| IsStopped())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter(myAnimations); anIter.More();
|
||||
anIter.Next())
|
||||
for (NCollection_Sequence<Handle(AIS_Animation)>::Iterator anIter (myAnimations); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(AIS_Animation)& anAnim = anIter.Value();
|
||||
AIS_AnimationProgress aPosition = thePosition;
|
||||
aPosition.LocalPts = aPosition.LocalPts - anAnim->StartPts();
|
||||
aPosition.LocalNormalized =
|
||||
anAnim->HasOwnDuration() ? (aPosition.LocalPts / anAnim->OwnDuration()) : 0.0;
|
||||
aPosition.LocalNormalized = Max(0.0, aPosition.LocalNormalized);
|
||||
aPosition.LocalNormalized = Min(1.0, aPosition.LocalNormalized);
|
||||
anAnim->updateWithChildren(aPosition);
|
||||
const Handle(AIS_Animation)& anAnim = anIter.Value();
|
||||
AIS_AnimationProgress aPosition = thePosition;
|
||||
aPosition.LocalPts = aPosition.LocalPts - anAnim->StartPts();
|
||||
aPosition.LocalNormalized = anAnim->HasOwnDuration()
|
||||
? (aPosition.LocalPts / anAnim->OwnDuration())
|
||||
: 0.0;
|
||||
aPosition.LocalNormalized = Max (0.0, aPosition.LocalNormalized);
|
||||
aPosition.LocalNormalized = Min (1.0, aPosition.LocalNormalized);
|
||||
anAnim->updateWithChildren (aPosition);
|
||||
}
|
||||
|
||||
if (thePosition.LocalPts >= Duration())
|
||||
@@ -284,5 +310,5 @@ void AIS_Animation::updateWithChildren(const AIS_AnimationProgress& thePosition)
|
||||
Stop();
|
||||
}
|
||||
|
||||
update(thePosition);
|
||||
update (thePosition);
|
||||
}
|
||||
|
@@ -22,18 +22,11 @@
|
||||
//! Structure defining current animation progress.
|
||||
struct AIS_AnimationProgress
|
||||
{
|
||||
Standard_Real Pts; //!< global presentation timestamp
|
||||
Standard_Real LocalPts; //!< presentation within current animation
|
||||
// clang-format off
|
||||
Standard_Real Pts; //!< global presentation timestamp
|
||||
Standard_Real LocalPts; //!< presentation within current animation
|
||||
Standard_Real LocalNormalized; //!< normalized position within current animation within 0..1 range
|
||||
// clang-format on
|
||||
|
||||
AIS_AnimationProgress()
|
||||
: Pts(-1.0),
|
||||
LocalPts(-1.0),
|
||||
LocalNormalized(-1.0)
|
||||
{
|
||||
}
|
||||
AIS_AnimationProgress() : Pts (-1.0), LocalPts (-1.0), LocalNormalized (-1.0) {}
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Animation, Standard_Transient)
|
||||
@@ -43,43 +36,38 @@ DEFINE_STANDARD_HANDLE(AIS_Animation, Standard_Transient)
|
||||
//!
|
||||
//! - Animation Implementor
|
||||
//! Sub-classes should override method AIS_Animation::update() to perform specific animation.
|
||||
//! AIS package provides limited number of such animation atoms - classes AIS_AnimationObject and
|
||||
//! AIS_AnimationCamera, which could be enough for defining a simple animation. In general case,
|
||||
//! application is expected defining own AIS_Animation sub-classes implementing
|
||||
//! application-specific animation logic (e.g. another interpolation or another kind of
|
||||
//! transformations - like color transition and others). The basic conception of
|
||||
//! AIS_Animation::update() is defining an exact scene state for the current presentation
|
||||
//! timestamp, providing a smooth and continuous animation well defined at any time step and in
|
||||
//! any direction. So that a time difference between two sequential drawn Viewer frames can vary
|
||||
//! from frame to frame without visual artifacts, increasing rendering framerate would not lead to
|
||||
//! animation being executed too fast and low framerate (on slow hardware) would not lead to
|
||||
//! animation played longer than defined duration. Hence, implementation should avoid usage of
|
||||
//! incremental step logic or should apply it very carefully.
|
||||
//! AIS package provides limited number of such animation atoms - classes AIS_AnimationObject and AIS_AnimationCamera, which could be enough for defining a simple animation.
|
||||
//! In general case, application is expected defining own AIS_Animation sub-classes implementing application-specific animation logic
|
||||
//! (e.g. another interpolation or another kind of transformations - like color transition and others).
|
||||
//! The basic conception of AIS_Animation::update() is defining an exact scene state for the current presentation timestamp,
|
||||
//! providing a smooth and continuous animation well defined at any time step and in any direction.
|
||||
//! So that a time difference between two sequential drawn Viewer frames can vary from frame to frame without visual artifacts,
|
||||
//! increasing rendering framerate would not lead to animation being executed too fast
|
||||
//! and low framerate (on slow hardware) would not lead to animation played longer than defined duration.
|
||||
//! Hence, implementation should avoid usage of incremental step logic or should apply it very carefully.
|
||||
//!
|
||||
//! - Animation Container
|
||||
//! AIS_Animation (no sub-classing) can be used to aggregate a sequence of Animation items
|
||||
//! (children). Each children should be defined with its own duration and start time (presentation
|
||||
//! timestamp). It is possible defining collection of nested AIS_Animation items, so that within
|
||||
//! each container level children define start playback time relative to its holder.
|
||||
//! AIS_Animation (no sub-classing) can be used to aggregate a sequence of Animation items (children).
|
||||
//! Each children should be defined with its own duration and start time (presentation timestamp).
|
||||
//! It is possible defining collection of nested AIS_Animation items, so that within each container level
|
||||
//! children define start playback time relative to its holder.
|
||||
//!
|
||||
//! - Animation playback Controller
|
||||
//! It is suggested that application would define a single AIS_Animation instance (optional
|
||||
//! sub-classing) for controlling animation playback as whole. Such controller should be filled in
|
||||
//! by other AIS_Animation as children objects, and will be managed by application by calling
|
||||
//! StartTimer(), UpdateTimer() and IsStopped() methods.
|
||||
//! It is suggested that application would define a single AIS_Animation instance (optional sub-classing) for controlling animation playback as whole.
|
||||
//! Such controller should be filled in by other AIS_Animation as children objects,
|
||||
//! and will be managed by application by calling StartTimer(), UpdateTimer() and IsStopped() methods.
|
||||
//!
|
||||
//! Note, that AIS_Animation::StartTimer() defines a timer calculating an elapsed time, not a
|
||||
//! multimedia timer executing Viewer updates at specific intervals! Application should avoid using
|
||||
//! implicit and immediate Viewer updates to ensure that AIS_Animation::UpdateTimer() is called
|
||||
//! before each redrawing of a Viewer content. Redrawing logic should be also managed at application
|
||||
//! level for managing a smooth animation (by defining a multimedia timer provided by used GUI
|
||||
//! framework executing updates at desired framerate, or as continuous redraws in loop).
|
||||
//! Note, that AIS_Animation::StartTimer() defines a timer calculating an elapsed time, not a multimedia timer executing Viewer updates at specific intervals!
|
||||
//! Application should avoid using implicit and immediate Viewer updates to ensure that AIS_Animation::UpdateTimer() is called before each redrawing of a Viewer content.
|
||||
//! Redrawing logic should be also managed at application level for managing a smooth animation
|
||||
//! (by defining a multimedia timer provided by used GUI framework executing updates at desired framerate, or as continuous redraws in loop).
|
||||
class AIS_Animation : public Standard_Transient
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Animation, Standard_Transient)
|
||||
public:
|
||||
|
||||
//! Creates empty animation.
|
||||
Standard_EXPORT AIS_Animation(const TCollection_AsciiString& theAnimationName);
|
||||
Standard_EXPORT AIS_Animation (const TCollection_AsciiString& theAnimationName);
|
||||
|
||||
//! Destruct object, clear arguments
|
||||
Standard_EXPORT virtual ~AIS_Animation();
|
||||
@@ -88,14 +76,15 @@ public:
|
||||
const TCollection_AsciiString& Name() const { return myName; }
|
||||
|
||||
public:
|
||||
|
||||
//! @return start time of the animation in the timeline
|
||||
Standard_Real StartPts() const { return myPtsStart; }
|
||||
|
||||
//! Sets time limits for animation in the animation timeline
|
||||
void SetStartPts(const Standard_Real thePtsStart) { myPtsStart = thePtsStart; }
|
||||
void SetStartPts (const Standard_Real thePtsStart) { myPtsStart = thePtsStart; }
|
||||
|
||||
//! @return duration of the animation in the timeline
|
||||
Standard_Real Duration() const { return Max(myOwnDuration, myChildrenDuration); }
|
||||
Standard_Real Duration() const { return Max (myOwnDuration, myChildrenDuration); }
|
||||
|
||||
//! Update total duration considering all animations on timeline.
|
||||
Standard_EXPORT void UpdateTotalDuration();
|
||||
@@ -107,50 +96,49 @@ public:
|
||||
Standard_Real OwnDuration() const { return myOwnDuration; }
|
||||
|
||||
//! Defines duration of the animation.
|
||||
void SetOwnDuration(const Standard_Real theDuration) { myOwnDuration = theDuration; }
|
||||
void SetOwnDuration (const Standard_Real theDuration) { myOwnDuration = theDuration; }
|
||||
|
||||
//! Add single animation to the timeline.
|
||||
//! @param theAnimation input animation
|
||||
Standard_EXPORT void Add(const Handle(AIS_Animation)& theAnimation);
|
||||
Standard_EXPORT void Add (const Handle(AIS_Animation)& theAnimation);
|
||||
|
||||
//! Clear animation timeline - remove all animations from it.
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Return the child animation with the given name.
|
||||
Standard_EXPORT Handle(AIS_Animation) Find(const TCollection_AsciiString& theAnimationName) const;
|
||||
Standard_EXPORT Handle(AIS_Animation) Find (const TCollection_AsciiString& theAnimationName) const;
|
||||
|
||||
//! Remove the child animation.
|
||||
Standard_EXPORT Standard_Boolean Remove(const Handle(AIS_Animation)& theAnimation);
|
||||
Standard_EXPORT Standard_Boolean Remove (const Handle(AIS_Animation)& theAnimation);
|
||||
|
||||
//! Replace the child animation.
|
||||
Standard_EXPORT Standard_Boolean Replace(const Handle(AIS_Animation)& theAnimationOld,
|
||||
const Handle(AIS_Animation)& theAnimationNew);
|
||||
Standard_EXPORT Standard_Boolean Replace (const Handle(AIS_Animation)& theAnimationOld,
|
||||
const Handle(AIS_Animation)& theAnimationNew);
|
||||
|
||||
//! Clears own children and then copy child animations from another object.
|
||||
//! Copy also Start Time and Duration values.
|
||||
Standard_EXPORT void CopyFrom(const Handle(AIS_Animation)& theOther);
|
||||
Standard_EXPORT void CopyFrom (const Handle(AIS_Animation)& theOther);
|
||||
|
||||
//! Return sequence of child animations.
|
||||
const NCollection_Sequence<Handle(AIS_Animation)>& Children() const { return myAnimations; }
|
||||
|
||||
public:
|
||||
|
||||
//! Start animation with internally defined timer instance.
|
||||
//! Calls ::Start() internally.
|
||||
//!
|
||||
//! Note, that this method initializes a timer calculating an elapsed time (presentation
|
||||
//! timestamps within AIS_Animation::UpdateTimer()), not a multimedia timer executing Viewer
|
||||
//! updates at specific intervals! Viewer redrawing should be managed at application level, so
|
||||
//! that AIS_Animation::UpdateTimer() is called once right before each redrawing of a Viewer
|
||||
//! content.
|
||||
//! Note, that this method initializes a timer calculating an elapsed time (presentation timestamps within AIS_Animation::UpdateTimer()),
|
||||
//! not a multimedia timer executing Viewer updates at specific intervals!
|
||||
//! Viewer redrawing should be managed at application level, so that AIS_Animation::UpdateTimer() is called once right before each redrawing of a Viewer content.
|
||||
//!
|
||||
//! @param theStartPts starting timer position (presentation timestamp)
|
||||
//! @param thePlaySpeed playback speed (1.0 means normal speed)
|
||||
//! @param theToUpdate flag to update defined animations to specified start position
|
||||
//! @param theToStopTimer flag to pause timer at the starting position
|
||||
Standard_EXPORT virtual void StartTimer(const Standard_Real theStartPts,
|
||||
const Standard_Real thePlaySpeed,
|
||||
const Standard_Boolean theToUpdate,
|
||||
const Standard_Boolean theToStopTimer = Standard_False);
|
||||
Standard_EXPORT virtual void StartTimer (const Standard_Real theStartPts,
|
||||
const Standard_Real thePlaySpeed,
|
||||
const Standard_Boolean theToUpdate,
|
||||
const Standard_Boolean theToStopTimer = Standard_False);
|
||||
|
||||
//! Update single frame of animation, update timer state
|
||||
//! @return current time of timeline progress.
|
||||
@@ -163,13 +151,14 @@ public:
|
||||
const Handle(Media_Timer)& Timer() const { return myTimer; }
|
||||
|
||||
//! Set playback timer.
|
||||
void SetTimer(const Handle(Media_Timer)& theTimer) { myTimer = theTimer; }
|
||||
void SetTimer (const Handle(Media_Timer)& theTimer) { myTimer = theTimer; }
|
||||
|
||||
public:
|
||||
|
||||
//! Start animation. This method changes status of the animation to Started.
|
||||
//! This status defines whether animation is to be performed in the timeline or not.
|
||||
//! @param theToUpdate call Update() method
|
||||
Standard_EXPORT virtual void Start(const Standard_Boolean theToUpdate);
|
||||
Standard_EXPORT virtual void Start (const Standard_Boolean theToUpdate);
|
||||
|
||||
//! Pause the process timeline.
|
||||
Standard_EXPORT virtual void Pause();
|
||||
@@ -185,17 +174,19 @@ public:
|
||||
//! Update single frame of animation, update timer state
|
||||
//! @param[in] thePts the time moment within [0; Duration()]
|
||||
//! @return True if timeline is in progress
|
||||
Standard_EXPORT virtual Standard_Boolean Update(const Standard_Real thePts);
|
||||
Standard_EXPORT virtual Standard_Boolean Update (const Standard_Real thePts);
|
||||
|
||||
protected:
|
||||
//! Process one step of the animation according to the input time progress, including all
|
||||
//! children. Calls also ::update() to update own animation.
|
||||
Standard_EXPORT virtual void updateWithChildren(const AIS_AnimationProgress& thePosition);
|
||||
|
||||
//! Process one step of the animation according to the input time progress, including all children.
|
||||
//! Calls also ::update() to update own animation.
|
||||
Standard_EXPORT virtual void updateWithChildren (const AIS_AnimationProgress& thePosition);
|
||||
|
||||
//! Update the own animation to specified position - should be overridden by sub-class.
|
||||
virtual void update(const AIS_AnimationProgress& theProgress) { (void)theProgress; }
|
||||
virtual void update (const AIS_AnimationProgress& theProgress) { (void )theProgress; }
|
||||
|
||||
protected:
|
||||
|
||||
//! Defines animation state.
|
||||
enum AnimationState
|
||||
{
|
||||
@@ -205,15 +196,18 @@ protected:
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Media_Timer) myTimer;
|
||||
|
||||
TCollection_AsciiString myName; //!< animation name
|
||||
NCollection_Sequence<Handle(AIS_Animation)> myAnimations; //!< sequence of child animations
|
||||
TCollection_AsciiString myName; //!< animation name
|
||||
NCollection_Sequence<Handle(AIS_Animation)>
|
||||
myAnimations; //!< sequence of child animations
|
||||
|
||||
AnimationState myState; //!< animation state - started, stopped of paused
|
||||
Standard_Real myPtsStart; //!< time of start in the timeline
|
||||
Standard_Real myOwnDuration; //!< duration of animation excluding children
|
||||
Standard_Real myChildrenDuration; //!< duration of animation including children
|
||||
|
||||
AnimationState myState; //!< animation state - started, stopped of paused
|
||||
Standard_Real myPtsStart; //!< time of start in the timeline
|
||||
Standard_Real myOwnDuration; //!< duration of animation excluding children
|
||||
Standard_Real myChildrenDuration; //!< duration of animation including children
|
||||
};
|
||||
|
||||
#endif // _AIS_Animation_HeaderFile
|
||||
|
@@ -15,35 +15,37 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_AnimationAxisRotation, AIS_BaseAnimationObject)
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
AIS_AnimationAxisRotation::AIS_AnimationAxisRotation(
|
||||
const TCollection_AsciiString& theAnimationName,
|
||||
const Handle(AIS_InteractiveContext)& theContext,
|
||||
const Handle(AIS_InteractiveObject)& theObject,
|
||||
const gp_Ax1& theAxis,
|
||||
const Standard_Real theAngleStart,
|
||||
const Standard_Real theAngleEnd)
|
||||
: AIS_BaseAnimationObject(theAnimationName, theContext, theObject),
|
||||
myRotAxis(theAxis),
|
||||
myAngleStart(theAngleStart),
|
||||
myAngleEnd(theAngleEnd)
|
||||
//=============================================================================
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
AIS_AnimationAxisRotation::AIS_AnimationAxisRotation (const TCollection_AsciiString& theAnimationName,
|
||||
const Handle(AIS_InteractiveContext)& theContext,
|
||||
const Handle(AIS_InteractiveObject)& theObject,
|
||||
const gp_Ax1& theAxis,
|
||||
const Standard_Real theAngleStart,
|
||||
const Standard_Real theAngleEnd)
|
||||
: AIS_BaseAnimationObject (theAnimationName, theContext, theObject),
|
||||
myRotAxis (theAxis),
|
||||
myAngleStart (theAngleStart),
|
||||
myAngleEnd (theAngleEnd)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
|
||||
void AIS_AnimationAxisRotation::update(const AIS_AnimationProgress& theProgress)
|
||||
//=============================================================================
|
||||
//function : update
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void AIS_AnimationAxisRotation::update (const AIS_AnimationProgress& theProgress)
|
||||
{
|
||||
if (myObject.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gp_Trsf aTrsf;
|
||||
Standard_Real aCurrentAngle =
|
||||
(1.0 - theProgress.LocalNormalized) * myAngleStart + theProgress.LocalNormalized * myAngleEnd;
|
||||
aTrsf.SetRotation(myRotAxis, aCurrentAngle);
|
||||
updateTrsf(aTrsf);
|
||||
gp_Trsf aTrsf;
|
||||
Standard_Real aCurrentAngle = (1.0 - theProgress.LocalNormalized) * myAngleStart + theProgress.LocalNormalized * myAngleEnd;
|
||||
aTrsf.SetRotation (myRotAxis, aCurrentAngle);
|
||||
updateTrsf (aTrsf);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user