1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

Compare commits

..

19 Commits

Author SHA1 Message Date
dpasukhi
bd2a789f15 Update version to 7.8.1 2024-03-31 23:05:22 +01:00
dpasukhi
a4e91f855b 0033656: Foundation Classes - Standard_Type crash during unloading static lib
Revert changes to use type_info as a key to use string.
Impact - performance decrease to search (once per class registration)
Will be updated with reorganizing type storage in future
2024-03-31 23:05:22 +01:00
oan
9efc032b9a 0033560: PARASOLID Import - XT importer raises exception SIGFPE Arithmetic Exception
Prevent division by zero in exceptional cases when vector of parameters contains only a single value.
2024-03-31 22:46:06 +01:00
ichesnok
44cbb3d8e7 0033410: Data Exchange, Step Import - TRIANGULATED_FACE from STEP where there are no pnval entries
Problem fixed by using array of nodes in case when aPnindices is empty.
2024-03-31 22:42:35 +01:00
astromko
392377a331 0033367: Modeling Algorithms - Normal projection or BOP problem [Regression]
Fixed passing of an incorrect curve into GeomAdaptor::MakeCurve() function.
2024-03-31 22:42:24 +01:00
astromko
6635f53848 0031601: Modeling Algorithms - BRepOffset_Tool Segmentation Fault
Added protection against null pointer dereferencing.
Modified BRepOffset_MakeOffset::MakeThickSolid method.
Fixed the problem with negative volume values.
Fixed several unit tests and added a new one.
2024-03-31 22:42:16 +01:00
ichesnok
f7f32bf33e 0033638: Data Exchange, Step Import - Style for tessellated object missed
TransferBRep_ShapeBinder used for tessellated face.
2024-03-31 22:41:14 +01:00
ichesnok
c1620d29fa 0033631: Data Exchange, Step import - Crash by reading STEP file
Creating Poly_Triangulation from ComplexTriangulatedSurfaceSet was fixed.
2024-03-31 22:41:08 +01:00
ichesnok
92e70f93d0 0033603: Data Exchange, Step Import - Crash reading corrupted STEP file
Crash fixed by checking IsNull().
2024-03-31 22:41:02 +01:00
ichesnok
54754bccab 0033602: Data Exchange, Step - Carriage return removing
Carriage removing integrated
2024-03-31 22:40:54 +01:00
ichesnok
33a5691ef1 0033596: Documentation - Incorrect default value read.step.tessellated
Default value of read.step.tessellated corrected.
2024-03-31 22:40:25 +01:00
abv
689b59692e 0025415: Data Exchange - Invalid result of loading a STEP file
Handling of special case found on some STEP files produced by FPX Expert 2013 (PCB design system):
edge curve is line displaced from its true position but with correct direction;
we shift the line in this case so that it passes through vertices correcty.

Protection against possible exception in writing XDE.
2024-03-31 22:40:18 +01:00
astromko
c7fd6ca63b 0033383: Modeling Algorithms - Wire/Face creation problem
ProjCurve3d and BRepAlgo_FaceRestrictor::Perform functions should not continue to work and should terminate if the BRep_Tool::Curve function returns null pointer.
2024-03-31 22:40:08 +01:00
ichesnok
9704e22131 0033261: Data Exchange, Step Import - Empty shape after reading process
Added a transfer for ShapeRepresentationRelationship in Transfer of MappedItem method,
in order to support link of components according to ISO 10303-203-2003.
2024-03-31 22:40:00 +01:00
ichesnok
f3f713569a 0033569: Data Exchange, STEP - Crash when reading multi-body file
Datum reading changed in ReadDatums() method:
using DatumSystemAP242 (DatumSystem or DatumReference) array
instead of DatumSystem array (DatumReference)
2024-03-31 22:39:52 +01:00
ichesnok
db976e0a59 0025188: Data Exchange, Step Export - Losing shapes after import
Check on null for description added to WriteStep methods
(for product, product_definition and product_definition_formation)
2024-03-31 22:39:42 +01:00
ichesnok
ee8f2ea3c2 0032980: Data Exchange - STEP import produce a crash
Check on null for loop added
2024-03-31 22:39:34 +01:00
oan
58393b24b6 0033567: Modeling Data - GeomLib_IsPlanarSurface raises exception SIGFPE Arithmetic Exception in Release mode
Add protection against zero-division
2024-03-31 22:39:22 +01:00
dpasukhi
b896c6f4af Update version to 7.8.1 dev 2024-03-31 22:39:07 +01:00
25620 changed files with 2464294 additions and 2495400 deletions

View File

@ -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

View File

@ -1,2 +0,0 @@
# Global formatting with new rules using clang-format 18.1.8
a5a7b3185b83c39d5b26cfaf138b9b87b5776e59

59
.github/CLA.md vendored
View File

@ -1,59 +0,0 @@
# Contributor License Agreement - OPEN CASCADE TECHNOLOGY
Thank You for Your interest in Open CASCADE Technology.
In order to clarify the intellectual property rights and the license granted to OPEN CASCADE SAS with contributions from You, any person or entity, OPEN CASCADE SAS must have this Contributor License Agreement (hereinafter referred to as "CLA") signed by You, indicating Your acceptance and consent to the license terms below. This license is for Your protection as a contributor as well as for the protection of OPEN CASCADE SAS and its users; it does not change Your rights to use Your own contributions for any other purpose.
This CLA applies to any contribution that You make to the product "Open CASCADE Technology" (hereinafter referred to as "OCCT", "the Product") developed by OPEN CASCADE SAS, including all contributions You made prior to signing this CLA and all of Your future contributions submitted to OPEN CASCADE SAS as long as You agree to this CLA, and sets out the intellectual property rights You grant to OPEN CASCADE SAS in the contributed materials. The term "us" shall also mean OPEN CASCADE SAS.
The term "You" shall mean the person or entity identified below, representing the copyright owner or legal entity authorized by the copyright owner that is making this agreement with OPEN CASCADE SAS. For legal entities, the entity making a contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single contributor. For the purposes of this definition, "control" means (i) the power, either direct or indirect, to exert influence on the direction or management of such entity, whether by contract or otherwise, or (ii) the ownership of fifty percent (50%) or more of the outstanding shares, or (iii) the beneficial ownership of such entity.
Read this CLA carefully before signing and keep a copy for Your records. This CLA, its terms and conditions, constitute a binding legal agreement.
If You agree to be bound by the terms of this CLA, please complete and sign this CLA where indicated below, then scan and submit the scanned copy as a PDF file to OPEN CASCADE SAS via Your user account section on the Web portal. Alternatively, You may send the signed CLA to OPEN CASCADE SAS by facsimile or in hard copy to the attention of DANIEL BRUNIER-COULIN at OPEN CASCADE SAS headquarters using the contact information provided in the "Contact Us" section.
1. The term "contribution" or "contributed materials" means any source code, object code, patch, tool, sample, graphic, specification, manual, documentation, any original work of authorship, including any modifications or additions to an existing work or any other material intentionally posted or submitted by You to us. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to OPEN CASCADE SAS or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, OPEN CASCADE SAS for the purpose of, but not limited to, discussing and improving a work or possible integration to future certified releases of OCCT, but excluding communication that is conspicuously marked or otherwise designated in writing by You or OPEN CASCADE SAS as "Not A Contribution" or "NAC".
2. With respect to any worldwide copyrights, or copyright applications and registrations, in Your contribution:
a) You hereby assign to OPEN CASCADE SAS joint ownership, and to the extent that such assignment is or becomes invalid, ineffective or unenforceable, You hereby grant to OPEN CASCADE SAS a perpetual, irrevocable, non-exclusive, worldwide, no-charge, royalty-free, unrestricted license to exercise all rights under the intellectual property law and rules in force or under the copyright if chosen by OPEN CASCADE SAS. This includes, at the option of OPEN CASCADE SAS, the right to sublicense these same rights to third parties through multiple levels of sub-licensees or other licensing arrangements;
b) You agree that OPEN CASCADE SAS can do all things in relation to Your contribution as if OPEN CASCADE SAS were its sole owner, and if OPEN CASCADE SAS makes a derivative work of Your contribution, OPEN CASCADE SAS will be the sole owner of that derivative work;
c) You agree that You will not assert any moral rights in Your contribution against OPEN CASCADE SAS, our licensees or transferees;
d) You agree that OPEN CASCADE SAS may register a copyright or any other intellectual property law in force in Your contribution and exercise all ownership rights associated with it; and
e) You agree that OPEN CASCADE SAS has no duty to consult with, obtain the consent of, pay or render an accounting to You or any third parties for any use or distribution of Your contribution.
3. With respect to any patents You own, or that You can license without payment to any third party, You hereby grant to OPEN CASCADE SAS a perpetual, irrevocable, non-exclusive, worldwide, no-charge, royalty-free, unrestricted license to:
a) make, have made, use, sell, offer to sell, import, and otherwise transfer Your contribution in whole or in part, alone or in combination with or included in any product, work or materials arising out of the Product which Your contribution was submitted for;
b) sublicense these same rights to third parties through multiple levels of sub-licensees or other licensing arrangements; and
c) reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your contributions and such derivative works.
4. Except as set out above, You keep all right, title, and interest in Your contribution. The rights that You grant to OPEN CASCADE SAS under these terms are effective on the date You first submitted a contribution to OPEN CASCADE SAS, even if Your submission took place before the date You sign these terms. Any contribution OPEN CASCADE SAS makes available under any license will also be made available under the Open Cascade Technology Public License (OCCTPL) or a suitable FSF (Free Software Foundation) or OSI (Open Source Initiative) approved license, if adopted by OPEN CASCADE SAS.
5. You covenant, represent and warrant that:
a) each contribution that You submit is and shall be an original work of authorship and that You can legally grant the rights set out in this CLA; and
b) each contribution will not violate any third party's copyrights, trademarks, patents, or other intellectual property rights; and
c) if any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your contribution, or the work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this CLA for that contribution or work shall terminate as of the date such litigation is filed; and
d) You have received permission to make contributions on behalf of the employer, that Your employer has waived such rights for Your contributions to OPEN CASCADE SAS, or that Your employer (that has rights to intellectual property that You create that includes Your contributions) has executed a separate corporate CLA with OPEN CASCADE SAS.
6. Should You wish to submit work that is not Your original creation, You may submit it to OPEN CASCADE SAS separately from any contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements), and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
7. You agree to notify OPEN CASCADE SAS if You become aware of any circumstance which would make any of the foregoing representations inaccurate in any respect. OPEN CASCADE SAS may publicly disclose Your contribution to the Product and the fact that You have signed this CLA.
8. You are not expected to provide support for Your contributions, except to the extent You desire to provide support.
9. This CLA is governed by the laws of France or an applicable law at the sole written choice of OPEN CASCADE SAS.
10. You may stop being bound by the terms of this CLA at any time, for any reason, by asking OPEN CASCADE through the Contact Us form. Even after its termination, this CLA still applies to all contributions You made prior to terminating the CLA. On the other hand, if You want to contribute again, You'll need to sign a new CLA.
[Contributor_License_Agreement.pdf](https://dev.opencascade.org/sites/default/files/Contributor_License_Agreement.pdf)

View File

@ -1,39 +0,0 @@
# Signing the Contributor License Agreement
## In order to contribute code to OCCT, you (or the legal entity you represent) must sign the Contributor License Agreement (CLA).
### What is the Contributor License Agreement and why is it necessary to sign it?
The Contributor License Agreement is needed to clarify the terms of usage of contributions by OPEN CASCADE SAS and the entire open source community.
The Contributor License Agreement clarifies the intellectual property rights applicable to contributions. It confirms that the contributor retains ownership of his contributions (the OPEN CASCADE company does not require exclusive copyright transfer for these contributions) and gives all rights to OPEN CASCADE to use the contribution. In turn, OPEN CASCADE guarantees the open source availability of all integrated contributions.
### How to sign the Contributor License Agreement
Accepting and signing the Contributor License Agreement is a prerequisite for contributing code. To sign the CLA, please register yourself first, and then follow the steps below:
1. Select the "Get Involved" menu
2. Download the Contribution License Agreement pdf file and print it
3. Read the agreement and sign it
4. Scan the signed CLA to a pdf file
5. If not yet done, log on to this website
6. In the CLA sending form, press the "Browse" button
7. Select your signed CLA file
8. Press "Send"
We will need some time to approve the CLA that you have submitted. You will be notified by e-mail when your CLA is approved and you are assigned the Contributor role.
### Q&A on the Contribution Agreement
**I want to contribute code that I developed as part of my job. Can I contribute this code?**
Yes, but as (under applicable legislation) your employer typically will own all intellectual property that you create as part of your employment, it is important that your employer has consented to your participation and contributions in the OCCT Project. That provides clarity to all parties involved.
**Can we sign a CLA to enable contributions from several employees in our company?**
Yes, if your company has several employees ready to contribute, a person representing your company can sign the CLA whereby your employer can specify and manage who is able to contribute from your company.
**I want to notify the OCCT Project of a bug I found. Can I report this bug?**
Yes, you simply need to register (you then become a Member) for entering a bug. The bug can be entered using our bug tracker from the Get Involved page. But please note that as a Member of this project, you have accepted the Terms and Conditions of this website, so the materials you provide must conform to these Terms.
**Can I terminate my Contributor License Agreement?**
Yes, you may terminate your Contributor License Agreement by sending a written notice through the contact form of this portal. The termination of your CLA will become effective not later than 5 days from the notice date. Please note, however, that all contributions you might have made to the OCCT Project before your CLA termination remain covered by that CLA.

View File

@ -1,41 +0,0 @@
# Contributing to OCCT
## Contribute Code
In order to contribute code to OCCT, you must register on this [portal](https://dev.opencascade.org/) and sign the Contributor License Agreement (CLA).
- [Introduction: What is CLA and Why It Is Needed?](CLA_SIGNING.md)
- [Contribution License Agreement](CLA.md)
- [CLA Submission Form](https://dev.opencascade.org/get_involed/cla_submission_form)
### Steps to Submit Your Contribution
1. **Clone OCCT Git Repository**: See [Guide to installing and using Git for OCCT development](https://dev.opencascade.org/doc/overview/html/occt_contribution__git_guide.html) if you are not familiar with Git.
2. **Develop Your Change**: Ensure it complies with [OCCT Coding Rules](https://dev.opencascade.org/doc/overview/html/occt_contribution__coding_rules.html).
3. **Build and Verify**: Build the modified version of OCCT and verify it works as expected. Consider creating a test case.
4. **Register an Issue**: Register an issue in the [Mantis bug tracker](https://tracker.dev.opencascade.org/login_select_proj_page.php?ref=bug_report_page.php) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues) describing your change.
5. **Push Your Change**: Push your change to the Git repository in a branch with a name starting with "CR" followed by the issue ID, then switch the issue to Resolved.
The contribution then passes code review and testing; if everything is OK, it will be integrated into the master branch in about one week.
See [Contribution Workflow](https://dev.opencascade.org/doc/overview/html/occt_contribution__contribution_workflow.html) for other possibilities and details on how contributions are processed.
For more details on integration into GitHub, see the [GitHub Discussions Guide](https://github.com/Open-Cascade-SAS/OCCT/discussions/36).
## Contribute Ideas
Every big thing starts with an idea. We appreciate your vision on how to enhance Open CASCADE technology. Share your thoughts on the [OCCT product development forum](https://dev.opencascade.org/forums) or submit your meaningful ideas and bug reports via [Mantis tracker](https://tracker.dev.opencascade.org) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues).
- **Forum**: [OCCT product development forum](https://dev.opencascade.org/forums)
- **Reporting Issues**: [Mantis tracker](https://tracker.dev.opencascade.org) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues)
## Contribute Knowledge
Know a lot about OCCT? You can help educate other OCCT users by writing OCCT-related articles or blog posts, creating samples, examples, or tutorials, and even by writing a book about OCCT! If you would like us to share your content via official OCCT resources, please [contact us](https://dev.opencascade.org/webform/contact_us).
## Contribute Documentation and Tutorials
Do you have an idea on how to make OCCT Documentation easier for new users or even more exhaustive for professionals? Or want to help with proofreading and technical writing? Translating OCCT Documentation and materials into your native language is also very much appreciated. You are always welcome to submit your documentation improvement suggestions via [Mantis tracker](https://tracker.dev.opencascade.org) or [GitHub issues](https://github.com/Open-Cascade-SAS/OCCT/issues)..
## Contribute to the Community
At any community interaction points, we value your support in starting forum topics or replying to other users posts, joining Open CASCADE social networks, participating in GitHub or Stack Overflow projects, and just spreading the word about OCCT! Welcome to our community!

View File

@ -1,92 +0,0 @@
name: "Bug Report"
description: "Report a bug related to the OCCT"
labels: ["2. Bug", "0. New"]
body:
- type: markdown
attributes:
value: |
**Please provide the following information:**
- type: textarea
id: description
attributes:
label: Description
description: "A detailed description of the bug"
validations:
required: true
- type: textarea
id: expected_behavior
attributes:
label: Expected Behavior
description: "What you expected to happen"
validations:
required: true
- type: textarea
id: actual_behavior
attributes:
label: Actual Behavior
description: "What actually happened"
validations:
required: true
- type: textarea
id: sample_code
attributes:
label: Sample Code or DRAW Tcl Script
description: "Provide a C++ sample or DRAW Tcl script to reproduce the issue"
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating System
description: "Select the operating system"
options:
- Linux
- Windows
- macOS
default: 0
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
default: 0
validations:
required: true
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
default: 1
validations:
required: true
- type: dropdown
id: occt_version
attributes:
label: OCCT Version
description: "Select the OCCT version where the issue was detected"
options:
- 7.4
- 7.5
- 7.6
- 7.7
- 7.8
- 7.9
- latest
default: 6
validations:
required: true
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@ -1,34 +0,0 @@
name: "Feature Request"
description: "Request a new feature or enhancement for the OCCT"
labels: ["2. Enhancement", "0. New"]
body:
- type: markdown
attributes:
value: |
**Please provide the following information:**
- type: textarea
id: description
attributes:
label: Description
description: "A detailed description of the feature request"
validations:
required: true
- type: textarea
id: use_case
attributes:
label: Use Case
description: "Describe the use case for the feature"
validations:
required: true
- type: textarea
id: benefits
attributes:
label: Benefits
description: "Explain the benefits of the feature"
validations:
required: true
- type: textarea
id: additional_context
attributes:
label: Additional Context
description: "Any additional context or information"

View File

@ -1,14 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Collaborative development portal
url: https://dev.opencascade.org/forums
about: You can also use the collaborative development portal to ask questions and discuss the problem you are seeing
- name: GitHub discussions
url: https://github.com/Open-Cascade-SAS/OCCT/discussions
about: You can also use GitHub discussions to ask questions and discuss the problem you are seeing
- name: Mantis bug tracker
url: https://tracker.dev.opencascade.org/
about: You can also use the Mantis bug tracker to report bugs and issues
- name: Contact US form
url: https://dev.opencascade.org/webform/contact_us
about: You can also use the Contact US form to ask questions and discuss the problem you are seeing

View File

@ -1,68 +0,0 @@
name: Build Documentation
description: 'Build OCCT documentation using doxygen'
runs:
using: composite
steps:
- name: Install dependencies
run: |
choco install -y graphviz
choco install -y doxygen.install
shell: pwsh
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Configure OCCT
run: |
mkdir build
cd build
cmake -T host=x64 `
-D USE_FREETYPE=ON `
-D USE_TK=OFF `
-D BUILD_USE_PCH=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_INCLUDE_SYMLINK=ON `
-D CMAKE_BUILD_TYPE=Release `
-D BUILD_DOC_Overview=ON `
-D BUILD_DOC_RefMan=ON `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D USE_D3D=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=ON `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="/W4 /WX" `
-D CMAKE_C_FLAGS="/W4 /WX" ..
shell: pwsh
- name: Build documentation
run: |
set PATH=%PATH%;C:\Program Files\doxygen\bin;C:\Program Files\Graphviz\bin;C:\Program Files\doxygen
cd build
cmake --build . --target doc --config Release
shell: cmd
- name: Upload refman documentation
uses: actions/upload-artifact@v4.4.3
with:
name: refman-doc
path: build/doc/refman
retention-days: 90
- name: Upload overview documentation
uses: actions/upload-artifact@v4.4.3
with:
name: overview-doc
path: build/doc/overview
retention-days: 90

View File

@ -1,57 +0,0 @@
name: 'Build CSharp Sample'
description: 'Build CSharp sample using OCCT installation'
inputs:
platform:
description: 'Build platform (windows)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Build CSharp Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
cd ${{ github.workspace }}/samples/CSharp
REM First upgrade solutions to VS2022
echo "Upgrading solution files to VS2022..."
devenv.exe CSharp.sln /upgrade
devenv.exe CSharp_D3D.sln /upgrade
REM Update project platform toolset
powershell -Command "(Get-Content OCCTProxy\OCCTProxy.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy\OCCTProxy.vcxproj"
powershell -Command "(Get-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj) -replace '<PlatformToolset>v100</PlatformToolset>', '<PlatformToolset>v143</PlatformToolset>' | Set-Content OCCTProxy_D3D\OCCTProxy_D3D.vcxproj"
REM Restore NuGet packages
echo "Upgrading solution files..."
msbuild.exe CSharp.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_csharp.log;Verbosity=detailed
msbuild.exe CSharp_D3D.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore_d3d.log;Verbosity=detailed
REM Build solutions with real-time console output
echo "Building CSharp.sln..."
msbuild.exe CSharp.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_csharp.log;Verbosity=detailed /m
echo "Building CSharp_D3D.sln..."
msbuild.exe CSharp_D3D.sln /p:Configuration=Release /p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build_d3d.log;Verbosity=detailed /m
- name: Upload CSharp Sample
uses: actions/upload-artifact@v4.4.3
with:
name: csharp-sample-${{ inputs.platform }}-x64
path: samples/CSharp
retention-days: 7

View File

@ -1,54 +0,0 @@
name: 'Build MFC Sample'
description: 'Build MFC sample using OCCT installation'
inputs:
platform:
description: 'Build platform (windows)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Build MFC Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
cd ${{ github.workspace }}/samples/mfc/standard
set "PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
REM First restore the solution
echo "Restoring solution..."
msbuild.exe ALL-vc14.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=restore.log;Verbosity=detailed
REM Build solution with detailed logging
echo "Building solution..."
msbuild.exe ALL-vc14.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=build.log;Verbosity=detailed /m
REM Display logs if build fails
if errorlevel 1 (
echo "Build failed. Contents of restore.log:"
type restore.log
echo "Contents of build.log:"
type build.log
exit /b 1
)
- name: Upload MFC Sample
uses: actions/upload-artifact@v4.4.3
with:
name: mfc-sample-${{ inputs.platform }}-x64
path: samples/mfc/
retention-days: 7

View File

@ -1,108 +0,0 @@
name: 'Build Qt Sample'
description: 'Build Qt samples using OCCT installation'
inputs:
platform:
description: 'Build platform (windows/linux)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
thirdparty_url:
description: 'URL to download 3rdparty dependencies'
required: false
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
- name: Setup MSBuild
if: inputs.platform == 'windows'
uses: microsoft/setup-msbuild@v2
- name: Build Qt Samples - Windows
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
cd ${{ github.workspace }}/occt-install/
call env.bat vc14 win64 Release
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x64
REM Setup Qt environment
set "QTDIR=${{ github.workspace }}\3rdparty-vc14-64\qt5.11.2-vc14-64"
set "PATH=%QTDIR%\bin;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE;%PATH%"
cd ${{ github.workspace }}/samples/qt
for %%s in (IESample Tutorial FuncDemo) do (
cd %%s
echo "Generating project for %%s..."
qmake -tp vc -r -o %%s.sln %%s0.pro
echo "Restoring %%s..."
msbuild.exe %%s.sln -t:Restore -p:Configuration=Release -p:Platform=x64 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_restore.log;Verbosity=detailed
echo "Building %%s..."
msbuild.exe %%s.sln /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143 /consoleloggerparameters:Verbosity=normal;Summary /flp:LogFile=%%s_build.log;Verbosity=detailed /m
REM Display logs if build fails
if errorlevel 1 (
echo "Build failed for %%s. Contents of restore log:"
type %%s_restore.log
echo "Contents of build log:"
type %%s_build.log
exit /b 1
)
cd ..
)
- name: Build Qt Samples - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd ${{ github.workspace }}/occt-install/bin
source env.sh
cd ${{ github.workspace }}/samples/qt
for sample in IESample Tutorial FuncDemo; do
cd $sample
aQMakePath=`which qmake`
host=`uname -s`
export STATION=$host
export RES_DIR="${{ github.workspace }}/samples/qt/${sample}/result"
qmake $sample.pro
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
make -j$aNbJobs release
cd ..
done
- name: Upload Qt Samples
uses: actions/upload-artifact@v4.4.3
with:
name: qt-samples-${{ inputs.platform }}-x64
path: |
samples/qt/
samples/qt/
retention-days: 7

View File

@ -1,93 +0,0 @@
name: 'Build TInspector'
description: 'Build TInspector using OCCT installation as a separate job'
inputs:
platform:
description: 'Build platform (windows/linux)'
required: true
install-artifact-name:
description: 'OCCT installation artifact name'
required: true
thirdparty_url:
description: 'URL to download 3rdparty dependencies'
required: false
default: 'https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip'
runs:
using: "composite"
steps:
- name: Download OCCT installation
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri ${{ inputs.thirdparty_url }} -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev qtbase5-dev qt5-qmake qtbase5-dev-tools qtdeclarative5-dev qttools5-dev qttools5-dev-tools
- name: Checkout TInspector
shell: bash
run: |
git clone https://github.com/Open-Cascade-SAS/Inspector.git inspector
cd inspector
git checkout 6da9ba776ef72a17dca3331974df4200024c7f34
- name: Configure TInspector - Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
cd inspector
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 `
-D CMAKE_BUILD_TYPE=Release `
-D BUILD_SHARED_LIBS=ON `
-D 3RDPARTY_DIR=${{ github.workspace }}//3rdparty-vc14-64 `
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install `
-D INSTALL_DIR=${{ github.workspace }}/inspector/install `
..
- name: Configure TInspector - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd inspector
mkdir build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install \
-D INSTALL_DIR=${{ github.workspace }}/inspector/install \
..
- name: Build TInspector - Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
cd inspector/build
cmake --build . --config Release --target install
- name: Build TInspector - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
cd inspector/build
make install -j$(nproc)
- name: Upload TInspector installation
uses: actions/upload-artifact@v4.4.3
with:
name: inspector-${{ inputs.platform }}-x64
path: inspector/install
retention-days: 7

View File

@ -1,85 +0,0 @@
name: 'Clang-Format Code Check'
description: 'Check code formatting of changed files using clang-format'
inputs:
base-ref:
description: 'Base reference to compare changes against'
required: true
default: 'master'
file-pattern:
description: 'Pattern to match files for formatting check'
required: false
default: '^(src)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
clang-format-version:
description: 'Required clang-format version'
required: false
default: '18.1.8'
outputs:
has-changes:
description: 'Whether any files needed formatting'
value: ${{ steps.git-check.outputs.has_changes }}
runs:
using: "composite"
steps:
- name: Check clang-format version
shell: pwsh
run: |
$version = clang-format --version
Write-Output "Detected clang-format version: $version"
$version | Select-String "${{ inputs.clang-format-version }}" >$null
if ($LASTEXITCODE -ne 0) {
echo "::error::Wrong clang-format version. Expected ${{ inputs.clang-format-version }}"
Write-Output "Error: Version mismatch - expected ${{ inputs.clang-format-version }}"
exit 1
}
- name: Get changed files
id: changed-files
shell: pwsh
run: |
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
Where-Object { $_ -match '${{ inputs.file-pattern }}' } |
Where-Object { Test-Path $_ }
$changedFiles | Set-Content "changed_files.txt"
if ($changedFiles.Count -gt 0) {
echo "has_files=true" >> $env:GITHUB_OUTPUT
}
- name: Check formatting
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
$files = Get-Content "changed_files.txt" | Where-Object { Test-Path $_ }
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
clang-format -i -style=file $_
}
- name: Check git status
id: git-check
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
git diff > format.patch
if ((Get-Item format.patch).length -gt 0) {
echo "has_changes=true" >> $env:GITHUB_OUTPUT
}
- name: Upload patch
if: steps.git-check.outputs.has_changes == 'true'
uses: actions/upload-artifact@v4
with:
name: format-patch
path: format.patch
- name: Failing step for formatting issues
if: steps.git-check.outputs.has_changes == 'true'
shell: pwsh
run: |
echo "::error::Files need formatting. To fix: 1. Download format.patch 2. \"git apply format.patch\" 3. Commit and push"
exit 1
branding:
icon: 'check-square'
color: 'green'

View File

@ -1,145 +0,0 @@
name: 'Run GTest Validation'
description: 'Execute GTest suite and validate results'
inputs:
platform:
description: 'Platform (windows, macos, linux)'
required: true
compiler:
description: 'Compiler (msvc, clang, gcc)'
required: true
install-artifact-name:
description: 'Name of the artifact containing the installed files'
required: true
artifact-suffix:
description: 'Suffix for the GTest results artifact name'
required: true
default: 'x64'
outputs:
has-failures:
description: 'Whether any tests failed'
value: ${{ steps.check-failures.outputs.has_failures }}
runs:
using: "composite"
steps:
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: install
- name: Download and extract 3rdparty dependencies for Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install macOS dependencies
if: inputs.platform == 'macos'
shell: bash
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freeimage draco glfw
- name: Install Linux dependencies
if: inputs.platform == 'linux'
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Setup Xvfb and Mesa for Linux
if: inputs.platform == 'linux'
uses: ./.github/actions/setup-xvfb-mesa
- name: Set execute permissions on Unix platforms
if: inputs.platform != 'windows'
shell: bash
run: |
chmod +x install/bin/OpenCascadeGTest
- name: Run OpenCascadeGTest on Windows
if: inputs.platform == 'windows'
id: run-gtest-windows
shell: cmd
run: |
cd install
call env.bat ${{ inputs.compiler == 'msvc' && 'vc14' || 'clang' }} win64 release
cd bin
set GTEST_OUTPUT=""
OpenCascadeGTest.exe --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
type gtest_output.log
exit /b 0
- name: Run OpenCascadeGTest on Unix platforms
if: inputs.platform != 'windows'
id: run-gtest-unix
shell: bash
env:
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
LIBGL_ALWAYS_SOFTWARE: 1
run: |
cd install/bin
source env.sh
./OpenCascadeGTest --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
cat gtest_output.log
- name: Upload GTest results
uses: actions/upload-artifact@v4.4.3
with:
name: gtest-results-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.artifact-suffix }}
path: |
install/bin/gtest_results.xml
install/bin/gtest_output.log
retention-days: 15
- name: Check for test failures on Windows
if: inputs.platform == 'windows'
id: check-failures-windows
shell: pwsh
run: |
cd install/bin
$log = Get-Content "gtest_output.log" -Raw
if ($log -match "\[\s+FAILED\s+\]") {
Write-Error "GTest failures detected in the output."
echo "has_failures=true" >> $env:GITHUB_OUTPUT
} else {
Write-Output "No GTest failures detected."
echo "has_failures=false" >> $env:GITHUB_OUTPUT
}
- name: Check for test failures on Unix
if: inputs.platform != 'windows'
id: check-failures-unix
shell: bash
run: |
cd install/bin
if grep -q "\[ FAILED \]" gtest_output.log; then
echo "::error::GTest failures detected in the output."
echo "has_failures=true" >> $GITHUB_OUTPUT
else
echo "No GTest failures detected."
echo "has_failures=false" >> $GITHUB_OUTPUT
fi
- name: Set combined output
id: check-failures
shell: bash
run: |
if [ "${{ inputs.platform }}" == "windows" ]; then
echo "has_failures=${{ steps.check-failures-windows.outputs.has_failures }}" >> $GITHUB_OUTPUT
else
echo "has_failures=${{ steps.check-failures-unix.outputs.has_failures }}" >> $GITHUB_OUTPUT
fi
- name: Fail job if tests failed
if: steps.check-failures.outputs.has_failures == 'true'
shell: bash
run: |
echo "::error::GTest failures detected"
exit 1

View File

@ -1,90 +0,0 @@
import os
import re
from bs4 import BeautifulSoup
from pathlib import Path
import glob
import os.path
def get_referenced_images(html_file):
# Get the directory containing the HTML file
html_dir = os.path.dirname(os.path.abspath(html_file))
with open(html_file, 'r', encoding='utf-8') as f:
soup = BeautifulSoup(f.read(), 'html.parser')
images = set()
# Extract direct image references
for img in soup.find_all('img'):
if src := img.get('src'):
# Convert relative path to absolute
abs_path = os.path.normpath(os.path.join(html_dir, src))
images.add(abs_path)
# Extract toggle references
for elem in soup.find_all(attrs={'onclick': True}):
onclick = elem['onclick']
paths = re.findall(r'diffimage_toggle\(this,"([^"]+)","([^"]+)"\)', onclick)
for src1, src2 in paths:
# Convert relative paths to absolute
abs_path1 = os.path.normpath(os.path.join(html_dir, src1))
abs_path2 = os.path.normpath(os.path.join(html_dir, src2))
images.add(abs_path1)
images.add(abs_path2)
return images
def cleanup_platform_images(results_dir, platform):
html_file = f"{results_dir}/current/{platform}/diff-*.html"
html_files = glob.glob(html_file)
if not html_files:
print(f"No diff HTML found for {platform}")
return
# Get referenced images from HTML
referenced = set()
for html in html_files:
images = get_referenced_images(html)
referenced.update(images)
# Convert relative paths to absolute
base_dir = Path(results_dir)
current_dir = base_dir / "current" / platform
master_dir = base_dir / "master" / platform
# Find all PNGs
png_files = set()
for directory in [current_dir, master_dir]:
for root, _, files in os.walk(directory):
for file in files:
if file.lower().endswith('.png'):
png_files.add(Path(root) / file)
# Remove unreferenced PNGs
for png in png_files:
if str(png) not in referenced:
try:
png.unlink()
except OSError as e:
print(f"Error removing {png}: {e}")
def main():
platforms = [
"windows-x64",
"windows-clang-x64",
"macos-x64",
"macos-gcc-x64",
"linux-clang-x64",
"linux-gcc-x64"
]
results_dir = Path("./").resolve()
for platform in platforms:
print(f"\nProcessing {platform}...")
cleanup_platform_images(results_dir, platform)
if __name__ == "__main__":
main()

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1 +0,0 @@
testgrid -outdir results/macos-x64 caf basic

View File

@ -1 +0,0 @@
testgrid -outdir results/macos-gcc-x64 caf basic

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -1,219 +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",
compiler_flags: "",
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
package: "mingw-w64-clang-x86_64-toolchain",
thirdparty_dir: "/clang64",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Wall -Wextra\"",
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "UCRT",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-ucrt-x86_64-toolchain",
thirdparty_dir: "/ucrt64",
compiler_flags: "",
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"
}
build_type: [Debug, Release]
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_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
shell: msys2 {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -- -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=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- 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=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full static
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- 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=${{ matrix.build_type }} \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full with DEBUG define
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@ -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_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Download and extract Mesa3D
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
- 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=Default `
-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

View File

@ -1,180 +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++",
compiler_flags: ""
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Werror -Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Werror -Wall -Wextra\""
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.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_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -- -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=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-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 \
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- 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=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-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 \
${{ matrix.config.compiler_flags }} ..
- name: Build full static
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- 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=${{ matrix.build_type }} \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-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 ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@ -1,102 +0,0 @@
# This workflow validates the WebAssembly build on Ubuntu.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
name: WebAssembly build (Ubuntu)
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"
EMSDK_VERSION: 3.1.74
jobs:
wasm-build:
name: WebAssembly Build
runs-on: ubuntu-24.04
strategy:
matrix:
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
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: Setup vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
- name: Add NuGet sources
run: |
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
sources add \
-Source "${FEED_URL}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${USERNAME}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${FEED_URL}"
- name: Setup Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install ${EMSDK_VERSION}
./emsdk activate ${EMSDK_VERSION}
echo "EMSDK=${{ github.workspace }}/emsdk" >> $GITHUB_ENV
echo "${{ github.workspace }}/emsdk" >> $GITHUB_PATH
echo "${{ github.workspace }}/emsdk/upstream/emscripten" >> $GITHUB_PATH
- name: Configure OCCT with vcpkg
run: |
source "${{ github.workspace }}/emsdk/emsdk_env.sh"
mkdir -p "build-${{ matrix.build_type }}"
cd "build-${{ matrix.build_type }}"
export VCPKG_ROOT="${{ github.workspace }}/vcpkg"
emcmake cmake -G "Ninja" \
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=wasm32-emscripten \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_USE_VCPKG=ON \
-DUSE_MMGR_TYPE=NATIVE \
-DBUILD_LIBRARY_TYPE=Static \
-DBUILD_MODULE_Draw=OFF \
-DUSE_FREETYPE=OFF \
-DUSE_TK=OFF \
-DUSE_TCL=OFF \
-DUSE_DRACO=ON \
-DUSE_FFMPEG=OFF \
-DUSE_FREEIMAGE=OFF \
-DUSE_OPENVR=OFF \
-DUSE_VTK=OFF \
-DUSE_TBB=OFF \
-DUSE_RAPIDJSON=ON \
-DINSTALL_DIR="${{ github.workspace }}/install-wasm-${{ matrix.build_type }}" \
-DCMAKE_CXX_FLAGS="-s WASM=1 -s EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] -s ALLOW_MEMORY_GROWTH=1" \
-DCMAKE_EXECUTABLE_SUFFIX=".js" ..
- name: Build
run: |
cd build-${{ matrix.build_type }}
cmake --build . --config ${{ matrix.build_type }} --target install -- -j4

View File

@ -1,170 +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, 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 \
-DBUILD_LIBRARY_TYPE="Static" \
-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

View File

@ -1,97 +0,0 @@
# This workflow performs code analysis using both CodeQL and Microsoft C++ Code Analysis.
# It is triggered on pushes to the 'master' branch and publishes warnings into the security GitHub tab.
# The workflow includes two jobs: one for CodeQL analysis on Ubuntu and another for MSVC Code Analysis on Windows.
name: Code Analysis
on:
push:
branches:
- 'master'
permissions:
contents: read
security-events: write
packages: read
env:
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
config: 'Debug'
jobs:
codeql-analyze:
name: CodeQL Analyze (C/C++)
runs-on: ubuntu-latest
steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7
# Step: Install necessary dependencies for building the project
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev
# Step: Initialize CodeQL for scanning
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.5
with:
languages: c-cpp
build-mode: manual
# Step: Build the project using CMake and Make
- name: Build project
shell: bash
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D USE_FREETYPE=OFF \
-D CMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
# Step: Perform CodeQL Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.5
with:
category: "/language:c-cpp"
msvc-analyze:
name: Microsoft C++ Code Analysis
runs-on: windows-latest
steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7
# Step: Install necessary dependencies using Chocolatey
- name: Install dependencies
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
choco install magicsplat-tcl-tk -y
# Step: Configure the project using CMake
- name: Configure CMake
run: |
mkdir build
cd build
cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} ..
# Step: Run MSVC Code Analysis
- name: Run MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@v0.1.1
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build }}
buildConfiguration: ${{ env.config }}
ruleset: NativeRecommendedRules.ruleset
# Step: Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3.26.5
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

5
.gitignore vendored
View File

@ -1,8 +1,6 @@
# standard directories for derived files in CASROOT
/.adm
/.cache
/.vscode
/lin
/mac
/wnt
@ -54,5 +52,4 @@ win64
/libtool
/stamp*
/build*
/install*
/tools/build*
/install

File diff suppressed because it is too large Load Diff

View File

@ -1,64 +0,0 @@
# Open CASCADE Technology
Open CASCADE Technology (OCCT) is a software development platform providing services for 3D surface and solid modeling, CAD data exchange, and visualization. Most of OCCT functionality is available in the form of C++ libraries. OCCT is ideal for developing software dealing with 3D modeling (CAD), manufacturing/measuring (CAM), or numerical simulation (CAE).
## License
Open CASCADE Technology is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation, with a special exception defined in the file `OCCT_LGPL_EXCEPTION.txt`. Consult the file `LICENSE_LGPL_21.txt` included in the OCCT distribution for the complete text of the license.
Alternatively, Open CASCADE Technology may be used under the terms of the Open CASCADE commercial license or a contractual agreement.
**Note:** Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and materials is on you. See the license text for a formal disclaimer.
## Packaging
You can receive certified versions of OCCT code in different packages:
- **Snapshot of Git repository:** Contains C++ header and source files of OCCT, documentation sources, build scripts, and CMake project files.
- **Complete source archive:** Contains all sources of OCCT, generated HTML and PDF documentation, and ready-to-use projects for building on all officially supported platforms.
- **Binary package (platform-specific):** In addition to the complete source archive, it includes binaries of OCCT and third-party libraries built on one platform. This package allows using OCCT immediately after installation.
Certified versions of OCCT can be downloaded from:
- [Open CASCADE Releases](https://dev.opencascade.org/release)
- [GitHub Releases](https://github.com/Open-Cascade-SAS/OCCT/releases)
You can also find OCCT pre-installed on your system or install it from packages provided by a third party. Note that packaging and functionality of such versions can be different from certified releases. Please consult the documentation accompanying your version for details.
## Documentation
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)
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).
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.
## 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.
## Version
The current version of OCCT can be found in the file [`adm/cmake/version.cmake`](adm/cmake/version.cmake).
## Development
### Bug Tracker
- [GitHub Issues](https://github.com/Open-Cascade-SAS/OCCT/issues)
- [OCCT Tracker](https://tracker.dev.opencascade.org/)
For information regarding OCCT code development, please consult the official OCCT Collaborative Development Portal:
- [OCCT Development Portal](http://dev.opencascade.org)
### Forum and Discussions
- [OCCT Forums](https://dev.opencascade.org/forums)
- [GitHub Discussions](https://github.com/Open-Cascade-SAS/OCCT/discussions)

89
README.txt Normal file
View File

@ -0,0 +1,89 @@
Open CASCADE Technology
=======================
This directory contains sources of Open CASCADE Technology (OCCT), a software
development platform providing services for 3D surface and solid modeling, CAD
data exchange, and visualization. Most of OCCT functionality is available in
the form of C++ libraries. OCCT can be best applied in development of software
dealing with 3D modeling (CAD), manufacturing / measuring (CAM) or numerical
simulation (CAE).
License
-------
Open CASCADE Technology is free software; you can redistribute it and / or
modify it under the terms of the GNU Lesser General Public version 2.1 as
published by the Free Software Foundation, with special exception defined in
the file OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included
in OCCT distribution for complete text of the license.
Alternatively, Open CASCADE Technology may be used under the terms of Open
CASCADE commercial license or contractual agreement.
Note that Open CASCADE Technology is provided on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND. The entire risk related to any use of the OCCT code and
materials is on you. See the license text for formal disclaimer.
Packaging
---------
You can receive certified version of OCCT code in different packages.
- Snapshot of Git repository: contains C++ header and source files of OCCT,
documentation sources, build scripts, and CMake project files.
- Complete source archive: contains all sources of OCCT, generated HTML and PDF
documentation, and ready-to-use projects for building on all officially
supported platforms.
- Binary package (platform-specific): in addition to complete source archive,
it includes binaries of OCCT and third-party libraries built on one platform.
This package allows using OCCT immediately after installation.
Certified versions of OCCT can be downloaded from http://www.opencascade.com
You can also find OCCT pre-installed on your system, or install it from
packages provided by a third party. Note that packaging and functionality
of such versions can be different from certified releases. Please consult
documentation accompanying your version for details.
Documentation
-------------
Open 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 environment variable PATH).
Use batch file *gendoc.bat* on Windows or Bash script *gendoc* on Linux
or OS X to (re)generate documentation.
- Read documentation in source plain text (MarkDown) format found in
subfolder *dox*
See *dox/dev_guides/documentation/documentation.md* 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/dev_guides/building/building.md* for instructions on
building OCCT from sources on supported platforms.
Version
-------
The current version of OCCT can be consulted in the file
*src/Standard/Standard_Version.hxx*
Development
-----------
For information regarding OCCT code development please consult the official
OCCT Collaborative Development Portal:
http://dev.opencascade.org

1
adm/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build-*

18
adm/CMPLRS Normal file
View File

@ -0,0 +1,18 @@
wnt WOKSteps_exec_link DRAWEXE #WOKStep_EXELink(exec.tks)
lin WOKSteps_exec_link DRAWEXE #WOKStep_EXELink(exec.tks)
wnt cmplrs_cxx f -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_cxx b -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_cxx Aspect (wnt cmplrs_cxx b) -D_AFXDLL
wnt cmplrs_cxx (wnt cmplrs_cxx b) -D_AFXDLL -D_AFXDLL
wnt cmplrs_c f -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_c b -D_CRT_SECURE_NO_DEPRECATE -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
wnt cmplrs_c NIS (wnt cmplrs_c b) -DSILGL -DSILGL_VRS=50
lin cmplrs_cxx f -DOCC_CONVERT_SIGNALS -D_GNU_SOURCE=1 -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
lin cmplrs_cxx b -DOCC_CONVERT_SIGNALS -D_GNU_SOURCE=1 -DHAVE_FREEIMAGE -DHAVE_TBB -DHAVE_OPENCL
lin cmplrs_c f -D_GNU_SOURCE=1 -fexceptions
lin cmplrs_c b -D_GNU_SOURCE=1 -fexceptions

View File

@ -1,7 +1,8 @@
FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing TKExpress
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKDE TKXSBase TKDESTEP TKDEIGES TKDESTL TKDEVRML TKDECascade TKDEOBJ TKDEGLTF TKDEPLY TKXCAF TKXmlXCAF TKBinXCAF TKRWMesh
DETools TKExpress ExpToCasExe
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE TKXSDRAWDE TKXSDRAWGLTF TKXSDRAWIGES TKXSDRAWOBJ TKXSDRAWPLY TKXSDRAWSTEP TKXSDRAWSTL TKXSDRAWVRML

4
adm/TOOLS Normal file
View File

@ -0,0 +1,4 @@
TModelingData TKShapeView TKMessageModel TKMessageView
TVisualization TKView TKVInspector
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
TTool TKTInspector TKToolsDraw TInspectorEXE

497
adm/UDLIST Normal file
View File

@ -0,0 +1,497 @@
n NCollection
n BSplCLib
n BSplSLib
n Bnd
n BVH
n CSLib
n Convert
n ElCLib
n ElSLib
n Expr
n ExprIntrp
n FSD
n GeomAbs
n Message
n OSD
n PLib
n Plugin
n Poly
n Precision
n Quantity
n Resource
n Standard
n StdFail
n Storage
n TColStd
n TColgp
n TCollection
n TShort
n TopLoc
n Units
n UnitsAPI
n gp
n math
r OS
n FlexLexer
t TKMath
t TKernel
n Adaptor2d
n Adaptor3d
n AdvApp2Var
n AdvApprox
n AppCont
n AppDef
n AppParCurves
n Approx
n BRep
n BRepAdaptor
n BRepLProp
n BRepTools
n BndLib
n CPnts
n Extrema
n FEmTool
n GC
n GCE2d
n GCPnts
n GProp
n Geom
n Geom2d
n Geom2dAdaptor
n Geom2dConvert
n Geom2dLProp
n GeomAdaptor
n GeomConvert
n GeomLProp
n GeomLib
n GeomProjLib
n GeomTools
n GeomEvaluator
n Hermit
n IntAna
n IntAna2d
n LProp
n LProp3d
n ProjLib
n TColGeom
n TColGeom2d
n TopAbs
n TopExp
n TopTools
n TopoDS
n gce
t TKBRep
t TKG2d
t TKG3d
t TKGeomBase
n AppBlend
n ApproxInt
n BOPTools
n BRepAlgo
n BRepAlgoAPI
n BRepApprox
n BRepBlend
n BRepBndLib
n BRepBuilderAPI
n BRepCheck
n BRepClass
n BRepClass3d
n BRepExtrema
n BRepFeat
n BRepFill
n BRepFilletAPI
n BRepGProp
n BRepIntCurveSurface
n BRepLib
n BRepMAT2d
n BRepMesh
n BRepMeshData
n BRepOffset
n BRepOffsetAPI
n BRepPreviewAPI
n BRepPrim
n BRepPrimAPI
n BRepProj
n BRepSweep
n BRepTopAdaptor
n BiTgte
n Bisector
n Blend
n BlendFunc
n ChFi2d
n ChFi3d
n ChFiDS
n ChFiKPart
n Contap
n Draft
n FairCurve
n FilletSurf
n GccAna
n GccEnt
n GccInt
n Geom2dAPI
n Geom2dGcc
n Geom2dHatch
n Geom2dInt
n GeomAPI
n GeomFill
n GeomInt
n GeomPlate
n HLRAlgo
n HLRBRep
n HLRTopoBRep
n HLRAppli
n Hatch
n HatchGen
n IMeshData
n IMeshTools
n IntCurve
n IntCurveSurface
n IntCurvesFace
n IntImp
n IntImpParGen
n IntPatch
n IntPolyh
n IntRes2d
n IntStart
n IntSurf
n IntTools
n IntWalk
n Intf
n Intrv
n Law
n LocOpe
n LocalAnalysis
n MAT
n MAT2d
n NLPlate
n Plate
n ShapeAlgo
n ShapeAnalysis
n ShapeBuild
n ShapeConstruct
n ShapeCustom
n ShapeExtend
n ShapeFix
n ShapeProcess
n ShapeProcessAPI
n ShapeUpgrade
n Sweep
n TopBas
n TopClass
n TopCnx
n TopOpeBRep
n TopOpeBRepBuild
n TopOpeBRepDS
n TopOpeBRepTool
n TopTrans
n XBRepMesh
t TKBO
t TKBool
t TKFeat
t TKFillet
t TKGeomAlgo
t TKHLR
t TKMesh
t TKOffset
t TKPrim
t TKShHealing
t TKTopAlgo
t TKXMesh
n AIS
n Aspect
n DsgPrs
n PrsDim
n Graphic3d
n Image
n Media
n MeshVS
n OpenGl
n OpenGles
n D3DHost
n Prs3d
n PrsMgr
n Select3D
n SelectBasics
n SelectMgr
n StdPrs
n StdSelect
n V3d
n Wasm
n WNT
n Xw
n Cocoa
r Textures
r Shaders
r XRResources
t TKMeshVS
t TKOpenGl
t TKOpenGles
t TKD3DHost
t TKService
t TKV3d
n BinTObjDrivers
n LDOM
n TObj
n XmlTObjDrivers
n AppStd
n AppStdL
n BinDrivers
n BinLDrivers
n BinMDF
n BinMDataStd
n BinMDataXtd
n BinMDocStd
n BinMFunction
n BinMNaming
n BinObjMgt
n BinTools
n CDF
n CDM
n PCDM
n StdLDrivers
n StdLPersistent
n StdObjMgt
n StdDrivers
n StdObject
n StdPersistent
n StdStorage
n ShapePersistent
n TDF
n TDataStd
n TDataXtd
n TDocStd
n TFunction
n TNaming
n TPrsStd
n UTL
n XmlDrivers
n XmlLDrivers
n XmlMDF
n XmlMDataStd
n XmlMDataXtd
n XmlMDocStd
n XmlMFunction
n XmlMNaming
n XmlObjMgt
r StdResource
r XmlOcafResource
t TKBin
t TKBinL
t TKBinTObj
t TKCAF
t TKCDF
t TKLCAF
t TKStdL
t TKStd
t TKTObj
t TKXml
t TKXmlL
t TKXmlTObj
n IGESFile
n StepFile
n APIHeaderSection
n BRepToIGES
n BRepToIGESBRep
n BinMXCAFDoc
n BinXCAFDrivers
n Geom2dToIGES
n GeomToIGES
n GeomToStep
n HeaderSection
n IFGraph
n IFSelect
n IGESAppli
n IGESBasic
n IGESCAFControl
n IGESControl
n IGESConvGeom
n IGESData
n IGESDefs
n IGESDimen
n IGESDraw
n IGESGeom
n IGESGraph
n IGESSelect
n IGESSolid
n IGESToBRep
n Interface
n LibCtl
n MoniTool
n RWHeaderSection
n RWStepAP203
n RWStepAP214
n RWStepAP242
n RWStepBasic
n RWStepDimTol
n RWStepElement
n RWStepFEA
n RWStepGeom
n RWStepKinematics
n RWStepRepr
n RWStepShape
n RWStepVisual
n RWStl
n STEPCAFControl
n STEPConstruct
n STEPControl
n STEPEdit
n STEPSelections
n StepAP203
n StepAP209
n StepAP214
n StepAP242
n StepBasic
n StepData
n StepDimTol
n StepElement
n StepFEA
n StepGeom
n StepKinematics
n StepRepr
n StepSelect
n StepShape
n StepToGeom
n StepToTopoDS
n StepVisual
n StlAPI
n TopoDSToStep
n Transfer
n TransferBRep
n UnitsMethods
n Vrml
n VrmlAPI
n VrmlConverter
n VrmlData
n XCAFApp
n XCAFDimTolObjects
n XCAFDoc
n XCAFPrs
n XSAlgo
n XSControl
n XmlMXCAFDoc
n XmlXCAFDrivers
r SHMessage
r XSMessage
r XSTEPResource
t TKBinXCAF
t TKDESTL
t TKDEVRML
t TKXCAF
t TKDE
t TKDECascade
t TKDEIGES
t TKDESTEP
t TKXSBase
t TKXmlXCAF
n BOPTest
n BRepTest
n DBRep
n DDF
n DDataStd
n DDocStd
n DE
n DEXCAFCascade
n DEBRepCascade
n DNaming
n DPrsStd
n Draw
n DrawDim
n DrawFairCurve
n DrawTrSurf
n GeometryTest
n GeomliteTest
n HLRTest
n MeshTest
n SWDRAW
n TObjDRAW
n OpenGlTest
n OpenGlesTest
n D3DHostTest
n ViewerTest
n XDEDRAW
n XSDRAW
n XSDRAWIGES
n XSDRAWSTEP
n XSDRAWSTL
n XSDRAWVRML
n XSDRAWDE
n XSDRAWGLTF
n XSDRAWOBJ
n XSDRAWPLY
r DrawResources
t TKDCAF
t TKDraw
t TKTObjDRAW
t TKTopTest
t TKOpenGlTest
t TKOpenGlesTest
t TKD3DHostTest
t TKViewerTest
t TKXDEDRAW
t TKXSDRAW
t TKXSDRAWIGES
t TKXSDRAWSTEP
t TKXSDRAWSTL
t TKXSDRAWVRML
t TKXSDRAWDE
t TKXSDRAWGLTF
t TKXSDRAWOBJ
t TKXSDRAWPLY
x DRAWEXE
n QADraw
n QANCollection
n QANewBRepNaming
n QANewDBRepNaming
n QANewModTopOpe
t TKQADraw
n QADNaming
n QABugs
n Font
n BOPAlgo
n BOPDS
n BOPCol
n IVtk
n IVtkOCC
n IVtkVTK
n IVtkTools
t TKIVtk
n IVtkDraw
t TKIVtkDraw
n Geom2dEvaluator
t TKVCAF
n XCAFView
n XCAFNoteObjects
t TKRWMesh
t TKDEGLTF
t TKDEOBJ
t TKDEPLY
n RWGltf
n RWMesh
n RWObj
n RWPly
n DFBrowser
n DFBrowserPane
n DFBrowserPaneXDE
n ShapeView
n TInspector
n TInspectorAPI
x TInspectorEXE
t TKDFBrowser
t TKShapeView
t TKTInspector
t TKTInspectorAPI
t TKToolsDraw
t TKTreeModel
t TKView
t TKVInspector
n ToolsDraw
n TreeModel
n View
n ViewControl
n VInspector
n Express
t TKExpress
x ExpToCasExe

View File

@ -19,7 +19,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify product folder in connection with 3RDPARTY_DIR
# specify product folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_${PRODUCT_NAME}_DIR PATH "The directory containing ${PRODUCT_NAME}")
@ -101,9 +101,8 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
string(TOLOWER ${PRODUCT_NAME} LOW_CASE_PRODUCT_NAME)
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
PATH_SUFFIXES include inc headers ${LOW_CASE_PRODUCT_NAME}
PATH_SUFFIXES include inc headers
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
@ -121,7 +120,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)

View File

@ -12,7 +12,7 @@ if (NOT BISON_EXECUTABLE OR NOT EXISTS "${BISON_EXECUTABLE}")
endif()
# Add paths to 3rdparty subfolders containing name "bison" to CMAKE_PROGRAM_PATH variable to make
# these paths searched by find_package
# these paths searhed by find_package
if (3RDPARTY_DIR)
file (GLOB BISON_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*bison*/")
foreach (candidate_path ${BISON_PATHS})

4212
adm/cmake/cotire.cmake Normal file

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@ else()
endif()
endif()
# hide all redundant variables
mark_as_advanced (DOXYGEN_SKIP_DOT)
mark_as_advanced (DOXYGEN_EXECUTABLE)
mark_as_advanced (DOXYGEN_DOT_EXECUTABLE)
# unset all redundant variables
OCCT_CHECK_AND_UNSET (DOXYGEN_SKIP_DOT)
OCCT_CHECK_AND_UNSET (DOXYGEN_EXECUTABLE)
OCCT_CHECK_AND_UNSET (DOXYGEN_DOT_EXECUTABLE)

View File

@ -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)
@ -96,11 +51,6 @@ if (NOT 3RDPARTY_DRACO_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}"
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_DRACO_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_DRACO_DIR}
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
@ -110,4 +60,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()

View File

@ -83,5 +83,5 @@ else()
set (3RDPARTY_EIGEN_INCLUDE_DIR "" CACHE PATH "the path to Eigen header file" FORCE)
endif()
# hide all redundant variables
mark_as_advanced(Eigen3_DIR)
# unset all redundant variables
OCCT_CHECK_AND_UNSET(Eigen3_DIR)

View File

@ -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}")
@ -247,7 +236,7 @@ foreach (LIBRARY_NAME ${CSF_FFmpeg})
mark_as_advanced (3RDPARTY_FFMPEG_LIBRARY_${LIBRARY_NAME} 3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME})
endforeach()
# hide all redundant variables
mark_as_advanced (FFMPEG_INCLUDE_DIRS)
mark_as_advanced (FFMPEG_LIBRARY_DIRS)
mark_as_advanced (FFMPEG_DIR)
# unset all redundant variables
OCCT_CHECK_AND_UNSET (FFMPEG_INCLUDE_DIRS)
OCCT_CHECK_AND_UNSET (FFMPEG_LIBRARY_DIRS)
OCCT_CHECK_AND_UNSET (FFMPEG_DIR)

View File

@ -15,7 +15,7 @@ if (NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}")
endif()
# Add paths to 3rdparty subfolders containing name "flex" to CMAKE_PROGRAM_PATH and
# CMAKE_INCLUDE_PATH variables to make these paths searched by find_package
# CMAKE_INCLUDE_PATH variables to make these paths searhed by find_package
if (3RDPARTY_DIR)
file (GLOB FLEX_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*flex*")
foreach (candidate_path ${FLEX_PATHS})
@ -31,13 +31,3 @@ find_package (FLEX 2.6.4)
if (NOT FLEX_FOUND OR NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_INCLUDE_DIR)
endif()
# remove old general version of FlexLexer
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h")
file(REMOVE ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h)
endif()
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()

View File

@ -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")

View File

@ -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()
@ -27,7 +14,7 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
# specify freetype folder in connection with 3RDPARTY_DIR
# specify freetype folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_FREETYPE_DIR PATH "The directory containing freetype")
@ -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)
@ -389,10 +368,10 @@ endif()
endif()
#endif()
# hide all redundant variables
mark_as_advanced(FREETYPE_INCLUDE_DIR_ft2build)
mark_as_advanced(FREETYPE_INCLUDE_DIR_freetype2)
mark_as_advanced(FREETYPE_LIBRARY_RELEASE)
# unset all redundant variables
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY_RELEASE)
if (BUILD_SHARED_LIBS)
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)

View File

@ -1,66 +0,0 @@
# Google Test integration for OCCT
# Only proceed if tests are enabled
if (NOT BUILD_GTEST)
set(GOOGLETEST_FOUND FALSE)
return()
endif()
# Check if the user has specified whether to install Google Test
if (NOT DEFINED INSTALL_GTEST)
set(INSTALL_GTEST OFF CACHE BOOL "Install Google Test")
endif()
# Google Test configuration options
option(GTEST_USE_EXTERNAL "Use externally provided Google Test installation" OFF)
option(GTEST_USE_FETCHCONTENT "Use FetchContent to download and build Google Test" ON)
# Try to find existing GTest installation
find_package(GTest QUIET)
if(GTest_FOUND)
message(STATUS "Found Googletest installation")
set(GOOGLETEST_FOUND TRUE)
set(GTEST_USE_EXTERNAL TRUE)
set(GTEST_USE_FETCHCONTENT FALSE)
else()
message(STATUS "Googletest not found in system paths")
if(GTEST_USE_FETCHCONTENT)
include(FetchContent)
# Set option to disable GMock before declaring the content
set(BUILD_GMOCK OFF CACHE BOOL "Builds the googlemock subproject" FORCE)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.16.0.zip
DOWNLOAD_EXTRACT_TIMESTAMP true
)
FetchContent_MakeAvailable(googletest)
# Set proper grouping for the targets in solution explorer
if(TARGET gtest)
set_target_properties(gtest PROPERTIES FOLDER "ThirdParty/GoogleTest")
target_compile_definitions(gtest PRIVATE GTEST_CREATE_SHARED_LIBRARY=1)
endif()
if(TARGET gtest_main)
set_target_properties(gtest_main PROPERTIES FOLDER "ThirdParty/GoogleTest")
target_compile_definitions(gtest_main PRIVATE GTEST_CREATE_SHARED_LIBRARY=1)
endif()
# Set variables for consistent use throughout the build system
set(GOOGLETEST_FOUND TRUE)
else()
message(STATUS "Google Test not available. Tests will be skipped.")
set(GOOGLETEST_FOUND FALSE)
endif()
endif()
# Enable CTest if Google Test is available
if(GOOGLETEST_FOUND)
include(GoogleTest)
endif()

View File

@ -1,105 +1,5 @@
# JeMalloc
function (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")
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATHS "${3RDPARTY_JEMALLOC_LIBRARY_DIR}" "${3RDPARTY_JEMALLOC_DIR}"
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
get_filename_component (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}}" PATH)
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
else()
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "")
endif()
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}" PARENT_SCOPE)
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)
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)
endif()
# install instructions
if (INSTALL_JEMALLOC AND NOT JEMALLOC_IS_STATIC_LIB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
get_filename_component(3RDPARTY_JEMALLOC_LIBRARY ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} REALPATH)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Debug
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}d")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Release
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}i")
endif()
set (USED_3RDPARTY_JEMALLOC_DIR "" PARENT_SCOPE)
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)
endif()
unset(3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} CACHE)
unset(3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} CACHE)
endfunction()
macro (SEARCH_JEMALLOC)
# find static jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".lib" ".a")
if (WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc" "STATIC")
elseif(NOT WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc_pic" "STATIC")
SET(CMAKE_FIND_LIBRARY_SUFFIXES "" "so")
JEMALLOC_LIB_SEARCH ("jemalloc.so.2" "SHARED")
endif()
# find shared jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
JEMALLOC_LIB_SEARCH ("jemalloc" "SHARED")
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()
@ -140,15 +40,10 @@ if (NOT 3RDPARTY_JEMALLOC_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_JEMALLOC_INCLUDE
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_path (3RDPARTY_JEMALLOC_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_JEMALLOC_DIR}
PATH_SUFFIXES include/jemalloc
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_JEMALLOC_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_JEMALLOC_DIR}
PATH_SUFFIXES include/jemalloc
CMAKE_FIND_ROOT_PATH_BOTH)
PATHS ${3RDPARTY_JEMALLOC_DIR}
PATH_SUFFIXES include/jemalloc
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
endif()
endif()
@ -166,5 +61,83 @@ else()
set (JEMALLOC_INSTALL_DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
endif()
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")
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATHS "${3RDPARTY_JEMALLOC_LIBRARY_DIR}" "${3RDPARTY_JEMALLOC_DIR}"
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} NAMES ${MMGR_LIB}
PATH_SUFFIXES ${JEMALLOC_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB})
get_filename_component (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}}" PATH)
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "${3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB}}")
else()
set (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} "")
endif()
endif()
if (3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB})
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)
else()
message("Cannot find ${MMGR_LIB} library in jemalloc 3rdparty")
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 (((${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)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
get_filename_component(3RDPARTY_JEMALLOC_LIBRARY ${3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB}} REALPATH)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
else()
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Debug
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}d")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS Release
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}")
install (FILES "${3RDPARTY_JEMALLOC_LIBRARY}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${JEMALLOC_INSTALL_DESTINATION}i")
endif()
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}})
endif()
unset(3RDPARTY_JEMALLOC_LIBRARY_DIR_${MMGR_LIB} CACHE)
unset(3RDPARTY_JEMALLOC_LIBRARY_${PREFIX}_${MMGR_LIB} CACHE)
endmacro()
# Reset CSF variable
set (CSF_MMGR "")
# find static jemalloc lib
SEARCH_JEMALLOC()
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
if (WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc" "STATIC")
elseif(NOT WIN32)
JEMALLOC_LIB_SEARCH ("jemalloc_pic" "STATIC")
SET(CMAKE_FIND_LIBRARY_SUFFIXES "" "so")
JEMALLOC_LIB_SEARCH ("jemalloc.so.2" "SHARED")
endif()
# find shared jemalloc lib
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".so")
JEMALLOC_LIB_SEARCH ("jemalloc" "SHARED")

View File

@ -82,25 +82,6 @@ else()
set (CSF_Draco)
endif()
# VTK
if (USE_VTK)
# the variable must to be empty, but keep there the list of libs
# that is used in the VTK component.
set (CSF_VTK
# vtkCommonCore
# vtkRenderingCore
# vtkRenderingFreeType
# vtkFiltersGeneral
# vtkIOImage
# vtkImagingCore
# vtkInteractionStyle
# vtkRenderingOpenGL
# vtkRenderingFreeTypeOpenGL
)
else()
set (CSF_VTK)
endif()
if (WIN32)
set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib")

View File

@ -26,22 +26,12 @@ endif()
if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd26812")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
if (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
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()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions -fPIC")
add_definitions(-DOCC_CONVERT_SIGNALS)
endif()
@ -151,19 +141,14 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
# /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang.
# /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically.
# /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
# /fp:precise (improve floating-point consistency) is similar to -ffloat-store in GCC, but there isn't a perfect equivalent in Clang.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fomit-frame-pointer -flto -ffunction-sections -ffloat-store")
# 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_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -flto")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flto")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
@ -182,21 +167,19 @@ 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()
endif()
if(MINGW)
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS}")
elseif(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
# _WIN32_WINNT=0x0601 (use Windows 7 SDK)
#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)
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
elseif (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")

View File

@ -1,687 +0,0 @@
##
# Function to collect modules, toolkits, and packages information for documentation
function(OCCT_DOC_COLLECT_MODULES_INFO)
# Set output variables in parent scope
set(OCCT_MODULES ${OCCT_MODULES} PARENT_SCOPE)
# For each module, collect its toolkits
foreach(OCCT_MODULE ${OCCT_MODULES})
if(NOT "${OCCT_MODULE}" STREQUAL "")
set(MODULES_TOOLKITS ${${OCCT_MODULE}_TOOLKITS})
set(TOOLKITS_IN_MODULE_${OCCT_MODULE} ${MODULES_TOOLKITS} PARENT_SCOPE)
# For each toolkit, collect its packages
foreach(TOOLKIT ${MODULES_TOOLKITS})
set(TOOLKIT_PARENT_MODULE_${TOOLKIT} ${OCCT_MODULE} PARENT_SCOPE)
# Get packages from toolkit
set(TOOLKIT_PACKAGES "")
EXTRACT_TOOLKIT_PACKAGES("src" ${TOOLKIT} TOOLKIT_PACKAGES)
set(PACKAGES_IN_TOOLKIT_${TOOLKIT} ${TOOLKIT_PACKAGES} PARENT_SCOPE)
endforeach()
endif()
endforeach()
endfunction()
# Function to generate module dependency graph
function(OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME)
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
# Create .dot file for module dependencies
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
# Create a list to track unique module connections
set(MODULE_CONNECTIONS)
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
# Convert module name to lowercase for URL
string(TOLOWER ${MODULE} MODULE_LOWER)
file(APPEND ${DOT_FILE} "\t${MODULE} [ URL = \"module_${MODULE_LOWER}.html\" ]\n")
# Add dependencies between modules
foreach(MODULE_TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${MODULE_TOOLKIT}})
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
NOT "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE}")
# Create a unique connection identifier
set(CONNECTION "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}->${MODULE}")
list(FIND MODULE_CONNECTIONS "${CONNECTION}" CONNECTION_EXISTS)
# Add connection only if it doesn't exist yet
if(${CONNECTION_EXISTS} EQUAL -1)
list(APPEND MODULE_CONNECTIONS "${CONNECTION}")
file(APPEND ${DOT_FILE} "\t${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}} -> ${MODULE} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
endif()
endif()
endforeach()
endforeach()
endif()
endforeach()
file(APPEND ${DOT_FILE} "}\n")
# Return the output file name
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
endfunction()
# Function to generate toolkit dependency graph for a module
function(OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME MODULE_NAME)
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
# Create .dot file for toolkit dependencies within a module
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE_NAME}})
# Convert toolkit name to lowercase for URL
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
file(APPEND ${DOT_FILE} "\t${TOOLKIT} [ URL = \"toolkit_${TOOLKIT_LOWER}.html\" ]\n")
# Add dependencies between toolkits in the same module
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT}})
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
"${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE_NAME}")
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} -> ${TOOLKIT} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
endif()
endforeach()
endforeach()
file(APPEND ${DOT_FILE} "}\n")
# Return the output file name
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
endfunction()
# Function to generate dependency graph for a specific toolkit
function(OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME TOOLKIT_NAME)
set(DOT_FILE "${OUTPUT_DIR}/${FILENAME}.dot")
# Create .dot file for dependencies of a single toolkit
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
# Convert toolkit name to lowercase for URL
string(TOLOWER ${TOOLKIT_NAME} TOOLKIT_NAME_LOWER)
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} [ URL = \"toolkit_${TOOLKIT_NAME_LOWER}.html\", shape = box ]\n")
# Add toolkit dependencies
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${TOOLKIT_NAME}})
# Convert dependent toolkit name to lowercase for URL
string(TOLOWER ${DEPENDENT_TOOLKIT} DEPENDENT_TOOLKIT_LOWER)
file(APPEND ${DOT_FILE} "\t${DEPENDENT_TOOLKIT} [ URL = \"toolkit_${DEPENDENT_TOOLKIT_LOWER}.html\", shape = box ]\n")
file(APPEND ${DOT_FILE} "\t${TOOLKIT_NAME} -> ${DEPENDENT_TOOLKIT} [ color = \"midnightblue\", style = \"solid\" ]\n")
endforeach()
if(TOOLKIT_DEPENDENCY_${TOOLKIT_NAME})
list(LENGTH TOOLKIT_DEPENDENCY_${TOOLKIT_NAME} DEPS_COUNT)
if(DEPS_COUNT GREATER 1)
file(APPEND ${DOT_FILE} "\taspect = 1\n")
endif()
endif()
file(APPEND ${DOT_FILE} "}\n")
# Return the output file name
set(DOT_OUTPUT_FILE "${FILENAME}" PARENT_SCOPE)
endfunction()
# Function to generate main page for documentation
function(OCCT_DOC_GENERATE_MAIN_PAGE OUTPUT_DIR OUTPUT_FILE)
set(MAIN_PAGE_FILE "${OUTPUT_DIR}/${OUTPUT_FILE}")
file(WRITE ${MAIN_PAGE_FILE} "/**\n")
# Check if we're generating documentation for a single module
if(DOC_SINGLE_MODULE)
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${DOC_SINGLE_MODULE}\n")
else()
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage Open CASCADE Technology Reference Manual\n\n")
# List all modules
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
# page id must be in lowercase
string(TOLOWER ${MODULE} MODULE_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage module_${MODULE_LOWER}\n")
endif()
endforeach()
# Add modules relationship diagram
OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_all_modules")
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_all_modules.dot\n")
endif()
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
# Generate pages for modules and their toolkits
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
if(DOC_SINGLE_MODULE)
file(APPEND ${MAIN_PAGE_FILE} "\\mainpage OCCT Module ${MODULE}\n")
else()
# page id must be in lowercase
string(TOLOWER ${MODULE} MODULE_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\page module_${MODULE_LOWER} Module ${MODULE}\n")
endif()
# List toolkits in the module
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
# page id must be in lowercase
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage toolkit_${TOOLKIT_LOWER}\n")
endforeach()
# Add module diagram
OCCT_DOC_CREATE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${MODULE}" ${MODULE})
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${MODULE}.dot\n")
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
endif()
endforeach()
# Generate pages for toolkits and their packages
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
# page id must be in lowercase
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\page toolkit_${TOOLKIT_LOWER} Toolkit ${TOOLKIT}\n")
# List packages in toolkit
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
set(PACKAGE_NAME ${PACKAGE})
# page id must be in lowercase
string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage package_${PACKAGE_NAME_LOWER}\n")
endforeach()
# Add toolkit dependencies diagram
OCCT_DOC_CREATE_SINGLE_TOOLKIT_DEPENDENCY_GRAPH("${OUTPUT_DIR}/html" "schema_${TOOLKIT}" ${TOOLKIT})
file(APPEND ${MAIN_PAGE_FILE} "\\dotfile schema_${TOOLKIT}.dot\n")
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
endforeach()
endif()
endforeach()
# Generate pages for packages and their classes
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
file(APPEND ${MAIN_PAGE_FILE} "/**\n")
# page id must be in lowercase
string(TOLOWER ${PACKAGE} PACKAGE_LOWER)
file(APPEND ${MAIN_PAGE_FILE} "\\page package_${PACKAGE_LOWER} Package ${PACKAGE}\n")
# Find header files in the package
EXTRACT_PACKAGE_FILES ("src" ${PACKAGE} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|hxx|hpp)$")
foreach(HEADER ${HEADER_FILES_FILTERING})
get_filename_component(HEADER_NAME ${HEADER} NAME_WE)
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage ${HEADER_NAME}\n")
# Append header file to DOXYGEN_INPUT_FILES list
list(APPEND DOXYGEN_INPUT_FILES "${HEADER}")
endforeach()
file(APPEND ${MAIN_PAGE_FILE} "**/\n\n")
endforeach()
endforeach()
endif()
endforeach()
# Create a variable containing all input files for Doxygen
string(REPLACE ";" " " DOXYGEN_INPUT_FILES_STRING "${DOXYGEN_INPUT_FILES}")
set(DOXYGEN_INPUT_FILES_STRING ${DOXYGEN_INPUT_FILES_STRING} PARENT_SCOPE)
endfunction()
# Function to extract dependency information for toolkits
function(OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES)
foreach(MODULE ${OCCT_MODULES})
if(NOT "${MODULE}" STREQUAL "")
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
EXTRACT_TOOLKIT_EXTERNLIB("src" ${TOOLKIT} EXTERNLIB_LIST)
set(DEPENDENT_TOOLKITS "")
foreach(EXTERNLIB ${EXTERNLIB_LIST})
if(EXTERNLIB MATCHES "^TK")
list(APPEND DEPENDENT_TOOLKITS ${EXTERNLIB})
endif()
endforeach()
set(TOOLKIT_DEPENDENCY_${TOOLKIT} ${DEPENDENT_TOOLKITS} PARENT_SCOPE)
endforeach()
endif()
endforeach()
endfunction()
# Function to load file lists for documentation
function(OCCT_DOC_LOAD_FILE_LISTS)
# Load list of HTML documentation files
set(FILES_HTML_PATH "${CMAKE_SOURCE_DIR}/dox/FILES_HTML.txt")
if(EXISTS ${FILES_HTML_PATH})
file(STRINGS ${FILES_HTML_PATH} HTML_FILES REGEX "^[^#]+")
set(OCCT_DOC_HTML_FILES ${HTML_FILES} PARENT_SCOPE)
else()
set(OCCT_DOC_HTML_FILES "" PARENT_SCOPE)
endif()
# Load list of PDF documentation files
set(FILES_PDF_PATH "${CMAKE_SOURCE_DIR}/dox/FILES_PDF.txt")
if(EXISTS ${FILES_PDF_PATH})
file(STRINGS ${FILES_PDF_PATH} PDF_FILES REGEX "^[^#]+")
set(OCCT_DOC_PDF_FILES ${PDF_FILES} PARENT_SCOPE)
else()
set(OCCT_DOC_PDF_FILES "" PARENT_SCOPE)
endif()
endfunction()
# Function to collect image directories from input files
function(OCCT_DOC_COLLECT_IMAGE_DIRS INPUT_DIRS RESULT_IMAGE_DIRS)
set(IMAGE_DIRS "")
foreach(INPUT_DIR ${INPUT_DIRS})
# Check if directory exists
if(EXISTS "${INPUT_DIR}")
# Add the standard "images" subdirectory if it exists
if(EXISTS "${INPUT_DIR}/images")
list(APPEND IMAGE_DIRS "${INPUT_DIR}/images")
endif()
# Find all subdirectories containing images
file(GLOB_RECURSE IMAGE_FILES
"${INPUT_DIR}/*.png"
"${INPUT_DIR}/*.jpg"
"${INPUT_DIR}/*.jpeg"
"${INPUT_DIR}/*.gif"
"${INPUT_DIR}/*.svg")
foreach(IMAGE_FILE ${IMAGE_FILES})
get_filename_component(IMAGE_DIR ${IMAGE_FILE} DIRECTORY)
list(APPEND IMAGE_DIRS "${IMAGE_DIR}")
endforeach()
endif()
endforeach()
if(IMAGE_DIRS)
list(REMOVE_DUPLICATES IMAGE_DIRS)
endif()
set(${RESULT_IMAGE_DIRS} ${IMAGE_DIRS} PARENT_SCOPE)
endfunction()
# Function to configure and run Doxygen for documentation generation
function(OCCT_DOC_CONFIGURE_DOXYGEN OUTPUT_DIR CONFIG_FILE DOC_TYPE)
# Create output directory if it doesn't exist
file(MAKE_DIRECTORY ${OUTPUT_DIR})
# Use existing Doxygen template file as base
if(DOC_TYPE STREQUAL "OVERVIEW")
set(TEMPLATE_DOXYFILE "${CMAKE_SOURCE_DIR}/dox/resources/occt_ug_html.doxyfile")
else()
set(TEMPLATE_DOXYFILE "${CMAKE_SOURCE_DIR}/dox/resources/occt_rm.doxyfile")
endif()
# Define Doxygen parameters that need to be overridden from the template
set(DOXYGEN_CONFIG_FILE "${OUTPUT_DIR}/${CONFIG_FILE}")
# Check if template file exists
if(NOT EXISTS ${TEMPLATE_DOXYFILE})
message(FATAL_ERROR "ERROR: Doxygen template file not found: ${TEMPLATE_DOXYFILE}")
return()
endif()
# Read template content
file(READ ${TEMPLATE_DOXYFILE} DOXYGEN_TEMPLATE_CONTENT)
# Create the output Doxyfile
file(WRITE ${DOXYGEN_CONFIG_FILE} "# Doxyfile generated by OCCT_DOC_CONFIGURE_DOXYGEN\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Base template: ${TEMPLATE_DOXYFILE}\n\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "${DOXYGEN_TEMPLATE_CONTENT}\n\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "# Custom overrides set by CMake:\n")
# Project information
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "OUTPUT_DIRECTORY = ${OUTPUT_DIR}\n")
# Ensure client-side search is configured correctly
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Search engine settings\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHENGINE = YES\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "SERVER_BASED_SEARCH = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTERNAL_SEARCH = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "SEARCHDATA_FILE = searchdata.xml\n")
# Additional parameters based on the document type
if(DOC_TYPE STREQUAL "OVERVIEW")
# Settings for Overview documentation
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${CMAKE_SOURCE_DIR}/dox/resources/occ_logo.png\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_ALL = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_STATIC = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */src/* */inc/* */drv/* */Properties/*\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "ENABLED_SECTIONS = OVERVIEW_SECTION\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt.tag\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TREEVIEW = YES\n")
# Setup tag file for cross-referencing with Reference Manual
if(BUILD_DOC_RefMan)
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Cross-referencing with Reference Manual\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "TAGFILES = \"${CMAKE_BINARY_DIR}/doc/refman/occt_refman.tag=../../refman/html\"\n")
endif()
# Input files for overview
if(DEFINED OCCT_OVERVIEW_FILES)
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${OCCT_OVERVIEW_FILES}\n")
else()
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${CMAKE_SOURCE_DIR}/dox\n")
endif()
# Collect image directories for overview
set(OVERVIEW_INPUT_DIRS ${CMAKE_SOURCE_DIR}/dox)
OCCT_DOC_COLLECT_IMAGE_DIRS("${OVERVIEW_INPUT_DIRS}" OVERVIEW_IMAGE_DIRS)
# Image path for overview
if(OVERVIEW_IMAGE_DIRS)
string(REPLACE ";" " " OVERVIEW_IMAGE_DIRS_STR "${OVERVIEW_IMAGE_DIRS}")
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${OVERVIEW_IMAGE_DIRS_STR} ${CMAKE_SOURCE_DIR}/dox/resources\n")
else()
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_DIR}/dox/resources\n")
endif()
# Example paths
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXAMPLE_PATH = ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/samples\n")
else()
# Settings for Reference Manual
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_NAME = \"Open CASCADE Technology Reference Manual\"\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "PROJECT_LOGO = ${CMAKE_SOURCE_DIR}/dox/resources/occ_logo.png\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "BUILTIN_STL_SUPPORT = YES\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PRIVATE = NO\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXTRACT_PACKAGE = YES\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "EXCLUDE_PATTERNS = */Properties/*\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "FILE_PATTERNS = *.h *.hxx *.lxx *.gxx *.pxx *.cxx *.cpp *.c *.md\n")
# Generate a tag file for cross-referencing from Overview
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Generate tag file for cross-referencing\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "GENERATE_TAGFILE = ${OUTPUT_DIR}/occt_refman.tag\n")
# Input files for reference manual - CRITICAL FOR PROPER GENERATION
file(APPEND ${DOXYGEN_CONFIG_FILE} "\n# Input files for reference manual\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT = ${CMAKE_SOURCE_DIR}/src\n")
# If generating documentation for specific modules
if(DEFINED OCCT_DOC_MODULES)
set(MODULE_PATHS "")
foreach(MODULE ${OCCT_DOC_MODULES})
foreach(TOOLKIT ${${MODULE}_TOOLKITS})
list(APPEND MODULE_PATHS "${CMAKE_SOURCE_DIR}/src/${TOOLKIT}")
endforeach()
endforeach()
string(REPLACE ";" " " MODULE_PATHS_STR "${MODULE_PATHS}")
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${MODULE_PATHS_STR}\n") # Use += to append to existing INPUT
endif()
# Configure image path for reference manual
set(REFMAN_INPUT_DIRS ${CMAKE_SOURCE_DIR}/src)
OCCT_DOC_COLLECT_IMAGE_DIRS("${REFMAN_INPUT_DIRS}" REFMAN_IMAGE_DIRS)
if(REFMAN_IMAGE_DIRS)
string(REPLACE ";" " " REFMAN_IMAGE_DIRS_STR "${REFMAN_IMAGE_DIRS}")
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${REFMAN_IMAGE_DIRS_STR} ${CMAKE_SOURCE_DIR}/dox/resources\n")
else()
file(APPEND ${DOXYGEN_CONFIG_FILE} "IMAGE_PATH = ${CMAKE_SOURCE_DIR}/dox/resources\n")
endif()
# Add main page file if generated
if(EXISTS "${OUTPUT_DIR}/main_page.dox")
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${OUTPUT_DIR}/main_page.dox\n") # Use += to append to existing INPUT
endif()
# Add header files to Doxygen input
if(DEFINED DOXYGEN_INPUT_FILES_STRING)
file(APPEND ${DOXYGEN_CONFIG_FILE} "INPUT += ${DOXYGEN_INPUT_FILES_STRING}\n") # Use += to append to existing INPUT
endif()
endif()
# Custom CSS
if(EXISTS "${CMAKE_SOURCE_DIR}/dox/resources/custom.css")
file(APPEND ${DOXYGEN_CONFIG_FILE} "HTML_EXTRA_STYLESHEET = ${CMAKE_SOURCE_DIR}/dox/resources/custom.css\n")
endif()
# Set paths for dot tool
if(GRAPHVIZ_DOT_EXECUTABLE)
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOT_PATH = ${GRAPHVIZ_DOT_EXECUTABLE}\n")
get_filename_component(DOT_DIRECTORY ${GRAPHVIZ_DOT_EXECUTABLE} DIRECTORY)
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFONTPATH = ${DOT_DIRECTORY}\n")
file(APPEND ${DOXYGEN_CONFIG_FILE} "DOTFILE_DIRS = ${OUTPUT_DIR}/html\n")
endif()
# Confirm file creation
if(EXISTS ${DOXYGEN_CONFIG_FILE})
message(STATUS "Successfully created Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
else()
message(FATAL_ERROR "Failed to create Doxygen configuration file at: ${DOXYGEN_CONFIG_FILE}")
endif()
endfunction()
# Function to check if required tools are available
function(OCCT_DOC_CHECK_TOOLS)
# Find Doxygen
find_package(Doxygen QUIET)
if(NOT DOXYGEN_FOUND)
message(WARNING "Doxygen not found. Documentation will not be generated.")
set(OCCT_DOC_TOOLS_AVAILABLE FALSE PARENT_SCOPE)
return()
endif()
# Find Graphviz
find_program(GRAPHVIZ_DOT_EXECUTABLE NAMES dot)
# Check for MathJax for LaTeX formulas
if(NOT MATHJAX_PATH)
set(MATHJAX_PATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5")
endif()
# Find tools for PDF generation if needed
if(BUILD_DOC_PDF)
# Find pdflatex
find_program(PDFLATEX_EXECUTABLE NAMES pdflatex)
if(NOT PDFLATEX_EXECUTABLE)
message(WARNING "pdflatex not found. PDF documentation will not be generated.")
set(BUILD_DOC_PDF FALSE PARENT_SCOPE)
endif()
# Find Inkscape (for SVG to PNG conversion for PDFs)
find_program(INKSCAPE_EXECUTABLE NAMES inkscape)
if(NOT INKSCAPE_EXECUTABLE)
message(WARNING "Inkscape not found. SVG images will not be properly converted in PDF documentation.")
endif()
set(PDFLATEX_EXECUTABLE ${PDFLATEX_EXECUTABLE} PARENT_SCOPE)
set(INKSCAPE_EXECUTABLE ${INKSCAPE_EXECUTABLE} PARENT_SCOPE)
endif()
# Find tools for CHM generation if needed
if(BUILD_DOC_CHM AND WIN32)
# Find HTML Help Compiler
find_program(HHC_EXECUTABLE NAMES hhc HHC)
if(NOT HHC_EXECUTABLE)
message(WARNING "HTML Help Compiler not found. CHM documentation will not be generated.")
set(BUILD_DOC_CHM FALSE PARENT_SCOPE)
endif()
set(HHC_EXECUTABLE ${HHC_EXECUTABLE} PARENT_SCOPE)
endif()
set(GRAPHVIZ_DOT_EXECUTABLE ${GRAPHVIZ_DOT_EXECUTABLE} PARENT_SCOPE)
set(MATHJAX_PATH ${MATHJAX_PATH} PARENT_SCOPE)
set(OCCT_DOC_TOOLS_AVAILABLE TRUE PARENT_SCOPE)
endfunction()
# Function to process LaTeX files for PDF generation
function(OCCT_DOC_PROCESS_LATEX OUTPUT_DIR)
# Skip if PDF generation is not enabled or pdflatex not found
if(NOT BUILD_DOC_PDF OR NOT PDFLATEX_EXECUTABLE)
return()
endif()
message(STATUS "Processing LaTeX files for PDF generation...")
# Process SVG images if Inkscape is available
if(INKSCAPE_EXECUTABLE)
file(GLOB SVG_FILES "${OUTPUT_DIR}/latex/*.svg")
foreach(SVG_FILE ${SVG_FILES})
get_filename_component(FILE_NAME ${SVG_FILE} NAME_WE)
set(PNG_FILE "${OUTPUT_DIR}/latex/${FILE_NAME}.png")
execute_process(
COMMAND ${INKSCAPE_EXECUTABLE} -z -e ${PNG_FILE} ${SVG_FILE}
RESULT_VARIABLE INKSCAPE_RESULT
)
if(NOT INKSCAPE_RESULT EQUAL 0)
message(WARNING "Failed to convert ${SVG_FILE} to PNG")
endif()
endforeach()
endif()
# Generate PDF from LaTeX
execute_process(
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
RESULT_VARIABLE LATEX_RESULT
OUTPUT_VARIABLE LATEX_OUTPUT
ERROR_VARIABLE LATEX_ERROR
)
if(NOT LATEX_RESULT EQUAL 0)
message(WARNING "Error generating PDF: ${LATEX_ERROR}")
else()
# Run pdflatex again for references
execute_process(
COMMAND ${PDFLATEX_EXECUTABLE} -interaction=nonstopmode refman.tex
WORKING_DIRECTORY "${OUTPUT_DIR}/latex"
)
message(STATUS "PDF documentation generated at ${OUTPUT_DIR}/latex/refman.pdf")
# Copy the PDF to a more accessible location
file(COPY "${OUTPUT_DIR}/latex/refman.pdf" DESTINATION "${OUTPUT_DIR}")
file(RENAME "${OUTPUT_DIR}/refman.pdf" "${OUTPUT_DIR}/${DOC_OUTPUT_NAME}.pdf")
endif()
endfunction()
# Main function to set up documentation targets
function(OCCT_SETUP_DOC_TARGETS)
# Check if required tools are available
OCCT_DOC_CHECK_TOOLS()
if(NOT OCCT_DOC_TOOLS_AVAILABLE)
return()
endif()
# Load lists of documentation files
OCCT_DOC_LOAD_FILE_LISTS()
# Collect module information
OCCT_DOC_COLLECT_MODULES_INFO()
# Extract toolkit dependencies
OCCT_DOC_EXTRACT_TOOLKIT_DEPENDENCIES()
# Create documentation output directories
set(DOC_ROOT_DIR "${CMAKE_BINARY_DIR}/doc")
file(MAKE_DIRECTORY ${DOC_ROOT_DIR})
# Setup Reference Manual target
if(BUILD_DOC_RefMan)
# Create output directories
set(REFMAN_OUTPUT_DIR "${DOC_ROOT_DIR}/refman")
file(MAKE_DIRECTORY ${REFMAN_OUTPUT_DIR})
file(MAKE_DIRECTORY "${REFMAN_OUTPUT_DIR}/html")
# Copy index file to provide fast access to HTML documentation
file(COPY "${CMAKE_SOURCE_DIR}/dox/resources/index.html" DESTINATION "${REFMAN_OUTPUT_DIR}")
# Generate main page for reference manual
OCCT_DOC_GENERATE_MAIN_PAGE(${REFMAN_OUTPUT_DIR} "main_page.dox")
# Configure Doxygen
set(DOC_TYPE "REFMAN")
OCCT_DOC_CONFIGURE_DOXYGEN(${REFMAN_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
# Add custom target for reference manual
add_custom_target(RefMan
COMMAND ${DOXYGEN_EXECUTABLE} ${REFMAN_OUTPUT_DIR}/Doxyfile
COMMENT "Generating Reference Manual with Doxygen"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
# Add custom command to install generated documentation if required
if(INSTALL_DOC_RefMan)
install(DIRECTORY "${REFMAN_OUTPUT_DIR}/html/"
DESTINATION "${INSTALL_DIR_DOC}/refman/html"
OPTIONAL)
endif()
endif()
# Setup Overview documentation target (after RefMan so it can use the RefMan tag file)
if(BUILD_DOC_Overview)
# Create output directories
set(OVERVIEW_OUTPUT_DIR "${DOC_ROOT_DIR}/overview")
file(MAKE_DIRECTORY ${OVERVIEW_OUTPUT_DIR})
file(MAKE_DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html")
# Configure Doxygen for Overview
set(DOC_TYPE "OVERVIEW")
OCCT_DOC_CONFIGURE_DOXYGEN(${OVERVIEW_OUTPUT_DIR} "Doxyfile" ${DOC_TYPE})
# Add custom target for overview documentation
add_custom_target(Overview
COMMAND ${DOXYGEN_EXECUTABLE} ${OVERVIEW_OUTPUT_DIR}/Doxyfile
COMMENT "Generating Overview documentation with Doxygen"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VERBATIM
)
# Copy index file to provide fast access to HTML documentation
file(COPY "${CMAKE_SOURCE_DIR}/dox/resources/index.html" DESTINATION "${OVERVIEW_OUTPUT_DIR}")
# Add custom command to copy generated documentation to install location if required
if(INSTALL_DOC_Overview)
install(DIRECTORY "${OVERVIEW_OUTPUT_DIR}/html/"
DESTINATION "${INSTALL_DIR_DOC}/overview/html"
OPTIONAL)
# Create overview.html only for windows
if(WIN32)
install(FILES "${CMAKE_SOURCE_DIR}/dox/resources/overview.html"
DESTINATION "${INSTALL_DIR_DOC}")
endif()
endif()
endif()
# Combined documentation target
if(BUILD_DOC_Overview AND BUILD_DOC_RefMan)
add_custom_target(doc ALL
DEPENDS RefMan Overview
COMMENT "Generating all documentation"
)
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
add_dependencies(Overview RefMan) # Ensure Overview uses RefMan tag file
elseif(BUILD_DOC_Overview)
add_custom_target(doc ALL
DEPENDS Overview
COMMENT "Generating Overview documentation"
)
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
elseif(BUILD_DOC_RefMan)
add_custom_target(doc ALL
DEPENDS RefMan
COMMENT "Generating Reference Manual"
)
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
endif()
set_property (TARGET doc PROPERTY FOLDER "Documentation")
endfunction()

View File

@ -1,245 +0,0 @@
# Google Test integration for OCCT toolkits
set (TEST_PROJECT_NAME OpenCascadeGTest)
# Initialize Google Test environment and create the target
function(OCCT_INIT_GTEST)
if (NOT GOOGLETEST_FOUND)
message(STATUS "Google Test not available. Skipping test project ${TEST_PROJECT_NAME}")
return()
endif()
# Initialize test data collections
set(OCCT_GTEST_SOURCE_FILES "" PARENT_SCOPE)
set(OCCT_GTEST_SOURCE_FILES_ABS "" PARENT_SCOPE)
set(OCCT_GTEST_TESTS_LIST "" PARENT_SCOPE)
# Create the test executable once
add_executable(${TEST_PROJECT_NAME})
set_target_properties(${TEST_PROJECT_NAME} PROPERTIES FOLDER "Testing")
# Link with Google Test
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE GTest::gtest_main)
# Add pthreads if necessary (for Linux)
if (UNIX AND NOT APPLE)
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE pthread)
endif()
target_compile_definitions(${TEST_PROJECT_NAME} PRIVATE GTEST_LINKED_AS_SHARED_LIBRARY=1)
# Link with all active toolkits that are libraries
foreach(TOOLKIT ${BUILD_TOOLKITS})
if(TARGET ${TOOLKIT})
get_target_property(TOOLKIT_TYPE ${TOOLKIT} TYPE)
if(TOOLKIT_TYPE STREQUAL "SHARED_LIBRARY" OR TOOLKIT_TYPE STREQUAL "STATIC_LIBRARY")
target_link_libraries(${TEST_PROJECT_NAME} PRIVATE ${TOOLKIT})
endif()
endif()
endforeach()
if (INSTALL_GTEST)
# Install the test executable
install (TARGETS ${TEST_PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
if (EMSCRIPTEN)
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${TEST_PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
endif()
endif()
endfunction()
# Add tests from a specific toolkit to the main test executable
function(OCCT_COLLECT_TOOLKIT_TESTS TOOLKIT_NAME)
# Skip if Google Test is not available or the test executable wasn't created
if (NOT GOOGLETEST_FOUND OR NOT TARGET ${TEST_PROJECT_NAME})
return()
endif()
# Extract test source files from FILES.cmake
set(FILES_CMAKE_PATH "${OCCT_${TOOLKIT_NAME}_FILES_LOCATION}/GTests/FILES.cmake")
if(EXISTS "${FILES_CMAKE_PATH}")
# Reset toolkit test files list
set(OCCT_${TOOLKIT_NAME}_GTests_FILES)
# Include the toolkit's FILES.cmake which sets OCCT_${TOOLKIT_NAME}_GTests_FILES
include("${FILES_CMAKE_PATH}")
set(TEST_SOURCE_FILES "${OCCT_${TOOLKIT_NAME}_GTests_FILES}")
# Skip if no test files found
if(NOT TEST_SOURCE_FILES)
return()
endif()
# Get module name for test organization
get_target_property(TOOLKIT_MODULE ${TOOLKIT_NAME} MODULE)
if(NOT TOOLKIT_MODULE)
set(TOOLKIT_MODULE "Unknown")
endif()
# Get absolute paths of test source files and add them to the executable
set(TEST_SOURCE_FILES_ABS)
foreach(TEST_SOURCE_FILE ${TEST_SOURCE_FILES})
set(TEST_SOURCE_FILE_ABS "${OCCT_${TOOLKIT_NAME}_GTests_FILES_LOCATION}/${TEST_SOURCE_FILE}")
list(APPEND TEST_SOURCE_FILES_ABS "${TEST_SOURCE_FILE_ABS}")
endforeach()
# Add test sources to the executable
target_sources(${TEST_PROJECT_NAME} PRIVATE ${TEST_SOURCE_FILES_ABS})
# Create a more reliable test discovery approach
# Use the WORKING_DIRECTORY parameter to ensure proper test execution context
gtest_add_tests(
TARGET ${TEST_PROJECT_NAME}
TEST_PREFIX "${TOOLKIT_MODULE}::${TOOLKIT_NAME}::"
SOURCES ${TEST_SOURCE_FILES_ABS}
TEST_LIST TOOLKIT_TESTS
SKIP_DEPENDENCY
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
# Configure test output properties to improve result capture
foreach(test_name ${TOOLKIT_TESTS})
set_tests_properties(${test_name} PROPERTIES
# Use proper result detection by checking output and return code
PASS_REGULAR_EXPRESSION "\\[ PASSED \\]"
FAIL_REGULAR_EXPRESSION "\\[ FAILED \\]"
)
endforeach()
# Add these tests to the main list so we can set environment for all tests later
# Get the existing list first
if(DEFINED OCCT_GTEST_TESTS_LIST)
set(TEMP_GTEST_TESTS_LIST ${OCCT_GTEST_TESTS_LIST})
else()
set(TEMP_GTEST_TESTS_LIST "")
endif()
# Append the new tests
list(APPEND TEMP_GTEST_TESTS_LIST ${TOOLKIT_TESTS})
# Update the parent scope variable
set(OCCT_GTEST_TESTS_LIST "${TEMP_GTEST_TESTS_LIST}" PARENT_SCOPE)
endif()
endfunction()
# Set environment variables for all collected tests
function(OCCT_SET_GTEST_ENVIRONMENT)
if (NOT GOOGLETEST_FOUND OR NOT TARGET ${TEST_PROJECT_NAME})
return()
endif()
if (OCCT_GTEST_TESTS_LIST)
# Set common environment variables
set(TEST_ENVIRONMENT
"CSF_LANGUAGE=us"
"MMGT_CLEAR=1"
"CSF_SHMessage=${CMAKE_SOURCE_DIR}/resources/SHMessage"
"CSF_MDTVTexturesDirectory=${CMAKE_SOURCE_DIR}/resources/Textures"
"CSF_ShadersDirectory=${CMAKE_SOURCE_DIR}/resources/Shaders"
"CSF_XSMessage=${CMAKE_SOURCE_DIR}/resources/XSMessage"
"CSF_TObjMessage=${CMAKE_SOURCE_DIR}/resources/TObj"
"CSF_StandardDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_PluginDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_XCAFDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_TObjDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_StandardLiteDefaults=${CMAKE_SOURCE_DIR}/resources/StdResource"
"CSF_IGESDefaults=${CMAKE_SOURCE_DIR}/resources/XSTEPResource"
"CSF_STEPDefaults=${CMAKE_SOURCE_DIR}/resources/XSTEPResource"
"CSF_XmlOcafResource=${CMAKE_SOURCE_DIR}/resources/XmlOcafResource"
"CSF_MIGRATION_TYPES=${CMAKE_SOURCE_DIR}/resources/StdResource/MigrationSheet.txt"
"CSF_OCCTResourcePath=${CMAKE_SOURCE_DIR}/resources"
"CSF_OCCTDataPath=${CMAKE_SOURCE_DIR}/data"
"CSF_OCCTDocPath=${CMAKE_SOURCE_DIR}/doc"
"CSF_OCCTSamplesPath=${CMAKE_SOURCE_DIR}/samples"
"CSF_OCCTTestsPath=${CMAKE_SOURCE_DIR}/tests"
"CSF_OCCTBinPath=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
"CSF_OCCTLibPath=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}"
"CSF_OCCTIncludePath=${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}"
"CASROOT=${CMAKE_SOURCE_DIR}"
)
# Build PATH environment variable
set(PATH_ELEMENTS
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)
# Add 3rdparty paths to PATH
if(3RDPARTY_TCL_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_TCL_LIBRARY_DIR}")
endif()
if(3RDPARTY_TK_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_TK_LIBRARY_DIR}")
endif()
if(3RDPARTY_FREETYPE_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_FREETYPE_LIBRARY_DIR}")
endif()
if(3RDPARTY_FREEIMAGE_LIBRARY_DIRS)
list(APPEND PATH_ELEMENTS "${3RDPARTY_FREEIMAGE_LIBRARY_DIRS}")
endif()
if(3RDPARTY_TBB_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_TBB_LIBRARY_DIR}")
endif()
if(3RDPARTY_VTK_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_VTK_LIBRARY_DIR}")
endif()
if(3RDPARTY_FFMPEG_LIBRARY_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
endif()
if(3RDPARTY_QT_DIR)
list(APPEND PATH_ELEMENTS "${3RDPARTY_QT_DIR}/bin")
endif()
if (3RDPARTY_DLL_DIRS)
foreach(DLL_DIR ${3RDPARTY_DLL_DIRS})
list(APPEND PATH_ELEMENTS "${DLL_DIR}")
endforeach()
endif()
# Create the PATH variable that ctest will use
if(WIN32)
string(REPLACE ";" "\\;" TEST_PATH_ENV "$ENV{PATH}")
string(REPLACE ";" "\\;" PATH_ELEMENTS_STR "${PATH_ELEMENTS}")
list(APPEND TEST_ENVIRONMENT "PATH=${PATH_ELEMENTS_STR}\\;${TEST_PATH_ENV}")
else()
string(REPLACE ";" ":" PATH_ELEMENTS_STR "${PATH_ELEMENTS}")
list(APPEND TEST_ENVIRONMENT "PATH=${PATH_ELEMENTS_STR}:$ENV{PATH}")
# Set LD_LIBRARY_PATH for Unix systems
list(APPEND TEST_ENVIRONMENT "LD_LIBRARY_PATH=${PATH_ELEMENTS_STR}:$ENV{LD_LIBRARY_PATH}")
# Set DYLD_LIBRARY_PATH for macOS
if(APPLE)
list(APPEND TEST_ENVIRONMENT "DYLD_LIBRARY_PATH=${PATH_ELEMENTS_STR}:$ENV{DYLD_LIBRARY_PATH}")
endif()
endif()
# Add DrawResources related environment if it exists
if(EXISTS "${CMAKE_SOURCE_DIR}/resources/DrawResources")
list(APPEND TEST_ENVIRONMENT "DRAWHOME=${CMAKE_SOURCE_DIR}/resources/DrawResources")
list(APPEND TEST_ENVIRONMENT "CSF_DrawPluginDefaults=${CMAKE_SOURCE_DIR}/resources/DrawResources")
if(EXISTS "${CMAKE_SOURCE_DIR}/resources/DrawResources/DrawDefault")
list(APPEND TEST_ENVIRONMENT "DRAWDEFAULT=${CMAKE_SOURCE_DIR}/resources/DrawResources/DrawDefault")
endif()
endif()
# Set FPE signal handler if enabled
if(BUILD_ENABLE_FPE_SIGNAL_HANDLER)
list(APPEND TEST_ENVIRONMENT "CSF_FPE=1")
endif()
# Set TCL/TK library paths if they differ
if(3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TK_LIBRARY_DIR AND NOT 3RDPARTY_TCL_LIBRARY_DIR STREQUAL 3RDPARTY_TK_LIBRARY_DIR)
if(3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT)
list(APPEND TEST_ENVIRONMENT "TCL_LIBRARY=${3RDPARTY_TCL_LIBRARY_DIR}/../lib/tcl${3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT}")
endif()
if(3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT)
list(APPEND TEST_ENVIRONMENT "TK_LIBRARY=${3RDPARTY_TK_LIBRARY_DIR}/../lib/tk${3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT}")
endif()
endif()
# Set environment for all tests in the project
set_tests_properties(${OCCT_GTEST_TESTS_LIST} PROPERTIES ENVIRONMENT "${TEST_ENVIRONMENT}")
endif()
endfunction()

View File

@ -32,23 +32,6 @@ macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS)
OCCT_CHECK_AND_UNSET (INSTALL_DIR_DOC)
endmacro()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
function(FIND_FOLDER_OR_FILE FILE_OR_FOLDER_NAME RESULT_PATH)
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
else()
set (${RESULT_PATH} "" PARENT_SCOPE)
endif()
endfunction()
# COMPILER_BITNESS variable
macro (OCCT_MAKE_COMPILER_BITNESS)
math (EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
@ -71,10 +54,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)
@ -92,39 +71,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()
@ -171,19 +131,25 @@ function (FIND_SUBDIRECTORY ROOT_DIRECTORY DIRECTORY_SUFFIX SUBDIRECTORY_NAME)
endfunction()
function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
set (${RESULT} ${ORIGIN_FILES} PARENT_SCOPE)
endfunction()
function (FILLUP_PRODUCT_SEARCH_TEMPLATE PRODUCT_NAME COMPILER COMPILER_BITNESS SEARCH_TEMPLATES)
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
set (SEARCH_TEMPLATES ${SEARCH_TEMPLATES} PARENT_SCOPE)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
file (GLOB FOUND_FILES "${BUILD_PATCH}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
endif()
file (GLOB ORIGIN_FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${SEARCH_TEMPLATE}")
foreach (ORIGIN_FILE ${ORIGIN_FILES})
# check for existence of patched version of current file
if (NOT BUILD_PATCH OR NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
else()
get_filename_component (ORIGIN_FILE_NAME "${ORIGIN_FILE}" NAME)
if (NOT EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${ORIGIN_FILE_NAME}")
list (APPEND FOUND_FILES ${ORIGIN_FILE})
endif()
endif()
endforeach()
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
endfunction()
function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
@ -197,11 +163,13 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
elseif ("${lower_PRODUCT_NAME}" STREQUAL "tbb")
list (APPEND SEARCH_TEMPLATES "^.*${lower_PRODUCT_NAME}.*")
else()
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} ${COMPILER} ${COMPILER_BITNESS} SEARCH_TEMPLATES)
if (WIN32 AND "${COMPILER}" STREQUAL "clang")
# for clang on Windows, search for "vc" as well
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} "vc" ${COMPILER_BITNESS} SEARCH_TEMPLATES)
endif()
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
endif()
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)
@ -228,236 +196,208 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
endfunction()
macro (OCCT_INSTALL_FILE_OR_DIR BEING_INSTALLED_OBJECT DESTINATION_PATH)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
if (IS_DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}")
# first of all, install original files
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
# secondly, rewrite original files with patched ones
install (DIRECTORY "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
install (FILES "${BUILD_PATCH}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
else()
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}")
install (DIRECTORY "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
else()
install (FILES "${CMAKE_SOURCE_DIR}/${BEING_INSTALLED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
endif()
endmacro()
macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME DESTINATION_PATH)
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${BUILD_NAME}" @ONLY)
endif()
install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
endmacro()
function (EXTRACT_TOOLKIT_PACKAGES RELATIVE_PATH OCCT_TOOLKIT RESULT_PACKAGES)
set (${RESULT_PACKAGES} ${OCCT_${OCCT_TOOLKIT}_LIST_OF_PACKAGES} PARENT_SCOPE)
endfunction()
function(EXTRACT_TOOLKIT_EXTERNLIB RELATIVE_PATH OCCT_TOOLKIT RESULT_LIBS)
set (${RESULT_LIBS} ${OCCT_${OCCT_TOOLKIT}_EXTERNAL_LIBS} PARENT_SCOPE)
endfunction()
function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_INCLUDE_FOLDER)
# Package name can be relative path, need to get only the name of the final element
get_filename_component (OCCT_PACKAGE ${OCCT_PACKAGE} NAME)
# package name is not unique, it can be reuse in tools and src,
# use extra parameter as relative path to distinguish between them
set (OCCT_PACKAGE_FILES "")
get_property(OCCT_PACKAGE_FILES GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_FILES)
get_property(OCCT_PACKAGE_INCLUDE_DIR GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_INCLUDE_DIR)
if (OCCT_PACKAGE_FILES)
set (${RESULT_FILES} ${OCCT_PACKAGE_FILES} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
return()
endif()
set (OCCT_PACKAGE_INCLUDE_DIR "${OCCT_${OCCT_PACKAGE}_FILES_LOCATION}")
set (OCCT_PACKAGE_FILES "${OCCT_${OCCT_PACKAGE}_FILES}")
# collect and search for the files in the package directory or patched one
# FILE contains inly filename that must to be inside package or patched directory
set (FILE_PATH_LIST)
foreach (OCCT_FILE ${OCCT_PACKAGE_FILES})
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE "${OCCT_FILE}")
list (APPEND FILE_PATH_LIST "${OCCT_PACKAGE_INCLUDE_DIR}/${OCCT_FILE}")
endforeach()
if (NOT FILE_PATH_LIST)
message (WARNING "FILES has not been found in ${OCCT_PACKAGE_INCLUDE_DIR} for package ${OCCT_PACKAGE}")
endif()
set (${RESULT_FILES} ${FILE_PATH_LIST} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_FILES "${FILE_PATH_LIST}")
set_property(GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_INCLUDE_DIR "${OCCT_PACKAGE_INCLUDE_DIR}")
endfunction()
# SOLUTION_TYPE: MODULES, TOOLS, SAMPLES
# OCCT_TOOLKIT: TK*
# RESULT_TKS_AS_DEPS: TK* dependencies
# RESULT_INCLUDE_FOLDERS: include folders
function(EXCTRACT_TOOLKIT_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS)
get_property(OCCT_TOOLKIT_INCLUDE_FOLDERS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_INCLUDE_FOLDERS)
if (OCCT_TOOLKIT_DEPS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
return()
endif()
set (EXTERNAL_LIBS)
EXTRACT_TOOLKIT_EXTERNLIB (${SOLUTION_TYPE} ${OCCT_TOOLKIT} EXTERNAL_LIBS)
foreach (EXTERNAL_LIB ${EXTERNAL_LIBS})
string (REGEX MATCH "^TK" TK_FOUND ${EXTERNAL_LIB})
if (TK_FOUND)
list (APPEND OCCT_TOOLKIT_DEPS ${EXTERNAL_LIB})
endif()
endforeach()
set (OCCT_TOOLKIT_PACKAGES)
EXTRACT_TOOLKIT_PACKAGES (${SOLUTION_TYPE} ${OCCT_TOOLKIT} OCCT_TOOLKIT_PACKAGES)
foreach(OCCT_PACKAGE ${OCCT_TOOLKIT_PACKAGES})
EXTRACT_PACKAGE_FILES (${SOLUTION_TYPE} ${OCCT_PACKAGE} OCCT_PACKAGE_FILES OCCT_PACKAGE_INCLUDE_DIR)
list (APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_PACKAGE_INCLUDE_DIR})
endforeach()
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS "${OCCT_TOOLKIT_DEPS}")
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_INCLUDE_FOLDERS "${OCCT_TOOLKIT_INCLUDE_FOLDERS}")
endfunction()
# SOLUTION_TYPE: MODULES, TOOLS, SAMPLES
# OCCT_TOOLKIT: TK*
# RESULT_TKS_AS_DEPS: list of TK* dependencies
# RESULT_INCLUDE_FOLDERS: list of include folders
function(EXCTRACT_TOOLKIT_FULL_DEPS SOLUTION_TYPE OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS)
get_property(OCCT_TOOLKIT_INCLUDE_FOLDERS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_INCLUDE_FOLDERS)
if (OCCT_TOOLKIT_DEPS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
return()
endif()
EXCTRACT_TOOLKIT_DEPS(${SOLUTION_TYPE} ${OCCT_TOOLKIT} OCCT_TOOLKIT_DEPS OCCT_TOOLKIT_INCLUDE_DIR)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${OCCT_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_TOOLKIT_INCLUDE_DIR})
foreach(DEP ${OCCT_TOOLKIT_DEPS})
EXCTRACT_TOOLKIT_FULL_DEPS(${SOLUTION_TYPE} ${DEP} DEP_TOOLKIT_DEPS DEP_INCLUDE_DIRS)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${DEP_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${DEP_INCLUDE_DIRS})
endforeach()
list(REMOVE_DUPLICATES OCCT_TOOLKIT_FULL_DEPS)
list(REMOVE_DUPLICATES OCCT_TOOLKIT_INCLUDE_FOLDERS)
set (${RESULT_TKS_AS_DEPS} ${OCCT_TOOLKIT_FULL_DEPS} PARENT_SCOPE)
set (${RESULT_INCLUDE_FOLDERS} ${OCCT_TOOLKIT_INCLUDE_FOLDERS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS "${OCCT_TOOLKIT_FULL_DEPS}")
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_INCLUDE_FOLDERS "${OCCT_TOOLKIT_INCLUDE_FOLDERS}")
endfunction()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCCT_BUILD_TOOLKITS THE_RELATIVE_PATH THE_OCCT_INSTALL_DIR_PREFIX)
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS OCCT_COLLECT_SOURCE_DIR OCCT_INSTALL_DIR_PREFIX)
set (OCCT_USED_PACKAGES)
# consider patched header.in template
set (TEMPLATE_HEADER_PATH "${CMAKE_SOURCE_DIR}/adm/templates/header.in")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/header.in")
set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in")
endif()
set (OCCT_HEADER_FILES_COMPLETE)
foreach(OCCT_TOOLKIT ${THE_OCCT_BUILD_TOOLKITS})
# parse PACKAGES file
EXTRACT_TOOLKIT_PACKAGES (${THE_RELATIVE_PATH} ${OCCT_TOOLKIT} USED_PACKAGES)
foreach(OCCT_PACKAGE ${USED_PACKAGES})
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_PACKAGE} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
endforeach()
set (ROOT_OCCT_DIR ${CMAKE_SOURCE_DIR})
foreach (OCCT_USED_TOOLKIT ${OCCT_BUILD_TOOLKITS})
# append all required package folders
set (OCCT_TOOLKIT_PACKAGES)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES")
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
endif()
list (APPEND OCCT_USED_PACKAGES ${OCCT_TOOLKIT_PACKAGES})
endforeach()
# Check that copying is done and match the include installation type.
# Check by first file in list.
list(GET OCCT_HEADER_FILES_COMPLETE 0 FIRST_OCCT_HEADER_FILE)
get_filename_component (FIRST_OCCT_HEADER_FILE ${FIRST_OCCT_HEADER_FILE} NAME)
set (TO_FORCE_COPY FALSE)
if (NOT EXISTS "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${FIRST_OCCT_HEADER_FILE}")
set (TO_FORCE_COPY TRUE)
else()
# get content and check the number of lines inside file.
# If more then 1 then it is a symlink.
file (STRINGS "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${FIRST_OCCT_HEADER_FILE}" FIRST_OCCT_HEADER_FILE_CONTENT)
list (LENGTH FIRST_OCCT_HEADER_FILE_CONTENT FIRST_OCCT_HEADER_FILE_CONTENT_LEN)
if (${FIRST_OCCT_HEADER_FILE_CONTENT_LEN} EQUAL 1 AND BUILD_INCLUDE_SYMLINK)
set (TO_FORCE_COPY TRUE)
elseif(${FIRST_OCCT_HEADER_FILE_CONTENT_LEN} GREATER 1 AND NOT BUILD_INCLUDE_SYMLINK)
set (TO_FORCE_COPY TRUE)
list (REMOVE_DUPLICATES OCCT_USED_PACKAGES)
set (OCCT_HEADER_FILES_COMPLETE)
set (OCCT_HEADER_FILE_NAMES_NOT_IN_FILES)
set (OCCT_HEADER_FILE_WITH_PROPER_NAMES)
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Compare FILES with files in package directories...")
foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
else()
message (WARNING "FILES has not been found in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}")
continue()
endif()
endif()
list (LENGTH OCCT_ALL_FILE_NAMES ALL_FILES_NB)
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
# emit warnings if there are unprocessed headers
file (GLOB OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/*.*")
file (GLOB OCCT_ALL_FILES_IN_PATCH_DIR "${BUILD_PATCH}/src/${OCCT_PACKAGE}/*.*")
# use patched header files
foreach (OCCT_FILE_IN_PATCH_DIR ${OCCT_ALL_FILES_IN_PATCH_DIR})
get_filename_component (OCCT_FILE_IN_PATCH_DIR_NAME ${OCCT_FILE_IN_PATCH_DIR} NAME)
list (REMOVE_ITEM OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/${OCCT_FILE_IN_PATCH_DIR_NAME}")
list (APPEND OCCT_ALL_FILES_IN_DIR "${OCCT_FILE_IN_PATCH_DIR}")
endforeach()
foreach (OCCT_FILE_IN_DIR ${OCCT_ALL_FILES_IN_DIR})
get_filename_component (OCCT_FILE_IN_DIR_NAME ${OCCT_FILE_IN_DIR} NAME)
set (OCCT_FILE_IN_DIR_STATUS OFF)
if (${ALL_FILES_NB} LESS 0)
break()
endif()
foreach (FILE_INDEX RANGE ${ALL_FILES_NB})
list (GET OCCT_ALL_FILE_NAMES ${FILE_INDEX} OCCT_FILE_NAME)
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE_NAME "${OCCT_FILE_NAME}")
if ("${OCCT_FILE_IN_DIR_NAME}" STREQUAL "${OCCT_FILE_NAME}")
set (OCCT_FILE_IN_DIR_STATUS ON)
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILES_COMPLETE ${OCCT_FILE_IN_DIR})
# collect header files with name that does not contain its package one
string (REGEX MATCH "^${OCCT_PACKAGE}[_.]" IS_HEADER_MATHCING_PACKAGE "${OCCT_FILE_NAME}")
if (NOT IS_HEADER_MATHCING_PACKAGE)
list (APPEND OCCT_HEADER_FILE_WITH_PROPER_NAMES "${OCCT_FILE_NAME}")
endif()
endif()
# remove found element from list
list (REMOVE_AT OCCT_ALL_FILE_NAMES ${FILE_INDEX})
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" ) # decrement number
break()
endif()
endforeach()
if (NOT OCCT_FILE_IN_DIR_STATUS)
message (STATUS "Warning. File ${OCCT_FILE_IN_DIR} is not listed in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
if (IS_HEADER_FOUND)
list (APPEND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${OCCT_FILE_NAME})
endif()
endif()
endforeach()
endforeach()
# create new file including found header
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Create header-links in inc folder...")
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
set(TARGET_FILE "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}")
# Check if the file already exists in the target directory
if (TO_FORCE_COPY OR NOT EXISTS "${TARGET_FILE}")
if (BUILD_INCLUDE_SYMLINK)
file (CREATE_LINK "${OCCT_HEADER_FILE}" "${TARGET_FILE}" SYMBOLIC)
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY)
endforeach()
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${OCCT_INSTALL_DIR_PREFIX}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")
file (GLOB OCCT_HEADER_FILES_OLD "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/*")
foreach (OCCT_HEADER_FILE_OLD ${OCCT_HEADER_FILES_OLD})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE_OLD} NAME)
string (REGEX MATCH "^[a-zA-Z0-9]+" PACKAGE_NAME "${HEADER_FILE_NAME}")
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
if (NOT EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not present in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
else()
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
configure_file ("${TEMPLATE_HEADER_PATH}" "${TARGET_FILE}" @ONLY)
list (FIND OCCT_HEADER_FILE_NAMES_NOT_IN_FILES ${PACKAGE_NAME} IS_HEADER_FOUND)
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is present in the sources but not involved in FILES and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif()
else()
set (IS_HEADER_FOUND -1)
if (NOT "${OCCT_HEADER_FILE_WITH_PROPER_NAMES}" STREQUAL "")
list (FIND OCCT_HEADER_FILE_WITH_PROPER_NAMES ${HEADER_FILE_NAME} IS_HEADER_FOUND)
endif()
if (${IS_HEADER_FOUND} EQUAL -1)
message (STATUS "Warning. \(${PACKAGE_NAME}\) ${OCCT_HEADER_FILE_OLD} is not used and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
endif()
endif()
endforeach()
set (OCCT_HEADER_FILES_INSTALLATION ${OCCT_HEADER_FILES_COMPLETE})
list (FILTER OCCT_HEADER_FILES_INSTALLATION INCLUDE REGEX ".*[.](h|hxx|lxx)$")
install (FILES ${OCCT_HEADER_FILES_INSTALLATION} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
endfunction()
# Macro to configure and install Standard_Version.hxx file
macro (CONFIGURE_AND_INSTALL_VERSION_HEADER)
if (DEFINED BUILD_OCCT_VERSION_EXT AND "${BUILD_OCCT_VERSION_EXT}" STREQUAL "${OCC_VERSION_STRING_EXT}" AND EXISTS "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx")
install(FILES "${OCCT_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
else()
set(BUILD_OCCT_VERSION_EXT "${OCC_VERSION_STRING_EXT}" CACHE STRING "OCCT Version string. Used only for caching, can't impact on build. For modification of version, please check adm/cmake/version.cmake" FORCE)
mark_as_advanced(BUILD_OCCT_VERSION_EXT)
string(TIMESTAMP OCCT_VERSION_DATE "%Y-%m-%d" UTC)
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/Standard_Version.hxx.in" "${INSTALL_DIR_INCLUDE}/Standard_Version.hxx" "Standard_Version.hxx" "${INSTALL_DIR}/${INSTALL_DIR_INCLUDE}")
endif()
endmacro()
function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER THE_IS_PRIVATE)
if (NOT BUILD_USE_PCH)
return()
endif()
if (${THE_IS_PRIVATE})
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
else()
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
endif()
endfunction()
macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
# first of all, copy original files
if (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}")
file (COPY "${CMAKE_SOURCE_DIR}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_COPIED_OBJECT}")
# secondly, rewrite original files with patched ones
file (COPY "${BUILD_PATCH}/${BEING_COPIED_OBJECT}" DESTINATION "${DESTINATION_PATH}")
endif()
endmacro()
macro (OCCT_CONFIGURE BEING_CONGIRUGED_FILE FINAL_NAME)
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}")
configure_file("${BUILD_PATCH}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/${BEING_CONGIRUGED_FILE}" "${FINAL_NAME}" @ONLY)
endif()
endmacro()
macro (OCCT_ADD_SUBDIRECTORY BEING_ADDED_DIRECTORY)
if (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
add_subdirectory(${BUILD_PATCH}/${BEING_ADDED_DIRECTORY})
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY}/CMakeLists.txt")
add_subdirectory (${CMAKE_SOURCE_DIR}/${BEING_ADDED_DIRECTORY})
else()
message (STATUS "${BEING_ADDED_DIRECTORY} directory is not included")
@ -471,8 +411,11 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
message(STATUS "Warning: the list of being used toolkits is empty")
else()
foreach (USED_TOOLKIT ${BUILD_TOOLKITS})
set (FILE_CONTENT)
EXTRACT_TOOLKIT_EXTERNLIB ("src" ${USED_TOOLKIT} FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${USED_TOOLKIT}/EXTERNLIB")
file (READ "${BUILD_PATCH}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB")
file (READ "${CMAKE_SOURCE_DIR}/src/${USED_TOOLKIT}/EXTERNLIB" FILE_CONTENT)
endif()
string (REGEX MATCH "${CSF_VAR_NAME}" DOES_FILE_CONTAIN "${FILE_CONTENT}")
@ -484,6 +427,17 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
endif()
endfunction()
function (FILE_TO_LIST FILE_NAME FILE_CONTENT)
set (LOCAL_FILE_CONTENT)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_NAME}")
file (STRINGS "${BUILD_PATCH}/${FILE_NAME}" LOCAL_FILE_CONTENT)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_NAME}")
file (STRINGS "${CMAKE_SOURCE_DIR}/${FILE_NAME}" LOCAL_FILE_CONTENT)
endif()
set (${FILE_CONTENT} ${LOCAL_FILE_CONTENT} PARENT_SCOPE)
endfunction()
# Function to determine if TOOLKIT is OCCT toolkit
function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
set (${IS_TOOLKIT_FOUND} OFF PARENT_SCOPE)
@ -497,6 +451,58 @@ function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
endforeach(MODULE)
endfunction()
# TOOLKIT_DEPS is defined with dependencies from file src/TOOLKIT_NAME/EXTERNLIB.
# CSF_ variables are ignored
function (OCCT_TOOLKIT_DEP TOOLKIT_NAME TOOLKIT_DEPS)
FILE_TO_LIST ("src/${TOOLKIT_NAME}/EXTERNLIB" FILE_CONTENT)
#list (APPEND LOCAL_TOOLKIT_DEPS ${TOOLKIT_NAME})
set (LOCAL_TOOLKIT_DEPS)
foreach (FILE_CONTENT_LINE ${FILE_CONTENT})
string (REGEX MATCH "^TK" TK_FOUND ${FILE_CONTENT_LINE})
if ("x${FILE_CONTENT_LINE}" STREQUAL "xDRAWEXE" OR NOT "${TK_FOUND}" STREQUAL "")
list (APPEND LOCAL_TOOLKIT_DEPS ${FILE_CONTENT_LINE})
endif()
endforeach()
set (${TOOLKIT_DEPS} ${LOCAL_TOOLKIT_DEPS} PARENT_SCOPE)
endfunction()
# TOOLKIT_FULL_DEPS is defined with complete dependencies (all levels)
function (OCCT_TOOLKIT_FULL_DEP TOOLKIT_NAME TOOLKIT_FULL_DEPS)
# first level dependencies are stored in LOCAL_TOOLKIT_FULL_DEPS
OCCT_TOOLKIT_DEP (${TOOLKIT_NAME} LOCAL_TOOLKIT_FULL_DEPS)
list (LENGTH LOCAL_TOOLKIT_FULL_DEPS LIST_LENGTH)
set (LIST_INDEX 0)
while (LIST_INDEX LESS LIST_LENGTH)
list (GET LOCAL_TOOLKIT_FULL_DEPS ${LIST_INDEX} CURRENT_TOOLKIT)
OCCT_TOOLKIT_DEP (${CURRENT_TOOLKIT} CURRENT_TOOLKIT_DEPS)
# append toolkits are not contained
foreach (CURRENT_TOOLKIT_DEP ${CURRENT_TOOLKIT_DEPS})
set (CURRENT_TOOLKIT_DEP_FOUND OFF)
foreach (LOCAL_TOOLKIT_FULL_DEP ${LOCAL_TOOLKIT_FULL_DEPS})
if ("${CURRENT_TOOLKIT_DEP}" STREQUAL "${LOCAL_TOOLKIT_FULL_DEP}")
set (CURRENT_TOOLKIT_DEP_FOUND ON)
break()
endif()
endforeach()
if ("${CURRENT_TOOLKIT_DEP_FOUND}" STREQUAL "OFF")
list (APPEND LOCAL_TOOLKIT_FULL_DEPS ${CURRENT_TOOLKIT_DEP})
endif()
endforeach()
# increment the list index
MATH(EXPR LIST_INDEX "${LIST_INDEX}+1")
# calculate new length
list (LENGTH LOCAL_TOOLKIT_FULL_DEPS LIST_LENGTH)
endwhile()
set (${TOOLKIT_FULL_DEPS} ${LOCAL_TOOLKIT_FULL_DEPS} PARENT_SCOPE)
endfunction()
# Function to get list of modules/toolkits/samples from file adm/${FILE_NAME}.
# Creates list <$MODULE_LIST> to store list of MODULES and
# <NAME_OF_MODULE>_TOOLKITS foreach module to store its toolkits, where "TOOLKITS" is defined by TOOLKITS_NAME_SUFFIX.
@ -515,80 +521,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})
# Use special flag from cache to turn on or off git hash extraction
if (NOT DEFINED USE_GIT_HASH)
set (USE_GIT_HASH ON CACHE BOOL "Use git hash in version string")
endif()
if (${USE_GIT_HASH})
OCCT_GET_GIT_HASH()
endif()
if (NOT "${GIT_HASH}" STREQUAL "")
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}-${GIT_HASH}")
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}")
endif()
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}")
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_STRING_EXT}" PARENT_SCOPE)
set (SET_OCC_VERSION_DEVELOPMENT "#define OCC_VERSION_DEVELOPMENT \"${OCC_VERSION_DEVELOPMENT}\"")
set (SET_OCC_VERSION_DEVELOPMENT "${SET_OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
if (OCC_VERSION_DEVELOPMENT AND OCC_VERSION_COMPLETE)
set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE)
else()
OCCT_CHECK_AND_UNSET(USE_GIT_HASH)
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)
@ -611,74 +579,6 @@ macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME
endmacro()
macro (FLEX_AND_BISON_TARGET_APPLY THE_PACKAGE_NAME RELATIVE_SOURCES_DIR)
# Generate Flex and Bison files
if (NOT ${BUILD_YACCLEX})
return()
endif()
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (NOT (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0))
message(FATAL_ERROR "Error: number of FLEX and BISON files is not equal for ${THE_PACKAGE_NAME}")
endif()
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (NOT (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL}))
continue()
endif()
# Note: files are generated in original source directory (not in patch!)
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${THE_PACKAGE_NAME}")
# choose appropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
if (CXX_BISON_LANGUAGE_FOUND)
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
message (STATUS "Info: remove old output FLEX file: ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
endif()
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
endforeach()
endmacro()
# Adds OCCT_INSTALL_BIN_LETTER variable ("" for Release, "d" for Debug and
# "i" for RelWithDebInfo) in OpenCASCADETargets-*.cmake files during
# installation process.
@ -692,7 +592,7 @@ macro (OCCT_UPDATE_TARGET_FILE)
install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
file (GLOB ALL_OCCT_TARGET_FILES \"\$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\")
foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
file (REMOVE \"\${TARGET_FILENAME}\")
@ -732,126 +632,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()

View File

@ -3,8 +3,8 @@
macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
set (RESOURCE_FILES)
set (isResDirectory FALSE)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}")
file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}/FILES" RESOURCE_FILES)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/src/${CurrentResource}")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource}/FILES" RESOURCE_FILES)
set (CurrentResource_Directory "${CurrentResource}")
set (isResDirectory TRUE)
else()
@ -27,23 +27,37 @@ macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
string (REPLACE "." "_" CurrentResource_FileName "${CurrentResource_FileName}")
set (HEADER_FILE_NAME "${CurrentResource_Directory}_${CurrentResource_FileName}.pxx")
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}")
# generate content for header file
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file resources/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
# read resource file
file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
string (REPLACE "\"" "\\\"" line "${line}")
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
endforeach()
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};\n\n")
# Save generated content to header file
set (HEADER_FILE "${OCCT_${CurrentResource_Directory}_FILES_LOCATION}/${HEADER_FILE_NAME}")
if (EXISTS "${HEADER_FILE}")
file (REMOVE "${HEADER_FILE}")
set (toProcessResFile TRUE)
if (isResDirectory)
list (FIND RESOURCE_FILES "${HEADER_FILE_NAME}" aResIndex)
if ("${aResIndex}" STREQUAL "-1")
set (toProcessResFile FALSE)
endif()
endif()
if (toProcessResFile)
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}")
# generate content for header file
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
# read resource file
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
string (REPLACE "\"" "\\\"" line "${line}")
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
endforeach()
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};")
# Save generated content to header file
set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")
if (EXISTS "${HEADER_FILE}")
file (REMOVE "${HEADER_FILE}")
endif()
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
endif()
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
endif()
endforeach()
endif()

View File

@ -23,7 +23,7 @@ if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
endif()
# parse PACKAGES file
EXTRACT_TOOLKIT_PACKAGES (${RELATIVE_SOURCES_DIR} ${PROJECT_NAME} USED_PACKAGES)
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
if ("${USED_PACKAGES}" STREQUAL "")
set (USED_PACKAGES ${PROJECT_NAME})
endif()
@ -47,6 +47,7 @@ endif()
# Get all used packages from toolkit
UNSET(RESOURCE_FILES)
foreach (OCCT_PACKAGE ${USED_PACKAGES})
#remove part after "/" in the OCCT_PACKAGE variable if exists
string (FIND "${OCCT_PACKAGE}" "/" _index)
if (_index GREATER -1)
@ -56,30 +57,149 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (OCCT_PACKAGE_NAME "${OCCT_PACKAGE}")
endif()
if (WIN32)
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE_NAME}_DLL")
endif()
set (SOURCE_FILES)
set (HEADER_FILES)
EXTRACT_PACKAGE_FILES (${RELATIVE_SOURCES_DIR} ${OCCT_PACKAGE} ALL_FILES INCLUDE_FOLDER)
# Generate Flex and Bison files
if (${BUILD_YACCLEX})
# flex files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
set (HEADER_FILES_FILTERING ${ALL_FILES})
set (SOURCE_FILES_FILTERING ${ALL_FILES})
# remove old general version of FlexLexer
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h")
file(REMOVE ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h)
endif()
# install copy of FlexLexer.h locally to allow further building without flex
if (FLEX_INCLUDE_DIR AND EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h")
configure_file("${FLEX_INCLUDE_DIR}/FlexLexer.h" "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h" @ONLY NEWLINE_STYLE LF)
endif()
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|p|g|lxx|hxx|pxx|hpp|gxx)$")
if(APPLE)
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cxx|cpp|mm)$")
else()
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|cpp|cxx)$")
# bison files
OCCT_ORIGIN_AND_PATCHED_FILES ("${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
list (SORT SOURCE_FILES_FLEX)
list (SORT SOURCE_FILES_BISON)
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
# Note: files are generated in original source directory (not in patch!)
set (FLEX_BISON_TARGET_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}")
# choose appropriate extension for generated files: "cxx" if source file contains
# instruction to generate C++ code, "c" otherwise
set (BISON_OUTPUT_FILE_EXT "c")
set (FLEX_OUTPUT_FILE_EXT "c")
file (STRINGS "${CURRENT_BISON_FILE}" FILE_BISON_CONTENT)
foreach (FILE_BISON_CONTENT_LINE ${FILE_BISON_CONTENT})
string (REGEX MATCH "%language \"C\\+\\+\"" CXX_BISON_LANGUAGE_FOUND ${FILE_BISON_CONTENT_LINE})
if (CXX_BISON_LANGUAGE_FOUND)
set (BISON_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
file (STRINGS "${CURRENT_FLEX_FILE}" FILE_FLEX_CONTENT)
foreach (FILE_FLEX_CONTENT_LINE ${FILE_FLEX_CONTENT})
string (REGEX MATCH "%option c\\+\\+" CXX_FLEX_LANGUAGE_FOUND ${FILE_FLEX_CONTENT_LINE})
if (CXX_FLEX_LANGUAGE_FOUND)
set (FLEX_OUTPUT_FILE_EXT "cxx")
endif()
endforeach()
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.${FLEX_OUTPUT_FILE_EXT})
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.${BISON_OUTPUT_FILE_EXT})
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
message (STATUS "Info: remove old output BISON file: ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${CURRENT_BISON_FILE_NAME}.tab.hxx)
endif()
if (EXISTS ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
message (STATUS "Info: remove old output FLEX file: ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}")
file(REMOVE ${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE})
endif()
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} "${FLEX_BISON_TARGET_DIR}/${BISON_OUTPUT_FILE}"
COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME} -l -M ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/=")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} "${FLEX_BISON_TARGET_DIR}/${FLEX_OUTPUT_FILE}"
COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME} -L")
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
endif()
endforeach()
endif()
endif()
list (APPEND HEADER_FILES ${HEADER_FILES_FILTERING})
list (APPEND SOURCE_FILES ${SOURCE_FILES_FILTERING})
# header files
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${HEADER_FILES_FILTERING}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${SOURCE_FILES_FILTERING}")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
else()
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
list (APPEND USED_INCFILES ${HEADER_FILES})
list (APPEND USED_SRCFILES ${SOURCE_FILES})
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
if(APPLE)
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
endif()
endif()
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
if(APPLE)
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
endif()
foreach(HEADER_FILE ${HEADER_FILES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
list (APPEND USED_INCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
else()
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
endif()
endforeach()
foreach(SOURCE_FILE ${SOURCE_FILES})
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
list (APPEND USED_SRCFILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${BUILD_PATCH}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
else()
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
endif()
endforeach()
if (USE_QT)
FIND_AND_INSTALL_QT_RESOURCES (${OCCT_PACKAGE} RESOURCE_FILES)
@ -96,7 +216,12 @@ string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
set (USED_RCFILE "")
if (MSVC)
set (USED_RCFILE "${CMAKE_BINARY_DIR}/resources/${PROJECT_NAME}.rc")
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in")
configure_file("${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
else()
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
endif()
endif()
set (CURRENT_MODULE)
@ -120,6 +245,18 @@ endif (USE_QT)
if (EXECUTABLE_PROJECT)
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
@ -129,7 +266,19 @@ if (EXECUTABLE_PROJECT)
else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (MSVC AND BUILD_SHARED_LIBS)
if (DEFINED ${PROJECT_NAME}_DISABLE_COTIRE AND ${PROJECT_NAME}_DISABLE_COTIRE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
else()
# To avoid excluding of PROJECT_NAME from cotire tool, we may use cotire
# COTIRE_PREFIX_HEADER_IGNORE_PATH instead. But, practically it causes many 'undefined symbols' error.
# So, we just exclude PROJECT_NAME from cotire list.
# if (DEFINED ${PROJECT_NAME}_COTIRE_IGNORE_PATH)
# set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_PREFIX_HEADER_IGNORE_PATH "${${PROJECT_NAME}_COTIRE_IGNORE_PATH}")
# endif()
endif()
if (MSVC)
if (BUILD_FORCE_RelWithDebInfo)
set (aReleasePdbConf "Release")
else()
@ -189,59 +338,108 @@ elseif (BUILD_SOVERSION_NUMBERS GREATER 1)
elseif (BUILD_SOVERSION_NUMBERS GREATER 0)
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}")
endif()
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
SOVERSION "${OCC_SOVERSION}"
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNLIB_AND_TOOLKITS)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
# SOME EXECUTABLE PROJECTS MAY USE CUSTOM TOOLKITS AND EXTERNAL LIBRARIES
# parse EXTERNLIB file
if (CUSTOM_EXTERNLIB)
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
foreach (EXTERNAL_LIB ${CUSTOM_EXTERNLIB})
string (REGEX MATCH "^TK" TK_FOUND ${EXTERNAL_LIB})
if (TK_FOUND)
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${EXTERNAL_LIB})
endif()
endforeach()
else()
EXTRACT_TOOLKIT_EXTERNLIB ("${RELATIVE_SOURCES_DIR}" "${PROJECT_NAME}" USED_EXTERNLIB_AND_TOOLKITS)
EXCTRACT_TOOLKIT_DEPS ("${RELATIVE_SOURCES_DIR}" "${PROJECT_NAME}" USED_TOOLKITS_BY_CURRENT_PROJECT _)
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT ${PROJECT_NAME})
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
endif()
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
if (COMMENT_FOUND)
continue()
endif()
if (NOT COMMENT_FOUND)
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
OCCT_INSTALL_VTK(${USED_ITEM})
endif()
else()
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
if ("${CSF_FOUND}" STREQUAL "")
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
add_definitions (-DHAVE_GLES2)
endif()
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
if ("${CURRENT_CSF}" STREQUAL "${CSF_Draco}")
set (CURRENT_CSF "")
set (USED_DRACO 1)
endif()
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 (NOT "${VTK_FOUND}" STREQUAL "")
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
if (BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
OCCT_INSTALL_VTK(${USED_ITEM})
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()
endif()
endif()
endif()
continue()
endif()
# Search for 3rd-party libraries as a dependency
set (CURRENT_CSF ${${USED_ITEM}})
if ("x${CURRENT_CSF}" STREQUAL "x")
continue()
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlLibs}")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "${CSF_OpenGlesLibs}")
add_definitions (-DHAVE_GLES2)
endif()
PROCESS_CSF_LIBRARIES ("${CURRENT_CSF}" USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT "${PROJECT_NAME}")
endforeach()
if (USE_DRACO)
if (USED_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()
endif()
if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1)
@ -277,12 +475,13 @@ else()
endif()
endif()
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
if (USE_QT)
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
@ -299,3 +498,35 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
endif()
endif()
# use Cotire to accelerate build via usage of precompiled headers
if (BUILD_USE_PCH)
if (WIN32)
# prevent definition of min and max macros through inclusion of Windows.h
# (for cotire builds)
add_definitions("-DNOMINMAX")
# avoid warnings on deprecated names from standard C library (see strsafe.h)
add_definitions("-DSTRSAFE_NO_DEPRECATE")
# avoid "std::Equal1" warning in QANCollection_Stl.cxx in debug mode
# suggesting using msvc "Checked Iterators"
add_definitions("-D_SCL_SECURE_NO_WARNINGS")
endif()
# Exclude system-provided glext.h.
# These macros are already defined within OpenGl_GlFunctions.hxx,
# however we have to duplicate them here for building TKOpenGl with PCH.
add_definitions("-DGL_GLEXT_LEGACY")
add_definitions("-DGLX_GLXEXT_LEGACY")
# workaround for old gcc
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
add_definitions("-D__STDC_CONSTANT_MACROS")
add_definitions("-D__STDC_FORMAT_MACROS")
endif()
# unity builds are not used since they do not add speed but cause conflicts
# in TKV3d
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${PROJECT_NAME})
endif()

View File

@ -0,0 +1,13 @@
if ("${TARGET_FOLDER}" STREQUAL "")
set (USE_QT ON)
set (RELATIVE_DIR "tools")
set (MODULES_LIST ${OCCT_TOOLS})
set (TARGET_FOLDER "Tools")
set (TOOLKITS_NAME_SUFFIX "TOOL_TOOLKITS")
else()
unset (USE_QT)
unset (RELATIVE_DIR)
unset (MODULES_LIST)
unset (TARGET_FOLDER)
unset (TOOLKITS_NAME_SUFFIX)
endif("${TARGET_FOLDER}" STREQUAL "")

View File

@ -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" "")

View File

@ -3,54 +3,38 @@
# Qt is searched manually first (just determine root)
message (STATUS "Processing Qt 3-rd party")
set (USE_QT_FROM_3RDPARTY_DIR TRUE)
if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt")
set (USE_QT_FROM_3RDPARTY_DIR FALSE)
else()
# Combine directory name with absolute path and show in GUI
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR")
endif()
endif()
if (${USE_QT_FROM_3RDPARTY_DIR})
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
# Without this setting find_package() will not work
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
# Now we can apply standard CMake finder for Qt5. We do this mostly
# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
else()
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml)
endif()
if (NOT ${Qt5_FOUND})
# Now we can apply standard CMake finder for Qt. We do this mostly
# to have qt4_wrap_cpp() function available
find_package(Qt4)
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR} AND WIN32)
# Qt5_DIR typically points to lib/cmake/Qt5, need to go up to Qt root
get_filename_component(QT_CMAKE_DIR "${Qt5_DIR}" DIRECTORY)
get_filename_component(QT_LIB_DIR "${QT_CMAKE_DIR}" DIRECTORY)
get_filename_component(QT_ROOT_DIR "${QT_LIB_DIR}" DIRECTORY)
# Verify this is indeed the Qt root by checking for bin and packages directories
if(EXISTS "${QT_ROOT_DIR}/bin")
set(3RDPARTY_QT_DIR ${QT_ROOT_DIR} CACHE PATH "The directory containing Qt" FORCE)
else()
message(WARNING "Found Qt5 at ${Qt5_DIR} but could not determine Qt root directory with bin/ and plugins/ folders")
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
endif()
elseif(NOT ${USE_QT_FROM_3RDPARTY_DIR})
set(3RDPARTY_QT_DIR ${Qt5_DIR} CACHE PATH "The directory containing Qt" FORCE)
# Combine directory name with absolute path and show in GUI
set (3RDPARTY_QT_DIR "${3RDPARTY_DIR}/${3RDPARTY_QT_DIR_NAME}" CACHE PATH "The directory containing Qt" FORCE)
message (STATUS "Info: Qt is used from folder: ${3RDPARTY_QT_DIR}")
endif()
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}/bin")
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
# Without this setting find_package() will not work
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
# Now we can apply standard CMake finder for Qt5. We do this mostly
# to have qt5_wrap_cpp() function available and Qt5_FOUND variable filled
find_package(Qt5 QUIET COMPONENTS Widgets Quick Xml PATHS ${3RDPARTY_QT_DIR} NO_DEFAULT_PATH)
if (NOT ${Qt5_FOUND})
# Now we can apply standard CMake finder for Qt. We do this mostly
# to have qt4_wrap_cpp() function available
find_package(Qt4)
#message (STATUS "Qt4 cmake configuration")
else()
#message (STATUS "Qt5 cmake configuration")
endif()
if (3RDPARTY_QT_DIR OR EXISTS "${3RDPARTY_QT_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_QT_DIR}/bin")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_QT_DLL_DIR)

View File

@ -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()
@ -90,5 +82,5 @@ else()
set (3RDPARTY_RAPIDJSON_INCLUDE_DIR "" CACHE PATH "the path to RapidJSON header file" FORCE)
endif()
# hide all redundant variables
mark_as_advanced(RapidJSON_DIR)
# unset all redundant variables
OCCT_CHECK_AND_UNSET(RapidJSON_DIR)

View File

@ -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)
@ -40,7 +27,7 @@ if (WIN32)
# Below, we have correct 3RDPARTY_DIR.
# Initialize TBB folder in connection with 3RDPARTY_DIR.
# Initialize TBB folder in connectin with 3RDPARTY_DIR.
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME)
@ -57,7 +44,7 @@ if (WIN32)
REQUIRED
CONFIG)
# Archive include directory
# Achive include directory
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
@ -69,17 +56,13 @@ if (WIN32)
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
endif()
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
# Archive *.lib files and directory containing it.
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
# Achive *.lib files and directory containing it.
get_target_property (TBB_LIB_FILE "TBB::${LIB_LOWER}" IMPORTED_IMPLIB_RELEASE)
# Reserve cache variable for *.lib.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.lib)")
@ -105,8 +88,8 @@ if (WIN32)
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# Archive *.dll files and directory containing it.
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
# Achive *.dll files and directory containing it.
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Reserve cache variable for *.dll.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
@ -188,9 +171,9 @@ else ()
REQUIRED
CONFIG)
endif()
# TBB has been configured (in other case FATAL_ERROR occurs).
# TBB has been configured (in other case FATAL_ERROR occures).
# Archive include directory.
# Achive include directory.
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
@ -202,17 +185,13 @@ else ()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
endif()
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
string(TOLOWER "${LIB}" LIB_LOWER)
string(TOUPPER "${LIB}" LIB_UPPER)
# Archive *.so files and directory containing it.
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
# Achive *.so files and directory containing it.
get_target_property (TBB_SO_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_RELEASE)
# Reserve cache variable for *.so.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.so)")

View File

@ -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)
@ -273,12 +269,13 @@ if (TK_FOUND AND 3RDPARTY_TCL_DIR)
endif()
endif()
# hide all redundant variables
# TCL
mark_as_advanced (TCL_LIBRARY)
mark_as_advanced (TCL_INCLUDE_PATH)
mark_as_advanced (TCL_TCLSH)
# unset all redundant variables
#TCL
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
#TK
mark_as_advanced (TK_LIBRARY)
mark_as_advanced (TK_INCLUDE_PATH)
mark_as_advanced (TK_WISH)
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TK_WISH)

View File

@ -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)
@ -274,15 +267,15 @@ if (BUILD_SHARED_LIBS)
mark_as_advanced (3RDPARTY_TK_LIBRARY 3RDPARTY_TK_DLL)
endif()
# hide all redundant variables
mark_as_advanced (TCL_LIBRARY)
mark_as_advanced (TCL_INCLUDE_PATH)
mark_as_advanced (TCL_TCLSH)
# unset all redundant variables
#TCL
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
#TK
mark_as_advanced (TK_LIBRARY)
mark_as_advanced (TK_INCLUDE_PATH)
mark_as_advanced (TK_WISH)
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TK_WISH)
if (NOT BUILD_SHARED_LIBS)
OCCT_CHECK_AND_UNSET (3RDPARTY_TK_LIBRARY)

View File

@ -1,5 +1,13 @@
# variable description
#
set (BUILD_PATCH_DESCR
"Points to the directory recognized as a 'patch' for OCCT. If specified,
the files from this directory take precedence over the corresponding native
OCCT sources. This way you are able to introduce patches to Open CASCADE
Technology not affecting the original source distribution")
set (BUILD_LIBRARY_TYPE_DESCR
"Specifies the type of library to be created. 'Shared' libraries
are linked dynamically and loaded at runtime. 'Static' libraries
@ -40,11 +48,6 @@ set (BUILD_USE_PCH_DESCR
"Use precompiled headers to accelerate the build.
Precompiled headers are generated automatically by Cotire tool.")
set (BUILD_INCLUDE_SYMLINK_DESCR
"Include symbolic links to the source files in the build directory.
OFF - using a reference file with direct include to the origin,
ON - symbolic link to the origin file are created")
# install variables
set (INSTALL_DIR_DESCR
"The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),
@ -113,6 +116,7 @@ endmacro()
BUILD_MODULE_MESSAGE (BUILD_MODULE_ApplicationFramework "ApplicationFramework")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DataExchange "DataExchange")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DETools "DETools")
BUILD_MODULE_MESSAGE (BUILD_MODULE_Draw "Draw")
BUILD_MODULE_MESSAGE (BUILD_MODULE_FoundationClasses "FoundationClasses")
BUILD_MODULE_MESSAGE (BUILD_MODULE_ModelingAlgorithms "ModelingAlgorithms")
@ -136,6 +140,13 @@ set (BUILD_SAMPLES_QT_DESCR
These samples show some possibilities of using OCCT and they can be executed
with script samples.bat from the installation directory (INSTALL_DIR)")
set (BUILD_Inspector_DESCR
"Indicates whether OCCT inspector should be built together with OCCT.
This inspector provides functionality to interactively inspect low-level content
of the OCAF data model, OCCT viewer, etc. have been introduced in OCCT.
It can be executed with script inspector.bat from the installation directory (INSTALL_DIR) or
using 'tinspector' command in DRAW interpretator")
set (BUILD_MODULE_UwpSample_DESCR
"Indicates whether OCCT UWP sample should be built together with OCCT.")
@ -199,30 +210,7 @@ set (USE_XLIB_DESCR "Indicates whether X11 is used or not")
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
# Documentation variables
set (BUILD_DOC_Overview_DESCR
"Build OCCT overview documentation using Doxygen")
set (BUILD_DOC_RefMan_DESCR
"Build OCCT reference manual documentation using Doxygen")
set (INSTALL_DOC_Overview_DESCR
"Install OCCT overview documentation")
set (INSTALL_DOC_RefMan_DESCR
"Install OCCT reference manual documentation")
macro (BUILD_MODULE MODULE_NAME)
set (ENABLE_MODULE TRUE)
set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/TOOLKITS)
set (${MODULE_NAME}_TOOLKITS ${OCCT_${MODULE_NAME}_LIST_OF_TOOLKITS})
foreach (TOOLKIT ${OCCT_${MODULE_NAME}_LIST_OF_TOOLKITS})
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/PACKAGES)
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/EXTERNLIB)
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/FILES)
foreach (PACKAGE ${OCCT_${TOOLKIT}_LIST_OF_PACKAGES})
OCCT_INCLUDE_CMAKE_FILE (src/${MODULE_NAME}/${TOOLKIT}/${PACKAGE}/FILES)
endforeach()
endforeach()
endmacro()

View File

@ -1,22 +0,0 @@
#======================================================================
#
# Purpose: Defines macros identifying current version of Open CASCADE
#
# OCC_VERSION_MAJOR : (integer) number identifying major version
# OCC_VERSION_MINOR : (integer) number identifying minor version
# OCC_VERSION_MAINTENANCE : (integer) number identifying maintenance version
# OCC_VERSION_DEVELOPMENT : (string) if defined, indicates development or modified version
# in case of release, remove the value
#
# Sample values of OCC_VERSION_DEVELOPMENT:
# - "dev" for development version between releases
# - "beta..." or "rc..." for beta releases or release candidates
# - "project..." for version containing project-specific fixes
#
# For development version git commit hash can be added to the version string
#======================================================================
set (OCC_VERSION_MAJOR 8 )
set (OCC_VERSION_MINOR 0 )
set (OCC_VERSION_MAINTENANCE 0 )
set (OCC_VERSION_DEVELOPMENT "dev" )

View File

@ -1,31 +1,5 @@
# vtk
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package(VTK REQUIRED
COMPONENTS
CommonCore
RenderingUI
RenderingOpenGL2
OPTIONAL_COMPONENTS
mpi
utf8
eigen
doubleconversion
lz4
lzma
expat
)
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()
@ -38,7 +12,7 @@ endif()
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify VTK folder in connection with 3RDPARTY_DIR
# specify VTK folder in connectin with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_VTK_DIR PATH "The directory containing VTK")
@ -86,20 +60,7 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} "${3RDPARTY_VTK_DIR}")
endif()
find_package(VTK QUIET
COMPONENTS
CommonCore
RenderingUI
RenderingOpenGL2
OPTIONAL_COMPONENTS
mpi
utf8
eigen
doubleconversion
lz4
lzma
expat
)
find_package(VTK QUIET)
if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
@ -239,7 +200,7 @@ endif()
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})
elseif (NOT VTK_FOUND)
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
endif()
@ -341,7 +302,6 @@ if (NOT INSTALL_VTK)
endif()
endif()
# hide some variables
mark_as_advanced (VTK_INCLUDE_DIRS)
mark_as_advanced (VTK_LIBRARY_DIRS)
mark_as_advanced (VTK_DIR)
OCCT_CHECK_AND_UNSET (VTK_INCLUDE_DIRS)
OCCT_CHECK_AND_UNSET (VTK_LIBRARY_DIRS)
OCCT_CHECK_AND_UNSET (VTK_DIR)

748
adm/genconf.tcl Normal file
View File

@ -0,0 +1,748 @@
#!/usr/bin/tclsh
# =======================================================================
# Created on: 2012-01-26
# Created by: Kirill GAVRILOV
# Copyright (c) 2012 OPEN CASCADE SAS
#
# This file is part of Open CASCADE Technology software library.
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as published
# by the Free Software Foundation, with special exception defined in the file
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
# distribution for complete text of the license and disclaimer of any warranty.
#
# Alternatively, this file may be used under the terms of Open CASCADE
# commercial license or contractual agreement.
# =======================================================================
# GUI procedure for search of third-party tools and generation of environment
# customization script
# =======================================================================
# load tools
source [file join [file dirname [info script]] genconfdeps.tcl]
# proxy variable for implicit file path normalization
set PRODUCTS_PATH_INPUT "$::PRODUCTS_PATH"
package require Tk
set aRowIter 0
set aCheckRowIter 0
frame .myFrame -padx 5 -pady 5
pack .myFrame -fill both -expand 1
frame .myFrame.myPrjFrame
frame .myFrame.myVsFrame
frame .myFrame.myHxxChecks
frame .myFrame.myChecks
# project file format
set SYS_PRJFMT_LIST {}
set SYS_PRJNAME_LIST {}
if { "$::tcl_platform(platform)" == "windows" } {
lappend ::SYS_PRJFMT_LIST "vcxproj"
lappend ::SYS_PRJNAME_LIST "Visual Studio (.vcxproj)"
}
if { "$tcl_platform(os)" == "Darwin" } {
lappend ::SYS_PRJFMT_LIST "xcd"
lappend ::SYS_PRJNAME_LIST "XCode (.xcd)"
}
lappend ::SYS_PRJFMT_LIST "cbp"
lappend ::SYS_PRJNAME_LIST "Code Blocks (.cbp)"
lappend ::SYS_PRJFMT_LIST "pro"
lappend ::SYS_PRJNAME_LIST "Qt Creator (.pro)"
set aPrjIndex [lsearch $::SYS_PRJFMT_LIST $::PRJFMT]
set ::PRJNAME [lindex $::SYS_PRJNAME_LIST $aPrjIndex]
set ::CONFIG "Release"
set SYS_VS_LIST {}
set SYS_VC_LIST {}
set SYS_VCVARS_LIST {}
# detect installed Visual Studio 2017+ instances by running vswhere.exe
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
lappend ::SYS_VC_LIST "vc141"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
lappend ::SYS_VC_LIST "vc141-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
lappend ::SYS_VC_LIST "vc142"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143)"
lappend ::SYS_VC_LIST "vc143"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset v143) UWP"
lappend ::SYS_VC_LIST "vc143-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[17.0,17.99\]" -latest -requires Microsoft.VisualStudio.Component.VC.ClangCL -property installationPath} res] && "$res" != "" } {
lappend ::SYS_VS_LIST "Visual Studio 2022 (17, toolset ClangCL)"
lappend ::SYS_VC_LIST "vclang"
lappend ::SYS_VCVARS_LIST "$res\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
# detect installed Visual Studio instances from global environment
if { [info exists ::env(VS140COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140)"
lappend ::SYS_VC_LIST "vc14"
lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
lappend ::SYS_VS_LIST "Visual Studio 2015 (14, toolset v140) UWP"
lappend ::SYS_VC_LIST "vc14-uwp"
lappend ::SYS_VCVARS_LIST "%VS140COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS120COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2013 (12, toolset v120)"
lappend ::SYS_VC_LIST "vc12"
lappend ::SYS_VCVARS_LIST "%VS120COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS110COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2012 (11, toolset v110)"
lappend ::SYS_VC_LIST "vc11"
lappend ::SYS_VCVARS_LIST "%VS110COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS100COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2010 (10, toolset v100)"
lappend ::SYS_VC_LIST "vc10"
lappend ::SYS_VCVARS_LIST "%VS100COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS90COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2008 (9, toolset v90)"
lappend ::SYS_VC_LIST "vc9"
lappend ::SYS_VCVARS_LIST "%VS90COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
if { [info exists ::env(VS80COMNTOOLS)] } {
lappend ::SYS_VS_LIST "Visual Studio 2005 (8, toolset v80)"
lappend ::SYS_VC_LIST "vc8"
lappend ::SYS_VCVARS_LIST "%VS80COMNTOOLS%..\\..\\VC\\vcvarsall.bat"
}
lappend ::SYS_VS_LIST "Custom"
lappend ::SYS_VC_LIST "vcX"
lappend ::SYS_VCVARS_LIST "%VSXXCOMNTOOLS%..\\..\\VC\\vcvarsall.bat"
set aVcVerIndex [lsearch $::SYS_VC_LIST $::VCVER]
set ::VSVER [lindex $::SYS_VS_LIST $aVcVerIndex]
if { "$::VCVARS" == "" } {
set ::VCVARS [lindex $::SYS_VCVARS_LIST $aVcVerIndex]
}
proc wokdep:gui:Close {} {
# if changed ask
exit
}
proc wokdep:gui:configSuffix {} {
if { "$::CONFIG" == "Debug" } {
return "D"
}
return ""
}
proc wokdep:gui:SwitchConfig {} {
set ::PRJFMT [lindex $::SYS_PRJFMT_LIST [.myFrame.myPrjFrame.myPrjCombo current]]
set ::VCVER [lindex $::SYS_VC_LIST [.myFrame.myVsFrame.myVsCombo current]]
set ::VCVARS [lindex $::SYS_VCVARS_LIST [.myFrame.myVsFrame.myVsCombo current]]
set ::CSF_OPT_INC {}
set ::CSF_OPT_LIB32 {}
set ::CSF_OPT_LIB64 {}
set ::CSF_OPT_BIN32 {}
set ::CSF_OPT_BIN64 {}
set ::CSF_OPT_LIB32D {}
set ::CSF_OPT_LIB64D {}
set ::CSF_OPT_BIN32D {}
set ::CSF_OPT_BIN64D {}
wokdep:gui:UpdateList
}
proc wokdep:gui:SwitchArch {} {
wokdep:gui:Show3264Bitness ::aRowIter
if { [llength [grid info .myFrame.mySave]] != 0 } {
grid forget .myFrame.mySave .myFrame.myClose
}
# Bottom section
grid .myFrame.mySave -row $::aRowIter -column 4 -columnspan 2
grid .myFrame.myClose -row $::aRowIter -column 6 -columnspan 2
}
# update label text and visibility
font create wokdep:gui:EmptyFont -size -1
proc wokdep:gui:SetLabelText {theLabel theText} {
set aFont TkDefaultFont
if { $theText == "" } {
set aFont wokdep:gui:EmptyFont
}
$theLabel configure -text $theText -font $aFont
}
proc wokdep:gui:UpdateList {} {
set anIncErrs {}
set anLib32Errs {}
set anLib64Errs {}
set anBin32Errs {}
set anBin64Errs {}
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_FREETYPE" == "true" } {
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:SearchX11 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
if { "$::HAVE_GLES2" == "true" } {
wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchGLES anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_FREEIMAGE" == "true" } {
wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_FFMPEG" == "true" } {
wokdep:SearchFFmpeg anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_OPENVR" == "true" } {
wokdep:SearchOpenVR anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_TBB" == "true" } {
wokdep:SearchTBB anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
# if { "$::HAVE_OPENCL" == "true" } {
# wokdep:SearchOpenCL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
# }
if { "$::HAVE_VTK" == "true" } {
wokdep:SearchVTK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_ZLIB" == "true" } {
set aCheckLib "z"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "zlib"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "$aCheckLib" {"zlib"}
}
if { "$::HAVE_LIBLZMA" == "true" } {
set aCheckLib "lzma"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "liblzma"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"}
}
if { "$::HAVE_E57" == "true" } {
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "e57" "e57/E57Foundation.h" "E57RefImpl" {"e57"}
set aCheckLib "xerces-c"
if { "$::tcl_platform(platform)" == "windows" } {
set aCheckLib "xerces-c_3"
}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "xerces-c" "xercesc/sax2/XMLReaderFactory.hpp" "$aCheckLib" {"xerces"}
}
if { "$::HAVE_RAPIDJSON" == "true" } {
wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::HAVE_DRACO" == "true" } {
set aDummy {}
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs aDummy aDummy "draco" "draco/compression/decode.h" "draco" {"draco"}
}
if {"$::BUILD_Inspector" == "true" } {
set ::CHECK_QT "true"
}
if { "$::CHECK_QT" == "true" } {
wokdep:SearchQt anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::CHECK_JDK" == "true" } {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myIncErrLbl [join $anIncErrs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64_ErrLbl [join $anBin64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib32D_ErrLbl [join $anLib32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myLib64D_ErrLbl [join $anLib64Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin32D_ErrLbl [join $anBin32Errs "\n"]
wokdep:gui:SetLabelText .myFrame.myBin64D_ErrLbl [join $anBin64Errs "\n"]
# merge duplicates
set ::CSF_OPT_LIB32 [lsort -unique $::CSF_OPT_LIB32]
set ::CSF_OPT_LIB64 [lsort -unique $::CSF_OPT_LIB64]
set ::CSF_OPT_BIN32 [lsort -unique $::CSF_OPT_BIN32]
set ::CSF_OPT_BIN64 [lsort -unique $::CSF_OPT_BIN64]
set ::CSF_OPT_LIB32D [lsort -unique $::CSF_OPT_LIB32D]
set ::CSF_OPT_LIB64D [lsort -unique $::CSF_OPT_LIB64D]
set ::CSF_OPT_BIN32D [lsort -unique $::CSF_OPT_BIN32D]
set ::CSF_OPT_BIN64D [lsort -unique $::CSF_OPT_BIN64D]
}
proc wokdep:gui:BrowseVcVars {} {
set aResult [tk_chooseDirectory -initialdir $::VCVARS -title "Choose a directory"]
if { "$aResult" != "" } {
set ::VCVARS $aResult
}
}
proc wokdep:gui:BrowsePartiesRoot {} {
set aResult [tk_chooseDirectory -initialdir $::PRODUCTS_PATH_INPUT -title "Choose a directory"]
if { "$aResult" != "" } {
set ::PRODUCTS_PATH_INPUT $aResult
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddIncPath {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_INC "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddLibPath {} {
set aCfg [wokdep:gui:configSuffix]
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_LIB${::ARCH}${aCfg} "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBinPath {} {
set aCfg [wokdep:gui:configSuffix]
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN${::ARCH}${aCfg} "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:RemoveIncPath {} {
set aSelIndices [.myFrame.myIncList curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myIncList delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveLibPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myLib${::ARCH}${aCfg}_List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myLib${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBinPath {} {
set aCfg [wokdep:gui:configSuffix]
set aSelIndices [.myFrame.myBin${::ARCH}${aCfg}_List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin${::ARCH}${aCfg}_List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetIncPath {} {
set ::CSF_OPT_INC {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetLibPath {} {
set ::CSF_OPT_LIB${::ARCH} {}
set ::CSF_OPT_LIB${::ARCH}D {}
set ::CSF_OPT_BIN${::ARCH} {}
set ::CSF_OPT_BIN${::ARCH}D {}
wokdep:gui:UpdateList
}
proc wokdep:gui:Show3264Bitness { theRowIter } {
upvar $theRowIter aRowIter
set aArchOld ""
set aCfg [wokdep:gui:configSuffix]
if { "$::ARCH" == "32" } {
set aArchOld "64"
} else {
set aArchOld "32"
}
set aCfgOld "D"
if { "$::CONFIG" == "Debug" } { set aCfgOld "" }
set aDelArch ${aArchOld}${aCfg}
if { [llength [grid info .myFrame.myLib${aDelArch}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelArch}_Lbl .myFrame.myLib${aDelArch}_List .myFrame.myLib${aDelArch}_Scrl
grid forget .myFrame.myLib${aDelArch}_Add .myFrame.myLib${aDelArch}_Remove .myFrame.myLib${aDelArch}_Clear .myFrame.myLib${aDelArch}_ErrLbl
grid forget .myFrame.myBin${aDelArch}_Lbl .myFrame.myBin${aDelArch}_List .myFrame.myBin${aDelArch}_Scrl
grid forget .myFrame.myBin${aDelArch}_Add .myFrame.myBin${aDelArch}_Remove .myFrame.myBin${aDelArch}_Clear .myFrame.myBin${aDelArch}_ErrLbl
}
set aDelCfg ${::ARCH}${aCfgOld}
if { [llength [grid info .myFrame.myLib${aDelCfg}_Lbl]] != 0 } {
grid forget .myFrame.myLib${aDelCfg}_Lbl .myFrame.myLib${aDelCfg}_List .myFrame.myLib${aDelCfg}_Scrl
grid forget .myFrame.myLib${aDelCfg}_Add .myFrame.myLib${aDelCfg}_Remove .myFrame.myLib${aDelCfg}_Clear .myFrame.myLib${aDelCfg}_ErrLbl
grid forget .myFrame.myBin${aDelCfg}_Lbl .myFrame.myBin${aDelCfg}_List .myFrame.myBin${aDelCfg}_Scrl
grid forget .myFrame.myBin${aDelCfg}_Add .myFrame.myBin${aDelCfg}_Remove .myFrame.myBin${aDelCfg}_Clear .myFrame.myBin${aDelCfg}_ErrLbl
}
set aNewCfg ${::ARCH}${aCfg}
# Additional libraries search paths
grid .myFrame.myLib${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib${aNewCfg}_Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib${aNewCfg}_Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables search paths
grid .myFrame.myBin${aNewCfg}_Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin${aNewCfg}_List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin${aNewCfg}_Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin${aNewCfg}_Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin${aNewCfg}_Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin${aNewCfg}_ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
}
# Header
ttk::label .myFrame.myPrjFrame.myPrjLbl -text "Project format:" -padding {5 5 20 5}
ttk::combobox .myFrame.myPrjFrame.myPrjCombo -values $SYS_PRJNAME_LIST -state readonly -textvariable PRJNAME -width 40
ttk::label .myFrame.myVsFrame.myVsLbl -text "Visual Studio configuration:" -padding {5 5 20 5}
ttk::combobox .myFrame.myVsFrame.myVsCombo -values $SYS_VS_LIST -state readonly -textvariable VSVER -width 40
ttk::combobox .myFrame.myVsFrame.myArchCombo -values { {32} {64} } -textvariable ARCH -state readonly -width 6
ttk::combobox .myFrame.myVsFrame.myConfigCombo -values { {Release} {Debug} } -textvariable CONFIG -state readonly -width 6
entry .myFrame.myVcEntry -textvariable VCVER -width 10
entry .myFrame.myVcVarsEntry -textvariable VCVARS -width 70
ttk::button .myFrame.myVcBrowseBtn -text "Browse" -command wokdep:gui:BrowseVcVars
ttk::label .myFrame.myHxxChecks.myRelDebInfoLbl -text "Release with Debug info"
checkbutton .myFrame.myHxxChecks.myRelDebInfoCheck -offvalue "false" -onvalue "true" -variable HAVE_RelWithDebInfo
#
ttk::combobox .myFrame.myHxxChecks.myScutsCombo -values { {ShortCut} {Copy} {HardLink} } -textvariable SHORTCUT_HEADERS -state readonly -width 12
ttk::label .myFrame.myHxxChecks.myScutsLbl -text "Strategy for filling headers folder inc:"
#
ttk::label .myFrame.mySrchLbl -text "3rd-parties search path:" -padding {5 5 80 5}
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH_INPUT -width 80
ttk::button .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
checkbutton .myFrame.myChecks.myFreeTypeCheck -offvalue "false" -onvalue "true" -variable HAVE_FREETYPE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFreeTypeLbl -text "Use FreeType"
checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myTbbLbl -text "Use Intel TBB"
checkbutton .myFrame.myChecks.myOpenVrCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENVR -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myOpenVrLbl -text "Use OpenVR"
if { "$::tcl_platform(os)" != "Darwin" } {
checkbutton .myFrame.myChecks.myGlesCheck -offvalue "false" -onvalue "true" -variable HAVE_GLES2 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myGlesLbl -text "Use OpenGL ES"
}
if { "$::tcl_platform(platform)" == "windows" } {
checkbutton .myFrame.myChecks.myD3dCheck -offvalue "false" -onvalue "true" -variable HAVE_D3D -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myD3dLbl -text "Use Direct3D"
}
checkbutton .myFrame.myChecks.myFFmpegCheck -offvalue "false" -onvalue "true" -variable HAVE_FFMPEG -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
#checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList
#ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL"
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
checkbutton .myFrame.myChecks.myDracoCheck -offvalue "false" -onvalue "true" -variable HAVE_DRACO -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myDracoLbl -text "Use Draco"
checkbutton .myFrame.myChecks.myXLibCheck -offvalue "false" -onvalue "true" -variable HAVE_XLIB
ttk::label .myFrame.myChecks.myXLibLbl -text "Use X11 for windows drawing"
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
checkbutton .myFrame.myChecks.myVtkCheck -offvalue "false" -onvalue "true" -variable HAVE_VTK -command wokdep:gui:UpdateList
checkbutton .myFrame.myChecks.myZLibCheck -offvalue "false" -onvalue "true" -variable HAVE_ZLIB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myZLibLbl -text "Use zlib"
checkbutton .myFrame.myChecks.myLzmaCheck -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma"
checkbutton .myFrame.myChecks.myE57Check -offvalue "false" -onvalue "true" -variable HAVE_E57 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myE57Lbl -text "Use E57"
checkbutton .myFrame.myChecks.myQtCheck -offvalue "false" -onvalue "true" -variable CHECK_QT -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myQtLbl -text "Search Qt"
checkbutton .myFrame.myChecks.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myJDKLbl -text "Search JDK"
if { "$::tcl_platform(platform)" == "windows" } {
checkbutton .myFrame.myChecks.myInspectorBuild -offvalue "false" -onvalue "true" -variable BUILD_Inspector -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myInspectorLbl -text "Build Inspector"
}
# Additional headers search paths
ttk::label .myFrame.myIncLbl -text "Additional headers search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myIncScrl -command ".myFrame.myIncList yview"
listbox .myFrame.myIncList -listvariable CSF_OPT_INC -width 80 -height 5 -yscrollcommand ".myFrame.myIncScrl set"
ttk::button .myFrame.myIncAdd -text "Add" -command wokdep:gui:AddIncPath
ttk::button .myFrame.myIncEdit -text "Edit"
ttk::button .myFrame.myIncRemove -text "Remove" -command wokdep:gui:RemoveIncPath
ttk::button .myFrame.myIncClear -text "Reset" -command wokdep:gui:ResetIncPath
ttk::label .myFrame.myIncErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (32-bit) search paths
ttk::label .myFrame.myLib32_Lbl -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32_Scrl -command ".myFrame.myLib32_List yview"
listbox .myFrame.myLib32_List -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32_Scrl set"
ttk::button .myFrame.myLib32_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32_Edit -text "Edit"
ttk::button .myFrame.myLib32_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (32-bit) search paths
ttk::label .myFrame.myLib32D_Lbl -text "Additional debug libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32D_Scrl -command ".myFrame.myLib32D_List yview"
listbox .myFrame.myLib32D_List -listvariable CSF_OPT_LIB32D -width 80 -height 5 -yscrollcommand ".myFrame.myLib32D_Scrl set"
ttk::button .myFrame.myLib32D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib32D_Edit -text "Edit"
ttk::button .myFrame.myLib32D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (64-bit) search paths
ttk::label .myFrame.myLib64_Lbl -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64_Scrl -command ".myFrame.myLib64_List yview"
listbox .myFrame.myLib64_List -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64_Scrl set"
ttk::button .myFrame.myLib64_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64_Edit -text "Edit"
ttk::button .myFrame.myLib64_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug libraries (64-bit) search paths
ttk::label .myFrame.myLib64D_Lbl -text "Additional debug libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64D_Scrl -command ".myFrame.myLib64D_List yview"
listbox .myFrame.myLib64D_List -listvariable CSF_OPT_LIB64D -width 80 -height 5 -yscrollcommand ".myFrame.myLib64D_Scrl set"
ttk::button .myFrame.myLib64D_Add -text "Add" -command wokdep:gui:AddLibPath
ttk::button .myFrame.myLib64D_Edit -text "Edit"
ttk::button .myFrame.myLib64D_Remove -text "Remove" -command wokdep:gui:RemoveLibPath
ttk::button .myFrame.myLib64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myLib64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (32-bit) search paths
ttk::label .myFrame.myBin32_Lbl -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32_Scrl -command ".myFrame.myBin32_List yview"
listbox .myFrame.myBin32_List -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32_Scrl set"
ttk::button .myFrame.myBin32_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32_Edit -text "Edit"
ttk::button .myFrame.myBin32_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (32-bit) search paths
ttk::label .myFrame.myBin32D_Lbl -text "Additional debug executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32D_Scrl -command ".myFrame.myBin32D_List yview"
listbox .myFrame.myBin32D_List -listvariable CSF_OPT_BIN32D -width 80 -height 5 -yscrollcommand ".myFrame.myBin32D_Scrl set"
ttk::button .myFrame.myBin32D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin32D_Edit -text "Edit"
ttk::button .myFrame.myBin32D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin32D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin32D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (64-bit) search paths
ttk::label .myFrame.myBin64_Lbl -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64_Scrl -command ".myFrame.myBin64_List yview"
listbox .myFrame.myBin64_List -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64_Scrl set"
ttk::button .myFrame.myBin64_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64_Edit -text "Edit"
ttk::button .myFrame.myBin64_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional debug executables (64-bit) search paths
ttk::label .myFrame.myBin64D_Lbl -text "Additional debug executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64D_Scrl -command ".myFrame.myBin64D_List yview"
listbox .myFrame.myBin64D_List -listvariable CSF_OPT_BIN64D -width 80 -height 5 -yscrollcommand ".myFrame.myBin64D_Scrl set"
ttk::button .myFrame.myBin64D_Add -text "Add" -command wokdep:gui:AddBinPath
ttk::button .myFrame.myBin64D_Edit -text "Edit"
ttk::button .myFrame.myBin64D_Remove -text "Remove" -command wokdep:gui:RemoveBinPath
ttk::button .myFrame.myBin64D_Clear -text "Reset" -command wokdep:gui:ResetLibPath
ttk::label .myFrame.myBin64D_ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Bottom
ttk::button .myFrame.mySave -text "Save" -command wokdep:SaveCustom
ttk::button .myFrame.myClose -text "Close" -command wokdep:gui:Close
# Create grid
# Header
grid .myFrame.myPrjFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myPrjFrame.myPrjLbl -row 0 -column 0
grid .myFrame.myPrjFrame.myPrjCombo -row 0 -column 1
if { "$tcl_platform(platform)" == "windows" } {
incr aRowIter
grid .myFrame.myVsFrame -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myVsFrame.myVsLbl -row 0 -column 0
grid .myFrame.myVsFrame.myVsCombo -row 0 -column 1 -padx 5
grid .myFrame.myVsFrame.myArchCombo -row 0 -column 2
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 3
incr aRowIter
grid .myFrame.myVcEntry -row $aRowIter -column 0
grid .myFrame.myVcVarsEntry -row $aRowIter -column 1 -columnspan 4 -sticky w
grid .myFrame.myVcBrowseBtn -row $aRowIter -column 6
incr aRowIter
} else {
grid .myFrame.myVsFrame -row $aRowIter -column 4 -sticky w
grid .myFrame.myVsFrame.myConfigCombo -row 0 -column 0
incr aRowIter
}
#
grid .myFrame.myHxxChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
grid .myFrame.myHxxChecks.myScutsLbl -row 0 -column 0
grid .myFrame.myHxxChecks.myScutsCombo -row 0 -column 1
if { "$tcl_platform(platform)" == "windows" } {
grid .myFrame.myHxxChecks.myRelDebInfoCheck -row 0 -column 2
grid .myFrame.myHxxChecks.myRelDebInfoLbl -row 0 -column 3
}
incr aRowIter
#
grid .myFrame.mySrchLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.mySrchEntry -row $aRowIter -column 0 -columnspan 5
grid .myFrame.mySrchBrowseBtn -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myChecks.myFreeTypeCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFreeTypeLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(os)" != "Darwin" } {
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 5 -sticky w
}
#grid .myFrame.myChecks.myOpenClCheck -row $aCheckRowIter -column 6 -sticky e
#grid .myFrame.myChecks.myOpenClLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myZLibCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myZLibLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myQtCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQtLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myDracoCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myDracoLbl -row $aCheckRowIter -column 3 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
} else {
grid .myFrame.myChecks.myXLibCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myXLibLbl -row $aCheckRowIter -column 5 -sticky w
}
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myOpenVrCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myOpenVrLbl -row $aCheckRowIter -column 5 -sticky w
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myE57Lbl -row $aCheckRowIter -column 7 -sticky w
if { "$::tcl_platform(platform)" == "windows" } {
grid .myFrame.myChecks.myInspectorBuild -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myInspectorLbl -row $aCheckRowIter -column 13 -sticky w
}
incr aCheckRowIter
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 13 -sticky w
incr aCheckRowIter
# Additional headers search paths
grid .myFrame.myIncLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myIncList -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myIncScrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myIncAdd -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myIncEdit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myIncRemove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myIncClear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myIncErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional search paths
wokdep:gui:Show3264Bitness aRowIter
# Bottom section
grid .myFrame.mySave -row $aRowIter -column 4 -columnspan 2
grid .myFrame.myClose -row $aRowIter -column 6 -columnspan 2
# Bind events
bind .myFrame.myPrjFrame.myPrjCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}
bind .myFrame.myVsFrame.myVsCombo <<ComboboxSelected>> {
wokdep:gui:SwitchConfig
}
bind .myFrame.myVsFrame.myArchCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
bind .myFrame.myVsFrame.myConfigCombo <<ComboboxSelected>> {
wokdep:gui:SwitchArch
}
.myFrame.mySrchEntry configure -validate all -validatecommand {
set ::PRODUCTS_PATH [file normalize "$::PRODUCTS_PATH_INPUT"]
#return [file exists "$::PRODUCTS_PATH"]
wokdep:gui:UpdateList
return 1
}
wokdep:gui:UpdateList

1556
adm/genconfdeps.tcl Normal file

File diff suppressed because it is too large Load Diff

906
adm/gendoc.tcl Normal file
View File

@ -0,0 +1,906 @@
# =======================================================================
# Created on: 2014-03-21
# Created by: OMY
# Copyright (c) 1996-1999 Matra Datavision
# Copyright (c) 1999-2014 OPEN CASCADE SAS
#
# This file is part of Open CASCADE Technology software library.
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as published
# by the Free Software Foundation, with special exception defined in the file
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
# distribution for complete text of the license and disclaimer of any warranty.
#
# Alternatively, this file may be used under the terms of Open CASCADE
# commercial license or contractual agreement.
# =======================================================================
# This script defines command gendoc compiling OCCT documents
# from *.md files to HTML pages
# =======================================================================
# load auxiliary tools
source [file join [file dirname [info script]] occaux.tcl]
# ======================================
# Common functions
# ======================================
# Prints help message
proc OCCDoc_PrintHelpMessage {} {
puts "\nUsage: gendoc \[-h\] {-refman|-overview} \[-html|-pdf|-chm\] \[-m=<list of modules>|-ug=<list of docs>\] \[-v\] \[-s=<search_mode>\] \[-mathjax=<path>\]"
puts ""
puts "Options are:"
puts ""
puts "choice of documentation to be generated:"
puts " -overview : To generate Overview and User Guides"
puts " (cannot be used with -refman)"
puts " -refman : To generate class Reference Manual"
puts " (cannot be used with -overview)"
puts ""
puts "choice of output format:"
puts " -html : To generate HTML files"
puts " (default, cannot be used with -pdf or -chm)"
puts " -pdf : To generate PDF files"
puts " (cannot be used with -refman, -html, or -chm)"
puts " -chm : To generate CHM files"
puts " (cannot be used with -html or -pdf)"
puts ""
puts "additional options:"
puts " -m=<modules_list> : List of OCCT modules (separated with comma),"
puts " for generation of Reference Manual"
puts " -ug=<docs_list> : List of MarkDown documents (separated with comma),"
puts " to use for generation of Overview / User Guides"
puts " -mathjax=<path> : To use local or alternative copy of MathJax"
puts " -s=<search_mode> : Specifies the Search mode of HTML documents"
puts " Can be: none | local | server | external"
puts " -h : Prints this help message"
puts " -v : Enables more verbose output"
}
# A command for User Documentation compilation
proc gendoc {args} {
# Parameters
set DOC_TYPE "REFMAN"
set GEN_MODE "HTML_ONLY"
set DOCFILES {}
set MODULES {}
set DOCLABEL ""
set VERB_MODE "NO"
set SEARCH_MODE "none"
set MATHJAX_LOCATION "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1"
set mathjax_js_name "MathJax.js"
set DOCTYPE_COMBO_FLAG 0
set GENMODE_COMBO_FLAG 0
set GENERATE_PRODUCTS_REFMAN "NO"
global available_docfiles; # The full list of md files for HTML or CHM generation
global available_pdf; # The full list of md files for PDF generation
global tcl_platform
global args_names
global args_values
global env
# Load list of docfiles
if { [OCCDoc_LoadFilesList] != 0 } {
puts "Error: File FILES_HTML.txt or FILES_PDF.txt was not found on this computer.\nAborting..."
return -1
}
# Parse CL arguments
if {[OCCDoc_ParseArguments $args] == 1} {
return -1
}
# Print help message if no arguments provided
if {[llength $args_names] == 0} {
OCCDoc_PrintHelpMessage
return 0
}
foreach arg_n $args_names {
if {$arg_n == "h"} {
OCCDoc_PrintHelpMessage
return 0
} elseif {$arg_n == "html"} {
if { ([ lsearch $args_names "refman" ] == -1) &&
([ lsearch $args_names "overview" ] == -1) } {
puts "Warning: Please specify -refman or -overview argument."
return -1
}
if { [ lsearch $args_names "refman" ] != -1 } {
continue
}
if { $GENMODE_COMBO_FLAG != 1 } {
set GEN_MODE "HTML_ONLY"
set GENMODE_COMBO_FLAG 1
} else {
puts "Error: Options -html, -pdf and -chm can not be combined."
return -1
}
} elseif {$arg_n == "chm"} {
if { ([ lsearch $args_names "refman" ] == -1) &&
([ lsearch $args_names "overview" ] == -1) } {
puts "Warning: Please specify -refman or -overview argument."
return -1
}
if { [ lsearch $args_names "refman" ] != -1 } {
continue
}
if { $GENMODE_COMBO_FLAG != 1 } {
set GEN_MODE "CHM_ONLY"
set GENMODE_COMBO_FLAG 1
} else {
puts "Error: Options -html, -pdf and -chm cannot be combined."
return -1
}
} elseif {$arg_n == "pdf"} {
if { ([ lsearch $args_names "refman" ] == -1) &&
([ lsearch $args_names "overview" ] == -1) } {
puts "Warning: Please specify -refman or -overview argument."
return -1
}
if { [ lsearch $args_names "refman" ] != -1 } {
continue
}
if { $GENMODE_COMBO_FLAG != 1 } {
set GEN_MODE "PDF_ONLY"
set GENMODE_COMBO_FLAG 1
} else {
puts "Error: Options -html, -pdf and -chm cannot be combined."
return -1
}
} elseif {$arg_n == "overview"} {
if { $DOCTYPE_COMBO_FLAG != 1 } {
set DOC_TYPE "OVERVIEW"
set DOCTYPE_COMBO_FLAG 1
} else {
puts "Error: Options -refman and -overview cannot be combined."
return -1
}
# Print ignored options
if { [ lsearch $args_names "m" ] != -1 } {
puts "\nInfo: The following options will be ignored: \n"
puts " * -m"
}
puts ""
} elseif {$arg_n == "refman"} {
if { $DOCTYPE_COMBO_FLAG != 1 } {
set DOC_TYPE "REFMAN"
set DOCTYPE_COMBO_FLAG 1
if { [file exists [OCCDoc_GetProdRootDir]/src/VAS/Products.tcl] } {
set GENERATE_PRODUCTS_REFMAN "YES"
}
} else {
puts "Error: Options -refman and -overview cannot be combined."
return -1
}
# Print ignored options
if { ([ lsearch $args_names "pdf" ] != -1) ||
([ lsearch $args_names "chm" ] != -1) ||
([ lsearch $args_names "ug" ] != -1) } {
puts "\nInfo: The following options will be ignored: \n"
if { [ lsearch $args_names "pdf" ] != -1 } {
puts " * -pdf"
}
if { [ lsearch $args_names "chm" ] != -1 } {
puts " * -chm"
}
if { [ lsearch $args_names "ug" ] != -1 } {
puts " * -ug"
}
puts ""
}
} elseif {$arg_n == "v"} {
set VERB_MODE "YES"
} elseif {$arg_n == "ug"} {
if { ([ lsearch $args_names "refman" ] != -1) } {
continue
}
if {$args_values(ug) != "NULL"} {
set DOCFILES $args_values(ug)
} else {
puts "Error in argument ug."
return -1
}
# Check if all chosen docfiles are correct
foreach docfile $DOCFILES {
if { [ lsearch $args_names "pdf" ] == -1 } {
# Check to generate HTMLs
if { [lsearch $available_docfiles $docfile] == -1 } {
puts "Error: File \"$docfile\" is not presented in the list of available docfiles."
puts " Please specify the correct docfile name."
return -1
}
} else {
# Check to generate PDFs
if { [lsearch $available_pdf $docfile] == -1 } {
puts "Error: File \"$docfile\" is not presented in the list of generic PDFs."
puts " Please specify the correct pdf name."
return -1
}
}
}
} elseif {$arg_n == "m"} {
if { [ lsearch $args_names "overview" ] != -1 } {
continue
}
if {$args_values(m) != "NULL"} {
set MODULES $args_values(m)
} else {
puts "Error in argument m."
return -1
}
} elseif {$arg_n == "s"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: search is not used with PDF and will be ignored."
continue
}
if {$args_values(s) != "NULL"} {
set SEARCH_MODE $args_values(s)
} else {
puts "Error in argument s."
return -1
}
} elseif {$arg_n == "mathjax"} {
if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: MathJax is not used with PDF and will be ignored."
}
set possible_mathjax_loc $args_values(mathjax)
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
set MATHJAX_LOCATION $args_values(mathjax)
puts "$MATHJAX_LOCATION"
} else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts " MathJax will be used from $MATHJAX_LOCATION"
}
} else {
puts "\nWrong argument: $arg_n"
OCCDoc_PrintHelpMessage
return -1
}
}
# Check the existence of the necessary tools
set DOXYGEN_PATH ""
set GRAPHVIZ_PATH ""
set INKSCAPE_PATH ""
set PDFLATEX_PATH ""
set HHC_PATH ""
OCCDoc_DetectNecessarySoftware $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH $PDFLATEX_PATH
if {$DOXYGEN_PATH == ""} {
puts " Aborting..."
return -1
}
if {"$::tcl_platform(platform)" == "windows"} {
if { ($GEN_MODE == "CHM_ONLY") && ($HHC_PATH == "") } {
puts " Aborting..."
return -1
}
}
if { ($PDFLATEX_PATH == "") && ($GEN_MODE == "PDF_ONLY") } {
puts " Aborting..."
return -1
}
# If we do not specify list for docfiles with -m argument,
# we assume that we have to generate all docfiles
if { [llength $DOCFILES] == 0 } {
if { $GEN_MODE != "PDF_ONLY" } {
set DOCFILES $available_docfiles
} else {
set DOCFILES $available_pdf
}
}
puts ""
# Start main activities
if { $GEN_MODE != "PDF_ONLY" } {
if { [OCCDoc_GetProdRootDir] == ""} {
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
} else {
if { $DOC_TYPE == "REFMAN" } {
if { $MODULES != "" } {
foreach module $MODULES {
OCCDoc_Main $DOC_TYPE $DOCFILES $module $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
} else {
OCCDoc_Main $DOC_TYPE $DOCFILES $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
} else {
foreach md $DOCFILES {
OCCDoc_Main $DOC_TYPE $md $MODULES $GEN_MODE $VERB_MODE $SEARCH_MODE $MATHJAX_LOCATION $GENERATE_PRODUCTS_REFMAN $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
}
}
} else {
puts "Generating OCCT User Guides in PDF format..."
foreach pdf $DOCFILES {
puts "\nInfo: Processing file $pdf"
# Some values are hardcoded because they are related only to PDF generation
OCCDoc_Main "OVERVIEW" [list $pdf] {} "PDF_ONLY" $VERB_MODE "none" $MATHJAX_LOCATION "NO" $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
}
puts "\n[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
}
}
# Main procedure for documents compilation
proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode searchMode mathjaxLocation generateProductsRefman DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH} {
global available_docfiles
global available_pdf
set ROOTDIR [OCCDoc_GetRootDir [OCCDoc_GetProdRootDir]]
set INDIR [OCCDoc_GetDoxDir]
set OUTDIR $ROOTDIR/doc
set PDFDIR $OUTDIR/pdf
set UGDIR $PDFDIR/user_guides
set DGDIR $PDFDIR/dev_guides
set TAGFILEDIR $OUTDIR/refman
set HTMLDIR $OUTDIR/overview/html
set LATEXDIR $OUTDIR/overview/latex
set DOXYFILE $OUTDIR/OCCT.cfg
# OUTDIR for products documentation should be separate directories for each components
if { [OCCDoc_GetProdRootDir] != ""} {
if { $docType == "REFMAN" } {
if { "$modules" != "" } {
source "[OCCDoc_GetSourceDir [OCCDoc_GetProdRootDir]]/VAS/${modules}.tcl"
set doc_component_name [${modules}:documentation_name]
set OUTDIR $OUTDIR/$doc_component_name
}
} else {
if {[regexp {([^/]+)/([^/]+)/([^/]+)} $docfiles dump doc_type doc_component doc_name]} {
set PDFNAME [file rootname $doc_name]
set OUTDIR $OUTDIR/$doc_component
} else {
error "Could not parse input path to *.md file: \"${docfiles}\""
}
}
set HTMLDIR $OUTDIR/html
set LATEXDIR $OUTDIR/latex
set DOXYFILE $OUTDIR/OCCT.cfg
set TAGFILEDIR $OUTDIR/refman
}
# Create or cleanup the output folders
if { [string compare -nocase $generateProductsRefman "YES"] != 0 } {
if { ![file exists $OUTDIR] } {
file mkdir $OUTDIR
}
if { ![file exists $HTMLDIR] } {
file mkdir $HTMLDIR
}
if { [OCCDoc_GetProdRootDir] == ""} {
if { ![file exists $PDFDIR] } {
file mkdir $PDFDIR
}
if { ![file exists $UGDIR] } {
file mkdir $UGDIR
}
if { ![file exists $DGDIR] } {
file mkdir $DGDIR
}
}
if { $generatorMode == "PDF_ONLY" } {
if { [file exists $LATEXDIR] } {
file delete -force $LATEXDIR
}
file mkdir $LATEXDIR
}
}
if { $docType == "REFMAN" } {
if { ![file exists $TAGFILEDIR] } {
file mkdir $TAGFILEDIR
}
}
# is MathJax HLink?
set mathjax_relative_location $mathjaxLocation
if { [file isdirectory "$mathjaxLocation"] } {
if { $generatorMode == "HTML_ONLY" } {
# related path
set mathjax_relative_location [OCCDoc_GetRelPath $HTMLDIR $mathjaxLocation]
} elseif { $generatorMode == "CHM_ONLY" } {
# absolute path
set mathjax_relative_location [file normalize $mathjaxLocation]
}
}
if { $generateProductsRefman == "YES" } {
set DOCDIR "$OUTDIR/refman"
puts "\nGenerating OCC Products Reference Manual\n"
} else {
if { $docType == "REFMAN"} {
set DOCDIR "$OUTDIR/refman"
puts "\nGenerating Open CASCADE Reference Manual\n"
} elseif { $docType == "OVERVIEW" } {
if { [OCCDoc_GetProdRootDir] == ""} {
set DOCDIR "$OUTDIR/overview"
} else {
set DOCDIR "$OUTDIR"
}
set FORMAT ""
if { ($generatorMode == "HTML_ONLY") || ($generatorMode == "CHM_ONLY") } {
if { $generatorMode == "HTML_ONLY" } {
set FORMAT " in HTML format..."
} elseif { $generatorMode == "CHM_ONLY" } {
set FORMAT " in CHM format..."
}
puts "Generating OCCT User Guides$FORMAT\n"
}
} else {
puts "Error: Invalid documentation type: $docType. Can not process."
return -1
}
}
# Generate Doxyfile
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating Doxyfile..."
if { [OCCDoc_MakeDoxyfile $docType $DOCDIR $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $modules $verboseMode $searchMode $HHC_PATH $mathjax_relative_location $GRAPHVIZ_PATH [OCCDoc_GetProdRootDir]] == -1 } {
return -1
}
# Run doxygen tool
set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
if { ($generatorMode == "HTML_ONLY") || ($docType == "REFMAN") } {
set LOGPREFIX "html_"
puts "$starttimestamp Generating HTML files..."
# Copy index file to provide fast access to HTML documentation
file copy -force $INDIR/resources/index.html $DOCDIR/index.html
} elseif { $generatorMode == "CHM_ONLY" } {
set LOGPREFIX "chm_"
puts "$starttimestamp Generating CHM file..."
} elseif { $generatorMode == "PDF_ONLY" } {
set LOGPREFIX "[file rootname [file tail [lindex $docfiles 0]]]_"
puts "$starttimestamp Generating PDF file..."
}
# Clean logfiles
set DOXYLOG $OUTDIR/${LOGPREFIX}doxygen_err.log
set DOXYOUT $OUTDIR/${LOGPREFIX}doxygen_out.log
file delete -force $DOXYLOG
file delete -force $DOXYOUT
set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $DOXYOUT} DOX_ERROR]
if {$RESULT != 0} {
set NbErrors [regexp -all -line {^\s*[^\s]+} $DOX_ERROR]
if {$NbErrors > 0} {
puts "Warning: Doxygen reported $NbErrors messages."
puts "See log in $DOXYLOG"
set DOX_ERROR_FILE [open $DOXYLOG "a"]
if {$generatorMode == "PDF_ONLY"} {
puts $DOX_ERROR_FILE "\n===================================================="
puts $DOX_ERROR_FILE "Logfile for $docfiles"
puts $DOX_ERROR_FILE "====================================================\n"
}
puts $DOX_ERROR_FILE $DOX_ERROR
close $DOX_ERROR_FILE
}
}
# Close the Doxygen application
after 300
# Start Post Processing
set curtime [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
if { $docType == "REFMAN" } {
# Post Process generated HTML pages and draw dependency graphs
if {[OCCDoc_PostProcessor $DOCDIR] == 0} {
puts "$curtime Generation completed."
puts "\nInfo: doxygen log file is located in:"
puts "${DOXYOUT}."
puts "\nReference Manual is generated in \n$DOCDIR"
}
} elseif { $docType == "OVERVIEW" } {
# Start PDF generation routine
if { $generatorMode == "PDF_ONLY" } {
set OS $::tcl_platform(platform)
if { $OS == "unix" } {
set PREFIX ".sh"
} elseif { $OS == "windows" } {
set PREFIX ".bat"
}
# Prepare a list of TeX files, generated by Doxygen
cd $LATEXDIR
set TEXFILES [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
foreach path $TEXFILES {
if { [string compare -nocase $path $LATEXDIR] == 0 } {
set DEL_IDX [lsearch $TEXFILES $path]
if { $DEL_IDX != -1 } {
set TEXFILES [lreplace $TEXFILES $DEL_IDX $DEL_IDX]
}
}
}
set TEXFILES [string map [list refman.tex ""] $TEXFILES]
if {$verboseMode == "YES"} {
puts "Info: Preprocessing generated TeX files..."
}
OCCDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
if {$verboseMode == "YES"} {
puts "Info: Converting SVG images to PNG format..."
}
if { $INKSCAPE_PATH != "" } {
OCCDoc_ProcessSvg $LATEXDIR $verboseMode
} else {
puts "Warning: SVG images will be lost in PDF documents."
}
if {$verboseMode == "YES"} {
puts "Info: Generating PDF file from TeX files..."
}
foreach TEX $TEXFILES {
# Rewrite existing REFMAN.tex file...
set TEX [lindex [split $TEX "."] 0]
if {$verboseMode == "YES"} {
puts "Info: Generating PDF file from $TEX..."
}
OCCDoc_MakeRefmanTex $TEX $LATEXDIR $verboseMode $available_pdf
if {"$::tcl_platform(platform)" == "windows"} {
set is_win "yes"
} else {
set is_win "no"
}
if {$verboseMode == "YES"} {
# ...and use it to generate PDF from TeX...
if {$is_win == "yes"} {
puts "Info: Executing $LATEXDIR/make.bat..."
} else {
puts "Info: Executing $LATEXDIR/Makefile..."
}
}
set PDFLOG $OUTDIR/${LOGPREFIX}pdflatex_err.log
set PDFOUT $OUTDIR/${LOGPREFIX}pdflatex_out.log
file delete -force $PDFLOG
file delete -force $PDFOUT
if {"$is_win" == "yes"} {
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$PDFOUT"} LaTeX_ERROR]
} else {
set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$PDFOUT"} LaTeX_ERROR]
# Small workaround for *nix stations
set prev_loc [pwd]
cd $LATEXDIR
set RESULT [catch {eval exec "pdflatex refman.tex" >> "$PDFOUT"} LaTeX_ERROR]
cd $prev_loc
}
if {$RESULT != 0} {
set NbErrors [regexp -all -line {^\s*[^\s]+} $LaTeX_ERROR]
if {$NbErrors > 0} {
puts "Warning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG"
set LaTeX_ERROR_FILE [open $PDFLOG "a+"]
puts $LaTeX_ERROR_FILE "\n===================================================="
puts $LaTeX_ERROR_FILE "Logfile of file $TEX:"
puts $LaTeX_ERROR_FILE "====================================================\n"
puts $LaTeX_ERROR_FILE $LaTeX_ERROR
close $LaTeX_ERROR_FILE
}
}
# ...and place it to the specific folder
if {![file exists "$LATEXDIR/refman.pdf"]} {
puts "Fatal: PDFLaTeX failed to create output file, stopping!"
return -1
}
set destFolder $PDFDIR
set parsed_string [split $TEX "_"]
if { [OCCDoc_GetProdRootDir] == ""} {
if { [lsearch $parsed_string "tutorial"] != -1 } {
set TEX [string map [list occt__ occt_] $TEX]
set destFolder $PDFDIR
} elseif { [lsearch $parsed_string "user"] != -1 } {
set TEX [string map [list user_guides__ ""] $TEX]
set destFolder $UGDIR
} elseif { [lsearch $parsed_string "dev"] != -1 } {
set TEX [string map [list dev_guides__ ""] $TEX]
set destFolder $DGDIR
}
} else {
set destFolder $OUTDIR
set TEX "$PDFNAME"
}
file rename -force $LATEXDIR/refman.pdf "$destFolder/$TEX.pdf"
puts "Generated $destFolder/$TEX.pdf"
}
} elseif { $generatorMode == "CHM_ONLY" } {
if { [OCCDoc_GetProdRootDir] == ""} {
file rename $OUTDIR/overview.chm $OUTDIR/occt_overview.chm
} else {
file rename -force $ROOTDIR/doc/overview.chm $OUTDIR/occt_overview.chm
}
}
cd $INDIR
if { $generatorMode == "HTML_ONLY" } {
puts "HTML documentation is generated in \n$DOCDIR"
} elseif { $generatorMode == "CHM_ONLY" } {
puts "Generated CHM documentation is in \n$OUTDIR/overview.chm"
}
}
# Remove temporary Doxygen files
set deleteList [glob -nocomplain -type f "*.tmp"]
foreach file $deleteList {
file delete $file
}
return 0
}
# Generates Doxygen configuration file for Overview documentation
proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMode ""} {DocFilesList {}} {ModulesList {}} verboseMode searchMode hhcPath mathjaxLocation graphvizPath productsPath} {
global module_dependency
set inputDir [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
set TEMPLATES_DIR [OCCDoc_GetDoxDir]/resources
set occt_version [OCCDoc_DetectCasVersion]
# Delete existent doxyfile
file delete $doxyFileName
# Copy specific template to the target folder
if { $docType == "REFMAN" } {
file copy "$TEMPLATES_DIR/occt_rm.doxyfile" $doxyFileName
} elseif { $docType == "OVERVIEW" } {
if { $generatorMode == "HTML_ONLY" || $generatorMode == "CHM_ONLY" } {
file copy "$TEMPLATES_DIR/occt_ug_html.doxyfile" $doxyFileName
} elseif { $generatorMode == "PDF_ONLY"} {
file copy "$TEMPLATES_DIR/occt_ug_pdf.doxyfile" $doxyFileName
} else {
puts "Error: Unknown generation mode"
return -1
}
} else {
puts "Error: Cannot generate unknown document type"
return -1
}
set doxyFile [open $doxyFileName "a"]
# Write specific options
if { $docType == "REFMAN" } {
# always include optional components
set aHaveD3dBack ""
set aHaveGlesBack ""
set aHaveVtkBack ""
if { [info exists ::env(HAVE_D3D)] } { set aHaveD3dBack "$::env(HAVE_D3D)" }
if { [info exists ::env(HAVE_GLES2)] } { set aHaveGlesBack "$::env(HAVE_GLES2)" }
if { [info exists ::env(HAVE_VTK)] } { set aHaveVtkBack "$::env(HAVE_VTK)" }
set ::env(HAVE_D3D) "true"
set ::env(HAVE_GLES2) "true"
set ::env(HAVE_VTK) "true"
# Load lists of modules scripts
if { $productsPath == "" } {
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
} else {
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/VAS/" *.tcl]
}
if { [llength $modules_scripts] != 0} {
foreach module_file $modules_scripts {
source $module_file
}
}
set ALL_MODULES [OCCDoc_GetModulesList $productsPath]
if { [llength $ModulesList] == 0 } {
# by default take all modules
set modules $ALL_MODULES
} else {
set modules $ModulesList
}
# Detect invalid names of modules
foreach module $modules {
if { $module == "" } {
continue
}
if {[lsearch $ALL_MODULES $module] == -1 } {
puts "Error: No module $module is known. Aborting..."
return -1
}
}
# Set context
set one_module [expr [llength $modules] == 1]
if { $one_module } {
set title "OCCT [$modules:name]"
set name $modules
} else {
set title "Open CASCADE Technology"
set name OCCT
}
OCCDoc_LoadData "${productsPath}"
# Add all dependencies of modules to the graph
set additional_modules {}
foreach module $modules {
set additional_modules [list {*}$additional_modules {*}$module_dependency($module)]
}
set modules [list {*}$modules {*}$additional_modules]
set modules [lsort -unique $modules]
# Get list of header files in the specified modules
set filelist {}
foreach module $modules {
if { $module == "" } {
continue
}
foreach tk [$module:toolkits] {
foreach pk [split [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $productsPath]]] {
if { [llength $pk] != "{}" } {
lappend filelist [OCCDoc_GetHeadersList "p" "$pk" "$productsPath"]
}
}
}
}
# Filter out files Handle_*.hxx and *.lxx
set hdrlist {}
foreach fileset $filelist {
set hdrset {}
foreach hdr $fileset {
if { ! [regexp {Handle_.*[.]hxx} $hdr] && ! [regexp {.*[.]lxx} $hdr] } {
lappend hdrset $hdr
}
}
lappend hdrlist $hdrset
}
set filelist $hdrlist
set doxyFile [open $doxyFileName "a"]
puts $doxyFile "PROJECT_NAME = \"$title\""
puts $doxyFile "PROJECT_NUMBER = $occt_version"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
puts $doxyFile "GENERATE_TAGFILE = $outDir/${name}.tag"
if { [string tolower $searchMode] == "none" } {
puts $doxyFile "SEARCHENGINE = NO"
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} else {
puts $doxyFile "SEARCHENGINE = YES"
if { [string tolower $searchMode] == "local" } {
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "server" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "external" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = YES"
} else {
puts "Error: Wrong search engine type: $searchMode."
close $doxyFile
return -1
}
}
puts $doxyFile "DOTFILE_DIRS = $outDir/html"
puts $doxyFile "DOT_PATH = $graphvizPath"
puts $doxyFile "INCLUDE_PATH = [OCCDoc_GetSourceDir $productsPath]"
# list of files to generate
set mainpage [OCCDoc_MakeMainPage $outDir $outDir/$name.dox $modules $productsPath]
puts $doxyFile ""
puts $doxyFile "INPUT = $mainpage \\"
foreach header $filelist {
puts $doxyFile " $header \\"
}
puts $doxyFile "MATHJAX_FORMAT = HTML-CSS"
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
puts $doxyFile ""
# restore environment variables
set ::env(HAVE_D3D) "$aHaveD3dBack"
set ::env(HAVE_GLES2) "$aHaveGlesBack"
set ::env(HAVE_VTK) "$aHaveVtkBack"
} elseif { $docType == "OVERVIEW" } {
# Add common options for generation of Overview and User Guides
puts $doxyFile "PROJECT_NUMBER = $occt_version"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png"
puts $doxyFile "EXAMPLE_PATH = [OCCDoc_GetSourceDir $productsPath]"
set PARAM_INPUT "INPUT ="
set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ "
foreach docFile $DocFilesList {
set NEW_IMG_PATH "$inputDir/$docFile"
if { [string compare $NEW_IMG_PATH [OCCDoc_GetRootDir $productsPath]] != 0 } {
set img_string [file dirname $NEW_IMG_PATH]/images
if { [file exists $img_string] } {
append PARAM_IMAGEPATH " $img_string"
}
}
append PARAM_INPUT " " $inputDir/$docFile
}
puts $doxyFile $PARAM_INPUT
puts $doxyFile $PARAM_IMAGEPATH
# Add document type-specific options
if { $generatorMode == "HTML_ONLY"} {
# generate tree view
puts $doxyFile "GENERATE_TREEVIEW = YES"
# Set a reference to a TAGFILE
if { $tagFileDir != "" } {
if {[file exists $tagFileDir/OCCT.tag] == 1} {
#set tagPath [OCCDoc_GetRelPath $tagFileDir $outDir/html]
set tagPath $tagFileDir
puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=../../refman/html"
}
}
# HTML Search engine options
if { [string tolower $searchMode] == "none" } {
puts $doxyFile "SEARCHENGINE = NO"
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} else {
puts $doxyFile "SEARCHENGINE = YES"
if { [string tolower $searchMode] == "local" } {
puts $doxyFile "SERVER_BASED_SEARCH = NO"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "server" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = NO"
} elseif { [string tolower $searchMode] == "external" } {
puts $doxyFile "SERVER_BASED_SEARCH = YES"
puts $doxyFile "EXTERNAL_SEARCH = YES"
} else {
puts "Error: Wrong search engine type: $searchMode."
close $doxyFile
return -1
}
}
} elseif { $generatorMode == "CHM_ONLY"} {
# specific options for CHM file generation
puts $doxyFile "GENERATE_TREEVIEW = NO"
puts $doxyFile "SEARCHENGINE = NO"
puts $doxyFile "GENERATE_HTMLHELP = YES"
puts $doxyFile "CHM_FILE = ../../overview.chm"
puts $doxyFile "HHC_LOCATION = \"$hhcPath\""
puts $doxyFile "DISABLE_INDEX = YES"
}
# Formula options
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
}
close $doxyFile
return 0
}

3617
adm/genproj.tcl Normal file

File diff suppressed because it is too large Load Diff

918
adm/occaux.tcl Normal file
View File

@ -0,0 +1,918 @@
# =======================================================================
# Created on: 2014-03-21
# Created by: OMY
# Copyright (c) 1996-1999 Matra Datavision
# Copyright (c) 1999-2014 OPEN CASCADE SAS
#
# This file is part of Open CASCADE Technology software library.
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 2.1 as published
# by the Free Software Foundation, with special exception defined in the file
# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
# distribution for complete text of the license and disclaimer of any warranty.
#
# Alternatively, this file may be used under the terms of Open CASCADE
# commercial license or contractual agreement.
# =======================================================================
# This script contains auxiliary functions which can be used
# in documentation generation process
# =======================================================================
# ==============================================
# Commonly used functions
# ==============================================
# Parses arguments line like "-arg1=val1 -arg2=val2 ..." to array args_names and map args_values
proc OCCDoc_ParseArguments {arguments} {
global args_names
global args_values
set args_names {}
array set args_values {}
foreach arg $arguments {
if {[regexp {^(-)[a-z_]+$} $arg] == 1} {
set name [string range $arg 1 [string length $arg]-1]
lappend args_names $name
set args_values($name) "NULL"
continue
} elseif {[regexp {^(-)[a-z_]+=.+$} $arg] == 1} {
set equal_symbol_position [string first "=" $arg]
set name [string range $arg 1 $equal_symbol_position-1]
lappend args_names $name
set value [string range $arg $equal_symbol_position+1 [string length $arguments]-1]
# To parse a list of values for -m parameter
if { [string first "," $value] != -1 } {
set value [split $value ","];
}
set args_values($name) $value
} else {
puts "Error in argument $arg."
return 1
}
}
return 0
}
# Returns script parent folder
proc OCCDoc_GetDoxDir { {theProductsPath ""} } {
if { $theProductsPath == "" } {
return [file normalize [file dirname [info script]]/../dox]
} else {
return [file normalize $theProductsPath]/dox
}
}
# Returns products root folder
proc OCCDoc_GetProdRootDir {} {
if {[info exists ::env(PRODROOT)]} {
return [file normalize $::env(PRODROOT)]
}
}
# Returns OCCT root dir
proc OCCDoc_GetOCCTRootDir {} {
set path [OCCDoc_GetDoxDir]
return [file normalize $path/..]
}
# Returns root dir
proc OCCDoc_GetRootDir { {theProductsPath ""} } {
if { $theProductsPath == "" } {
return [OCCDoc_GetOCCTRootDir]
} else {
return [file normalize $theProductsPath]
}
}
# Returns OCCT include dir
proc OCCDoc_GetIncDir { {theProductsPath ""} } {
set path [OCCDoc_GetRootDir $theProductsPath]
return "$path/inc"
}
# Returns OCCT source dir
proc OCCDoc_GetSourceDir { {theProductsPath ""} } {
set path [OCCDoc_GetRootDir $theProductsPath]
return "$path/src"
}
# Returns name of the package from the current toolkit
proc OCCDoc_GetNameFromPath { thePath } {
set splitted_path [split $thePath "/" ]
set package_name [lindex $splitted_path end]
return $package_name
}
# Returns the relative path between two folders
proc OCCDoc_GetRelPath {thePathFrom thePathTo} {
if { [file isdirectory "$thePathFrom"] == 0 } {
return ""
}
set aPathFrom [file normalize "$thePathFrom"]
set aPathTo [file normalize "$thePathTo"]
set aCutedPathFrom "${aPathFrom}/dummy"
set aRelatedDeepPath ""
while { "$aCutedPathFrom" != [file normalize "$aCutedPathFrom/.."] } {
set aCutedPathFrom [file normalize "$aCutedPathFrom/.."]
# does aPathTo contain aCutedPathFrom?
regsub -all $aCutedPathFrom $aPathTo "" aPathFromAfterCut
if { "$aPathFromAfterCut" != "$aPathTo" } { # if so
if { "$aCutedPathFrom" == "$aPathFrom" } { # just go higher, for example, ./somefolder/someotherfolder
set aPathTo ".${aPathTo}"
} elseif { "$aCutedPathFrom" == "$aPathTo" } { # remove the last "/"
set aRelatedDeepPath [string replace $aRelatedDeepPath end end ""]
}
regsub -all $aCutedPathFrom $aPathTo $aRelatedDeepPath aPathToAfterCut
regsub -all "//" $aPathToAfterCut "/" aPathToAfterCut
return $aPathToAfterCut
}
set aRelatedDeepPath "$aRelatedDeepPath../"
}
return $thePathTo
}
# Returns OCCT version string from file Standard_Version.hxx (if available)
proc OCCDoc_DetectCasVersion {} {
set occt_ver 6.7.0
set occt_ver_add ""
set filename "[OCCDoc_GetSourceDir]/Standard/Standard_Version.hxx"
if { [file exists $filename] } {
set fh [open $filename "r"]
set fh_loaded [read $fh]
close $fh
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
regexp {[^/]\s*#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
}
return $occt_ver
}
# Checks if the necessary tools exist
proc OCCDoc_DetectNecessarySoftware { DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH HHC_PATH PDFLATEX_PATH } {
upvar 1 DOXYGEN_PATH doxy_path
upvar 1 GRAPHVIZ_PATH graph_path
upvar 1 INKSCAPE_PATH inkscape_path
upvar 1 HHC_PATH hhc_path
upvar 1 PDFLATEX_PATH latex_path
set doxy_path ""
set graph_path ""
set inkscape_path ""
set latex_path ""
set hhc_path ""
set is_win "no"
if { "$::tcl_platform(platform)" == "windows" } {
set is_win "yes"
}
if {"$is_win" == "yes"} {
set exe ".exe"
set com ".com"
} else {
set exe ""
set com ""
}
set g_flag "no"
set d_flag "no"
set i_flag "no"
set h_flag "no"
set l_flag "no"
puts ""
set envPath $::env(PATH)
if { $is_win == "yes" } {
set searchPathsList [split $envPath ";"]
} else {
set searchPathsList [split $envPath ":"]
}
foreach path $searchPathsList {
if { ($is_win == "no") &&
(($path == "/usr/bin") || ($path == "/usr/local/bin")) } {
# Avoid searching in default bin location
continue
}
if {$d_flag == "no"} {
if { [file exists $path/doxygen$exe] } {
catch { exec $path/doxygen -V } version_string
set version [lindex [split $version_string "\n"] 0]
puts "Info: $version "
puts " found in $path."
set doxy_path "$path/doxygen$exe"
set d_flag "yes"
}
}
if {$g_flag == "no"} {
if { [file exists $path/dot$exe] } {
catch { exec $path/dot -V } version
puts "Info: $version "
puts " found in $path."
set graph_path "$path/dot$exe"
set g_flag "yes"
}
}
if {$i_flag == "no"} {
if { [file exists $path/inkscape$com] } {
catch { exec $path/inkscape -V } version
puts "Info: $version "
puts " found in $path."
set inkscape_path "$path/inkscape$com"
set i_flag "yes"
}
}
if {$l_flag == "no"} {
if { [file exists $path/pdflatex$exe] } {
catch { exec $path/pdflatex -version } version
set version [lindex [split $version "\n"] 0]
puts "Info: $version "
puts " found in $path."
set latex_path "$path/pdflatex$exe"
set l_flag "yes"
}
}
if { ("$is_win" == "yes") && ($h_flag == "no") } {
if { [file exists $path/hhc.exe] } {
puts "Info: hhc "
puts " found in $path."
set hhc_path "hhc$exe"
set h_flag "yes"
}
}
if { ($d_flag == "yes") &&
($i_flag == "yes") &&
($g_flag == "yes") &&
($l_flag == "yes") &&
(($is_win == "yes") &&
($h_flag == "yes")) } {
break
}
}
# On Windows search for hhc.exe in the default location
# if it has not been found yet
if { ("$is_win" == "yes") && ($h_flag == "no") } {
if { [info exists ::env(ProgramFiles\(x86\))] } {
set h_flag "yes"
set path "$::env(ProgramFiles\(x86\))\\HTML Help Workshop"
set hhc_path "$path\\hhc.exe"
puts "Info: hhc "
puts " found in $path."
} else {
if { [info exists ::env(ProgramFiles)] } {
set h_flag "yes"
set path "$::env(ProgramFiles)\\HTML Help Workshop"
set hhc_path "$path\\hhc.exe"
puts "Info: hhc"
puts " found in $path."
}
}
}
# On *nix-like platforms,
# check the default binary locations if the tools had not been found yet
if { $is_win == "no" &&
(($d_flag == "no") ||
($i_flag == "no") ||
($g_flag == "no") ||
($l_flag == "no")) } {
set default_path { "/usr/bin" "/usr/local/bin" }
foreach path $default_path {
if {$d_flag == "no"} {
if { [file exists $path/doxygen$exe] } {
catch { exec $path/doxygen -V } version_string
set version [lindex [split $version_string "\n"] 0]
puts "Info: $version "
puts " found in $path."
set doxy_path "$path/doxygen$exe"
set d_flag "yes"
}
}
if {$g_flag == "no"} {
if { [file exists $path/dot$exe] } {
catch { exec $path/dot -V } version
puts "Info: $version "
puts " found in $path."
set graph_path "$path/dot$exe"
set g_flag "yes"
}
}
if {$i_flag == "no"} {
if { [file exists $path/inkscape$exe] } {
catch { exec $path/inkscape -V } version
puts "Info: $version "
puts " found in $path."
set inkscape_path "$path/inkscape$exe"
set i_flag "yes"
}
}
if {$l_flag == "no"} {
if { [file exists $path/pdflatex$exe] } {
catch { exec $path/pdflatex -version } version
set version [lindex [split $version "\n"] 0]
puts "Info: $version "
puts " found in $path."
set latex_path "$path/pdflatex$exe"
set l_flag "yes"
}
}
}
}
# Check if tools have been found
if { $d_flag == "no" } {
puts "Warning: Could not find doxygen installed."
return -1
}
if { $g_flag == "no" } {
puts "Warning: Could not find graphviz installed."
}
if { $i_flag == "no" } {
puts "Warning: Could not find inkscape installed."
}
if { $l_flag == "no" } {
puts "Warning: Could not find pdflatex installed."
}
if { ("$::tcl_platform(platform)" == "windows") && ($h_flag == "no") } {
puts "Warning: Could not find hhc installed."
}
puts ""
}
# Convert SVG files to PDF format to allow including them to PDF
# (requires InkScape to be in PATH)
proc OCCDoc_ProcessSvg {latexDir verboseMode} {
set anSvgList [glob -nocomplain $latexDir/*.svg]
if { $anSvgList == {} } {
return
}
catch { exec inkscape -V } anInkVer
set isOldSyntax 0
if {[string match "Inkscape 0.*" $anInkVer]} { set isOldSyntax 1 }
foreach file $anSvgList {
if {$verboseMode == "YES"} {
puts "Info: Converting file $file..."
}
set pdffile "[file rootname $file].pdf"
if { $isOldSyntax == 1 } {
if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } {
#puts "Error: $res."
return
}
} else {
if { [catch {exec inkscape $file --export-area-drawing --export-type=pdf --export-filename=$pdffile} res] } {
#puts "Error: $res."
return
}
}
}
}
# ==============================================
# Reference Manual-specific functions
# ==============================================
# Finds dependencies between all modules
proc OCCDoc_CreateModulesDependencyGraph {dir filename modules mpageprefix} {
global module_dependency
if {![catch {open $dir/$filename.dot "w"} file]} {
puts $file "digraph $filename"
puts $file "\{"
foreach mod $modules {
if { $mod == "" } {
continue
}
puts $file "\t$mod \[ URL = \"[string tolower $mpageprefix$mod.html]\" \]"
foreach mod_depend $module_dependency($mod) {
puts $file "\t$mod_depend -> $mod \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
}
}
puts $file "\}"
close $file
return $filename
}
}
# Finds dependencies between all toolkits in module
proc OCCDoc_CreateModuleToolkitsDependencyGraph {dir filename modulename tpageprefix} {
global toolkits_in_module
global toolkit_dependency
global toolkit_parent_module
if {![catch {open $dir/$filename.dot "w"} file]} {
puts $file "digraph $filename"
puts $file "\{"
foreach tk $toolkits_in_module($modulename) {
puts $file "\t$tk \[ URL = \"[string tolower $tpageprefix$tk.html]\"\ ]"
foreach tkd $toolkit_dependency($tk) {
if { [info exists toolkit_parent_module($tkd)] } {
if {$toolkit_parent_module($tkd) == $modulename} {
puts $file "\t$tkd -> $tk \[ dir = \"back\", color = \"midnightblue\", style = \"solid\" \]"
}
}
}
}
puts $file "\}"
close $file
return $filename
}
}
# Finds dependencies between the current toolkit and other toolkits
proc OCCDoc_CreateToolkitDependencyGraph {dir filename toolkitname tpageprefix} {
global toolkit_dependency
if {![catch {open $dir/$filename.dot "w"} file]} {
puts $file "digraph $filename"
puts $file "\{"
puts $file "\t$toolkitname \[ URL = \"[string tolower $tpageprefix$toolkitname.html]\"\, shape = box ]"
foreach tkd $toolkit_dependency($toolkitname) {
puts $file "\t$tkd \[ URL = \"[string tolower $tpageprefix$tkd.html]\"\ , shape = box ]"
puts $file "\t$toolkitname -> $tkd \[ color = \"midnightblue\", style = \"solid\" \]"
}
if {[llength $toolkit_dependency($toolkitname)] > 1} {
puts $file "\taspect = 1"
}
puts $file "\}"
close $file
return $filename
}
}
# Fills arrays of modules, toolkits, dependency of modules/toolkits etc
proc OCCDoc_LoadData { {theProductsDir ""} } {
global toolkits_in_module
global toolkit_dependency
global toolkit_parent_module
global module_dependency
if { $theProductsDir == ""} {
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/OS/" *.tcl]
} else {
set modules_files [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/VAS/" *.tcl]
}
foreach module_file $modules_files {
source $module_file
}
set modules [OCCDoc_GetModulesList $theProductsDir]
foreach mod $modules {
if { $mod == "" } {
continue
}
# Get toolkits of current module
set toolkits_in_module($mod) [$mod:toolkits]
# Get all dependence of current toolkit
foreach tk $toolkits_in_module($mod) {
# set parent module of current toolkit
set toolkit_parent_module($tk) $mod
set exlibfile [open "[OCCDoc_GetSourceDir $theProductsDir]/$tk/EXTERNLIB" r]
set exlibfile_data [read $exlibfile]
set exlibfile_data [split $exlibfile_data "\n"]
set toolkit_dependency($tk) {}
foreach dtk $exlibfile_data {
if { ([string first "TK" $dtk 0] == 0) ||
([string first "P" $dtk 0] == 0) } {
lappend toolkit_dependency($tk) $dtk
}
}
close $exlibfile
}
}
# Get modules dependency
foreach mod $modules {
set module_dependency($mod) {}
foreach tk $toolkits_in_module($mod) {
foreach tkd $toolkit_dependency($tk) {
if { [info exists toolkit_parent_module($tkd)] } {
if { $toolkit_parent_module($tkd) != $mod &&
[lsearch $module_dependency($mod) $toolkit_parent_module($tkd)] == -1} {
lappend module_dependency($mod) $toolkit_parent_module($tkd)
}
}
}
}
}
}
# Returns list of packages of the given toolkit
proc OCCDoc_GetPackagesList { theToolKitPath } {
set packages_list {}
# Open file with list of packages of the given toolkit
set fileid [open "$theToolKitPath/PACKAGES" "r"]
while { [eof $fileid] == 0 } {
set str [gets $fileid]
if { $str != "" } {
lappend packages_list $str
}
}
close $fileid
return $packages_list
}
# Returns list of modules from UDLIST
proc OCCDoc_GetModulesList { {theProductsDir ""} } {
if { $theProductsDir == "" } {
source "[OCCDoc_GetSourceDir $theProductsDir]/OS/Modules.tcl"
# load a command from this file
set modules [OS:Modules]
} else {
source "[OCCDoc_GetSourceDir $theProductsDir]/VAS/Products.tcl"
# load a command from this file
set modules [VAS:Products]
set modules [lsearch -not -all -inline $modules "VAS"]
}
return $modules
}
# Returns list of desired files in the specified location
proc OCCDoc_GetHeadersList { theDesiredContent thePackageName {theProductsDir ""} } {
# Get list of header files with path
set files_list [split [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $theProductsDir]/$thePackageName" "${thePackageName}.hxx" "${thePackageName}_*.hxx"]]
# Get content according to desired type ('p' for path and 'f' for filenames only)
if { $theDesiredContent == "p" } {
return $files_list
} elseif { $theDesiredContent == "f" } {
# Cut paths from filenames
foreach file $files_list {
set elem_index [lsearch $files_list $file]
lset files_list $elem_index [OCCDoc_GetNameFromPath [lindex $files_list $elem_index]]
}
return $files_list
}
}
# Returns location of the toolkit
proc OCCDoc_Locate { theToolKitName {theProductsDir ""} } {
set tk_dir "[OCCDoc_GetSourceDir $theProductsDir]/[OCCDoc_GetNameFromPath $theToolKitName]"
return $tk_dir
}
# Gets contents of the given html node (for Post-processing)
proc OCCDoc_GetNodeContents {node props html} {
set openTag "<$node$props>"
set closingTag "</$node>"
set start [string first $openTag $html]
if {$start == -1} {
return ""
}
set start [expr $start + [string length $openTag]]
set end [string length $html]
set html [string range $html $start $end]
set start [string first $closingTag $html]
set end [string length $html]
if {$start == -1} {
return ""
}
set start [expr $start - 1]
return [string range $html 0 $start]
}
# Generates main page file describing module structure
proc OCCDoc_MakeMainPage {outDir outFile modules {theProductsDir ""} } {
global env
set one_module [expr [llength $modules] == 1]
set fd [open $outFile "w"]
set module_prefix "module_"
set toolkit_prefix "toolkit_"
set package_prefix "package_"
if { ! [file exists "$outDir/html"] } {
file mkdir "$outDir/html"
}
OCCDoc_LoadData $theProductsDir
# Main page: list of modules
if { ! $one_module } {
puts $fd "/**"
puts $fd "\\mainpage Open CASCADE Technology"
foreach mod $modules {
puts $fd "\\li \\subpage [string tolower $module_prefix$mod]"
}
# insert modules relationship diagram
puts $fd "\\dotfile [OCCDoc_CreateModulesDependencyGraph $outDir/html schema_all_modules $modules $module_prefix]"
puts $fd "**/\n"
}
# One page per module: list of toolkits
set toolkits {}
foreach mod $modules {
if { $mod == "" } {
continue
}
puts $fd "/**"
if { $one_module } {
puts $fd "\\mainpage OCCT Module [$mod:name]"
} else {
puts $fd "\\page [string tolower module_$mod] Module [$mod:name]"
}
foreach tk [lsort [$mod:toolkits]] {
lappend toolkits $tk
puts $fd "\\li \\subpage [string tolower $toolkit_prefix$tk]"
}
puts $fd "\\dotfile [OCCDoc_CreateModuleToolkitsDependencyGraph $outDir/html schema_$mod $mod $toolkit_prefix]"
puts $fd "**/\n"
}
# One page per toolkit: list of packages
set packages {}
foreach tk $toolkits {
puts $fd "/**"
puts $fd "\\page [string tolower toolkit_$tk] Toolkit $tk"
foreach pk [lsort [OCCDoc_GetPackagesList [OCCDoc_Locate $tk $theProductsDir]]] {
lappend packages $pk
set u [OCCDoc_GetNameFromPath $pk]
puts $fd "\\li \\subpage [string tolower $package_prefix$u]"
}
puts $fd "\\dotfile [OCCDoc_CreateToolkitDependencyGraph $outDir/html schema_$tk $tk $toolkit_prefix]"
puts $fd "**/\n"
}
# One page per package: list of classes
foreach pk $packages {
set u [OCCDoc_GetNameFromPath $pk]
puts $fd "/**"
puts $fd "\\page [string tolower $package_prefix$u] Package $u"
foreach hdr [lsort [OCCDoc_GetHeadersList "f" "$pk" "$theProductsDir"]] {
if { ! [regexp {^Handle_} $hdr] && [regexp {(.*)[.]hxx} $hdr str obj] } {
puts $fd "\\li \\subpage $obj"
}
}
puts $fd "**/\n"
}
close $fd
return $outFile
}
# Parses generated files to add a navigation path
proc OCCDoc_PostProcessor {outDir} {
puts "[clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Post-process is started ..."
append outDir "/html"
set files [glob -nocomplain -type f $outDir/package_*]
if { $files != {} } {
foreach f [lsort $files] {
set packageFilePnt [open $f r]
set packageFile [read $packageFilePnt]
set navPath [OCCDoc_GetNodeContents "div" " id=\"nav-path\" class=\"navpath\"" $packageFile]
set packageName [OCCDoc_GetNodeContents "div" " class=\"title\"" $packageFile]
regsub -all {<[^<>]*>} $packageName "" packageName
# add package link to nav path
set first [expr 1 + [string last "/" $f]]
set last [expr [string length $f] - 1]
set packageFileName [string range $f $first $last]
set end [string first "</ul>" $navPath]
set end [expr $end - 1]
set navPath [string range $navPath 0 $end]
append navPath " <li class=\"navelem\"><a class=\"el\" href=\"$packageFileName\">$packageName</a> </li>\n </ul>"
# get list of files to update
set listContents [OCCDoc_GetNodeContents "div" " class=\"textblock\"" $packageFile]
set listContents [OCCDoc_GetNodeContents "ul" "" $listContents]
set lines [split $listContents "\n"]
foreach line $lines {
if {[regexp {href=\"([^\"]*)\"} $line tmpLine classFileName]} {
# check if anchor is there
set anchorPos [string first "#" $classFileName]
if {$anchorPos != -1} {
set classFileName [string range $classFileName 0 [expr $anchorPos - 1]]
}
# read class file
set classFilePnt [open $outDir/$classFileName r+]
set classFile [read $classFilePnt]
# find position of content block
set contentPos [string first "<div class=\"header\">" $classFile]
set navPart [string range $classFile 0 [expr $contentPos - 1]]
# position where to insert nav path
set posToInsert [string last "</div>" $navPart]
set prePart [string range $classFile 0 [expr $posToInsert - 1]]
set postPart [string range $classFile $posToInsert [string length $classFile]]
set newClassFile ""
append newClassFile $prePart " <div id=\"nav-path\" class=\"navpath\">" $navPath \n " </div>" \n $postPart
# write updated content
seek $classFilePnt 0
puts $classFilePnt $newClassFile
close $classFilePnt
}
}
close $packageFilePnt
}
return 0
} else {
puts "no files found"
return 1
}
}
# ======================================
# User Guides-specific functions
# ======================================
# Loads a list of docfiles from file FILES.txt
proc OCCDoc_LoadFilesList {} {
set INPUTDIR [OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]
global available_docfiles
set available_docfiles {}
# Read data from file
if { [file exists "$INPUTDIR/FILES_HTML.txt"] == 1 } {
set FILE [open "$INPUTDIR/FILES_HTML.txt" r]
while {1} {
set line [string trim [gets $FILE]]
# trim possible comments starting with '#'
set line [regsub {\#.*} $line {}]
if {$line != ""} {
lappend available_docfiles $line
}
if {[eof $FILE]} {
close $FILE
break
}
}
} else {
return -1
}
global available_pdf
set available_pdf {}
# Read data from file
if { [file exists "$INPUTDIR/FILES_PDF.txt"] } {
set FILE [open "$INPUTDIR/FILES_PDF.txt" r]
while {1} {
set line [string trim [gets $FILE]]
# Trim possible comments starting with '#'
set line [regsub {\#.*} $line {}]
if {$line != ""} {
lappend available_pdf $line
}
if {[eof $FILE]} {
close $FILE
break
}
}
} else {
return -1
}
return 0
}
# Writes new TeX file for conversion from tex to pdf for a specific doc
proc OCCDoc_MakeRefmanTex {fileName latexDir verboseMode latexFilesList} {
if { $verboseMode == "YES" } {
puts "Info: Making refman.tex file for $fileName..."
}
set DOCNAME "$latexDir/refman.tex"
if {[file exists $DOCNAME] == 1} {
file delete -force $DOCNAME
}
# Copy template file to latex folder
if { "[OCCDoc_GetProdRootDir]" != "" } {
file copy "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex" $DOCNAME
} else {
file copy "[OCCDoc_GetDoxDir]/resources/occt_pdf_template.tex" $DOCNAME
}
# Get templatized data
set texfile [open $DOCNAME "r"]
set texfile_loaded [read $texfile]
close $texfile
# Replace dummy values
set year [clock format [clock seconds] -format {%Y}]
set month [clock format [clock seconds] -format {%B}]
set texfile [open $DOCNAME "w"]
set casVersion [OCCDoc_DetectCasVersion]
# Get name of the document
set docLabel ""
foreach aFileName $latexFilesList {
# Find the file in FILES_PDF.txt
set parsedFileName [file rootname [lindex [split $aFileName "/" ] end]]
if { [regexp "${parsedFileName}$" $fileName] } {
set filepath "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/$aFileName"
if { [file exists $filepath] } {
set MDFile [open $filepath "r"]
set label [split [gets $MDFile] "\{"]
set docLabel [lindex $label 0]
close $MDFile
break
}
}
}
set occtlogo_path "[OCCDoc_GetDoxDir]/resources/occt_logo.png"
set occlogo_path "[OCCDoc_GetDoxDir]/resources/occ_logo.png"
set copyright_path "[OCCDoc_GetDoxDir [OCCDoc_GetProdRootDir]]/resources/prod_pdf_template.tex"
set texfile_loaded [string map [list DEFDOCLABEL "$docLabel" DEFCASVERSION "$casVersion" DEFFILENAME "$fileName" DEFYEAR "$year" DEFMONTH "$month" DEFCOPYRIGHT "$copyright_path" DEFLOGO "$occtlogo_path" DEFOCCLOGO "$occlogo_path" DEFTITLE ""] $texfile_loaded]
# Get data
puts $texfile $texfile_loaded
close $texfile
}
# Postprocesses generated TeX files
proc OCCDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
foreach TEX $texFiles {
if {$verboseMode == "YES"} {
puts "Info: Preprocessing file $TEX..."
}
if {![file exists $TEX]} {
puts "Error: file $TEX does not exist."
return -1
}
set IN_F [open "$TEX" "r"]
set TMPFILENAME "$latexDir/temp.tex"
set OUT_F [open $TMPFILENAME w]
while {1} {
set line [gets $IN_F]
if { [string first "\\includegraphics" $line] != -1 } {
# replace svg extension by pdf
set line [regsub {[.]svg} $line ".pdf"]
# Center images in TeX files
set line "\\begin{center}\n $line\n\\end{center}"
} elseif { [string first "\\subsection" $line] != -1 } {
# Replace \subsection with \section tag
regsub -all "\\\\subsection" $line "\\\\section" line
} elseif { [string first "\\subsubsection" $line] != -1 } {
# Replace \subsubsection with \subsection tag
regsub -all "\\\\subsubsection" $line "\\\\subsection" line
} elseif { [string first "\\paragraph" $line] != -1 } {
# Replace \paragraph with \subsubsection tag
regsub -all "\\\\paragraph" $line "\\\\subsubsection" line
}
puts $OUT_F $line
if {[eof $IN_F]} {
close $IN_F
close $OUT_F
break
}
}
file delete -force $TEX
file rename $TMPFILENAME $TEX
}
}

5
adm/qmake/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/*/*.pro
/*/*/*.pro
*.pro.user
custom.pri
custom.auto.pri

165
adm/qmake/OccCppConfig.pri Normal file
View 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
View 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}))
}
}
}
}

View File

@ -0,0 +1,2 @@
OCC_MODULE_NAME = \$\$TARGET
include(../OccModule.pri)

166
adm/qmake/OccToolkit.pri Normal file
View File

@ -0,0 +1,166 @@
# 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|gxx)$
aPxxRegex = ^.*\.(pxx)$
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}
}
}
}

View File

@ -0,0 +1,2 @@
OCC_TOOLKIT_NAME = \$\$TARGET
include(../../OccToolkit.pri)

45
adm/qmake/Occt.pro Normal file
View 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
View File

View File

@ -0,0 +1 @@
#include \"../src/$${OCCT_PACKAGE}/$${OCCT_HEADER}\"

View 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

View 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>

View File

@ -33,6 +33,7 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
@ -66,9 +67,8 @@ if ["%toCMake%"] == ["1"] (
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
rem Get OCCT version
call "%~dp0build_common.bat"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
for %%s in (%anNdkAbiList%) do (
@ -167,6 +167,7 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="OFF" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@ -27,6 +27,7 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_MODULE_DETools=OFF"
rem Optional 3rd-party libraries to enable
rem set "USE_RAPIDJSON=ON"

View File

@ -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%"

View File

@ -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}"

View File

@ -16,6 +16,7 @@ rem set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
rem set "INSTALL_DIR=%SrcRoot%\install"
rem set BUILD_DOC_Overview=OFF
rem set BUILD_Inspector=OFF
rem set BUILD_LIBRARY_TYPE=Shared
rem set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
rem set BUILD_WITH_DEBUG=OFF
@ -27,8 +28,12 @@ rem Use semicolon-separated list of toolkits if you want to disable all modules
rem and build only some toolkits.
rem set BUILD_ADDITIONAL_TOOLKITS=
rem Set a directory recognized as a patch for OCCT.
rem set BUILD_PATCH=
rem set BUILD_MODULE_ApplicationFramework=ON
rem set BUILD_MODULE_DataExchange=ON
rem set BUILD_MODULE_DETools=OFF
rem set BUILD_MODULE_Draw=ON
rem set BUILD_MODULE_ModelingAlgorithms=ON
rem set BUILD_MODULE_ModelingData=ON

View File

@ -11,6 +11,7 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
#INSTALL_DIR="$SrcRoot/install"
#BUILD_DOC_Overview=OFF
#BUILD_Inspector=OFF
#BUILD_LIBRARY_TYPE=Shared
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
#BUILD_WITH_DEBUG=OFF
@ -20,8 +21,12 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
# and build only some toolkits.
#BUILD_ADDITIONAL_TOOLKITS=
# Set a directory recognized as a patch for OCCT.
#BUILD_PATCH=
#BUILD_MODULE_ApplicationFramework=ON
#BUILD_MODULE_DataExchange=ON
#BUILD_MODULE_DETools=OFF
#BUILD_MODULE_Draw=ON
#BUILD_MODULE_ModelingAlgorithms=ON
#BUILD_MODULE_ModelingData=ON

View File

@ -17,7 +17,9 @@ set "INSTALL_DIR=%SrcRoot%\install"
set BUILD_ADDITIONAL_TOOLKITS=
set BUILD_DOC_Overview=OFF
set BUILD_Inspector=OFF
set BUILD_LIBRARY_TYPE=Shared
set BUILD_PATCH=
set BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
set BUILD_WITH_DEBUG=OFF
set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
@ -26,6 +28,7 @@ set BUILD_FORCE_RelWithDebInfo=OFF
set BUILD_MODULE_ApplicationFramework=ON
set BUILD_MODULE_DataExchange=ON
set BUILD_MODULE_DETools=OFF
set BUILD_MODULE_Draw=ON
set BUILD_MODULE_ModelingAlgorithms=ON
set BUILD_MODULE_ModelingData=ON
@ -56,14 +59,17 @@ cmake -G "%arch_compile%" ^
-D 3RDPARTY_DIR:STRING="%OCCT3RDPARTY%" ^
-D BUILD_ADDITIONAL_TOOLKITS:STRING="%BUILD_ADDITIONAL_TOOLKITS%" ^
-D BUILD_DOC_Overview:BOOL=%BUILD_DOC_Overview% ^
-D BUILD_Inspector:BOOL=%BUILD_Inspector% ^
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
-D BUILD_MODULE_DETools:BOOL=%BUILD_MODULE_DETools% ^
-D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
-D BUILD_MODULE_FoundationClasses:BOOL=ON ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^
-D BUILD_MODULE_ModelingData:BOOL=%BUILD_MODULE_ModelingData% ^
-D BUILD_MODULE_Visualization:BOOL=%BUILD_MODULE_Visualization% ^
-D BUILD_PATCH:PATH="%BUILD_PATCH%" ^
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=%BUILD_RELEASE_DISABLE_EXCEPTIONS% ^
-D BUILD_WITH_DEBUG:BOOL=%BUILD_WITH_DEBUG% ^
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=%BUILD_ENABLE_FPE_SIGNAL_HANDLER% ^

View File

@ -22,13 +22,16 @@ INSTALL_DIR_LIB=lin64/gcc/lib$DEB
BUILD_ADDITIONAL_TOOLKITS=
BUILD_DOC_Overview=OFF
BUILD_Inspector=OFF
BUILD_LIBRARY_TYPE=Shared
BUILD_PATCH=
BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
BUILD_WITH_DEBUG=OFF
BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
BUILD_MODULE_ApplicationFramework=ON
BUILD_MODULE_DataExchange=ON
BUILD_MODULE_DETools=OFF
BUILD_MODULE_Draw=ON
BUILD_MODULE_ModelingAlgorithms=ON
BUILD_MODULE_ModelingData=ON
@ -57,14 +60,17 @@ cmake -G "Unix Makefiles" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$FREETYPE_DIR" \
-D BUILD_ADDITIONAL_TOOLKITS:STRING="$BUILD_ADDITIONAL_TOOLKITS" \
-D BUILD_DOC_Overview:BOOL=$BUILD_DOC_Overview \
-D BUILD_Inspector:BOOL=$BUILD_Inspector \
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
-D BUILD_MODULE_DETools:BOOL=$BUILD_MODULE_DETools \
-D BUILD_MODULE_Draw:BOOL=$BUILD_MODULE_Draw \
-D BUILD_MODULE_FoundationClasses:BOOL=ON \
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \
-D BUILD_MODULE_ModelingData:BOOL=$BUILD_MODULE_ModelingData \
-D BUILD_MODULE_Visualization:BOOL=$BUILD_MODULE_Visualization \
-D BUILD_PATCH:PATH="$BUILD_PATCH" \
-D BUILD_RELEASE_DISABLE_EXCEPTIONS:BOOL=$BUILD_RELEASE_DISABLE_EXCEPTIONS \
-D BUILD_WITH_DEBUG:BOOL=$BUILD_WITH_DEBUG \
-D BUILD_ENABLE_FPE_SIGNAL_HANDLER:BOOL=$BUILD_ENABLE_FPE_SIGNAL_HANDLER \

View File

@ -34,6 +34,7 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export USE_FREETYPE=ON
export USE_FREEIMAGE=OFF
@ -48,7 +49,8 @@ if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
source "${aScriptDir}/ios_custom.sh"
fi
source "${aScriptDir}/build_common.sh"
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
@ -147,6 +149,7 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="OFF" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@ -20,6 +20,7 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON

View File

@ -34,6 +34,7 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export BUILD_Draw=ON
export USE_FREETYPE=ON
@ -50,7 +51,8 @@ if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
source "${aScriptDir}/macos_custom.sh"
fi
source "${aScriptDir}/build_common.sh"
anOcctVerSuffix=`grep -e "#define OCC_VERSION_DEVELOPMENT" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
anOcctVersion=`grep -e "#define OCC_VERSION_COMPLETE" "$aCasSrc/src/Standard/Standard_Version.hxx" | awk '{print $3}' | xargs`
aGitBranch=`git symbolic-ref --short HEAD`
YEAR=$(date +"%Y")
@ -144,6 +146,7 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@ -19,6 +19,7 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export BUILD_Draw=ON
#export USE_RAPIDJSON=ON

View File

@ -32,6 +32,7 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=ON"
rem Optional 3rd-party libraries to enable
@ -52,8 +53,9 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
call "%~dp0build_common.bat"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
@ -154,6 +156,7 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^

View File

@ -22,6 +22,7 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_DETools=OFF"
rem set "BUILD_Draw=ON"
rem set "USE_RAPIDJSON=ON"

View File

@ -32,6 +32,7 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=OFF"
rem Optional 3rd-party libraries to enable
@ -54,8 +55,8 @@ if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
set "aGitBranch="
call "%~dp0build_common.bat"
set "aGitBranch="
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_DEVELOPMENT" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVerSuffix=%%i" )
for /f tokens^=2^ delims^=^" %%i in ('findstr /b /c:"#define OCC_VERSION_COMPLETE" "%aCasSrc%\src\Standard\Standard_Version.hxx"') do ( set "anOcctVersion=%%i" )
for /f %%i in ('git symbolic-ref --short HEAD') do ( set "aGitBranch=%%i" )
set "aBuildType=Release"
@ -175,6 +176,7 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@ -20,6 +20,7 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
. "${aScriptDir}/wasm_custom.sh"
@ -74,6 +75,7 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
@ -92,6 +94,7 @@ cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"

Some files were not shown because too many files have changed in this diff Show More