1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

..

1 Commits

17535 changed files with 559870 additions and 566396 deletions

4
.gitattributes vendored
View File

@@ -1,8 +1,6 @@
.gitattributes eol=lf .gitattributes eol=lf
.gitignore eol=lf .gitignore eol=lf
*.txt eol=lf *.txt eol=lf
*.htm eol=lf
*.html eol=lf
*.h eol=lf *.h eol=lf
*.c eol=lf *.c eol=lf
*.inl eol=lf *.inl eol=lf
@@ -31,7 +29,6 @@
*.xib eol=lf *.xib eol=lf
*.plist eol=lf *.plist eol=lf
*.java eol=lf *.java eol=lf
*.js eol=lf
*.igs eol=lf *.igs eol=lf
*.iges eol=lf *.iges eol=lf
*.stp eol=lf *.stp eol=lf
@@ -47,7 +44,6 @@
FILES eol=lf FILES eol=lf
PACKAGES eol=lf PACKAGES eol=lf
EXTERNLIB eol=lf EXTERNLIB eol=lf
EXTERNLIB_STATIC eol=lf
UDLIST eol=lf UDLIST eol=lf
tests/* eol=lf tests/* eol=lf
tests/*/* eol=lf tests/*/* eol=lf

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,102 +0,0 @@
name: "Application Framework Bug Report"
description: "Report a bug related to the Application Framework"
labels: ["1. Application Framework", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Application Framework Feature Request"
description: "Request a new feature or enhancement for the Application Framework"
labels: ["1. Application Framework", "2. Enhancement"]
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,102 +0,0 @@
name: "Build Bug Report"
description: "Report a bug related to the build process"
labels: ["1. Build", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Build Feature Request"
description: "Request a new feature or enhancement for the build process"
labels: ["1. Build", "2. Enhancement"]
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,102 +0,0 @@
name: "Coding Bug Report"
description: "Report a bug related to coding"
labels: ["1. Coding", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Coding Feature Request"
description: "Request a new feature or enhancement for coding"
labels: ["1. Coding", "2. Enhancement"]
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,102 +0,0 @@
name: "Configuration Bug Report"
description: "Report a bug related to configuration"
labels: ["1. Configuration", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Configuration Feature Request"
description: "Request a new feature or enhancement for configuration"
labels: ["1. Configuration", "2. Enhancement"]
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,102 +0,0 @@
name: "DRAW Bug Report"
description: "Report a bug related to DRAW"
labels: ["1. 2. Bug", "DRAW"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "DRAW Feature Request"
description: "Request a new feature related to DRAW"
labels: ["1. Enhancement", "DRAW"]
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,102 +0,0 @@
name: "Data Exchange Bug Report"
description: "Report a bug related to data exchange"
labels: ["1. Data Exchange", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Data Exchange Feature Request"
description: "Request a new feature or enhancement for data exchange"
labels: ["1. Data Exchange", "2. Enhancement"]
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,102 +0,0 @@
name: "Documentation Bug Report"
description: "Report a bug related to documentation"
labels: ["1. Documentation", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Documentation Feature Request"
description: "Request a new feature or enhancement for documentation"
labels: ["1. Documentation", "2. Enhancement"]
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,102 +0,0 @@
name: "Foundation Classes Bug Report"
description: "Report a bug related to Foundation Classes"
labels: ["1. Foundation Classes", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Foundation Classes Feature Request"
description: "Request a new feature or enhancement for Foundation Classes"
labels: ["1. Foundation Classes", "2. Enhancement"]
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,102 +0,0 @@
name: "Mesh Bug Report"
description: "Report a bug related to Mesh"
labels: ["1. Mesh", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Mesh Feature Request"
description: "Request a new feature or enhancement for Mesh"
labels: ["1. Mesh", "2. Enhancement"]
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,102 +0,0 @@
name: "Modeling Bug Report"
description: "Report a bug related to Modeling"
labels: ["1. Modeling", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Modeling Feature Request"
description: "Request a new feature or enhancement for Modeling"
labels: ["1. Modeling", "2. Enhancement"]
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,102 +0,0 @@
name: "Samples Bug Report"
description: "Report a bug related to Samples"
labels: ["1. Samples", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Samples Feature Request"
description: "Request a new feature or enhancement for Samples"
labels: ["1. Samples", "2. Enhancement"]
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,102 +0,0 @@
name: "Shape Healing Bug Report"
description: "Report a bug related to Shape Healing"
labels: ["1. Shape Healing", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Shape Healing Feature Request"
description: "Request a new feature or enhancement for Shape Healing"
labels: ["1. Shape Healing", "2. Enhancement"]
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,102 +0,0 @@
name: "Testing Bug Report"
description: "Report a bug related to Testing"
labels: ["1. Testing", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Testing Feature Request"
description: "Request a new feature or enhancement for Testing"
labels: ["1. Testing", "2. Enhancement"]
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,102 +0,0 @@
name: "Visualization Bug Report"
description: "Report a bug related to Visualization"
labels: ["1. Visualization", "2. Bug"]
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
validations:
required: true
- type: dropdown
id: compiler
attributes:
label: Compiler
description: "Select the compiler"
options:
- GCC
- Clang
- MSVC
validations:
required: true
- type: input
id: compiler_version
attributes:
label: Compiler Version
description: "Specify the compiler version (optional)"
- type: dropdown
id: bitness
attributes:
label: Bitness
description: "Select the bitness"
options:
- 32-bit
- 64-bit
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.8
- 7.9
- latest
validations:
required: true
- type: input
id: precise_occt_version
attributes:
label: Precise OCCT Version or Branch
description: "Specify the precise OCCT version, branch, or SSH (optional)"
- type: input
id: environment
attributes:
label: Environment
description: "Details about your environment (OS, compiler, etc.)"
- type: textarea
id: additional_files
attributes:
label: Additional Files
description: "Attach any additional files that may help in reproducing the issue"

View File

@@ -1,34 +0,0 @@
name: "Visualization Feature Request"
description: "Request a new feature or enhancement for Visualization"
labels: ["1. Visualization", "2. Enhancement"]
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,929 +0,0 @@
# This workflow builds and tests OCCT on multiple platforms (Windows, macOS, Linux with Clang, and Linux with GCC).
# It is triggered on pull requests to any branch.
# The workflow includes steps to prepare and build the project on each platform, run tests, and upload the results.
# Concurrency is set to ensure that only one instance of the workflow runs per pull request at a time.
name: Build and Test OCCT on Multiple Platforms
on:
pull_request:
branches:
- '**'
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
prepare-and-build-windows-x64:
name: Prepare and Build on Windows with MSVC (x64)
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: 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 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D INSTALL_DIR=${{ github.workspace }}/install `
-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 ..
shell: pwsh
- name: Build OCCT
run: |
cd build
cmake --build . --config Release -- /m
- name: Install OCCT
run: |
cd build
cmake --install . --config Release
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: install-windows-x64
path: install
retention-days: 7
prepare-and-build-windows-clang-x64:
name: Prepare and Build on Windows with Clang (x64)
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Configure OCCT
run: |
mkdir build
cd build
cmake -G "Ninja" `
-D CMAKE_C_COMPILER=clang `
-D CMAKE_CXX_COMPILER=clang++ `
-D USE_FREETYPE=ON `
-D USE_TK=OFF `
-D BUILD_USE_PCH=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_INCLUDE_SYMLINK=ON `
-D CMAKE_BUILD_TYPE=Release `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D INSTALL_DIR=${{ github.workspace }}/install `
-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 ..
shell: pwsh
- name: Build OCCT
run: |
cd build
cmake --build . --config Release
- name: Install OCCT
run: |
cd build
cmake --install . --config Release
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: install-windows-clang-x64
path: install
retention-days: 7
prepare-and-build-macos-x64:
name: Prepare and Build on macOS with Clang (x64)
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- name: Configure OCCT
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++ \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_RAPIDJSON=ON \
-D USE_DRACO=ON \
-D USE_FREETYPE=ON \
-D USE_OPENGL=ON \
-D USE_FREEIMAGE=ON ..
- name: Build OCCT
run: |
cd build
make -j$(sysctl -n hw.logicalcpu)
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: install-macos-x64
path: install
retention-days: 7
prepare-and-build-macos-gcc-x64:
name: Prepare and Build on macOS with GCC (x64)
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
brew update
brew install gcc tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- name: Configure OCCT
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_RAPIDJSON=ON \
-D USE_DRACO=ON \
-D USE_FREETYPE=ON \
-D USE_OPENGL=ON \
-D USE_FREEIMAGE=ON ..
- name: Build OCCT
run: |
cd build
make -j$(sysctl -n hw.logicalcpu)
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: install-macos-gcc-x64
path: install
retention-days: 7
prepare-and-build-linux-clang-x64:
name: Prepare and Build on Ubuntu with Clang (x64)
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
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: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- name: Configure OCCT
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++ \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D USE_TK=OFF \
-D CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
- name: Build OCCT
run: |
cd build
make -j"$(nproc)"
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: install-linux-clang-x64
path: install
retention-days: 7
prepare-and-build-linux-gcc-x64:
name: Prepare and Build on Ubuntu with GCC (x64)
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- name: Configure OCCT
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D BUILD_USE_PCH=ON \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D USE_TK=OFF \
-D CMAKE_BUILD_TYPE=Release \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
- name: Build OCCT
run: |
cd build
make -j"$(nproc)"
- name: Install OCCT
run: |
cd build
make install
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: install-linux-gcc-x64
path: install
retention-days: 7
test-windows-x64:
name: Test on Windows (x64)
runs-on: windows-2022
needs: prepare-and-build-windows-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Download and extract test data
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip
Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.8.0.zip
shell: pwsh
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-windows-x64
path: install
- name: Run tests
run: |
cd install
call env.bat vc14 win64 release
DRAWEXE.exe -v -c testgrid
shell: cmd
env:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload test results
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: results-windows-x64
path: install/results
retention-days: 15
test-windows-clang-x64:
name: Test on Windows with Clang (x64)
runs-on: windows-2022
needs: prepare-and-build-windows-clang-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Download and extract test data
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.zip -OutFile opencascade-dataset-7.8.0.zip
Expand-Archive -Path opencascade-dataset-7.8.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.8.0.zip
shell: pwsh
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-windows-clang-x64
path: install
- name: Run tests
run: |
cd install
call env.bat clang win64 release
DRAWEXE.exe -v -c testgrid
shell: cmd
env:
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload test results
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: results-windows-clang-x64
path: install/results
retention-days: 15
test-macos-x64:
name: Test on macOS (x64)
runs-on: macos-15
needs: prepare-and-build-macos-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- name: Download test data
run: |
cd data
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-macos-x64
path: install
- name: Set LIBGL_ALWAYS_SOFTWARE environment variable
run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- name: Run tests
run: |
cd install
cd bin
source env.sh
./DRAWEXE -v -c testgrid
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload test results
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: results-macos-x64
path: install/bin/results
retention-days: 15
test-macos-gcc-x64:
name: Test on macOS with GCC (x64)
runs-on: macos-15
needs: prepare-and-build-macos-gcc-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freetype freeimage draco glfw
- name: Download test data
run: |
cd data
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-macos-gcc-x64
path: install
- name: Set LIBGL_ALWAYS_SOFTWARE environment variable
run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- name: Run tests
run: |
cd install
cd bin
source env.sh
./DRAWEXE -v -c testgrid
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload test results
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: results-macos-gcc-x64
path: install/bin/results
retention-days: 15
test-linux-clang-x64:
name: Test on Linux with Clang (x64)
runs-on: ubuntu-24.04
needs: prepare-and-build-linux-clang-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
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: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri
- name: Start Xvfb
run: Xvfb :99 -screen 0 1920x1080x24 &
- name: Set DISPLAY environment variable
run: echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Download test data
run: |
cd data
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-linux-clang-x64
path: install
- name: Set LIBGL_ALWAYS_SOFTWARE environment variable
run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- name: Run tests
run: |
cd install
cd bin
source env.sh
./DRAWEXE -v -c testgrid
shell: bash
env:
DISPLAY: :99
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload test results
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: results-linux-clang-x64
path: install/bin/results
retention-days: 15
test-linux-gcc-x64:
name: Test on Linux with GCC (x64)
runs-on: ubuntu-24.04
needs: prepare-and-build-linux-gcc-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri
- name: Start Xvfb
run: Xvfb :99 -screen 0 1920x1080x24 &
- name: Set DISPLAY environment variable
run: echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Download test data
run: |
cd data
wget https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_8_0/opencascade-dataset-7.8.0.tar.xz
tar -xf opencascade-dataset-7.8.0.tar.xz
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-linux-gcc-x64
path: install
- name: Set LIBGL_ALWAYS_SOFTWARE environment variable
run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- name: Run tests
run: |
cd install
cd bin
source env.sh
./DRAWEXE -v -c testgrid
shell: bash
env:
DISPLAY: :99
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload test results
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: results-linux-gcc-x64
path: install/bin/results
retention-days: 15
summarize:
name: Summarize and Send PR Message
runs-on: ubuntu-24.04
needs: [test-windows-x64, test-windows-clang-x64, test-macos-x64, test-macos-gcc-x64, test-linux-clang-x64, test-linux-gcc-x64]
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev
- name: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1-mesa-dri
- name: Start Xvfb
run: Xvfb :99 -screen 0 1920x1080x24 &
- name: Set DISPLAY environment variable
run: echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Set LIBGL_ALWAYS_SOFTWARE environment variable
run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-linux-gcc-x64
path: install
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
workflow_name="Build and Test OCCT on Multiple Platforms"
target_branch="${{ github.event.pull_request.base.ref }}"
echo "Fetching latest run ID for workflow: $workflow_name on branch: $target_branch"
response=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=$target_branch")
latest_run_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflow_runs[] | select(.name==$workflow_name) | .id' | head -n 1)
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
- name: Download all test results (Windows x64) from master
uses: actions/download-artifact@v4.1.7
with:
name: results-windows-x64
path: install/bin/results/master/windows-x64
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Download all test results (Windows Clang x64) from master
uses: actions/download-artifact@v4.1.7
with:
name: results-windows-clang-x64
path: install/bin/results/master/windows-clang-x64
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Download all test results (macOS x64) from master
uses: actions/download-artifact@v4.1.7
with:
name: results-macos-x64
path: install/bin/results/master/macos-x64
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Download all test results (macOS GCC x64) from master
uses: actions/download-artifact@v4.1.7
with:
name: results-macos-gcc-x64
path: install/bin/results/master/macos-gcc-x64
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Download all test results (Linux Clang x64) from master
uses: actions/download-artifact@v4.1.7
with:
name: results-linux-clang-x64
path: install/bin/results/master/linux-clang-x64
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Download all test results (Linux GCC x64) from master
uses: actions/download-artifact@v4.1.7
with:
name: results-linux-gcc-x64
path: install/bin/results/master/linux-gcc-x64
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ env.latest_run_id }}
- name: Download all test results (Windows x64)
uses: actions/download-artifact@v4.1.7
with:
name: results-windows-x64
path: install/bin/results/current/windows-x64
- name: Download all test results (Windows Clang x64)
uses: actions/download-artifact@v4.1.7
with:
name: results-windows-clang-x64
path: install/bin/results/current/windows-clang-x64
- name: Download all test results (macOS x64)
uses: actions/download-artifact@v4.1.7
with:
name: results-macos-x64
path: install/bin/results/current/macos-x64
- name: Download all test results (macOS GCC x64)
uses: actions/download-artifact@v4.1.7
with:
name: results-macos-gcc-x64
path: install/bin/results/current/macos-gcc-x64
- name: Download all test results (Linux Clang x64)
uses: actions/download-artifact@v4.1.7
with:
name: results-linux-clang-x64
path: install/bin/results/current/linux-clang-x64
- name: Download all test results (Linux GCC x64)
uses: actions/download-artifact@v4.1.7
with:
name: results-linux-gcc-x64
path: install/bin/results/current/linux-gcc-x64
- name: Run tests
run: |
echo "Comparing test results..."
cd install
cd bin
source env.sh
for dir in results/current/windows-x64/*; do RESULTS_CURRENT_WINDOWS_X64=$dir; done
for dir in results/master/windows-x64/*; do RESULTS_MASTER_WINDOWS_X64=$dir; done
for dir in results/current/windows-clang-x64/*; do RESULTS_CURRENT_WINDOWS_CLANG_X64=$dir; done
for dir in results/master/windows-clang-x64/*; do RESULTS_MASTER_WINDOWS_CLANG_X64=$dir; done
for dir in results/current/macos-x64/*; do RESULTS_CURRENT_MACOS_X64=$dir; done
for dir in results/master/macos-x64/*; do RESULTS_MASTER_MACOS_X64=$dir; done
for dir in results/current/macos-gcc-x64/*; do RESULTS_CURRENT_MACOS_GCC_X64=$dir; done
for dir in results/master/macos-gcc-x64/*; do RESULTS_MASTER_MACOS_GCC_X64=$dir; done
for dir in results/current/linux-clang-x64/*; do RESULTS_CURRENT_LINUX_CLANG_X64=$dir; done
for dir in results/master/linux-clang-x64/*; do RESULTS_MASTER_LINUX_CLANG_X64=$dir; done
for dir in results/current/linux-gcc-x64/*; do RESULTS_CURRENT_LINUX_GCC_X64=$dir; done
for dir in results/master/linux-gcc-x64/*; do RESULTS_MASTER_LINUX_GCC_X64=$dir; done
./DRAWEXE -v -c testdiff $RESULTS_CURRENT_WINDOWS_X64 $RESULTS_MASTER_WINDOWS_X64 &
./DRAWEXE -v -c testdiff $RESULTS_CURRENT_WINDOWS_CLANG_X64 $RESULTS_MASTER_WINDOWS_CLANG_X64 &
./DRAWEXE -v -c testdiff $RESULTS_CURRENT_MACOS_X64 $RESULTS_MASTER_MACOS_X64 &
./DRAWEXE -v -c testdiff $RESULTS_CURRENT_MACOS_GCC_X64 $RESULTS_MASTER_MACOS_GCC_X64 &
./DRAWEXE -v -c testdiff $RESULTS_CURRENT_LINUX_CLANG_X64 $RESULTS_MASTER_LINUX_CLANG_X64 &
./DRAWEXE -v -c testdiff $RESULTS_CURRENT_LINUX_GCC_X64 $RESULTS_MASTER_LINUX_GCC_X64 &
wait
shell: bash
env:
DISPLAY: :99
LIBGL_ALWAYS_SOFTWARE: 1
- name: Upload updated test results (Windows x64)
uses: actions/upload-artifact@v4.4.3
with:
name: results-windows-x64
overwrite: true
path: install/bin/results/current/windows-x64
- name: Upload updated test results (Windows Clang x64)
uses: actions/upload-artifact@v4.4.3
with:
name: results-windows-clang-x64
overwrite: true
path: install/bin/results/current/windows-clang-x64
- name: Upload updated test results (macOS x64)
uses: actions/upload-artifact@v4.4.3
with:
name: results-macos-x64
overwrite: true
path: install/bin/results/current/macos-x64
- name: Upload updated test results (macOS GCC x64)
uses: actions/upload-artifact@v4.4.3
with:
name: results-macos-gcc-x64
overwrite: true
path: install/bin/results/current/macos-gcc-x64
- name: Upload updated test results (Linux Clang x64)
uses: actions/upload-artifact@v4.4.3
with:
name: results-linux-clang-x64
overwrite: true
path: install/bin/results/current/linux-clang-x64
- name: Upload updated test results (Linux GCC x64)
uses: actions/upload-artifact@v4.4.3
with:
name: results-linux-gcc-x64
overwrite: true
path: install/bin/results/current/linux-gcc-x64
- name: Upload test compare result logs
uses: actions/upload-artifact@v4.4.3
with:
name: test-compare-results
overwrite: true
path: |
install/bin/results/current/**/diff-*.html
install/bin/results/current/**/diff-*.log
install/bin/results/current/**/summary.html
install/bin/results/current/**/tests.log

View File

@@ -1,45 +0,0 @@
# This workflow builds the OCCT reference manual documentation.
# It is triggered on pushes to the 'master' branch.
# The workflow includes steps to checkout the repository, install dependencies, build the documentation, and upload the generated documentation and logs as artifacts.
name: Build Documentation
on:
push:
branches:
- 'master'
jobs:
build:
name: Build Refman Documentation
runs-on: ubuntu-24.04
steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.2.1
# Step: Install necessary dependencies for building the documentation
- 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 doxygen graphviz
# Step: Build the reference manual documentation
- name: Build documentation
run: bash gendoc -refman
# Step: Upload the generated reference manual documentation as an artifact
- name: Upload refman documentation
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: refman-doc
path: doc/refman
retention-days: 90
# Step: Upload the documentation generation log as an artifact
- name: Upload generation log
uses: actions/upload-artifact@v4.4.3
with:
name: doxygen.log
path: doc/html_doxygen_err.log
retention-days: 90

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

8
.gitignore vendored
View File

@@ -1,8 +1,6 @@
# standard directories for derived files in CASROOT # standard directories for derived files in CASROOT
/.adm /.adm
/.cache
/.vscode
/lin /lin
/mac /mac
/wnt /wnt
@@ -14,6 +12,12 @@
win32 win32
win64 win64
# standard names of directories for objects and binaries for samples
bin
obj
Debug
Release
# project files and artifacts # project files and artifacts
/adm/msvc /adm/msvc
/adm/wnt /adm/wnt

View File

@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.5 FATAL_ERROR) cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake") set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/adm/cmake")
@@ -6,26 +6,6 @@ set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE) set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
# set using C++ standard
set (BUILD_CPP_STANDARD "C++11" CACHE STRING "Select using c++ standard.")
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++11" "C++14" "C++17" "C++20" "C++23")
# Set desired C++ standard
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++11")
set (CMAKE_CXX_STANDARD 11)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++14")
set (CMAKE_CXX_STANDARD 14)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
set (CMAKE_CXX_STANDARD 17)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++20")
set (CMAKE_CXX_STANDARD 20)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++23")
set (CMAKE_CXX_STANDARD 23)
else ()
message (FATAL_ERROR, "misprint in c++ standard name")
endif()
set (CMAKE_CXX_STANDARD_REQUIRED ON)
# macro: include patched file if it exists # macro: include patched file if it exists
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE) macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake") if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${BEING_INCLUDED_FILE}.cmake")
@@ -35,14 +15,6 @@ macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
endif() endif()
endmacro() endmacro()
# set using memory manager option for TKernel
set (USE_MMGR_TYPE "NATIVE" CACHE STRING "Select using memory manager tool.")
set_property(CACHE USE_MMGR_TYPE PROPERTY STRINGS "NATIVE" "FLEXIBLE" "TBB" "JEMALLOC")
# set profile for C++ compiler and linker
set (BUILD_OPT_PROFILE "Default" CACHE STRING "Select profile for compiler and linker.")
set_property(CACHE BUILD_OPT_PROFILE PROPERTY STRINGS "Default" "Production")
# include variable description # include variable description
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vardescr")
@@ -84,20 +56,6 @@ set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR}) set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR})
set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE}) set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE})
# set soversion variable determining compatibility version on platforms with symlinks
# 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance
if (NOT BUILD_SOVERSION_NUMBERS)
set (BUILD_SOVERSION_NUMBERS "0" CACHE STRING "${BUILD_SOVERSION_NUMBERS_DESCR}" FORCE)
SET_PROPERTY(CACHE BUILD_SOVERSION_NUMBERS PROPERTY STRINGS 0 1 2 3)
# update default state of soversion on different platforms
if (WIN32 OR ANDROID OR EMSCRIPTEN)
set (BUILD_SOVERSION_NUMBERS 0)
else()
set (BUILD_SOVERSION_NUMBERS 2)
endif()
endif()
set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}") set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}")
# Regeneration of OCCT resource files # Regeneration of OCCT resource files
@@ -133,35 +91,29 @@ if (NOT DEFINED BUILD_RELEASE_DISABLE_EXCEPTIONS)
set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}") set (BUILD_RELEASE_DISABLE_EXCEPTIONS ON CACHE BOOL "${BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR}")
endif() endif()
if (MSVC)
set (BUILD_FORCE_RelWithDebInfo OFF CACHE BOOL "${BUILD_FORCE_RelWithDebInfo_DESCR}")
else()
set (BUILD_FORCE_RelWithDebInfo OFF)
endif()
if (BUILD_FORCE_RelWithDebInfo)
set (CMAKE_CONFIGURATION_TYPES Release Debug CACHE INTERNAL "" FORCE)
endif()
# option to enable or disable use of precompiled headers # option to enable or disable use of precompiled headers
if (NOT DEFINED BUILD_USE_PCH) if (NOT DEFINED BUILD_USE_PCH)
set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}") set (BUILD_USE_PCH OFF CACHE BOOL "${BUILD_USE_PCH_DESCR}")
endif() endif()
if (CMAKE_VERSION VERSION_LESS "3.16") if (BUILD_USE_PCH)
OCCT_CHECK_AND_UNSET (BUILD_USE_PCH)
elseif (NOT BUILD_USE_PCH)
set (CMAKE_DISABLE_PRECOMPILE_HEADERS ON)
else ()
set (CMAKE_DISABLE_PRECOMPILE_HEADERS OFF)
endif()
if (NOT DEFINED BUILD_INCLUDE_SYMLINK) # Load Cotire tool for accelerating build procedure
set (BUILD_INCLUDE_SYMLINK OFF CACHE BOOL "${BUILD_INCLUDE_SYMLINK_DESCR}") include(cotire)
endif()
# Set Cotire to ignore lxx, pxx, gxx
set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS "lxx;pxx;gxx" CACHE STRING "Set Cotire to ignore OCCT specific files that can be #included" FORCE)
# Set priority for inclusion of system headers in PCH to reduce problems
# due to incomplete inclusion or wrong order.
if (WIN32)
# on Windows, assume that SDK (windows.h) is in default location
set(ProgramFilesX86 "ProgramFiles(x86)")
file(TO_CMAKE_PATH "$ENV{${ProgramFilesX86}}" ProgramFilesX86)
set_property (DIRECTORY PROPERTY COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH "${ProgramFilesX86}")
unset(ProgramFilesX86)
endif()
if (CMAKE_VERSION VERSION_LESS "3.14")
OCCT_CHECK_AND_UNSET (BUILD_INCLUDE_SYMLINK)
endif() endif()
# copy samples to install directory # copy samples to install directory
@@ -213,7 +165,7 @@ if (NOT DEFINED CMAKE_INSTALL_PREFIX_PREV)
elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}") elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
# CMAKE_INSTALL_PREFIX has been changed at previous step # CMAKE_INSTALL_PREFIX has been changed at previous step
set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE) set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
# INSTALL_DIR is required to be updated # INSTALL_DIR is required to be updated
set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE) set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE)
endif() endif()
@@ -225,10 +177,10 @@ elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}")
# INSTALL_DIR has been changed at previous step # INSTALL_DIR has been changed at previous step
set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
# sync CMAKE_INSTALL_PREFIX with INSTALL_DIR # sync CMAKE_INSTALL_PREFIX with INSTALL_DIR
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
# set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder # set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder
set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE)
endif() endif()
@@ -267,7 +219,7 @@ if (NOT DEFINED INSTALL_DIR_BIN)
endif() endif()
endif() endif()
# define folder containing all shell/batch scripts # define folder contaning all shell/batch scripts
if (NOT DEFINED INSTALL_DIR_SCRIPT) if (NOT DEFINED INSTALL_DIR_SCRIPT)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}") set (INSTALL_DIR_SCRIPT "${INSTALL_DIR_BIN}" CACHE PATH "${INSTALL_DIR_SCRIPT_DESCR}")
@@ -359,7 +311,7 @@ if (NOT DEFINED INSTALL_DIR_DOC)
endif() endif()
endif() endif()
# define folder containing CMake configuration files # define folder contaning CMake configuration files
if (NOT DEFINED INSTALL_DIR_CMAKE) if (NOT DEFINED INSTALL_DIR_CMAKE)
if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix")
if (INSTALL_DIR_WITH_VERSION) if (INSTALL_DIR_WITH_VERSION)
@@ -412,28 +364,12 @@ if (MSVC)
endif() endif()
# whether use optional 3rdparty or not # whether use optional 3rdparty or not
set (USE_TK ON CACHE BOOL "${USE_TK_DESCR}") if (APPLE)
set (USE_FREETYPE ON CACHE BOOL "${USE_FREETYPE_DESCR}") set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
set (USE_OPENVR OFF CACHE BOOL "${USE_OPENVR_DESCR}")
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
set (USE_DRACO OFF CACHE BOOL "${USE_DRACO_DESCR}")
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
if (WIN32 OR ANDROID OR IOS OR EMSCRIPTEN)
# no Xlib
elseif (APPLE)
set (USE_XLIB OFF CACHE BOOL "${USE_XLIB_DESCR}")
else()
set (USE_XLIB ON CACHE BOOL "${USE_XLIB_DESCR}")
endif() endif()
if (WIN32) if (WIN32)
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}") set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
else()
set (USE_D3D OFF)
endif() endif()
# Enable/Disable the floating point exceptions (FPE) during runtime. # Enable/Disable the floating point exceptions (FPE) during runtime.
@@ -447,15 +383,6 @@ else()
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 0) set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 0)
endif() endif()
# OpenGL
if (ANDROID OR IOS OR EMSCRIPTEN OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_OPENGL OFF)
set (USE_GLES2 ON)
else()
set (USE_OPENGL ON CACHE BOOL "${USE_OPENGL_DESCR}")
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
# include the patched or original list of modules # include the patched or original list of modules
# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits # list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
# list <OCCT_MODULES> will contain all modules # list <OCCT_MODULES> will contain all modules
@@ -479,7 +406,7 @@ if (NOT DEFINED BUILD_DOC_Overview)
set (DO_ONLY_CHECK_FOR_DOXYGEN ON) set (DO_ONLY_CHECK_FOR_DOXYGEN ON)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen")
set (DO_ONLY_CHECK_FOR_DOXYGEN OFF) set (DO_ONLY_CHECK_FOR_DOXYGEN OFF)
if (CAN_DOXYGEN_BE_USED) if (CAN_DOXYGEN_BE_USED)
message (STATUS "Info. Overview building is turned on") message (STATUS "Info. Overview building is turned on")
endif() endif()
@@ -487,6 +414,10 @@ if (NOT DEFINED BUILD_DOC_Overview)
set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}") set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
endif() endif()
if (NOT USE_D3D)
list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
endif()
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable # accumulate used toolkits (first level) in BUILD_TOOLKITS variable
list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS}) list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
@@ -496,19 +427,21 @@ foreach (OCCT_MODULE ${OCCT_MODULES})
endif() endif()
endforeach() endforeach()
# DRAWEXE excluded when library build is static
if (NOT BUILD_SHARED_LIBS)
list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
endif()
# accumulate all used toolkits # accumulate all used toolkits
list (REMOVE_DUPLICATES BUILD_TOOLKITS) list (REMOVE_DUPLICATES BUILD_TOOLKITS)
set (RAW_BUILD_TOOLKITS) set (RAW_BUILD_TOOLKITS)
set (OCCT_FULL_LIST_OF_INCLUDES)
foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS}) foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
EXCTRACT_TOOLKIT_FULL_DEPS ("src" ${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS TOOLKIT_INCLUDES) OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS)
list (APPEND OCCT_FULL_LIST_OF_INCLUDES ${TOOLKIT_INCLUDES})
list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS}) list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS})
endforeach() endforeach()
list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS) list (REMOVE_DUPLICATES RAW_BUILD_TOOLKITS)
list (REMOVE_DUPLICATES OCCT_FULL_LIST_OF_INCLUDES)
set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS}) set (BUILD_TOOLKITS ${RAW_BUILD_TOOLKITS})
# include the patched or original list of definitions and flags # include the patched or original list of definitions and flags
@@ -551,70 +484,35 @@ endif()
# search for CSF variable in EXTERNLIB of each being used toolkit # search for CSF variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE) OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL) OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
OCCT_IS_PRODUCT_REQUIRED (CSF_TclTkLibs CAN_USE_TK) OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
OCCT_IS_PRODUCT_REQUIRED (CSF_XwLibs CAN_USE_XLIB) OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE CAN_USE_FREETYPE)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_OPENGL)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlesLibs CAN_USE_GLES2)
OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB) OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN) OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
# define CSF variable # define CSF variable
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
# Tcl (mandatory for Draw Harness)
if (USE_TCL) if (USE_TCL)
message (STATUS "Info: TCL is used by OCCT") message (STATUS "Info: TCL is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
message (STATUS "Info: TK is used by OCCT")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
else() else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
endif()
# Tk (optional for Draw Harness)
if (CAN_USE_TK)
if (USE_TK)
message (STATUS "Info: TK is used by OCCT")
add_definitions (-DHAVE_TK)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_TK")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
OCCT_CHECK_AND_UNSET ("INSTALL_TK") OCCT_CHECK_AND_UNSET ("INSTALL_TK")
endif() endif()
# Xlib if (USE_FREETYPE)
if (CAN_USE_XLIB) message (STATUS "Info: Freetype is used by OCCT")
if (USE_XLIB) OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
message (STATUS "Info: Xlib is used by OCCT")
add_definitions (-DHAVE_XLIB)
if (APPLE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
endif()
endif()
else() else()
OCCT_CHECK_AND_UNSET ("USE_XLIB")
endif()
# FreeType
if (CAN_USE_FREETYPE)
if (USE_FREETYPE)
message (STATUS "Info: FreeType is used by OCCT")
add_definitions (-DHAVE_FREETYPE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_FREETYPE")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE") OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
endif() endif()
@@ -625,7 +523,7 @@ if (USE_VTK)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
else() else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
if (NOT CAN_USE_VTK EQUAL -1) if (NOT CAN_USE_VTK EQUAL -1)
message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled") message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled")
@@ -634,8 +532,25 @@ else()
endif() endif()
endif() endif()
# D3D
if (USE_D3D)
add_definitions (-DHAVE_D3D)
#if(MSVC_VERSION LESS 1700)
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
#endif()
endif()
# GLX
if (USE_GLX)
add_definitions (-DMACOSX_USE_GLX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
endif()
# FREEIMAGE # FREEIMAGE
if (CAN_USE_FREEIMAGE) if (CAN_USE_FREEIMAGE)
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
if (USE_FREEIMAGE) if (USE_FREEIMAGE)
add_definitions (-DHAVE_FREEIMAGE) add_definitions (-DHAVE_FREEIMAGE)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
@@ -650,29 +565,13 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE") OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
endif() endif()
# OpenVR
# search for CSF_OpenVR variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
if (CAN_USE_OPENVR)
if (USE_OPENVR)
add_definitions (-DHAVE_OPENVR)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/openvr")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENVR")
OCCT_CHECK_AND_UNSET ("INSTALL_OPENVR")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_OPENVR")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENVR")
OCCT_CHECK_AND_UNSET ("INSTALL_OPENVR")
endif()
# FFmpeg # FFmpeg
# search for CSF_FFmpeg variable in EXTERNLIB of each being used toolkit # search for CSF_FFmpeg variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG) OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
if (CAN_USE_FFMPEG) if (CAN_USE_FFMPEG)
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
if (USE_FFMPEG) if (USE_FFMPEG)
add_definitions (-DHAVE_FFMPEG) add_definitions (-DHAVE_FFMPEG)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
@@ -687,33 +586,23 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG") OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
endif() endif()
# OpenGL
if (CAN_USE_OPENGL)
if (USE_OPENGL)
add_definitions (-DHAVE_OPENGL_EXT)
else()
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGl)
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlTest)
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_OPENGL")
endif()
# OpenGL ES 2.0 # OpenGL ES 2.0
if (CAN_USE_GLES2) if (CAN_USE_GLES2)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_GLES2 ON)
else()
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
if (USE_GLES2) if (USE_GLES2)
add_definitions (-DHAVE_GLES2_EXT) add_definitions (-DHAVE_GLES2)
if (NOT IOS) OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
endif()
else() else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2") OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
OCCT_CHECK_AND_UNSET ("INSTALL_EGL") OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2") OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGles)
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlesTest)
endif() endif()
else() else()
OCCT_CHECK_AND_UNSET ("USE_GLES2") OCCT_CHECK_AND_UNSET ("USE_GLES2")
@@ -724,19 +613,10 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2") OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
endif() endif()
# D3D
if (USE_D3D)
add_definitions (-DHAVE_D3D)
#if(MSVC_VERSION LESS 1700)
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
#endif()
else()
list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHost)
list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHostTest)
endif()
# TBB # TBB
if (NOT DEFINED ANDROID AND CAN_USE_TBB) if (NOT DEFINED ANDROID AND CAN_USE_TBB)
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
if (USE_TBB) if (USE_TBB)
add_definitions (-DHAVE_TBB) add_definitions (-DHAVE_TBB)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
@@ -757,6 +637,8 @@ endif()
# search for CSF_RapidJSON variable in EXTERNLIB of each being used toolkit # search for CSF_RapidJSON variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON) OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON)
if (CAN_USE_RAPIDJSON) if (CAN_USE_RAPIDJSON)
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
if (USE_RAPIDJSON) if (USE_RAPIDJSON)
add_definitions (-DHAVE_RAPIDJSON) add_definitions (-DHAVE_RAPIDJSON)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/rapidjson") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/rapidjson")
@@ -771,26 +653,10 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON") OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON")
endif() endif()
# Draco library
# search for CSF_Draco variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_Draco CAN_USE_DRACO)
if (CAN_USE_DRACO)
if (USE_DRACO)
add_definitions (-DHAVE_DRACO)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/draco")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_DRACO")
OCCT_CHECK_AND_UNSET ("INSTALL_DRACO")
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_DRACO")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_DRACO")
OCCT_CHECK_AND_UNSET ("INSTALL_DRACO")
endif()
# EIGEN # EIGEN
if (CAN_USE_EIGEN) if (CAN_USE_EIGEN)
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
if (USE_EIGEN) if (USE_EIGEN)
add_definitions (-DHAVE_EIGEN) add_definitions (-DHAVE_EIGEN)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
@@ -828,28 +694,20 @@ else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE") OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE")
endif() endif()
# bison # bison
if (BUILD_YACCLEX) if (BUILD_YACCLEX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison")
else() else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_BISON_EXECUTABLE") OCCT_CHECK_AND_UNSET ("3RDPARTY_BISON_EXECUTABLE")
endif() endif()
# flex # flex
if (BUILD_YACCLEX) if (BUILD_YACCLEX)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/flex") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/flex")
else() else()
OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE") OCCT_CHECK_AND_UNSET ("3RDPARTY_FLEX_EXECUTABLE")
endif() endif()
# Jemalloc
if ("${USE_MMGR_TYPE}" STREQUAL "JEMALLOC")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/jemalloc")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_JEMALLOC")
OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC")
endif()
# qt for inspector and samples # qt for inspector and samples
if (BUILD_Inspector OR BUILD_SAMPLES_QT) if (BUILD_Inspector OR BUILD_SAMPLES_QT)
# check qt 3rdparty path # check qt 3rdparty path
@@ -875,9 +733,6 @@ if (3RDPARTY_INCLUDE_DIRS)
include_directories (${3RDPARTY_INCLUDE_DIRS}) include_directories (${3RDPARTY_INCLUDE_DIRS})
endif() endif()
# Ensure the include directory exists
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}")
# include <cmake binary folder>/inc # include <cmake binary folder>/inc
include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}) include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})
@@ -925,7 +780,7 @@ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
if (WIN32) if (WIN32)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
@@ -935,7 +790,7 @@ string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...") message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
# collect all the headers to <binary dir>/inc folder # collect all the headers to <binary dir>/inc folder
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "src" "${INSTALL_DIR_INCLUDE}") COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "${CMAKE_SOURCE_DIR}/src" "${INSTALL_DIR_INCLUDE}")
string(TIMESTAMP CURRENT_TIME "%H:%M:%S") string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting") message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
@@ -967,7 +822,7 @@ if (BUILD_Inspector)
# collect all the headers to <binary dir>/inc/inspector folder # collect all the headers to <binary dir>/inc/inspector folder
string(TIMESTAMP CURRENT_TIME "%H:%M:%S") string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...") message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/inc/inspector ...")
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "tools" "${INSTALL_DIR_INCLUDE}/inspector") COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOL_TOOLKITS}" "${CMAKE_SOURCE_DIR}/tools" "${INSTALL_DIR_INCLUDE}/inspector")
endif() endif()
# OCCT samples # OCCT samples
@@ -994,11 +849,9 @@ if (INSTALL_SAMPLES)
OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR_SAMPLES}") OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR_SAMPLES}") OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR_SAMPLES}") OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR_SAMPLES}")
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code" "${INSTALL_DIR_SAMPLES}/OCCTOverview")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}") install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}") install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/OCCTOverview" RENAME "env.${SCRIPT_EXT}")
install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}") install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}")
endif() endif()
@@ -1015,10 +868,10 @@ if (${DRAWEXE_INDEX} GREATER -1)
# copy draw script to install script folder # copy draw script to install script folder
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}") if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}")
install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}" install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
else() else()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}" install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
endif() endif()
# copy draw script to CMake binary folder # copy draw script to CMake binary folder
@@ -1033,13 +886,13 @@ else()
set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\$1\" \"\$2\" \nfi") set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\$1\" \"\$2\" \nfi")
endif() endif()
# validating custom.bat/sh for changes # change custom.bat/sh
if (EXISTS "${CMAKE_BINARY_DIR}/custom.${SCRIPT_EXT}" AND EXISTS "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}") if (EXISTS "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}")
file (READ "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT) file (READ "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT)
if (NOT "${CUSTOM_CONTENT}" MATCHES "${ADDITIONAL_CUSTOM_CONTENT}")
set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}") set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}")
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
endif() file (WRITE "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}")
else() else()
OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}") OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}")
endif() endif()
@@ -1077,9 +930,6 @@ if (WIN32)
OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}") OCCT_CONFIGURE ("adm/templates/env.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}")
# install env script # install env script
install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}") install (FILES "${CMAKE_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}")
# copy build.bat and install.bat scripts to CMake binary folder
OCCT_COPY_FILE_OR_DIR ("adm/templates/build.bat" "${CMAKE_BINARY_DIR}")
OCCT_COPY_FILE_OR_DIR ("adm/templates/install.bat" "${CMAKE_BINARY_DIR}")
else() else()
set (SUB_ENV_NAME "env.${SCRIPT_EXT}") set (SUB_ENV_NAME "env.${SCRIPT_EXT}")
set (SUB_ENV_BUILD_NAME "env.install.${SCRIPT_EXT}") set (SUB_ENV_BUILD_NAME "env.install.${SCRIPT_EXT}")
@@ -1112,15 +962,6 @@ if (BUILD_SAMPLES_QT)
OCCT_INSTALL_FILE_OR_DIR ("samples/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/samples") OCCT_INSTALL_FILE_OR_DIR ("samples/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/samples")
#message("Copy Sample resources: samples/${RESOURCE} into ${INSTALL_DIR_RESOURCE}/samples") #message("Copy Sample resources: samples/${RESOURCE} into ${INSTALL_DIR_RESOURCE}/samples")
endforeach() endforeach()
## Copy sources of OCCTOverview for using in the sample
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/DataExchangeSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/OcafSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/GeometrySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/TopologySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/TriangulationSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/Viewer2dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/Viewer3dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code")
endif() endif()
@@ -1179,8 +1020,14 @@ if (BUILD_SAMPLES_MFC)
add_subdirectory(samples/mfc/standard/mfcsample) add_subdirectory(samples/mfc/standard/mfcsample)
add_subdirectory(samples/mfc/standard/01_Geometry) add_subdirectory(samples/mfc/standard/01_Geometry)
add_subdirectory(samples/mfc/standard/02_Modeling) add_subdirectory(samples/mfc/standard/02_Modeling)
add_subdirectory(samples/mfc/standard/03_ImportExport) add_subdirectory(samples/mfc/standard/03_Viewer2d)
add_subdirectory(samples/mfc/standard/04_HLR) add_subdirectory(samples/mfc/standard/04_Viewer3d)
add_subdirectory(samples/mfc/standard/05_ImportExport)
add_subdirectory(samples/mfc/standard/06_Ocaf)
add_subdirectory(samples/mfc/standard/07_Triangulation)
add_subdirectory(samples/mfc/standard/08_HLR)
add_subdirectory(samples/mfc/standard/09_Animation)
add_subdirectory(samples/mfc/standard/10_Convert)
message (STATUS "Info: \(${CURRENT_TIME}\) MFC Sample projects added") message (STATUS "Info: \(${CURRENT_TIME}\) MFC Sample projects added")
endif() endif()
@@ -1220,10 +1067,10 @@ if (BUILD_TOOL_TOOLKITS)
# copy tinspector script to install script folder # copy tinspector script to install script folder
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}") if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}")
install (FILES "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}" install (FILES "${BUILD_PATCH}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
else() else()
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}" install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/inspector.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
endif() endif()
set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}") set (OpenCASCADE_BINARY_DIR "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
@@ -1258,9 +1105,6 @@ foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
endforeach() endforeach()
list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED) list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS) list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS)
# these macros are defined for specific toolkits, not globalwise
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_OPENGL)
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_GLES2)
# export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files # export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files
foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES}) foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
@@ -1278,7 +1122,7 @@ foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
endforeach() endforeach()
# install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration # install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)") install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
install (CODE "file(INSTALL FILES \"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" DESTINATION \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/\" TYPE FILE)") install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
foreach (OCCT_MODULE ${OCCT_MODULES}) foreach (OCCT_MODULE ${OCCT_MODULES})
if (BUILD_MODULE_${OCCT_MODULE}) if (BUILD_MODULE_${OCCT_MODULE})
@@ -1314,7 +1158,7 @@ if (WIN32)
set (SET_OpenCASCADE_WITH_D3D "set (OpenCASCADE_WITH_D3D ${USE_D3D})") set (SET_OpenCASCADE_WITH_D3D "set (OpenCASCADE_WITH_D3D ${USE_D3D})")
endif() endif()
if (APPLE) if (APPLE)
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_XLIB})") set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_GLX})")
endif() endif()
# Configure and install cmake config file # Configure and install cmake config file
@@ -1335,7 +1179,7 @@ foreach (OCCT_MODULE ${OCCT_MODULES_ENABLED})
install(EXPORT OpenCASCADE${OCCT_MODULE}Targets DESTINATION "${INSTALL_DIR_CMAKE}") install(EXPORT OpenCASCADE${OCCT_MODULE}Targets DESTINATION "${INSTALL_DIR_CMAKE}")
endforeach() endforeach()
# Update generated OpenCASCADETargets-*.cmake files # Update generated OpenCASCADETargets-*.cmake files
# to have correct paths to libraries depending on the configuration # to have correct paths to libraries depending on the configuration
OCCT_UPDATE_TARGET_FILE () OCCT_UPDATE_TARGET_FILE ()

View File

@@ -1,63 +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.7](https://dev.opencascade.org/doc/occt-7.7.0/overview)
Documentation can be part of the package. To preview documentation as part of the package, open the file `doc/html/index.html` to browse HTML documentation.
If HTML documentation is not available in your package, you can:
- **Generate it from sources:** You need to have Tcl and Doxygen 1.8.4 (or above) installed on your system and accessible in your environment (check the environment variable PATH). Use the batch file `gendoc.bat` on Windows or the Bash script `gendoc` on Linux or OS X to (re)generate documentation.
- **Read documentation in source plain text (Markdown) format** found in the subfolder `dox`.
See `dox/dev_guides/documentation/documentation.md` or [Building Documentation](https://dev.opencascade.org/doc/occt-7.7.0/overview/html/build_upgrade__building_documentation.html) for details.
## Building
In most cases, you need to rebuild OCCT on your platform (OS, compiler) before using it in your project to ensure binary compatibility.
Consult the file `dox/dev_guides/building/building.md` or [Building OCCT](https://dev.opencascade.org/doc/overview/html/build_upgrade__building_occt.html) for instructions on building OCCT from sources on supported platforms.
## Version
The current version of OCCT can be found in the file `src/Standard/Standard_Version.hxx`.
## 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,8 +1,7 @@
FoundationClasses TKernel TKMath FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF 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 DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
DETools TKExpress ExpToCasExe Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE TKXSDRAWDE TKXSDRAWGLTF TKXSDRAWIGES TKXSDRAWOBJ TKXSDRAWPLY TKXSDRAWSTEP TKXSDRAWSTL TKXSDRAWVRML

View File

@@ -3,7 +3,6 @@ StdResource
SHMessage SHMessage
Textures Textures
Shaders Shaders
XRResources
XSMessage XSMessage
XSTEPResource XSTEPResource
XmlOcafResource XmlOcafResource

View File

@@ -1 +1 @@
qt AndroidQt FuncDemo IESample Tutorial OCCTOverview qt AndroidQt FuncDemo IESample Tutorial

View File

@@ -1,3 +1,2 @@
qt/Common/res/ qt/Common/res/
qt/Tutorial/res/ qt/Tutorial/res/
qt/OCCTOverview/res/

View File

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

View File

@@ -11,6 +11,7 @@ n Expr
n ExprIntrp n ExprIntrp
n FSD n FSD
n GeomAbs n GeomAbs
n MMgt
n Message n Message
n OSD n OSD
n PLib n PLib
@@ -32,7 +33,6 @@ n UnitsAPI
n gp n gp
n math n math
r OS r OS
n FlexLexer
t TKMath t TKMath
t TKernel t TKernel
n Adaptor2d n Adaptor2d
@@ -108,7 +108,6 @@ n BRepMesh
n BRepMeshData n BRepMeshData
n BRepOffset n BRepOffset
n BRepOffsetAPI n BRepOffsetAPI
n BRepPreviewAPI
n BRepPrim n BRepPrim
n BRepPrimAPI n BRepPrimAPI
n BRepProj n BRepProj
@@ -198,16 +197,15 @@ t TKPrim
t TKShHealing t TKShHealing
t TKTopAlgo t TKTopAlgo
t TKXMesh t TKXMesh
n InterfaceGraphic
n AIS n AIS
n Aspect n Aspect
n DsgPrs n DsgPrs
n PrsDim
n Graphic3d n Graphic3d
n Image n Image
n Media n Media
n MeshVS n MeshVS
n OpenGl n OpenGl
n OpenGles
n D3DHost n D3DHost
n Prs3d n Prs3d
n PrsMgr n PrsMgr
@@ -216,17 +214,15 @@ n SelectBasics
n SelectMgr n SelectMgr
n StdPrs n StdPrs
n StdSelect n StdSelect
n TColQuantity
n V3d n V3d
n Wasm
n WNT n WNT
n Xw n Xw
n Cocoa n Cocoa
r Textures r Textures
r Shaders r Shaders
r XRResources
t TKMeshVS t TKMeshVS
t TKOpenGl t TKOpenGl
t TKOpenGles
t TKD3DHost t TKD3DHost
t TKService t TKService
t TKV3d t TKV3d
@@ -329,7 +325,6 @@ n RWStepDimTol
n RWStepElement n RWStepElement
n RWStepFEA n RWStepFEA
n RWStepGeom n RWStepGeom
n RWStepKinematics
n RWStepRepr n RWStepRepr
n RWStepShape n RWStepShape
n RWStepVisual n RWStepVisual
@@ -349,7 +344,6 @@ n StepDimTol
n StepElement n StepElement
n StepFEA n StepFEA
n StepGeom n StepGeom
n StepKinematics
n StepRepr n StepRepr
n StepSelect n StepSelect
n StepShape n StepShape
@@ -377,13 +371,16 @@ r SHMessage
r XSMessage r XSMessage
r XSTEPResource r XSTEPResource
t TKBinXCAF t TKBinXCAF
t TKDESTL t TKIGES
t TKDEVRML t TKSTEP
t TKSTEP209
t TKSTEPAttr
t TKSTEPBase
t TKSTL
t TKVRML
t TKXCAF t TKXCAF
t TKDE t TKXDEIGES
t TKDECascade t TKXDESTEP
t TKDEIGES
t TKDESTEP
t TKXSBase t TKXSBase
t TKXmlXCAF t TKXmlXCAF
n BOPTest n BOPTest
@@ -392,9 +389,6 @@ n DBRep
n DDF n DDF
n DDataStd n DDataStd
n DDocStd n DDocStd
n DE
n DEXCAFCascade
n DEBRepCascade
n DNaming n DNaming
n DPrsStd n DPrsStd
n Draw n Draw
@@ -407,39 +401,20 @@ n HLRTest
n MeshTest n MeshTest
n SWDRAW n SWDRAW
n TObjDRAW n TObjDRAW
n OpenGlTest
n OpenGlesTest
n D3DHostTest
n ViewerTest n ViewerTest
n XDEDRAW n XDEDRAW
n XSDRAW n XSDRAW
n XSDRAWIGES n XSDRAWIGES
n XSDRAWSTEP n XSDRAWSTEP
n XSDRAWSTL n XSDRAWSTLVRML
n XSDRAWVRML
n XSDRAWDE
n XSDRAWGLTF
n XSDRAWOBJ
n XSDRAWPLY
r DrawResources r DrawResources
t TKDCAF t TKDCAF
t TKDraw t TKDraw
t TKTObjDRAW t TKTObjDRAW
t TKTopTest t TKTopTest
t TKOpenGlTest
t TKOpenGlesTest
t TKD3DHostTest
t TKViewerTest t TKViewerTest
t TKXDEDRAW t TKXDEDRAW
t TKXSDRAW t TKXSDRAW
t TKXSDRAWIGES
t TKXSDRAWSTEP
t TKXSDRAWSTL
t TKXSDRAWVRML
t TKXSDRAWDE
t TKXSDRAWGLTF
t TKXSDRAWOBJ
t TKXSDRAWPLY
x DRAWEXE x DRAWEXE
n QADraw n QADraw
n QANCollection n QANCollection
@@ -465,33 +440,6 @@ t TKVCAF
n XCAFView n XCAFView
n XCAFNoteObjects n XCAFNoteObjects
t TKRWMesh t TKRWMesh
t TKDEGLTF
t TKDEOBJ
t TKDEPLY
n RWGltf n RWGltf
n RWMesh n RWMesh
n RWObj 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

@@ -6,137 +6,6 @@ endif()
set(3RDPARTY_MACRO_ALREADY_INCLUDED 1) set(3RDPARTY_MACRO_ALREADY_INCLUDED 1)
macro(THIRDPARTY_PRODUCT_LIBRARY PRODUCT_NAME LIBRARY_CSF_NAME LIBRARY_PATH_DEBUG_SUFFIX VARIABLE_DEBUG_SUFFIX)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
# if (BUILD_SHARED_LIBS)
# library
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (${PRODUCT_NAME}_PATH_SUFFIXES lib${LIBRARY_PATH_DEBUG_SUFFIX})
if (WIN32)
set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} win${COMPILER_BITNESS}/${COMPILER}/lib${LIBRARY_PATH_DEBUG_SUFFIX})
set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} lib${LIBRARY_PATH_DEBUG_SUFFIX}/win${COMPILER_BITNESS})
endif()
if (ANDROID)
set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} libs/${ANDROID_ABI})
endif()
if(UNIX AND NOT APPLE AND NOT ANDROID)
set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} lib/linux${COMPILER_BITNESS})
endif()
# set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
if ((3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") OR (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}${VARIABLE_DEBUG_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}${VARIABLE_DEBUG_SUFFIX}}"))
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}${VARIABLE_DEBUG_SUFFIX}}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if ("${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}-NOTFOUND")
# find directory recursive
FIND_SUBDIRECTORY (${3RDPARTY_${PRODUCT_NAME}_DIR} "${${PRODUCT_NAME}_PATH_SUFFIXES}" SUBDIR_NAME)
if (NOT "${SUBDIR_NAME}" STREQUAL "")
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} NAMES ${LIBRARY_NAME_SUFFIX}
PATHS "${SUBDIR_NAME}"
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
endif()
endif()
else()
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} NAMES ${LIBRARY_NAME}
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
endif()
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX})
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "" CACHE FILEPATH "The path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
endif()
# shared library
if (WIN32)
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
# set 3RDPARTY_${PRODUCT_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_DLL
set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
if ((3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") OR (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}${VARIABLE_DEBUG_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}${VARIABLE_DEBUG_SUFFIX}}"))
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}${VARIABLE_DEBUG_SUFFIX}}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES bin${LIBRARY_PATH_DEBUG_SUFFIX} win${COMPILER_BITNESS}/${COMPILER}/bin${LIBRARY_PATH_DEBUG_SUFFIX} bin${LIBRARY_PATH_DEBUG_SUFFIX}/win${COMPILER_BITNESS}
NO_DEFAULT_PATH)
if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}-NOTFOUND")
# find directory recursive
FIND_SUBDIRECTORY (${3RDPARTY_${PRODUCT_NAME}_DIR} bin${LIBRARY_PATH_DEBUG_SUFFIX} SUBDIR_NAME)
if (NOT "${SUBDIR_NAME}" STREQUAL "")
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} NAMES ${LIBRARY_NAME_SUFFIX}
PATHS "${SUBDIR_NAME}"
PATH_SUFFIXES bin${LIBRARY_PATH_DEBUG_SUFFIX}
NO_DEFAULT_PATH)
endif()
endif()
else()
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} NAMES ${LIBRARY_NAME} PATH_SUFFIXES bin${LIBRARY_PATH_DEBUG_SUFFIX})
endif()
if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} "" CACHE FILEPATH "${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
endif()
endif()
if (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX}}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX})
endif()
endif()
if (WIN32)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIRS${VARIABLE_DEBUG_SUFFIX} "")
else()
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS${VARIABLE_DEBUG_SUFFIX} "")
endif()
foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
if (WIN32)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIRS${VARIABLE_DEBUG_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}};${3RDPARTY_${PRODUCT_NAME}_DLL_DIRS}")
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS${VARIABLE_DEBUG_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}")
else()
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS${VARIABLE_DEBUG_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}:${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS}")
endif()
endforeach()
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX} 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}${VARIABLE_DEBUG_SUFFIX})
# endif()
endforeach()
endmacro()
macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME_DEBUG_SUFFIX) macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME_DEBUG_SUFFIX)
if (NOT DEFINED INSTALL_${PRODUCT_NAME} AND BUILD_SHARED_LIBS) if (NOT DEFINED INSTALL_${PRODUCT_NAME} AND BUILD_SHARED_LIBS)
@@ -150,7 +19,7 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
# include occt macros. compiler_bitness, os_wiht_bit, compiler # include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros") 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}") if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_${PRODUCT_NAME}_DIR PATH "The directory containing ${PRODUCT_NAME}") #CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_${PRODUCT_NAME}_DIR PATH "The directory containing ${PRODUCT_NAME}")
@@ -184,27 +53,12 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME} OR NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}") if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME} OR NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}")
set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME} "" CACHE FILEPATH "${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE) set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME} "" CACHE FILEPATH "${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
endif() endif()
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}) if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME})
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"") set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"")
endif() endif()
#Debug
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME}_DEBUG OR NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG}")
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME}_DEBUG "" CACHE FILEPATH "${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG "" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"")
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME}_DEBUG OR NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG}")
set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME}_DEBUG "" CACHE FILEPATH "${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"")
endif()
endif() endif()
endif() endif()
@@ -230,25 +84,6 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
else() else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"") CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"")
endif() endif()
#Debug
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME}_DEBUG FILEPATH "the path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"")
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME}_DEBUG AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME}_DEBUG}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME}_DEBUG}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG}" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}_DEBUG PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"")
endif()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME}_DEBUG FILEPATH "the path to ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"")
if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME}_DEBUG AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME}_DEBUG}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME}_DEBUG}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG}" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
else()
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_${PRODUCT_NAME}_DIR 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}_DEBUG PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"")
endif()
endif() endif()
endif() endif()
endif() endif()
@@ -262,13 +97,12 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") if (3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}")
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME} find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
PATHS ${3RDPARTY_${PRODUCT_NAME}_DIR} PATHS ${3RDPARTY_${PRODUCT_NAME}_DIR}
PATH_SUFFIXES include inc headers PATH_SUFFIXES include inc
CMAKE_FIND_ROOT_PATH_BOTH CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
else() else()
string(TOLOWER ${PRODUCT_NAME} LOW_CASE_PRODUCT_NAME)
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME} find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
PATH_SUFFIXES include inc headers ${LOW_CASE_PRODUCT_NAME} PATH_SUFFIXES include inc
CMAKE_FIND_ROOT_PATH_BOTH) CMAKE_FIND_ROOT_PATH_BOTH)
endif() endif()
endif() endif()
@@ -281,97 +115,184 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE FILEPATH "The path to ${HEADER_NAME}" FORCE) set (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "" CACHE FILEPATH "The path to ${HEADER_NAME}" FORCE)
endif() endif()
THIRDPARTY_PRODUCT_LIBRARY (${PRODUCT_NAME} ${LIBRARY_CSF_NAME} "" "") foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
if (NOT SINGLE_GENERATOR) string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
THIRDPARTY_PRODUCT_LIBRARY (${PRODUCT_NAME} ${LIBRARY_CSF_NAME} "d" "_DEBUG") # if (BUILD_SHARED_LIBS)
foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}}) # library
string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}") if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}")
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}_DEBUG) set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}" CACHE FILEPATH "The path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
endif()
if (NOT 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG) set (${PRODUCT_NAME}_PATH_SUFFIXES lib)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE) if (WIN32)
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG) set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} win${COMPILER_BITNESS}/${COMPILER}/lib)
list (REMOVE_ITEM 3RDPARTY_NO_LIBS 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG) endif()
if (ANDROID)
set (${PRODUCT_NAME}_PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES} libs/${ANDROID_ABI})
endif()
# set 3RDPARTY_${PRODUCT_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_LIBRARY
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} "3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
if ((3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") OR (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}}"))
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME}}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
if ("${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}-NOTFOUND")
# find directory recursive
FIND_SUBDIRECTORY (${3RDPARTY_${PRODUCT_NAME}_DIR} "${${PRODUCT_NAME}_PATH_SUFFIXES}" SUBDIR_NAME)
if (NOT "${SUBDIR_NAME}" STREQUAL "")
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME_SUFFIX}
PATHS "${SUBDIR_NAME}"
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
endif()
endif()
else()
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME}
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX} "" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
endif() endif()
endif() endif()
if (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX})
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} "" CACHE FILEPATH "The path to ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
endif()
# shared library
if (WIN32) if (WIN32)
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}_DEBUG) if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} OR NOT EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}")
set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}" CACHE FILEPATH "${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
endif()
if (NOT 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG) set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}}" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
if (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG) # set 3RDPARTY_${PRODUCT_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${PRODUCT_NAME}_DLL
list (REMOVE_ITEM 3RDPARTY_NO_DLLS 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}_DEBUG) set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}-NOTFOUND" CACHE FILEPATH "The path to ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
if ((3RDPARTY_${PRODUCT_NAME}_DIR AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DIR}") OR (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}"))
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME}
PATHS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME}}" "${3RDPARTY_${PRODUCT_NAME}_DIR}"
PATH_SUFFIXES bin win${COMPILER_BITNESS}/${COMPILER}/bin
NO_DEFAULT_PATH)
if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}-NOTFOUND")
# find directory recursive
FIND_SUBDIRECTORY (${3RDPARTY_${PRODUCT_NAME}_DIR} bin SUBDIR_NAME)
if (NOT "${SUBDIR_NAME}" STREQUAL "")
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME_SUFFIX}
PATHS "${SUBDIR_NAME}"
PATH_SUFFIXES bin
NO_DEFAULT_PATH)
endif()
endif()
else()
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME} PATH_SUFFIXES bin)
endif()
if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} AND EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}")
get_filename_component (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}" PATH)
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX} "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}}" CACHE PATH "The directory containing ${PRODUCT_NAME} library \"${LIBRARY_NAME}\"" FORCE)
else()
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX} "" CACHE PATH "The directory containing ${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
set (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} "" CACHE FILEPATH "${PRODUCT_NAME} shared library \"${LIBRARY_NAME}\"" FORCE)
endif() endif()
endif() endif()
endif()
endforeach()
endif()
set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "") if (3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX} OR EXISTS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}}")
if (INSTALL_${PRODUCT_NAME})
set (USED_3RDPARTY_${PRODUCT_NAME}_DIR "")
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}" DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}_DEBUG}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(ABS_PATH ${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}} REALPATH)
if ("${PRODUCT_NAME}" STREQUAL "FREEIMAGE")
get_filename_component(FREEIMLIB ${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}} NAME)
if (SINGLE_GENERATOR)
install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_DIR_LIB}" RENAME ${FREEIMLIB}.3)
else() else()
install (FILES "${ABS_PATH}" list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX})
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${FREEIMLIB}.3)
install (FILES "${ABS_PATH}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
RENAME ${FREEIMLIB}.3)
get_filename_component(FREEIMLIB_DEBUG ${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}_DEBUG} NAME)
install (FILES "${ABS_PATH}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
RENAME ${FREEIMLIB_DEBUG}.3)
endif() endif()
endif() endif()
endif()
else()
# the library directory for using by the executable
foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
if (WIN32) if (WIN32)
set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}};${USED_3RDPARTY_${PRODUCT_NAME}_DIRS}") set (3RDPARTY_${PRODUCT_NAME}_DLL_DIRS "")
else() else()
set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}:${USED_3RDPARTY_${PRODUCT_NAME}_DIRS}") set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS "")
endif() endif()
endforeach()
if (WIN32) foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
set (USED_3RDPARTY_${PRODUCT_NAME}_DIR ${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}}) string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
endif() if (WIN32)
endif() set (3RDPARTY_${PRODUCT_NAME}_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}};${3RDPARTY_${PRODUCT_NAME}_DLL_DIRS}")
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}")
else()
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}:${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS}")
endif()
endforeach()
set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "")
if (INSTALL_${PRODUCT_NAME})
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
if (SINGLE_GENERATOR)
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}" DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(ABS_PATH ${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}} REALPATH)
if ("${PRODUCT_NAME}" STREQUAL "FREEIMAGE")
get_filename_component(FREEIMLIB ${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}} NAME)
if (SINGLE_GENERATOR)
install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_DIR_LIB}" RENAME ${FREEIMLIB}.3)
else()
install (FILES "${ABS_PATH}"
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${FREEIMLIB}.3)
install (FILES "${ABS_PATH}"
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
RENAME ${FREEIMLIB}.3)
install (FILES "${ABS_PATH}"
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
RENAME ${FREEIMLIB}.3)
endif()
endif()
endif()
else()
# the library directory for using by the executable
foreach (LIBRARY_NAME ${${LIBRARY_CSF_NAME}})
string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
if (WIN32)
set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}};${USED_3RDPARTY_${PRODUCT_NAME}_DIRS}")
else()
set (USED_3RDPARTY_${PRODUCT_NAME}_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}:${USED_3RDPARTY_${PRODUCT_NAME}_DIRS}")
endif()
endforeach()
endif()
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} 3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX})
# endif()
endforeach()
endmacro() endmacro()
macro (COMPLIANCE_PRODUCT_CONSISTENCY LIBNAME) macro (COMPLIANCE_PRODUCT_CONSISTENCY LIBNAME)

View File

@@ -2,24 +2,19 @@
# execute FindBISON script by "find_package (Bison)" is required to define BISON_TARGET macro # execute FindBISON script by "find_package (Bison)" is required to define BISON_TARGET macro
# delete obsolete 3RDPARTY_BISON_EXECUTABLE cache variable (not used anymore) if (NOT DEFINED 3RDPARTY_BISON_EXECUTABLE)
unset (3RDPARTY_BISON_EXECUTABLE CACHE) set (3RDPARTY_BISON_EXECUTABLE "" CACHE FILEPATH "The path to the bison command")
# delete BISON_EXECUTABLE cache variable if it is empty, otherwise find_package will fail
# without reasonable diagnostic
if (NOT BISON_EXECUTABLE OR NOT EXISTS "${BISON_EXECUTABLE}")
unset (BISON_EXECUTABLE CACHE)
endif() endif()
# Add paths to 3rdparty subfolders containing name "bison" to CMAKE_PROGRAM_PATH variable to make # BISON_EXECUTABLE is required by BISON_TARGET macro and should be defined
# these paths searched by find_package set (BISON_EXECUTABLE "${3RDPARTY_BISON_EXECUTABLE}" CACHE FILEPATH "path to the bison executable" FORCE)
if (3RDPARTY_DIR)
file (GLOB BISON_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*bison*/") find_package (BISON)
foreach (candidate_path ${BISON_PATHS})
if (IS_DIRECTORY ${candidate_path}) if (BISON_FOUND)
list (APPEND CMAKE_PROGRAM_PATH ${candidate_path}) set (3RDPARTY_BISON_EXECUTABLE "${BISON_EXECUTABLE}" CACHE FILEPATH "The Path to the bison command" FORCE)
endif()
endforeach()
endif() endif()
find_package (BISON 3.7.4) if (NOT 3RDPARTY_BISON_EXECUTABLE OR NOT EXISTS "${3RDPARTY_BISON_EXECUTABLE}")
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_BISON_EXECUTABLE)
endif()

4017
adm/cmake/cotire.cmake Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +0,0 @@
# Draco - a library for a lossy vertex data compression, used as extension to glTF format.
# https://github.com/google/draco
THIRDPARTY_PRODUCT("DRACO" "draco/draco_features.h" "CSF_Draco" "")

View File

@@ -1,3 +1,3 @@
# EGL # EGL
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlesLibs" "") THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlLibs" "")

View File

@@ -191,13 +191,13 @@ foreach (LIBRARY_NAME ${CSF_FFmpeg})
else() else()
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}" install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS Release CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}") DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}" install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS RelWithDebInfo CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}i") DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}" install (FILES "${3RDPARTY_FFMPEG_DLL_${LIBRARY_NAME}}"
CONFIGURATIONS Debug CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/${INSTALL_DIR_BIN}d") DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
endif() endif()
else() else()
get_filename_component(3RDPARTY_FFMPEG_LIBRARY_ABS ${3RDPARTY_FFMPEG_LIBRARY_${LIBRARY_NAME}} REALPATH) get_filename_component(3RDPARTY_FFMPEG_LIBRARY_ABS ${3RDPARTY_FFMPEG_LIBRARY_${LIBRARY_NAME}} REALPATH)

View File

@@ -2,42 +2,19 @@
# execute FindFLEX script by "find_package (Flex)" is required to define FLEX_TARGET macro # execute FindFLEX script by "find_package (Flex)" is required to define FLEX_TARGET macro
# delete obsolete 3RDPARTY_FLEX_EXECUTABLE cache variable (not used anymore) if (NOT DEFINED 3RDPARTY_FLEX_EXECUTABLE)
unset (3RDPARTY_FLEX_EXECUTABLE CACHE) set (3RDPARTY_FLEX_EXECUTABLE "" CACHE FILEPATH "The Path to the flex command")
# delete FLEX_EXECUTABLE cache variable if it is empty, otherwise find_package will fail
# without reasonable diagnostic
if (NOT FLEX_EXECUTABLE OR NOT EXISTS "${FLEX_EXECUTABLE}")
unset (FLEX_EXECUTABLE CACHE)
endif()
if (NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}")
unset (FLEX_INCLUDE_DIR CACHE)
endif() endif()
# Add paths to 3rdparty subfolders containing name "flex" to CMAKE_PROGRAM_PATH and # FLEX_EXECUTABLE is required by FLEX_TARGET macro and should be defined
# CMAKE_INCLUDE_PATH variables to make these paths searched by find_package set (FLEX_EXECUTABLE "${3RDPARTY_FLEX_EXECUTABLE}" CACHE FILEPATH "path to the flex executable" FORCE)
if (3RDPARTY_DIR)
file (GLOB FLEX_PATHS LIST_DIRECTORIES true "${3RDPARTY_DIR}/*flex*")
foreach (candidate_path ${FLEX_PATHS})
if (IS_DIRECTORY ${candidate_path})
list (APPEND CMAKE_PROGRAM_PATH ${candidate_path})
list (APPEND CMAKE_INCLUDE_PATH ${candidate_path})
endif()
endforeach()
endif()
find_package (FLEX 2.6.4)
if (NOT FLEX_FOUND OR NOT FLEX_INCLUDE_DIR OR NOT EXISTS "${FLEX_INCLUDE_DIR}/FlexLexer.h") find_package (FLEX)
list (APPEND 3RDPARTY_NOT_INCLUDED FLEX_INCLUDE_DIR)
if (FLEX_FOUND)
set (3RDPARTY_FLEX_EXECUTABLE "${FLEX_EXECUTABLE}" CACHE FILEPATH "The Path to the flex command" FORCE)
endif() endif()
# remove old general version of FlexLexer if (NOT 3RDPARTY_FLEX_EXECUTABLE OR NOT EXISTS "${3RDPARTY_FLEX_EXECUTABLE}")
if (EXISTS ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/FlexLexer/FlexLexer.h) list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FLEX_EXECUTABLE)
message (STATUS "Info: remove old FLEX header file: ${CMAKE_SOURCE_DIR}/src/FlexLexer/FlexLexer.h") endif()
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

@@ -14,7 +14,7 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_COMPILER_SHORT_NAME() OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS() 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}") if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
#CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_FREETYPE_DIR PATH "The directory containing freetype") #CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_FREETYPE_DIR PATH "The directory containing freetype")
@@ -110,19 +110,8 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}") set (ENV{FREETYPE_DIR} "${3RDPARTY_FREETYPE_DIR}")
endif() endif()
unset (FREETYPE_LIBRARY_RELEASE)
find_package(Freetype) find_package(Freetype)
# Only for UNIX (not APPLE)
if ((NOT WIN32) AND (NOT APPLE))
# To avoid linker error on Ubuntu 18.04 and others linux distributives we should
# link with freetype library, compiled as Position Independent Code (PIC),
# for example, with shared object.
if ((DEFINED FREETYPE_LIBRARY_RELEASE) AND (NOT "${FREETYPE_LIBRARY_RELEASE}" STREQUAL "") AND (EXISTS "${FREETYPE_LIBRARY_RELEASE}"))
string (REPLACE "\.a" "\.so" FREETYPE_LIBRARY_RELEASE "${FREETYPE_LIBRARY_RELEASE}")
endif()
endif()
# restore ENV{FREETYPE_DIR} # restore ENV{FREETYPE_DIR}
if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}") if (3RDPARTY_FREETYPE_DIR AND EXISTS "${3RDPARTY_FREETYPE_DIR}")
set (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR}) set (ENV{FREETYPE_DIR} ${CACHED_FREETYPE_DIR})
@@ -133,7 +122,7 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_ft2build FILEPATH "The directory containing ft2build.h header") CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_ft2build FILEPATH "The directory containing ft2build.h header")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "The directory containing ftheader.h header") CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_INCLUDE_DIR_freetype2 FILEPATH "The directory containing ftheader.h header")
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY_RELEASE FILEPATH "freetype library") CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FREETYPE_DIR FREETYPE_LIBRARY FILEPATH "freetype library")
endif() endif()
endif() endif()
@@ -152,8 +141,8 @@ if (IS_BUILTIN_SEARCH_REQUIRED)
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}") if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
if (FREETYPE_LIBRARY_RELEASE AND EXISTS "${FREETYPE_LIBRARY_RELEASE}") if (FREETYPE_LIBRARY AND EXISTS "${FREETYPE_LIBRARY}")
set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY_RELEASE}" CACHE FILEPATH "The path to freetype library" FORCE) set (3RDPARTY_FREETYPE_LIBRARY "${FREETYPE_LIBRARY}" CACHE FILEPATH "The path to freetype library" FORCE)
endif() endif()
endif() endif()
@@ -231,7 +220,7 @@ endif()
# freetype library # freetype library
#if (BUILD_SHARED_LIBS) #if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}") if (NOT 3RDPARTY_FREETYPE_LIBRARY OR NOT EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib) set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
set (FREETYPE_PATH_SUFFIXES lib) set (FREETYPE_PATH_SUFFIXES lib)
if (ANDROID) if (ANDROID)
@@ -253,16 +242,6 @@ endif()
CMAKE_FIND_ROOT_PATH_BOTH) CMAKE_FIND_ROOT_PATH_BOTH)
endif() endif()
# Only for UNIX (not APPLE)
if ((NOT WIN32) AND (NOT APPLE))
# To avoid linker error on Ubuntu 18.04 and some others linux distributives we should
# link with freetype library, compiled as Position Independent Code (PIC),
# for example, with shared object.
if ((DEFINED 3RDPARTY_FREETYPE_LIBRARY) AND (NOT "${3RDPARTY_FREETYPE_LIBRARY}" STREQUAL "") AND (EXISTS "${3RDPARTY_FREETYPE_LIBRARY}"))
string (REPLACE "\.a" "\.so" 3RDPARTY_FREETYPE_LIBRARY "${3RDPARTY_FREETYPE_LIBRARY}")
endif()
endif()
if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}") if (3RDPARTY_FREETYPE_LIBRARY AND EXISTS "${3RDPARTY_FREETYPE_LIBRARY}")
get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH) get_filename_component (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY}" PATH)
set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE) set (3RDPARTY_FREETYPE_LIBRARY_DIR "${3RDPARTY_FREETYPE_LIBRARY_DIR}" CACHE PATH "The directory containing freetype library" FORCE)
@@ -371,7 +350,7 @@ endif()
# unset all redundant variables # unset all redundant variables
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build) OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_ft2build)
OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2) OCCT_CHECK_AND_UNSET(FREETYPE_INCLUDE_DIR_freetype2)
OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY_RELEASE) OCCT_CHECK_AND_UNSET(FREETYPE_LIBRARY)
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL) mark_as_advanced (3RDPARTY_FREETYPE_LIBRARY 3RDPARTY_FREETYPE_DLL)

View File

@@ -1,3 +1,3 @@
# OpenGL ES 2.0 # OpenGL ES 2.0
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlesLibs" "") THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlLibs" "")

View File

@@ -1,155 +0,0 @@
# JeMalloc
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)
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})
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()
macro (SEARCH_JEMALLOC)
# find static jemalloc lib
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")
endmacro()
# Reset CSF variable
set (CSF_MMGR "")
if (NOT DEFINED INSTALL_JEMALLOC)
set (INSTALL_JEMALLOC OFF CACHE BOOL "${INSTALL_INSTALL_JEMALLOC_DESCR}")
endif()
# include occt macros. compiler_bitness, os_with_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
# specify JEMALLOC folder in connection with 3RDPARTY_DIR
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
if (NOT 3RDPARTY_JEMALLOC_DIR OR NOT EXISTS "${3RDPARTY_JEMALLOC_DIR}")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" jemalloc JEMALLOC_DIR_NAME)
if (JEMALLOC_DIR_NAME)
set (3RDPARTY_JEMALLOC_DIR "${3RDPARTY_DIR}/${JEMALLOC_DIR_NAME}" CACHE PATH "The directory containing JEMALLOC" FORCE)
set (3RDPARTY_JEMALLOC_DIR "${3RDPARTY_DIR}/${JEMALLOC_DIR_NAME}")
message(STATUS "Info: JEMALLOC detected in ${3RDPARTY_JEMALLOC_DIR}")
endif()
endif()
else()
endif()
# define required JEMALLOC variables
if (NOT DEFINED 3RDPARTY_JEMALLOC_INCLUDE_DIR)
set (3RDPARTY_JEMALLOC_INCLUDE_DIR "" CACHE PATH "the path of headers directory")
endif()
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_${PRODUCT_NAME}_DIR
if (3RDPARTY_JEMALLOC_DIR AND EXISTS "${3RDPARTY_JEMALLOC_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_JEMALLOC_DIR 3RDPARTY_JEMALLOC_INCLUDE_DIR PATH "the path to JEMALLOC")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_JEMALLOC_DIR 3RDPARTY_JEMALLOC_LIBRARY_DIR FILEPATH "The directory containing JEMALLOC libraries")
endif()
# header
if (NOT 3RDPARTY_JEMALLOC_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_JEMALLOC_INCLUDE_DIR}")
set (HEADER_NAMES jemalloc.h)
# set 3RDPARTY_JEMALLOC_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_JEMALLOC_INCLUDE_DIR
set (3RDPARTY_JEMALLOC_INCLUDE_DIR "3RDPARTY_JEMALLOC_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "the path to header directory" FORCE)
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)
endif()
endif()
if (3RDPARTY_JEMALLOC_INCLUDE_DIR AND EXISTS "${3RDPARTY_JEMALLOC_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_JEMALLOC_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_JEMALLOC_INCLUDE_DIR)
set (3RDPARTY_JEMALLOC_INCLUDE_DIR "" CACHE FILEPATH "the path to jemalloc.h" FORCE)
endif()
# Installing destination path
if (WIN32)
set (JEMALLOC_INSTALL_DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_BIN}")
else()
set (JEMALLOC_INSTALL_DESTINATION "${INSTALL_DIR}/${INSTALL_DIR_LIB}")
endif()
# find static jemalloc lib
SEARCH_JEMALLOC()

View File

@@ -42,46 +42,22 @@ else()
endif() endif()
endif() endif()
# OpenVR # TCL/TK
if (USE_OPENVR)
set (CSF_OpenVR "openvr_api")
else()
set (CSF_OpenVR)
endif()
# TCL
if (USE_TCL) if (USE_TCL)
if (WIN32) if (WIN32)
set (CSF_TclLibs "tcl86") set (CSF_TclLibs "tcl86")
else()
if(APPLE)
set (CSF_TclLibs Tcl)
elseif(UNIX)
set (CSF_TclLibs "tcl8.6")
endif()
endif()
endif()
# TK
if (USE_TK)
if (WIN32)
set (CSF_TclTkLibs "tk86") set (CSF_TclTkLibs "tk86")
else() else()
if(APPLE) if(APPLE)
set (CSF_TclTkLibs Tk) set (CSF_TclTkLibs Tk)
set (CSF_TclLibs Tcl)
elseif(UNIX) elseif(UNIX)
set (CSF_TclTkLibs "tk8.6") set (CSF_TclLibs "tcl8.6")
set (CSF_TclTkLibs "tk8.6")
endif() endif()
endif() endif()
endif() endif()
# Draco
if (USE_DRACO)
set (CSF_Draco "draco")
else()
set (CSF_Draco)
endif()
if (WIN32) if (WIN32)
set (CSF_advapi32 "advapi32.lib") set (CSF_advapi32 "advapi32.lib")
set (CSF_gdi32 "gdi32.lib") set (CSF_gdi32 "gdi32.lib")
@@ -91,8 +67,12 @@ if (WIN32)
set (CSF_psapi "psapi.lib") set (CSF_psapi "psapi.lib")
set (CSF_winmm "winmm.lib") set (CSF_winmm "winmm.lib")
set (CSF_d3d9 "D3D9.lib") set (CSF_d3d9 "D3D9.lib")
set (CSF_OpenGlLibs "opengl32.lib") if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
set (CSF_OpenGlesLibs "libEGL libGLESv2") set (CSF_OpenGlLibs "libEGL libGLESv2")
else()
set (CSF_OpenGlLibs "opengl32.lib")
endif()
else() else()
if (APPLE) if (APPLE)
@@ -113,38 +93,30 @@ else()
OCCT_CHECK_AND_UNSET (IOKit_LIB) OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (IOS) if (IOS)
find_library (OpenGlesLibs_LIB NAMES OpenGLES) find_library (OpenGlLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB}) set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB) OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
elseif (USE_XLIB) elseif (USE_GLX)
set (CSF_OpenGlLibs "GL") set (CSF_OpenGlLibs GL)
set (CSF_XwLibs "X11") set (CSF_XwLibs "X11 Xext Xmu Xi")
else() else()
find_library (OpenGlLibs_LIB NAMES OpenGL) find_library (OpenGlLibs_LIB NAMES OpenGL)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB}) set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB) OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif() endif()
elseif (EMSCRIPTEN)
set (CSF_ThreadLibs "pthread rt stdc++")
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_dl "dl")
elseif (ANDROID) elseif (ANDROID)
set (CSF_ThreadLibs "c") set (CSF_ThreadLibs "c")
set (CSF_OpenGlesLibs "EGL GLESv2") set (CSF_OpenGlLibs "EGL GLESv2")
set (CSF_androidlog "log")
elseif (UNIX) elseif (UNIX)
set (CSF_ThreadLibs "pthread rt stdc++") set (CSF_ThreadLibs "pthread rt stdc++")
if (USE_XLIB) if (USE_GLES2)
set (CSF_OpenGlLibs "GL") set (CSF_OpenGlLibs "EGL GLESv2")
set (CSF_XwLibs "X11")
else() else()
set (CSF_OpenGlLibs "GL EGL") set (CSF_OpenGlLibs "GL")
endif() endif()
set (CSF_OpenGlesLibs "EGL GLESv2") set (CSF_XwLibs "X11 Xext Xmu Xi")
set (CSF_dl "dl") set (CSF_dl "dl")
if (USE_FREETYPE) set (CSF_fontconfig "fontconfig")
set (CSF_fontconfig "fontconfig")
endif()
endif() endif()
endif() endif()

View File

@@ -25,19 +25,10 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
endif() endif()
if (MSVC) if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
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) add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else() else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions -fPIC")
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()
add_definitions(-DOCC_CONVERT_SIGNALS) add_definitions(-DOCC_CONVERT_SIGNALS)
endif() endif()
@@ -49,35 +40,6 @@ elseif (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa")
endif() endif()
if (MSVC)
if ("${BUILD_OPT_PROFILE}" STREQUAL "Production")
# string pooling (GF), function-level linking (Gy)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GF /Gy")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GF /Gy")
# Favor fast code (Ot), Omit frame pointers (Oy)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ot /Oy")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Ot /Oy")
# Whole Program Optimisation (GL), Enable intrinsic functions (Oi)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL /Oi")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GL /Oi")
# Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG")
endif()
if (BUILD_FORCE_RelWithDebInfo)
# generate debug info (Zi), inline expansion level (Ob1)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /Ob1")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi /Ob1")
# generate debug info (debug), OptimizeReferences=true (OPT:REF), EnableCOMDATFolding=true (OPT:ICF)
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /debug /OPT:REF /OPT:ICF")
endif()
endif()
# remove _WINDOWS flag if it exists # remove _WINDOWS flag if it exists
string (REGEX MATCH "/D_WINDOWS" IS_WINDOWSFLAG "${CMAKE_CXX_FLAGS}") string (REGEX MATCH "/D_WINDOWS" IS_WINDOWSFLAG "${CMAKE_CXX_FLAGS}")
if (IS_WINDOWSFLAG) if (IS_WINDOWSFLAG)
@@ -138,27 +100,8 @@ if (MSVC)
else() else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif() endif()
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")) elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
if ("${BUILD_OPT_PROFILE}" STREQUAL "Production")
# /Ot (favor speed over size) is similar to -O2 or -O3 in GCC/Clang.
# /Oy (omit frame pointers) is similar to -fomit-frame-pointer in GCC/Clang.
# /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} -O2 -fomit-frame-pointer -flto -ffunction-sections")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -fomit-frame-pointer -flto -ffunction-sections")
# 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 -Wl,--gc-sections")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
endif()
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
if (APPLE) if (APPLE)
set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}") set (CMAKE_SHARED_LINKER_FLAGS "-lm ${CMAKE_SHARED_LINKER_FLAGS}")
@@ -168,25 +111,34 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
endif() endif()
endif() endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]") if(MINGW)
if (APPLE) # Set default release optimization option to O2 instead of O3, since in
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated. # some OCCT related examples, this gives significantly smaller binaries
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}") # at comparable performace with MinGW-w64.
string (REGEX MATCH "-O3" IS_O3_CXX "${CMAKE_CXX_FLAGS_RELEASE}")
if (IS_O3_CXX)
string (REGEX REPLACE "-O3" "-O2" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
else()
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
endif() endif()
# Optimize size of binaries
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set (CMAKE_CXX_FLAGS "-std=gnu++0x ${CMAKE_CXX_FLAGS}")
elseif(MINGW) add_definitions(-D_WIN32_WINNT=0x0501)
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 # workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols") set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
elseif ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang")
# Optimize size of binaries if (APPLE)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") # CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") set (CMAKE_CXX_FLAGS "-std=c++0x -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
else()
set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX) elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
# Optimize size of binaries set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
endif()
# Optimize size of binaries
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR MINGW)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
endif() endif()

View File

@@ -12,12 +12,18 @@ macro (OCCT_CHECK_AND_UNSET VARNAME)
endif() endif()
endmacro() endmacro()
macro (OCCT_CHECK_AND_UNSET_GROUP GROUPNAME) macro (OCCT_CHECK_AND_UNSET_GROUP VARNAME)
get_cmake_property(VARS VARIABLES) OCCT_CHECK_AND_UNSET ("${VARNAME}_DIR")
string (REGEX MATCHALL "(^|;)${GROUPNAME}[A-Za-z0-9_]*" GROUPNAME_VARS "${VARS}")
foreach(GROUPNAME_VAR ${GROUPNAME_VARS}) OCCT_CHECK_AND_UNSET ("${VARNAME}_INCLUDE_DIR")
OCCT_CHECK_AND_UNSET(${GROUPNAME_VAR})
endforeach() OCCT_CHECK_AND_UNSET ("${VARNAME}_LIBRARY")
OCCT_CHECK_AND_UNSET ("${VARNAME}_LIBRARY_DIR")
if (WIN32)
OCCT_CHECK_AND_UNSET ("${VARNAME}_DLL")
OCCT_CHECK_AND_UNSET ("${VARNAME}_DLL_DIR")
endif()
endmacro() endmacro()
macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS) macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS)
@@ -32,27 +38,6 @@ macro (OCCT_CHECK_AND_UNSET_INSTALL_DIR_SUBDIRS)
OCCT_CHECK_AND_UNSET (INSTALL_DIR_DOC) OCCT_CHECK_AND_UNSET (INSTALL_DIR_DOC)
endmacro() endmacro()
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(FIND_FOLDER_OR_FILE FILE_OR_FOLDER_NAME RESULT_PATH)
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${BUILD_PATCH}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}")
set (${RESULT_PATH} "${CMAKE_SOURCE_DIR}/${FILE_OR_FOLDER_NAME}" PARENT_SCOPE)
else()
set (${RESULT_PATH} "" PARENT_SCOPE)
endif()
endfunction()
# COMPILER_BITNESS variable # COMPILER_BITNESS variable
macro (OCCT_MAKE_COMPILER_BITNESS) macro (OCCT_MAKE_COMPILER_BITNESS)
math (EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)") math (EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
@@ -101,9 +86,9 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
set (COMPILER gcc) set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX) elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
set (COMPILER gxx) set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (COMPILER clang) set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
set (COMPILER icc) set (COMPILER icc)
else() else()
set (COMPILER ${CMAKE_GENERATOR}) set (COMPILER ${CMAKE_GENERATOR})
@@ -173,17 +158,6 @@ function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE) set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
endfunction() 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)
endfunction()
function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT) function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
OCCT_MAKE_COMPILER_SHORT_NAME() OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS() OCCT_MAKE_COMPILER_BITNESS()
@@ -192,14 +166,14 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
if ("${lower_PRODUCT_NAME}" STREQUAL "egl") if ("${lower_PRODUCT_NAME}" STREQUAL "egl")
string (SUBSTRING "${lower_PRODUCT_NAME}" 1 -1 lower_PRODUCT_NAME) string (SUBSTRING "${lower_PRODUCT_NAME}" 1 -1 lower_PRODUCT_NAME)
list (APPEND SEARCH_TEMPLATES "[^gl]+${lower_PRODUCT_NAME}.*") list (APPEND SEARCH_TEMPLATES "[^gl]+${lower_PRODUCT_NAME}.*")
elseif ("${lower_PRODUCT_NAME}" STREQUAL "tbb")
list (APPEND SEARCH_TEMPLATES "^.*${lower_PRODUCT_NAME}.*")
else() else()
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} ${COMPILER} ${COMPILER_BITNESS} SEARCH_TEMPLATES) list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
if (WIN32 AND "${COMPILER}" STREQUAL "clang") list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
# for clang on Windows, search for "vc" as well list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} "vc" ${COMPILER_BITNESS} SEARCH_TEMPLATES) list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
endif() 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() endif()
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST) SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)
@@ -255,150 +229,7 @@ macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME
install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME}) install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
endmacro() endmacro()
function (EXTRACT_TOOLKIT_PACKAGES RELATIVE_PATH OCCT_TOOLKIT RESULT_PACKAGES) macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS OCCT_COLLECT_SOURCE_DIR OCCT_INSTALL_DIR_PREFIX)
set (OCCT_TOOLKIT_PACKAGES "")
get_property(OCCT_TOOLKIT_PACKAGES GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_PACKAGES)
if (OCCT_TOOLKIT_PACKAGES)
set (${RESULT_PACKAGES} ${OCCT_TOOLKIT_PACKAGES} PARENT_SCOPE)
return()
endif()
FILE_TO_LIST ("${RELATIVE_PATH}/${OCCT_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
set (${RESULT_PACKAGES} ${OCCT_TOOLKIT_PACKAGES} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_PACKAGES "${OCCT_TOOLKIT_PACKAGES}")
endfunction()
function(EXTRACT_TOOLKIT_EXTERNLIB RELATIVE_PATH OCCT_TOOLKIT RESULT_LIBS)
set (OCCT_TOOLKIT_LIBS "")
get_property(OCCT_TOOLKIT_LIBS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_LIBS)
if (OCCT_TOOLKIT_LIBS)
set (${RESULT_LIBS} ${OCCT_TOOLKIT_LIBS} PARENT_SCOPE)
return()
endif()
FILE_TO_LIST ("${RELATIVE_PATH}/${OCCT_TOOLKIT}/EXTERNLIB" OCCT_TOOLKIT_LIBS)
set (${RESULT_LIBS} ${OCCT_TOOLKIT_LIBS} PARENT_SCOPE)
set_property(GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_LIBS "${OCCT_TOOLKIT_LIBS}")
endfunction()
function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_INCLUDE_FOLDER)
# package name 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()
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
set (OCCT_PACKAGE_INCLUDE_DIR "${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
elseif (EXISTS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}/FILES" OCCT_PACKAGE_FILES)
set (OCCT_PACKAGE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
# collect and searach for the files in the package directory or patached one
# FILE contains inly filename that must to be inside package or patched directory
set (FILE_PATH_LIST)
foreach (OCCT_FILE ${OCCT_PACKAGE_FILES})
string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE "${OCCT_FILE}")
FIND_FOLDER_OR_FILE ("${RELATIVE_PATH}/${OCCT_PACKAGE}/${OCCT_FILE}" CUSTOM_FILE_PATH)
if (CUSTOM_FILE_PATH)
list (APPEND FILE_PATH_LIST "${CUSTOM_FILE_PATH}")
endif()
endforeach()
if (NOT FILE_PATH_LIST)
if(BUILD_PATH)
message (WARNING "FILES has not been found in ${BUILD_PATCH}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
else()
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/${RELATIVE_PATH}/${OCCT_PACKAGE}")
endif()
endif()
set (${RESULT_FILES} ${FILE_PATH_LIST} PARENT_SCOPE)
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()
function(EXCTRACT_TOOLKIT_DEPS RELATIVE_PATH OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_DEPS)
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 (${RELATIVE_PATH} ${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 (${RELATIVE_PATH} ${OCCT_TOOLKIT} OCCT_TOOLKIT_PACKAGES)
foreach(OCCT_PACKAGE ${OCCT_TOOLKIT_PACKAGES})
EXTRACT_PACKAGE_FILES (${RELATIVE_PATH} ${OCCT_PACKAGE} OCCT_PACKAGE_FILES OCCT_PACKAGE_INCLUDE_DIR)
list (APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_PACKAGE_INCLUDE_DIR})
endforeach()
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()
function(EXCTRACT_TOOLKIT_FULL_DEPS RELATIVE_PATH OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
set (OCCT_TOOLKIT_DEPS "")
set (OCCT_TOOLKIT_INCLUDE_FOLDERS "")
get_property(OCCT_TOOLKIT_DEPS GLOBAL PROPERTY OCCT_TOOLKIT_${OCCT_TOOLKIT}_FULL_DEPS)
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(${RELATIVE_PATH} ${OCCT_TOOLKIT} OCCT_TOOLKIT_DEPS OCCT_TOOLKIT_INCLUDE_DIR)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${OCCT_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${OCCT_TOOLKIT_INCLUDE_DIR})
foreach(DEP ${OCCT_TOOLKIT_DEPS})
EXCTRACT_TOOLKIT_FULL_DEPS(${RELATIVE_PATH} ${DEP} DEP_TOOLKIT_DEPS DEP_INCLUDE_DIRS)
list(APPEND OCCT_TOOLKIT_FULL_DEPS ${DEP_TOOLKIT_DEPS})
list(APPEND OCCT_TOOLKIT_INCLUDE_FOLDERS ${DEP_INCLUDE_DIRS})
endforeach()
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 (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 (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCCT_BUILD_TOOLKITS THE_RELATIVE_PATH THE_OCCT_INSTALL_DIR_PREFIX)
set (OCCT_USED_PACKAGES) set (OCCT_USED_PACKAGES)
# consider patched header.in template # consider patched header.in template
@@ -407,37 +238,145 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in") set (TEMPLATE_HEADER_PATH "${BUILD_PATCH}/adm/templates/header.in")
endif() endif()
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()
list (REMOVE_DUPLICATES OCCT_USED_PACKAGES)
set (OCCT_HEADER_FILES_COMPLETE) set (OCCT_HEADER_FILES_COMPLETE)
foreach(OCCT_TOOLKIT ${THE_OCCT_BUILD_TOOLKITS}) set (OCCT_HEADER_FILE_NAMES_NOT_IN_FILES)
# parse PACKAGES file set (OCCT_HEADER_FILE_WITH_PROPER_NAMES)
EXTRACT_TOOLKIT_PACKAGES (${THE_RELATIVE_PATH} ${OCCT_TOOLKIT} USED_PACKAGES)
foreach(OCCT_PACKAGE ${USED_PACKAGES}) string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_PACKAGE} ALL_FILES _) message (STATUS "Info: \(${CURRENT_TIME}\) Compare FILES with files in package directories...")
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|lxx|gxx)") foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES})
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING}) 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()
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()
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}) foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME) get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
if (BUILD_INCLUDE_SYMLINK) set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
file (CREATE_LINK "${OCCT_HEADER_FILE}" "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" SYMBOLIC) 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()
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() else()
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"") set (IS_HEADER_FOUND -1)
configure_file ("${TEMPLATE_HEADER_PATH}" "${THE_ROOT_TARGET_OCCT_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY) 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() endif()
endforeach() endforeach()
endmacro()
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
endfunction()
function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER)
if (NOT BUILD_USE_PCH)
return()
endif()
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
endfunction()
macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH) macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
# first of all, copy original files # first of all, copy original files
@@ -476,8 +415,11 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
message(STATUS "Warning: the list of being used toolkits is empty") message(STATUS "Warning: the list of being used toolkits is empty")
else() else()
foreach (USED_TOOLKIT ${BUILD_TOOLKITS}) foreach (USED_TOOLKIT ${BUILD_TOOLKITS})
set (FILE_CONTENT) if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${USED_TOOLKIT}/EXTERNLIB")
EXTRACT_TOOLKIT_EXTERNLIB ("src" ${USED_TOOLKIT} FILE_CONTENT) 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}") string (REGEX MATCH "${CSF_VAR_NAME}" DOES_FILE_CONTAIN "${FILE_CONTENT}")
@@ -489,6 +431,17 @@ function (OCCT_IS_PRODUCT_REQUIRED CSF_VAR_NAME USE_PRODUCT)
endif() endif()
endfunction() 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 to determine if TOOLKIT is OCCT toolkit
function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND) function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
set (${IS_TOOLKIT_FOUND} OFF PARENT_SCOPE) set (${IS_TOOLKIT_FOUND} OFF PARENT_SCOPE)
@@ -502,6 +455,58 @@ function (IS_OCCT_TOOLKIT TOOLKIT_NAME MODULES IS_TOOLKIT_FOUND)
endforeach(MODULE) endforeach(MODULE)
endfunction() 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}. # Function to get list of modules/toolkits/samples from file adm/${FILE_NAME}.
# Creates list <$MODULE_LIST> to store list of MODULES and # 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. # <NAME_OF_MODULE>_TOOLKITS foreach module to store its toolkits, where "TOOLKITS" is defined by TOOLKITS_NAME_SUFFIX.
@@ -578,74 +583,6 @@ macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME
endmacro() 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 # Adds OCCT_INSTALL_BIN_LETTER variable ("" for Release, "d" for Debug and
# "i" for RelWithDebInfo) in OpenCASCADETargets-*.cmake files during # "i" for RelWithDebInfo) in OpenCASCADETargets-*.cmake files during
# installation process. # installation process.
@@ -658,7 +595,9 @@ macro (OCCT_UPDATE_TARGET_FILE)
endif() endif()
install (CODE install (CODE
"string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE) "cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE)
file (GLOB ALL_OCCT_TARGET_FILES \"${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}) foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES})
file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT) file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT)
@@ -667,7 +606,8 @@ macro (OCCT_UPDATE_TARGET_FILE)
string (REGEX REPLACE \"[\\\\]?[\\\$]{OCCT_INSTALL_BIN_LETTER}\" \"\${OCCT_INSTALL_BIN_LETTER}\" line \"\${line}\") string (REGEX REPLACE \"[\\\\]?[\\\$]{OCCT_INSTALL_BIN_LETTER}\" \"\${OCCT_INSTALL_BIN_LETTER}\" line \"\${line}\")
file (APPEND \"\${TARGET_FILENAME}\" \"\${line}\\n\") file (APPEND \"\${TARGET_FILENAME}\" \"\${line}\\n\")
endforeach() endforeach()
endforeach()") endforeach()
cmake_policy(POP)")
endmacro() endmacro()
macro (OCCT_INSERT_CODE_FOR_TARGET) macro (OCCT_INSERT_CODE_FOR_TARGET)
@@ -681,14 +621,17 @@ macro (OCCT_INSERT_CODE_FOR_TARGET)
endmacro() endmacro()
macro (OCCT_UPDATE_DRAW_DEFAULT_FILE) macro (OCCT_UPDATE_DRAW_DEFAULT_FILE)
install(CODE "set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\") install(CODE "cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
set (DRAW_DEFAULT_FILE_NAME \"${INSTALL_DIR}/${INSTALL_DIR_RESOURCE}/DrawResources/DrawPlugin\")
file (STRINGS \"\${DRAW_DEFAULT_FILE_NAME}\" DRAW_DEFAULT_CONTENT) file (STRINGS \"\${DRAW_DEFAULT_FILE_NAME}\" DRAW_DEFAULT_CONTENT)
file (REMOVE \"\${DRAW_DEFAULT_FILE_NAME}\") file (REMOVE \"\${DRAW_DEFAULT_FILE_NAME}\")
foreach (line IN LISTS DRAW_DEFAULT_CONTENT) foreach (line IN LISTS DRAW_DEFAULT_CONTENT)
string (REGEX MATCH \": TK\([a-zA-Z]+\)$\" IS_TK_LINE \"\${line}\") string (REGEX MATCH \": TK\([a-zA-Z]+\)$\" IS_TK_LINE \"\${line}\")
string (REGEX REPLACE \": TK\([a-zA-Z]+\)$\" \": TK\${CMAKE_MATCH_1}${BUILD_SHARED_LIBRARY_NAME_POSTFIX}\" line \"\${line}\") string (REGEX REPLACE \": TK\([a-zA-Z]+\)$\" \": TK\${CMAKE_MATCH_1}${BUILD_SHARED_LIBRARY_NAME_POSTFIX}\" line \"\${line}\")
file (APPEND \"\${DRAW_DEFAULT_FILE_NAME}\" \"\${line}\\n\") file (APPEND \"\${DRAW_DEFAULT_FILE_NAME}\" \"\${line}\\n\")
endforeach()") endforeach()
cmake_policy(POP)")
endmacro() endmacro()
macro (OCCT_CREATE_SYMLINK_TO_FILE LIBRARY_NAME LINK_NAME) macro (OCCT_CREATE_SYMLINK_TO_FILE LIBRARY_NAME LINK_NAME)

View File

@@ -22,15 +22,12 @@ if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
set (OCCT_TOOLKITS_NAME_SUFFIX "TOOLKITS") set (OCCT_TOOLKITS_NAME_SUFFIX "TOOLKITS")
endif() endif()
# parse PACKAGES file # parce 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 "") if ("${USED_PACKAGES}" STREQUAL "")
set (USED_PACKAGES ${PROJECT_NAME}) set (USED_PACKAGES ${PROJECT_NAME})
endif() endif()
set (PROJECT_LIBRARIES_DEBUG)
set (PROJECT_LIBRARIES_RELEASE)
if (USE_QT) if (USE_QT)
# Qt dependencies # Qt dependencies
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/qt_macro) OCCT_INCLUDE_CMAKE_FILE (adm/cmake/qt_macro)
@@ -42,7 +39,7 @@ set (PRECOMPILED_DEFS)
if (NOT BUILD_SHARED_LIBS) if (NOT BUILD_SHARED_LIBS)
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS") list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
if (WIN32 AND NOT EXECUTABLE_PROJECT) if (WIN32)
list (APPEND PRECOMPILED_DEFS "-DOCCT_STATIC_BUILD") list (APPEND PRECOMPILED_DEFS "-DOCCT_STATIC_BUILD")
endif() endif()
endif() endif()
@@ -50,6 +47,7 @@ endif()
# Get all used packages from toolkit # Get all used packages from toolkit
UNSET(RESOURCE_FILES) UNSET(RESOURCE_FILES)
foreach (OCCT_PACKAGE ${USED_PACKAGES}) foreach (OCCT_PACKAGE ${USED_PACKAGES})
#remove part after "/" in the OCCT_PACKAGE variable if exists #remove part after "/" in the OCCT_PACKAGE variable if exists
string (FIND "${OCCT_PACKAGE}" "/" _index) string (FIND "${OCCT_PACKAGE}" "/" _index)
if (_index GREATER -1) if (_index GREATER -1)
@@ -59,44 +57,117 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
set (OCCT_PACKAGE_NAME "${OCCT_PACKAGE}") set (OCCT_PACKAGE_NAME "${OCCT_PACKAGE}")
endif() endif()
if (WIN32) # TKService contains platform-dependent packages: Xw and WNT
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE_NAME}_DLL") if ((WIN32 AND "${OCCT_PACKAGE}" STREQUAL "Xw") OR (NOT WIN32 AND "${OCCT_PACKAGE}" STREQUAL "WNT"))
endif() # do nothing
set (SOURCE_FILES)
set (HEADER_FILES)
EXTRACT_PACKAGE_FILES (${RELATIVE_SOURCES_DIR} ${OCCT_PACKAGE} ALL_FILES INCLUDE_FOLDER)
set (HEADER_FILES_FILTERING ${ALL_FILES})
set (SOURCE_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|lxx|gxx)")
if(APPLE)
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c|mm)")
else() else()
list (FILTER SOURCE_FILES_FILTERING INCLUDE REGEX ".+[.](c)")
if (WIN32)
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE_NAME}_DLL")
endif()
set (SOURCE_FILES)
set (HEADER_FILES)
# 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)
# 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})
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.c)
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.c)
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME}")
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME}")
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()
# 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")
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")
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)
#message("Qt Resource files are: ${QT_RESOURCE_FILES} in ${OCCT_PACKAGE}")
endif(USE_QT)
#message("Resource files are: ${RESOURCE_FILES} in ${OCCT_PACKAGE}")
foreach(RESOURCE_FILE ${RESOURCE_FILES})
SOURCE_GROUP ("Resource Files\\${OCCT_PACKAGE_NAME}" FILES "${RESOURCE_FILE}")
endforeach()
endif() endif()
list (APPEND HEADER_FILES ${HEADER_FILES_FILTERING})
list (APPEND SOURCE_FILES ${SOURCE_FILES_FILTERING})
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE_NAME}" FILES "${HEADER_FILES_FILTERING}")
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE_NAME}" FILES "${SOURCE_FILES_FILTERING}")
list (APPEND USED_INCFILES ${HEADER_FILES})
list (APPEND USED_SRCFILES ${SOURCE_FILES})
if (USE_QT)
FIND_AND_INSTALL_QT_RESOURCES (${OCCT_PACKAGE} RESOURCE_FILES)
#message("Qt Resource files are: ${QT_RESOURCE_FILES} in ${OCCT_PACKAGE}")
endif(USE_QT)
#message("Resource files are: ${RESOURCE_FILES} in ${OCCT_PACKAGE}")
foreach(RESOURCE_FILE ${RESOURCE_FILES})
SOURCE_GROUP ("Resource Files\\${OCCT_PACKAGE_NAME}" FILES "${RESOURCE_FILE}")
endforeach()
endforeach() endforeach()
string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}") string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
@@ -134,28 +205,13 @@ if (EXECUTABLE_PROJECT)
install (TARGETS ${PROJECT_NAME} install (TARGETS ${PROJECT_NAME}
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}") DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
if (EMSCRIPTEN)
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
endif()
else() else()
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES}) add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
if (MSVC) if (MSVC)
if (BUILD_FORCE_RelWithDebInfo) install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
set (aReleasePdbConf "Release") CONFIGURATIONS Debug RelWithDebInfo
else()
set (aReleasePdbConf)
endif()
if (BUILD_SHARED_LIBS)
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}") DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
else()
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
CONFIGURATIONS Debug ${aReleasePdbConf} RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
endif()
endif() endif()
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "") if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
@@ -167,8 +223,7 @@ else()
EXPORT OpenCASCADE${CURRENT_MODULE}Targets EXPORT OpenCASCADE${CURRENT_MODULE}Targets
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}" RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}" ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}" LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
INCLUDES DESTINATION ${INSTALL_DIR_INCLUDE})
if (NOT WIN32) if (NOT WIN32)
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "") if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
@@ -193,118 +248,80 @@ get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)
get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR) get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR)
get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE) get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE)
set (OCC_SOVERSION "") if (ANDROID)
if (BUILD_SOVERSION_NUMBERS GREATER 2) # do not append version to the filename
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}") set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
elseif (BUILD_SOVERSION_NUMBERS GREATER 1) else()
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}") set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
elseif (BUILD_SOVERSION_NUMBERS GREATER 0) SOVERSION "${OCC_VERSION_MAJOR}"
set (OCC_SOVERSION "${OCC_VERSION_MAJOR}") VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
endif() 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_TOOLKITS_BY_CURRENT_PROJECT)
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT) set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
set (USED_EXTERNLIB_AND_TOOLKITS)
set (USED_PROJECT_LIBRARIES)
# SOME EXECUTABLE PROJECTS MAY USE CUSTOM TOOLKITS AND EXTERNAL LIBRARIES
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})
endif()
# parce EXTERNLIB file
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS}) foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM}) string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
if (COMMENT_FOUND) if (NOT COMMENT_FOUND)
continue() string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
endif() 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")
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)
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM}) if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM}) 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 "${VTK_FOUND}" STREQUAL "") if (NOT ${LIBRARY_FROM_CACHE})
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM}) # prepare a list from a string with whitespaces
if (BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK) separate_arguments (CURRENT_CSF)
OCCT_INSTALL_VTK(${USED_ITEM}) list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
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()
set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF})
string (TOLOWER "${CSF_LIBRARY}" CSF_LIBRARY)
string (REPLACE "+" "[+]" CSF_LIBRARY "${CSF_LIBRARY}")
string (REPLACE "." "" CSF_LIBRARY "${CSF_LIBRARY}")
get_cmake_property(ALL_CACHE_VARIABLES CACHE_VARIABLES)
string (REGEX MATCHALL "(^|;)3RDPARTY_[^;]+_LIBRARY[^;]*" ALL_CACHE_VARIABLES "${ALL_CACHE_VARIABLES}")
foreach (CACHE_VARIABLE ${ALL_CACHE_VARIABLES})
set (CURRENT_CACHE_LIBRARY ${${CACHE_VARIABLE}})
string (TOLOWER "${CACHE_VARIABLE}" CACHE_VARIABLE)
if (EXISTS "${CURRENT_CACHE_LIBRARY}" AND NOT IS_DIRECTORY "${CURRENT_CACHE_LIBRARY}")
string (REGEX MATCH "_${CSF_LIBRARY}(_debug|_release)*$" IS_ENDING "${CACHE_VARIABLE}")
string (REGEX MATCH "^([a-z]+)" CSF_WO_VERSION "${CSF_LIBRARY}")
string (REGEX MATCH "_${CSF_WO_VERSION}(_debug|_release)*$" 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")
string (REGEX MATCH "_debug$" IS_DEBUG "${CACHE_VARIABLE}")
list (APPEND USED_PROJECT_LIBRARIES "${CSF_LIBRARY}")
if ("x${IS_DEBUG}" STREQUAL "x")
list (APPEND PROJECT_LIBRARIES_RELEASE "${CURRENT_CACHE_LIBRARY}")
set (USED_PROJECT_LIBRARY_${CSF_LIBRARY}_RELEASE "${CURRENT_CACHE_LIBRARY}")
else()
list (APPEND PROJECT_LIBRARIES_DEBUG "${CURRENT_CACHE_LIBRARY}")
set (USED_PROJECT_LIBRARY_${CSF_LIBRARY}_DEBUG "${CURRENT_CACHE_LIBRARY}")
endif() endif()
set (LIBRARY_FROM_CACHE 1)
endif() endif()
endif() endif()
endforeach() endif()
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()
endforeach() endforeach()
foreach (USED_ITEM ${USED_PROJECT_LIBRARIES})
if (USED_PROJECT_LIBRARY_${USED_ITEM}_RELEASE AND NOT USED_PROJECT_LIBRARY_${USED_ITEM}_DEBUG)
list (APPEND PROJECT_LIBRARIES_DEBUG "${USED_PROJECT_LIBRARY_${USED_ITEM}_RELEASE}")
endif()
unset (USED_PROJECT_LIBRARY_${CSF_LIBRARY}_RELEASE)
unset (USED_PROJECT_LIBRARY_${CSF_LIBRARY}_DEBUG)
endforeach()
unset (USED_PROJECT_LIBRARIES)
if (APPLE) if (APPLE)
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND) list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
if (NOT ${IS_X11_FOUND} EQUAL -1) if (NOT ${IS_X11_FOUND} EQUAL -1)
find_package (X11 COMPONENTS X11) find_package (X11 COMPONENTS X11 Xext Xmu Xi)
if (NOT X11_FOUND) if (NOT X11_FOUND)
message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org") message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
endif() endif()
@@ -313,7 +330,7 @@ endif()
# Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used. # Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used.
# Add VTK_OPENGL2_BACKEND definition. # Add VTK_OPENGL2_BACKEND definition.
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2" OR IS_VTK_9XX) if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
add_definitions(-DVTK_OPENGL2_BACKEND) add_definitions(-DVTK_OPENGL2_BACKEND)
foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL) foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND) list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND)
@@ -336,19 +353,18 @@ else()
endif() endif()
endif() endif()
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT) if (BUILD_SHARED_LIBS)
if(IS_VTK_9XX) target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
endif() endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG}) if (USE_QT)
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG}) foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
endforeach() target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
foreach (PROJECT_LIBRARY_RELEASE ${PROJECT_LIBRARIES_RELEASE}) endforeach()
target_link_libraries (${PROJECT_NAME} optimized ${PROJECT_LIBRARY_RELEASE}) foreach (PROJECT_LIBRARY_RELEASE ${PROJECT_LIBRARIES_RELEASE})
endforeach() target_link_libraries (${PROJECT_NAME} optimized ${PROJECT_LIBRARY_RELEASE})
endforeach()
endif()
# suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS # suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
@@ -357,3 +373,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") message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
endif() endif()
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

@@ -1,5 +0,0 @@
# OpenVR SDK
# 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
THIRDPARTY_PRODUCT("OPENVR" "openvr.h" "CSF_OpenVR" "")

View File

@@ -7,8 +7,7 @@ if (NOT DEFINED ${3RDPARTY_QT_DIR} AND ${3RDPARTY_QT_DIR} STREQUAL "")
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME) FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" Qt 3RDPARTY_QT_DIR_NAME)
if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "") if (NOT DEFINED ${3RDPARTY_QT_DIR_NAME} AND ${3RDPARTY_QT_DIR_NAME} STREQUAL "")
set (3RDPARTY_QT_DIR "" CACHE PATH "The directory containing qt") message (FATAL_ERROR "... Qt root directory was not found")
message (FATAL_ERROR "Could not find used third-party product: 3RDPARTY_QT_DIR")
endif() endif()
# Combine directory name with absolute path and show in GUI # Combine directory name with absolute path and show in GUI
@@ -32,10 +31,4 @@ if (NOT ${Qt5_FOUND})
#message (STATUS "Qt4 cmake configuration") #message (STATUS "Qt4 cmake configuration")
else() else()
#message (STATUS "Qt5 cmake configuration") #message (STATUS "Qt5 cmake configuration")
endif() 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)
endif()

View File

@@ -1,248 +1,294 @@
# tbb # tbb
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS)
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}")
endif()
# tbb directory
if (NOT DEFINED 3RDPARTY_TBB_DIR)
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb")
endif()
if (MSVC AND BUILD_SHARED_LIBS) if (MSVC AND BUILD_SHARED_LIBS)
add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE) add_definitions (-D__TBB_NO_IMPLICIT_LINKAGE)
add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE) add_definitions (-D__TBBMALLOC_NO_IMPLICIT_LINKAGE)
endif() endif()
if (NOT DEFINED INSTALL_TBB AND BUILD_SHARED_LIBS) # include occt macros. compiler_bitness, os_wiht_bit, compiler
set (INSTALL_TBB OFF CACHE BOOL "${INSTALL_TBB_DESCR}") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
endif()
# Initialize tbb directory. # specify TBB folder in connectin with 3RDPARTY_DIR
if (NOT DEFINED 3RDPARTY_TBB_DIR) if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing tbb") #CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_DIR 3RDPARTY_TBB_DIR PATH "The directory containing tbb")
endif()
if (WIN32) if (NOT 3RDPARTY_TBB_DIR OR NOT EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT DEFINED 3RDPARTY_DIR)
message (FATAL_ERROR "3RDPARTY_DIR is not defined.")
endif()
if ("${3RDPARTY_DIR}" STREQUAL "")
message (FATAL_ERROR "3RDPARTY_DIR is empty string.")
endif()
if (NOT EXISTS "${3RDPARTY_DIR}")
message (FATAL_ERROR "3RDPARTY_DIR is not exist.")
endif()
# Below, we have correct 3RDPARTY_DIR.
# Initialize TBB folder in connection with 3RDPARTY_DIR.
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME) FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME)
if (TBB_DIR_NAME) if (TBB_DIR_NAME)
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE) set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE)
endif() endif()
endif() endif()
else()
#set (3RDPARTY_TBB_DIR "" CACHE PATH "The directory containing TBB" FORCE)
endif()
# Here we have full path name to installation directory of TBB. if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR)
# Employ it. set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB")
if (EXISTS "${3RDPARTY_TBB_DIR}") endif()
find_package (
TBB 2021.5
PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH
REQUIRED
CONFIG)
# Archive include directory if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
get_target_property (TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES) # check 3RDPARTY_TBB_INCLUDE_DIR for consictency with specified 3RDPARTY_TBB_DIR
if (NOT DEFINED 3RDPARTY_TBB_INCLUDE_DIR) CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_TBB_INCLUDE_DIR PATH "The directory containing headers of the TBB")
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "The directory containing headers of the TBB") endif()
# tbb.h
if (NOT 3RDPARTY_TBB_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
set (HEADER_NAMES tbb.h tbb/tbb.h)
# set 3RDPARTY_TBB_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_TBB_INCLUDE_DIR
set (3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "the path to tbb.h" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_TBB_DIR}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_TBB_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATH_SUFFIXES include
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()
if (3RDPARTY_TBB_INCLUDE_DIR AND EXISTS "${3RDPARTY_TBB_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
set (3RDPARTY_TBB_INCLUDE_DIR "" CACHE PATH "the path to tbb.h" FORCE)
endif()
# common steps for tbb and tbbmalloc
macro (TBB_PRODUCT_SEARCH PRODUCT_LIBRARY_NAME)
string (TOUPPER ${PRODUCT_LIBRARY_NAME} upper_PRODUCT_LIBRARY_NAME)
# define required tbb/tbbmalloc variables
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library")
endif()
if (WIN32)
if (NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif() endif()
if (EXISTS "${TBB_INCLUDE_DIR}") endif()
set (3RDPARTY_TBB_INCLUDE_DIR "${TBB_INCLUDE_DIR}" CACHE PATH "The directory containing headers of the TBB" FORCE)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}") if (WIN32 AND NOT DEFINED 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library")
endif()
# check 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_ paths for consistency with specified 3RDPARTY_TBB_DIR
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY FILEPATH "the path to ${upper_PRODUCT_LIBRARY_NAME} library")
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else() else()
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR) CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library")
endif() endif()
# Get installed configuration of tbb if (WIN32)
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS) CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL FILEPATH "the path to ${upper_PRODUCT_LIBRARY_NAME} shared library")
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
separate_arguments (CSF_TBB) if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
foreach (LIB IN LISTS CSF_TBB) get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}" PATH)
string(TOLOWER "${LIB}" LIB_LOWER) set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
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})
# Reserve cache variable for *.lib.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.lib)")
endif()
# Reserve cache variable for directory containing *.lib file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.lib)")
endif()
if (EXISTS "${TBB_LIB_FILE}")
set (3RDPARTY_${LIB_UPPER}_LIBRARY
"${TBB_LIB_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.lib)"
FORCE)
get_filename_component (TBB_LIB_FILE_DIRECTORY "${TBB_LIB_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR
"${TBB_LIB_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.lib)"
FORCE)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_UPPER}_LIBRARY_DIR}")
else() else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# Archive *.dll files and directory containing it. CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_TBB_DIR 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library")
get_target_property (TBB_DLL_FILE "TBB::${LIB_LOWER}" IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
# Reserve cache variable for *.dll.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL)
set (3RDPARTY_${LIB_UPPER}_DLL "" CACHE FILEPATH "${LIB_UPPER} library (*.dll)")
endif() endif()
# Reserve cache variable for directory containing *.dll file. endif()
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_DLL_DIR) endif()
set (3RDPARTY_${LIB_UPPER}_DLL_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.dll)")
endif() OCCT_MAKE_COMPILER_SHORT_NAME()
if (EXISTS "${TBB_DLL_FILE}") OCCT_MAKE_COMPILER_BITNESS()
set (3RDPARTY_${LIB_UPPER}_DLL
"${TBB_DLL_FILE}" if (${COMPILER_BITNESS} EQUAL 32)
CACHE FILEPATH set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME ia32)
"${LIB_UPPER} library (*.dll)" else()
FORCE) set (${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME intel64)
get_filename_component (TBB_DLL_FILE_DIRECTORY "${TBB_DLL_FILE}" DIRECTORY) endif()
set (3RDPARTY_${LIB_UPPER}_DLL_DIR
"${TBB_DLL_FILE_DIRECTORY}" # tbb/tbbmalloc library
CACHE PATH if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
"The directory containing ${LIB_UPPER} library (*.dll)"
FORCE) set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIB_UPPER}_DLL_DIR}") set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME})
# set 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}")
file (GLOB ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/*")
if (${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST)
list (GET ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else() else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${LIB_UPPER}_DLL_DIR) set (PRODUCT_PATH_SUFFIXES lib ${PRODUCT_LIBRARY_NAME} lib/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
endif() endif()
# install *.dll (tbb & tbbmalloc) find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
if (INSTALL_TBB) PATHS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" "${3RDPARTY_TBB_DIR}"
OCCT_MAKE_OS_WITH_BITNESS() PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
OCCT_MAKE_COMPILER_SHORT_NAME() CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY ${PRODUCT_LIBRARY_NAME}
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
if (SINGLE_GENERATOR) if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}")
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} DESTINATION "${INSTALL_DIR_BIN}") get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY_DIR)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY "" CACHE FILEPATH "The path to ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
endif()
# tbb/tbbmalloc shared library
if (WIN32)
if (NOT 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL OR NOT EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
set (PRODUCT_PATH_SUFFIXES bin)
# set 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL as notfound, otherwise find_library can't assign a new value to 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL-NOTFOUND" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
if (NOT EXISTS "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER}")
if (EXISTS "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}")
file (GLOB ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST "${3RDPARTY_TBB_DIR}/bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/*")
if (${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST)
list (GET ${upper_PRODUCT_LIBRARY_NAME}_COMPILER_LIST -1 THE_MOST_FRESH_COMPILER_VERSION)
if (THE_MOST_FRESH_COMPILER_VERSION)
get_filename_component (THE_MOST_FRESH_COMPILER_VERSION_NAME "${THE_MOST_FRESH_COMPILER_VERSION}" NAME)
set (PRODUCT_PATH_SUFFIXES bin bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${THE_MOST_FRESH_COMPILER_VERSION_NAME})
endif()
endif()
endif()
else() else()
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_BIN}") set (PRODUCT_PATH_SUFFIXES bin bin/${${upper_PRODUCT_LIBRARY_NAME}_ARCH_NAME}/${COMPILER})
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_BIN}i") endif()
install (FILES ${3RDPARTY_${LIB_UPPER}_DLL} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_BIN}d")
if (3RDPARTY_TBB_DIR AND EXISTS "${3RDPARTY_TBB_DIR}")
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME}
PATHS "${3RDPARTY_TBB_DIR}"
PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES}
NO_DEFAULT_PATH)
else()
find_library (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL ${PRODUCT_LIBRARY_NAME} PATH_SUFFIXES ${PRODUCT_PATH_SUFFIXES})
endif()
if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL AND EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}")
get_filename_component (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}" PATH)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} library" FORCE)
else()
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR "" CACHE PATH "The directory containing ${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
set (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL "" CACHE FILEPATH "${upper_PRODUCT_LIBRARY_NAME} shared library" FORCE)
endif() endif()
endif() endif()
mark_as_advanced (3RDPARTY_${LIB_UPPER}_LIBRARY 3RDPARTY_${LIB_UPPER}_DLL)
endforeach()
if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "")
else()
# the *.dll/*.so* directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
endif() endif()
else()
message (FATAL_ERROR "Installation directory with TBB is not exist.") if (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR OR EXISTS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL_DIR)
endif()
endif() endif()
else ()
# NOT WIN32 branch # install tbb/tbbmalloc
if ((DEFINED 3RDPARTY_DIR) AND (NOT "${3RDPARTY_DIR}" STREQUAL "") AND (EXISTS "${3RDPARTY_DIR}")) if (INSTALL_TBB)
# Here, we have correct 3RDPARTY_DIR. OCCT_MAKE_OS_WITH_BITNESS()
# Trying to specify TBB folder in connection with 3RDPARTY_DIR OCCT_MAKE_COMPILER_SHORT_NAME()
if (("${3RDPARTY_TBB_DIR}" STREQUAL "") OR (NOT EXISTS "${3RDPARTY_TBB_DIR}"))
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" TBB TBB_DIR_NAME) if (WIN32)
if (TBB_DIR_NAME) if (SINGLE_GENERATOR)
set (3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${TBB_DIR_NAME}" CACHE PATH "The directory containing tbb" FORCE) install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL} DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif() endif()
endif()
if ((NOT "${3RDPARTY_TBB_DIR}" STREQUAL "") AND (EXISTS "${3RDPARTY_TBB_DIR}"))
# Find TBB 2021.5 in existing directory.
find_package (
TBB 2021.5
PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH
REQUIRED
CONFIG)
else() else()
# Find TBB 2021.5 in system directory. get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY} NAME)
find_package (
TBB 2021.5
REQUIRED
CONFIG)
endif()
else()
# Find TBB 2021.5 in system directory.
find_package (
TBB 2021.5
REQUIRED
CONFIG)
endif()
# TBB has been configured (in other case FATAL_ERROR occurs).
# Archive 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")
endif()
if (EXISTS "${TBB_INCLUDE_DIR}")
set (3RDPARTY_TBB_INCLUDE_DIR "${TBB_INCLUDE_DIR}" CACHE PATH "The directory containing headers of the TBB" FORCE)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TBB_INCLUDE_DIR}")
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})
# Reserve cache variable for *.so.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY "" CACHE FILEPATH "${LIB_UPPER} library (*.so)")
endif()
# Reserve cache variable for directory containing *.so file.
if (NOT DEFINED 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR "" CACHE PATH "The directory containing ${LIB_UPPER} library (*.so)")
endif()
if (EXISTS "${TBB_SO_FILE}")
set (3RDPARTY_${LIB_UPPER}_LIBRARY
"${TBB_SO_FILE}"
CACHE FILEPATH
"${LIB_UPPER} library (*.so)"
FORCE)
get_filename_component (TBB_SO_FILE_DIRECTORY "${TBB_SO_FILE}" DIRECTORY)
set (3RDPARTY_${LIB_UPPER}_LIBRARY_DIR
"${TBB_SO_FILE_DIRECTORY}"
CACHE PATH
"The directory containing ${LIB_UPPER} library (*.so)"
FORCE)
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIB_UPPER}_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_${LIB_UPPER}_LIBRARY_DIR)
endif()
# install *.so* (tbb & tbbmalloc)
if (INSTALL_TBB)
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (SINGLE_GENERATOR) if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} DESTINATION "${INSTALL_DIR_LIB}") install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
else() else()
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Release DESTINATION "${INSTALL_DIR_LIB}") install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS RelWithDebInfo DESTINATION "${INSTALL_DIR_LIB}i") CONFIGURATIONS Release
install (FILES ${3RDPARTY_${LIB_UPPER}_LIBRARY} CONFIGURATIONS Debug DESTINATION "${INSTALL_DIR_LIB}d") DESTINATION "${INSTALL_DIR_LIB}"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
install (FILES ${3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY}.2
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d"
RENAME ${PRODUCT_LIBRARY_NAME}.2)
endif() endif()
endif() endif()
endif()
mark_as_advanced (3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_LIBRARY 3RDPARTY_${upper_PRODUCT_LIBRARY_NAME}_DLL)
endmacro()
#if (BUILD_SHARED_LIBS)
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
TBB_PRODUCT_SEARCH (${LIB})
endforeach() endforeach()
if (INSTALL_TBB) if (INSTALL_TBB)
set (USED_3RDPARTY_TBB_DIR "") set (USED_3RDPARTY_TBB_DIR "")
else() else()
# the *.so* directory for using by the executable # the library directory for using by the executable
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR}) if (WIN32)
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_DLL_DIR})
else()
set (USED_3RDPARTY_TBB_DIR ${3RDPARTY_TBB_LIBRARY_DIR})
endif()
endif() endif()
endif() #endif()

View File

@@ -1,6 +1,6 @@
# tcl # tcl
if (NOT DEFINED INSTALL_TCL) if (NOT DEFINED INSTALL_TCL AND BUILD_SHARED_LIBS)
set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}") set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
endif() endif()
@@ -14,30 +14,30 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl") set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
endif() endif()
if (BUILD_SHARED_LIBS)
# tcl library file (with absolute path)
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
endif()
# tcl library file (with absolute path) # tcl library directory
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR) if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE) set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
endif() endif()
# tcl library directory # tcl shared library (with absolute path)
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR) if (WIN32)
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library") if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
endif() set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
endif()
endif()
# tcl shared library (with absolute path) # tcl shared library directory
if (WIN32) if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR) set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
endif() endif()
endif() endif()
# tcl shared library directory
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
endif()
# search for tcl in user defined directory # search for tcl in user defined directory
if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR) if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME) FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
@@ -64,197 +64,203 @@ if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
endif() endif()
endif() endif()
# tcl dir and library if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_TCL_LIBRARY) # tcl dir and library
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}") if (NOT 3RDPARTY_TCL_LIBRARY)
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE) if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
if (NOT 3RDPARTY_TCL_LIBRARY_DIR) if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH) get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE) set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif() endif()
endif() endif()
endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "") if (WIN32)
if (3RDPARTY_TCL_DLL_DIR) if (NOT 3RDPARTY_TCL_DLL)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}") set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin") set (DLL_FOLDER_FOR_SEARCH "")
elseif (3RDPARTY_TCL_LIBRARY_DIR) if (3RDPARTY_TCL_DLL_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH) set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin") elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
elseif (3RDPARTY_TCL_LIBRARY_DIR)
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
endif() endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
PATHS "${DLL_FOLDER_FOR_SEARCH}"
NO_DEFAULT_PATH)
endif() endif()
endif() endif()
COMPLIANCE_PRODUCT_CONSISTENCY(TCL) COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
# tcl dir and library if (BUILD_SHARED_LIBS)
if (NOT 3RDPARTY_TCL_LIBRARY) # tcl dir and library
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE) if (NOT 3RDPARTY_TCL_LIBRARY)
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs} set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}" find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
NO_DEFAULT_PATH) PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
NO_DEFAULT_PATH)
# search in another place if previous search doesn't find anything # search in another place if previous search doesn't find anything
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs} find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
PATHS "${3RDPARTY_TCL_DIR}/lib" PATHS "${3RDPARTY_TCL_DIR}/lib"
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
endif()
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY) if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH) set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
endif()
endif()
set (3RDPARTY_TCL_LIBRARY_VERSION "")
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
message (STATUS "Info: TCL version isn't found")
endif()
endif()
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
if (3RDPARTY_TCL_LIBRARY_VERSION)
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
endif()
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
else()
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif() endif()
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE) if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION} get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
PATHS "${DLL_FOLDER_FOR_SEARCH}" set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
NO_DEFAULT_PATH)
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
endif() endif()
endif() endif()
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH) set (3RDPARTY_TCL_LIBRARY_VERSION "")
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE) if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
message (STATUS "Info: TCL version isn't found")
endif()
endif() endif()
endif()
# include found paths to common variables set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}") if (3RDPARTY_TCL_LIBRARY_VERSION)
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}") string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
else() string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR) set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
endif()
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
endif()
if (WIN32)
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
endif() endif()
endif()
# install tcl
if (INSTALL_TCL)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32) if (WIN32)
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also if (NOT 3RDPARTY_TCL_DLL)
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
# collect and install all dlls from tcl dll dirs set (DLL_FOLDER_FOR_SEARCH "")
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll") if (3RDPARTY_TCL_DLL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
elseif (3RDPARTY_TCL_DIR)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
else()
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
endif()
if (SINGLE_GENERATOR) set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}") find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
else() PATHS "${DLL_FOLDER_FOR_SEARCH}"
install (FILES ${TCL_DLLS} NO_DEFAULT_PATH)
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}") if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
install (FILES ${TCL_DLLS} set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
CONFIGURATIONS RelWithDebInfo endif()
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${TCL_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif() endif()
else() if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH) get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif() endif()
endif() endif()
if (TCL_TCLSH_VERSION) # include found paths to common variables
# tcl is required to install in lib folder (without) if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}") list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
else() else()
message (STATUS "\nWarning: tclX.X subdir won't be copied during the installation process.") list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.") endif()
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
else()
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
endif() endif()
set (USED_3RDPARTY_TCL_DIR "")
else()
# the library directory for using by the executable
if (WIN32) if (WIN32)
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR}) if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
else() list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR}) else()
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
endif()
endif() endif()
endif()
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL) # install tcl
if (INSTALL_TCL)
# include occt macros. compiler_bitness, os_wiht_bit, compiler
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
if (WIN32)
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
# collect and install all dlls from tcl dll dirs
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
if (SINGLE_GENERATOR)
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
else()
install (FILES ${TCL_DLLS}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_BIN}")
install (FILES ${TCL_DLLS}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_BIN}i")
install (FILES ${TCL_DLLS}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_BIN}d")
endif()
else()
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
if (SINGLE_GENERATOR)
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
else()
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Release
DESTINATION "${INSTALL_DIR_LIB}")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS RelWithDebInfo
DESTINATION "${INSTALL_DIR_LIB}i")
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
CONFIGURATIONS Debug
DESTINATION "${INSTALL_DIR_LIB}d")
endif()
endif()
if (TCL_TCLSH_VERSION)
# tcl is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
else()
message (STATUS "\nWarning: tclX.X subdir won't be copyied during the installation process.")
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
endif()
set (USED_3RDPARTY_TCL_DIR "")
else()
# the library directory for using by the executable
if (WIN32)
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
else()
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
endif()
endif()
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
endif()
if (TK_FOUND AND 3RDPARTY_TCL_DIR) if (TK_FOUND AND 3RDPARTY_TCL_DIR)
@@ -279,3 +285,10 @@ OCCT_CHECK_AND_UNSET (TK_LIBRARY)
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH) OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
OCCT_CHECK_AND_UNSET (TK_WISH) OCCT_CHECK_AND_UNSET (TK_WISH)
if (NOT BUILD_SHARED_LIBS)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY_DIR)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL)
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL_DIR)
OCCT_CHECK_AND_UNSET (INSTALL_TCL)
endif()

View File

@@ -250,7 +250,7 @@ if (BUILD_SHARED_LIBS)
# tk is required to install in lib folder (without) # tk is required to install in lib folder (without)
install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}") install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
else() else()
message (STATUS "\nWarning: tkX.X subdir won't be copied during the installation process.") message (STATUS "\nWarning: tkX.X subdir won't be copyied during the installation process.")
message (STATUS "Try seeking tk within another folder by changing 3RDPARTY_TK_DIR variable.") message (STATUS "Try seeking tk within another folder by changing 3RDPARTY_TK_DIR variable.")
endif() endif()

View File

@@ -28,9 +28,6 @@ Applies only for Debug configuration.")
set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR
"Append the postfix to names of output libraries") "Append the postfix to names of output libraries")
set (BUILD_SOVERSION_NUMBERS_DESCR
"Version numbers to put into SONAME: 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance")
set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR
"Disables exceptions like Standard_OutOfRange in Release builds. "Disables exceptions like Standard_OutOfRange in Release builds.
Defines No_Exception macros for Release builds when enabled (default). Defines No_Exception macros for Release builds when enabled (default).
@@ -41,18 +38,10 @@ set (BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR
Corresponding environment variable (CSF_FPE) can be changed manually Corresponding environment variable (CSF_FPE) can be changed manually
in custom.bat/sh scripts without regeneration by CMake.") in custom.bat/sh scripts without regeneration by CMake.")
set (BUILD_FORCE_RelWithDebInfo_DESCR
"Generate PDB files within normal Release build.")
set (BUILD_USE_PCH_DESCR set (BUILD_USE_PCH_DESCR
"Use precompiled headers to accelerate the build. "Use precompiled headers to accelerate the build.
Precompiled headers are generated automatically by Cotire tool.") 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 # install variables
set (INSTALL_DIR_DESCR set (INSTALL_DIR_DESCR
"The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable), "The place where built OCCT libraries, headers, test cases (INSTALL_TEST_CASES variable),
@@ -100,7 +89,6 @@ INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)") INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)")
INSTALL_MESSAGE (INSTALL_FFMPEG "FFmpeg binaries") INSTALL_MESSAGE (INSTALL_FFMPEG "FFmpeg binaries")
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries") INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
INSTALL_MESSAGE (INSTALL_OPENVR "OpenVR binaries")
INSTALL_MESSAGE (INSTALL_EIGEN "EIGEN header files") INSTALL_MESSAGE (INSTALL_EIGEN "EIGEN header files")
INSTALL_MESSAGE (INSTALL_EGL "EGL binaries") INSTALL_MESSAGE (INSTALL_EGL "EGL binaries")
INSTALL_MESSAGE (INSTALL_GLES2 "OpenGL ES 2.0 binaries") INSTALL_MESSAGE (INSTALL_GLES2 "OpenGL ES 2.0 binaries")
@@ -121,7 +109,6 @@ endmacro()
BUILD_MODULE_MESSAGE (BUILD_MODULE_ApplicationFramework "ApplicationFramework") BUILD_MODULE_MESSAGE (BUILD_MODULE_ApplicationFramework "ApplicationFramework")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DataExchange "DataExchange") 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_Draw "Draw")
BUILD_MODULE_MESSAGE (BUILD_MODULE_FoundationClasses "FoundationClasses") BUILD_MODULE_MESSAGE (BUILD_MODULE_FoundationClasses "FoundationClasses")
BUILD_MODULE_MESSAGE (BUILD_MODULE_ModelingAlgorithms "ModelingAlgorithms") BUILD_MODULE_MESSAGE (BUILD_MODULE_ModelingAlgorithms "ModelingAlgorithms")
@@ -167,38 +154,25 @@ set (3RDPARTY_DIR_DESCR
third-party product have been found - corresponding CMake variables will be specified third-party product have been found - corresponding CMake variables will be specified
(VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)") (VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)")
set (USE_TK_DESCR
"Indicates whether Tk product should be used by Draw Harness for user interface")
set (USE_FREETYPE_DESCR
"Indicates whether FreeType product should be used in OCCT for text rendering using external font files")
set (USE_FFMPEG_DESCR set (USE_FFMPEG_DESCR
"Indicates whether FFmpeg framework is used or not. FFmpeg stands for "Indicates whether FFmpeg framework is used or not. FFmpeg stands for
multimedia data handling, open-source software libraries used for video encoding and decoding.") multimedia data handling, open-source software libraries used for video encoding and decoding.")
set (USE_FREEIMAGE_DESCR set (USE_FREEIMAGE_DESCR
"Indicates whether FreeImage product should be used in OCCT visualization "Indicates whether Freeimage product should be used in OCCT visualization
module for support of popular graphics image formats (PNG, BMP etc)") module for support of popular graphics image formats (PNG, BMP etc)")
set (USE_OPENVR_DESCR
"Indicates whether OpenVR should be used in OCCT visualization module for VR support")
set (USE_RAPIDJSON_DESCR set (USE_RAPIDJSON_DESCR
"Indicates whether RapidJSON product should be used in OCCT DataExchange "Indicates whether RapidJSON product should be used in OCCT DataExchange
module for support of JSON-based formats like glTF") module for support of JSON-based formats like glTF")
set (USE_DRACO_DESCR
"Indicates whether Draco mesh decoding library should be used by glTF reader")
set (USE_EGL_DESCR set (USE_EGL_DESCR
"Indicates whether EGL should be used in OCCT visualization "Indicates whether EGL should be used in OCCT visualization
module instead of conventional OpenGL context creation APIs") module instead of conventional OpenGL context creation APIs")
set (USE_OPENGL_DESCR
"Indicates whether OpenGL desktop should be used in OCCT visualization module")
set (USE_GLES2_DESCR set (USE_GLES2_DESCR
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization module") "Indicates whether OpenGL ES 2.0 should be used in OCCT visualization
module instead of desktop OpenGL")
set (USE_TBB_DESCR set (USE_TBB_DESCR
"Indicates whether TBB is used or not. TBB stands for Threading Building Blocks, "Indicates whether TBB is used or not. TBB stands for Threading Building Blocks,
@@ -211,7 +185,7 @@ ToolKit, the technology of Kitware Inc intended for general-purpose scientific
visualization. OCCT comes with a bridge between CAD data representation and visualization. OCCT comes with a bridge between CAD data representation and
VTK by means of its dedicated VIS component (VTK Integration Services).") VTK by means of its dedicated VIS component (VTK Integration Services).")
set (USE_XLIB_DESCR "Indicates whether X11 is used or not") set (USE_GLX_DESCR "Indicates whether X11 OpenGl on OSX is used or not")
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not") set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")

View File

@@ -66,15 +66,10 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
set (ENV{VTK_DIR} ${CACHED_VTK_DIR}) set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
endif() endif()
unset (IS_VTK_9XX)
if (VTK_FOUND) if (VTK_FOUND)
message ("VTK version (${VTK_VERSION})")
if(VTK_MAJOR_VERSION EQUAL 8 AND VTK_MINOR_VERSION GREATER 9 OR VTK_MAJOR_VERSION GREATER 8) # add compiler flags, preprocessor definitions, include and link dirs
set (IS_VTK_9XX 1) include (${VTK_USE_FILE})
else()
# add compiler flags, preprocessor definitions, include and link dirs
include (${VTK_USE_FILE})
endif()
if (VTK_LIBRARIES) if (VTK_LIBRARIES)
@@ -86,83 +81,79 @@ if (VTK_FOUND)
# endif() # endif()
foreach (VTK_LIBRARY ${VTK_LIBRARIES}) foreach (VTK_LIBRARY ${VTK_LIBRARIES})
if (IS_VTK_9XX) string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
string (REGEX MATCH "^VTK::" IS_VTK_LIBRARY ${VTK_LIBRARY}) if (IS_VTK_LIBRARY AND TARGET ${VTK_LIBRARY})
else() # get paths from corresponding variables
string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY}) if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
endif() list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
if (NOT IS_VTK_LIBRARY OR NOT TARGET ${VTK_LIBRARY})
continue()
endif()
# get paths from corresponding variables
if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
endif()
if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
endif()
if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
if (NOT WIN32)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
endif() endif()
endif()
# get paths from corresponding properties if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS) list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
if (TARGET_VTK_IMPORT_CONFS)
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
# todo: choose configuration in connection with the build type
#if (CMAKE_BUILD_TYPE)
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
# endforeach()
#endif()
# Work-around against link failure in case if VTK contains dependency
# on DirectX: its run-time is always present on Windows, but SDK can
# be absent on current workstation, while not actually needed for
# OCCT linking.
# VTK 6.1 for VC 10
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
endif() endif()
endif()
# VTK 6.1 for VC 12, 14
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB}) if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}") list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
if (NOT WIN32)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
endif()
endif() endif()
endif()
get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF}) # get paths from corresponding properties
if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}") get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS)
get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
endif()
get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF}) if (TARGET_VTK_IMPORT_CONFS)
if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}") list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
if (WIN32) # todo: choose configuration in connection with the build type
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}") #if (CMAKE_BUILD_TYPE)
else() # foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}") # endforeach()
#endif()
# Work-around against link failure in case if VTK contains dependency
# on DirectX: its run-time is always present on Windows, but SDK can
# be absent on current workstation, while not actually needed for
# OCCT linking.
# VTK 6.1 for VC 10
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
endif()
endif()
# VTK 6.1 for VC 12, 14
get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
if (HARDCODED_D3D9_LIB)
message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
endif()
endif()
get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
endif()
get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
if (WIN32)
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
else()
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
endif()
endif()
endif() endif()
endif() endif()
endif() endif()
@@ -196,11 +187,10 @@ if (VTK_FOUND)
endif() endif()
endif() endif()
# endif() # endif()
endif()
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}") if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS ${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) list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
endif() endif()

672
adm/genconf.tcl Normal file
View File

@@ -0,0 +1,672 @@
#!/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 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] } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141)"
lappend ::SYS_VC_LIST "vc141"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[15.0,15.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2017 (15, toolset v141) UWP"
lappend ::SYS_VC_LIST "vc141-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142)"
lappend ::SYS_VC_LIST "vc142"
lappend ::SYS_VCVARS_LIST "$res\\VC\\vcvarsall.bat"
}
if { ! [catch {exec vswhere.exe -version "\[16.0,16.99\]" -latest -requires Microsoft.VisualStudio.Workload.Universal -property installationPath} res] } {
lappend ::SYS_VS_LIST "Visual Studio 2019 (16, toolset v142) UWP"
lappend ::SYS_VC_LIST "vc142-uwp"
lappend ::SYS_VCVARS_LIST "$res\\VC\\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: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 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:SwitchArch {} {
if { "$::ARCH" == "32" } {
wokdep:gui:Show32Bitness ::aRowIter
}
if { "$::ARCH" == "64" } {
wokdep:gui:Show64Bitness ::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
}
proc wokdep:gui:UpdateList {} {
set anIncErrs {}
set anLib32Errs {}
set anLib64Errs {}
set anBin32Errs {}
set anBin64Errs {}
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
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_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" } {
wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "zlib" "zlib.h" "zlib" {"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 { "$::CHECK_QT4" == "true" } {
wokdep:SearchQt4 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
if { "$::CHECK_JDK" == "true" } {
wokdep:SearchJDK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
.myFrame.myIncErrLbl configure -text [join $anIncErrs "\n"]
.myFrame.myLib32ErrLbl configure -text [join $anLib32Errs "\n"]
.myFrame.myLib64ErrLbl configure -text [join $anLib64Errs "\n"]
.myFrame.myBin32ErrLbl configure -text [join $anBin32Errs "\n"]
.myFrame.myBin64ErrLbl configure -text [join $anBin64Errs "\n"]
}
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:AddLib32Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_LIB32 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddLib64Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_LIB64 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBin32Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN32 "$aResult"
wokdep:gui:UpdateList
}
}
proc wokdep:gui:AddBin64Path {} {
set aResult [tk_chooseDirectory -title "Choose a directory"]
if { "$aResult" != "" } {
lappend ::CSF_OPT_BIN64 "$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:RemoveLib32Path {} {
set aSelIndices [.myFrame.myLib32List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myLib32List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveLib64Path {} {
set aSelIndices [.myFrame.myLib64List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myLib64List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBin32Path {} {
set aSelIndices [.myFrame.myBin32List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin32List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:RemoveBin64Path {} {
set aSelIndices [.myFrame.myBin64List curselection]
if { [llength $aSelIndices] != 0 } {
.myFrame.myBin64List delete [lindex $aSelIndices 0]
}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetIncPath {} {
set ::CSF_OPT_INC {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetLib32Path {} {
set ::CSF_OPT_LIB32 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetLib64Path {} {
set ::CSF_OPT_LIB64 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetBin32Path {} {
set ::CSF_OPT_BIN32 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:ResetBin64Path {} {
set ::CSF_OPT_BIN64 {}
wokdep:gui:UpdateList
}
proc wokdep:gui:Show32Bitness { theRowIter } {
upvar $theRowIter aRowIter
if { [llength [grid info .myFrame.myLib64Lbl]] != 0 } {
grid forget .myFrame.myLib64Lbl .myFrame.myLib64List .myFrame.myLib64Scrl
grid forget .myFrame.myLib64Add .myFrame.myLib64Remove .myFrame.myLib64Clear .myFrame.myLib64ErrLbl
grid forget .myFrame.myBin64Lbl .myFrame.myBin64List .myFrame.myBin64Scrl
grid forget .myFrame.myBin64Add .myFrame.myBin64Remove .myFrame.myBin64Clear .myFrame.myBin64ErrLbl
}
# Additional libraries (32-bit) search paths
grid .myFrame.myLib32Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib32List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib32Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib32Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib32Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib32Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib32Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables (32-bit) search paths
grid .myFrame.myBin32Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin32List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin32Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin32Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin32Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin32Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin32Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin32ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
}
proc wokdep:gui:Show64Bitness { theRowIter } {
upvar $theRowIter aRowIter
if { [llength [grid info .myFrame.myLib32Lbl]] != 0 } {
grid forget .myFrame.myLib32Lbl .myFrame.myLib32List .myFrame.myLib32Scrl
grid forget .myFrame.myLib32Add .myFrame.myLib32Remove .myFrame.myLib32Clear .myFrame.myLib32ErrLbl
grid forget .myFrame.myBin32Lbl .myFrame.myBin32List .myFrame.myBin32Scrl
grid forget .myFrame.myBin32Add .myFrame.myBin32Remove .myFrame.myBin32Clear .myFrame.myBin32ErrLbl
}
# Additional libraries (64-bit) search paths
grid .myFrame.myLib64Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myLib64List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myLib64Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myLib64Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myLib64Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myLib64ErrLbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
# Additional executables (64-bit) search paths
grid .myFrame.myBin64Lbl -row $aRowIter -column 0 -columnspan 10 -sticky w
incr aRowIter
grid .myFrame.myBin64List -row $aRowIter -column 0 -rowspan 4 -columnspan 5
grid .myFrame.myBin64Scrl -row $aRowIter -column 5 -rowspan 4
grid .myFrame.myBin64Add -row $aRowIter -column 6
incr aRowIter
#grid .myFrame.myBin64Edit -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64Remove -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64Clear -row $aRowIter -column 6
incr aRowIter
grid .myFrame.myBin64ErrLbl -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
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.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"
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.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
ttk::label .myFrame.myChecks.myMacGLXLbl -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.myQt4Check -offvalue "false" -onvalue "true" -variable CHECK_QT4 -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myQt4Lbl -text "Search Qt4"
checkbutton .myFrame.myChecks.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myJDKLbl -text "Search JDK"
# 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.myLib32Lbl -text "Additional libraries (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib32Scrl -command ".myFrame.myLib32List yview"
listbox .myFrame.myLib32List -listvariable CSF_OPT_LIB32 -width 80 -height 5 -yscrollcommand ".myFrame.myLib32Scrl set"
ttk::button .myFrame.myLib32Add -text "Add" -command wokdep:gui:AddLib32Path
ttk::button .myFrame.myLib32Edit -text "Edit"
ttk::button .myFrame.myLib32Remove -text "Remove" -command wokdep:gui:RemoveLib32Path
ttk::button .myFrame.myLib32Clear -text "Reset" -command wokdep:gui:ResetLib32Path
ttk::label .myFrame.myLib32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional libraries (64-bit) search paths
ttk::label .myFrame.myLib64Lbl -text "Additional libraries (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myLib64Scrl -command ".myFrame.myLib64List yview"
listbox .myFrame.myLib64List -listvariable CSF_OPT_LIB64 -width 80 -height 5 -yscrollcommand ".myFrame.myLib64Scrl set"
ttk::button .myFrame.myLib64Add -text "Add" -command wokdep:gui:AddLib64Path
ttk::button .myFrame.myLib64Edit -text "Edit"
ttk::button .myFrame.myLib64Remove -text "Remove" -command wokdep:gui:RemoveLib64Path
ttk::button .myFrame.myLib64Clear -text "Reset" -command wokdep:gui:ResetLib64Path
ttk::label .myFrame.myLib64ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (32-bit) search paths
ttk::label .myFrame.myBin32Lbl -text "Additional executables (32-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin32Scrl -command ".myFrame.myBin32List yview"
listbox .myFrame.myBin32List -listvariable CSF_OPT_BIN32 -width 80 -height 5 -yscrollcommand ".myFrame.myBin32Scrl set"
ttk::button .myFrame.myBin32Add -text "Add" -command wokdep:gui:AddBin32Path
ttk::button .myFrame.myBin32Edit -text "Edit"
ttk::button .myFrame.myBin32Remove -text "Remove" -command wokdep:gui:RemoveBin32Path
ttk::button .myFrame.myBin32Clear -text "Reset" -command wokdep:gui:ResetBin32Path
ttk::label .myFrame.myBin32ErrLbl -text "Error: " -foreground red -padding {5 5 5 5}
# Additional executables (64-bit) search paths
ttk::label .myFrame.myBin64Lbl -text "Additional executables (64-bit) search paths:" -padding {5 5 80 5}
scrollbar .myFrame.myBin64Scrl -command ".myFrame.myBin64List yview"
listbox .myFrame.myBin64List -listvariable CSF_OPT_BIN64 -width 80 -height 5 -yscrollcommand ".myFrame.myBin64Scrl set"
ttk::button .myFrame.myBin64Add -text "Add" -command wokdep:gui:AddBin64Path
ttk::button .myFrame.myBin64Edit -text "Edit"
ttk::button .myFrame.myBin64Remove -text "Remove" -command wokdep:gui:RemoveBin64Path
ttk::button .myFrame.myBin64Clear -text "Reset" -command wokdep:gui:ResetBin64Path
ttk::label .myFrame.myBin64ErrLbl -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
incr aRowIter
if { "$tcl_platform(platform)" == "windows" } {
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
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
}
#
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.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 2 -sticky e
grid .myFrame.myChecks.myTbbLbl -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.myQt4Check -row $aCheckRowIter -column 12 -sticky e
grid .myFrame.myChecks.myQt4Lbl -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
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
} elseif { "$::tcl_platform(os)" == "Darwin" } {
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myMacGLXLbl -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.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
grid .myFrame.myChecks.myE57Lbl -row $aCheckRowIter -column 7 -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 32-bit search paths
if { "$ARCH" == "32" } {
wokdep:gui:Show32Bitness aRowIter
}
# Additional 64-bit search paths
if { "$ARCH" == "64" } {
wokdep:gui:Show64Bitness 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
}
.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

1355
adm/genconfdeps.tcl Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -237,10 +237,8 @@ proc gendoc {args} {
} }
} elseif {$arg_n == "s"} { } elseif {$arg_n == "s"} {
if { [ lsearch $args_names "pdf" ] != -1 } { if { [ lsearch $args_names "pdf" ] != -1 } {
puts "Warning: search is not used with PDF and will be ignored."
continue continue
} }
if {$args_values(s) != "NULL"} { if {$args_values(s) != "NULL"} {
set SEARCH_MODE $args_values(s) set SEARCH_MODE $args_values(s)
} else { } else {
@@ -249,16 +247,16 @@ proc gendoc {args} {
} }
} elseif {$arg_n == "mathjax"} { } elseif {$arg_n == "mathjax"} {
if { [ lsearch $args_names "pdf" ] != -1 } { 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)
set possible_mathjax_loc $args_values(mathjax) puts "$MATHJAX_LOCATION"
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} { } else {
set MATHJAX_LOCATION $args_values(mathjax) puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc."
puts "$MATHJAX_LOCATION" puts " MathJax will be used from $MATHJAX_LOCATION"
}
} else { } else {
puts "Warning: $mathjax_js_name is not found in $possible_mathjax_loc." puts "Warning: MathJax is not used with pdf and will be ignored."
puts " MathJax will be used from $MATHJAX_LOCATION"
} }
} else { } else {
puts "\nWrong argument: $arg_n" puts "\nWrong argument: $arg_n"
@@ -688,17 +686,6 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
# Write specific options # Write specific options
if { $docType == "REFMAN" } { 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 # Load lists of modules scripts
if { $productsPath == "" } { if { $productsPath == "" } {
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl] set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
@@ -824,18 +811,12 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
puts $doxyFile "" puts $doxyFile ""
# restore environment variables
set ::env(HAVE_D3D) "$aHaveD3dBack"
set ::env(HAVE_GLES2) "$aHaveGlesBack"
set ::env(HAVE_VTK) "$aHaveVtkBack"
} elseif { $docType == "OVERVIEW" } { } elseif { $docType == "OVERVIEW" } {
# Add common options for generation of Overview and User Guides # Add common options for generation of Overview and User Guides
puts $doxyFile "PROJECT_NUMBER = $occt_version" puts $doxyFile "PROJECT_NUMBER = $occt_version"
puts $doxyFile "OUTPUT_DIRECTORY = $outDir/." puts $doxyFile "OUTPUT_DIRECTORY = $outDir/."
puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png" puts $doxyFile "PROJECT_LOGO = [OCCDoc_GetDoxDir]/resources/occ_logo.png"
puts $doxyFile "EXAMPLE_PATH = [OCCDoc_GetSourceDir $productsPath]"
set PARAM_INPUT "INPUT =" set PARAM_INPUT "INPUT ="
set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ " set PARAM_IMAGEPATH "IMAGE_PATH = [OCCDoc_GetDoxDir]/resources/ "

3451
adm/genproj.tcl Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@
# commercial license or contractual agreement. # commercial license or contractual agreement.
# ======================================================================= # =======================================================================
# This script contains auxiliary functions which can be used # This script contains auxilary functions which can be used
# in documentation generation process # in documentation generation process
# ======================================================================= # =======================================================================
@@ -179,10 +179,8 @@ proc OCCDoc_DetectNecessarySoftware { DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH H
} }
if {"$is_win" == "yes"} { if {"$is_win" == "yes"} {
set exe ".exe" set exe ".exe"
set com ".com"
} else { } else {
set exe "" set exe ""
set com ""
} }
set g_flag "no" set g_flag "no"
@@ -226,11 +224,11 @@ proc OCCDoc_DetectNecessarySoftware { DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH H
} }
} }
if {$i_flag == "no"} { if {$i_flag == "no"} {
if { [file exists $path/inkscape$com] } { if { [file exists $path/inkscape$exe] } {
catch { exec $path/inkscape -V } version catch { exec $path/inkscape -V } version
puts "Info: $version " puts "Info: $version "
puts " found in $path." puts " found in $path."
set inkscape_path "$path/inkscape$com" set inkscape_path "$path/inkscape$exe"
set i_flag "yes" set i_flag "yes"
} }
} }
@@ -358,29 +356,15 @@ proc OCCDoc_DetectNecessarySoftware { DOXYGEN_PATH GRAPHVIZ_PATH INKSCAPE_PATH H
# Convert SVG files to PDF format to allow including them to PDF # Convert SVG files to PDF format to allow including them to PDF
# (requires InkScape to be in PATH) # (requires InkScape to be in PATH)
proc OCCDoc_ProcessSvg {latexDir verboseMode} { proc OCCDoc_ProcessSvg {latexDir verboseMode} {
set anSvgList [glob -nocomplain $latexDir/*.svg]
if { $anSvgList == {} } {
return
}
catch { exec inkscape -V } anInkVer foreach file [glob -nocomplain $latexDir/*.svg] {
set isOldSyntax 0
if {[string match "Inkscape 0.*" $anInkVer]} { set isOldSyntax 1 }
foreach file $anSvgList {
if {$verboseMode == "YES"} { if {$verboseMode == "YES"} {
puts "Info: Converting file $file..." puts "Info: Converting file $file..."
} }
set pdffile "[file rootname $file].pdf" set pdffile "[file rootname $file].pdf"
if { $isOldSyntax == 1 } { if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } {
if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } { #puts "Error: $res."
#puts "Error: $res." return
return
}
} else {
if { [catch {exec inkscape $file --export-area-drawing --export-type=pdf --export-filename=$pdffile} res] } {
#puts "Error: $res."
return
}
} }
} }
} }
@@ -635,7 +619,7 @@ proc OCCDoc_MakeMainPage {outDir outFile modules {theProductsDir ""} } {
foreach mod $modules { foreach mod $modules {
puts $fd "\\li \\subpage [string tolower $module_prefix$mod]" puts $fd "\\li \\subpage [string tolower $module_prefix$mod]"
} }
# insert modules relationship diagram # insert modules relationship diagramm
puts $fd "\\dotfile [OCCDoc_CreateModulesDependencyGraph $outDir/html schema_all_modules $modules $module_prefix]" puts $fd "\\dotfile [OCCDoc_CreateModulesDependencyGraph $outDir/html schema_all_modules $modules $module_prefix]"
puts $fd "**/\n" puts $fd "**/\n"
} }
@@ -915,4 +899,4 @@ proc OCCDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
file delete -force $TEX file delete -force $TEX
file rename $TMPFILENAME $TEX file rename $TMPFILENAME $TEX
} }
} }

View File

@@ -13,8 +13,8 @@ OccGitRoot = $$_PRO_FILE_PWD_/../../../..
# Define compilation flags # Define compilation flags
CONFIG += warn_on CONFIG += warn_on
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra QMAKE_CFLAGS_WARN_ON = -Wall
QMAKE_CXXFLAGS_WARN_ON = -Wall -Wextra QMAKE_CXXFLAGS_WARN_ON = -Wall
win32 { win32 {
QMAKE_CFLAGS_WARN_ON = -W4 QMAKE_CFLAGS_WARN_ON = -W4
QMAKE_CXXFLAGS_WARN_ON = -W4 QMAKE_CXXFLAGS_WARN_ON = -W4
@@ -39,10 +39,6 @@ win32 {
DEFINES += _SCL_SECURE_NO_WARNINGS DEFINES += _SCL_SECURE_NO_WARNINGS
} else { } else {
CONFIG += c++11 CONFIG += c++11
clang {
QMAKE_CFLAGS_WARN_ON += -Wshorten-64-to-32
QMAKE_CXXFLAGS_WARN_ON += -Wshorten-64-to-32
}
QMAKE_CFLAGS += -fexceptions QMAKE_CFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fexceptions QMAKE_CXXFLAGS += -fexceptions
QMAKE_CXXFLAGS += -fvisibility=default QMAKE_CXXFLAGS += -fvisibility=default
@@ -53,9 +49,6 @@ win32 {
} else { } else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
} }
} else:gcc {
# ask linker to report missing library dependencies
QMAKE_LFLAGS += -Wl,-z,defs
} }
} }
!CONFIG(debug, debug|release) { !CONFIG(debug, debug|release) {
@@ -119,8 +112,6 @@ android-g++ {
# VS2015, vc141 # VS2015, vc141
} else:equals(aMsvcVer, 16.0){ } else:equals(aMsvcVer, 16.0){
# VS2019, vc142 # VS2019, vc142
} else:equals(aMsvcVer, 17.0){
# VS2022, vc143
} else { } else {
warning (Unknown msvc version. "$$MY_COMPILER" is used) warning (Unknown msvc version. "$$MY_COMPILER" is used)
} }
@@ -162,4 +153,5 @@ win32 {
} }
} }
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET} #OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}

View File

@@ -15,14 +15,8 @@ for (aModuleIter, aModuleList) {
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 } equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 } !HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { 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, "TKD3DHost") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHostTest") { toSkipToolkit = 1 }
equals (toSkipToolkit, 0) { equals (toSkipToolkit, 0) {
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit) #warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in) eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro) eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)

View File

@@ -18,7 +18,7 @@ aHxxRoot = $$OccGitRoot/inc
INCLUDEPATH += $$aHxxRoot INCLUDEPATH += $$aHxxRoot
# CSF variables # CSF variables
HAVE_FREETYPE { CSF_FREETYPE = -lfreetype } CSF_FREETYPE = -lfreetype
CSF_TclLibs = -ltcl8.6 CSF_TclLibs = -ltcl8.6
CSF_TclTkLibs = -ltk8.6 CSF_TclTkLibs = -ltk8.6
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 } HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
@@ -26,7 +26,6 @@ HAVE_FFMPEG { CSF_FFmpeg = -lavcodec -lavformat -lswscale -lavutil }
HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc } HAVE_TBB { CSF_TBB = -ltbb -ltbbmalloc }
HAVE_ZLIB { CSF_ZLIB = -lzlib } HAVE_ZLIB { CSF_ZLIB = -lzlib }
HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma } HAVE_LIBLZMA { CSF_LIBLZMA = -lliblzma }
HAVE_DRACO { CSF_Draco = -ldraco }
win32 { win32 {
CSF_kernel32 = -lkernel32 CSF_kernel32 = -lkernel32
CSF_advapi32 = -ladvapi32 CSF_advapi32 = -ladvapi32
@@ -37,7 +36,7 @@ win32 {
CSF_wsock32 = -lwsock32 CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32 CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32 CSF_OpenGlLibs = -lopengl32
CSF_OpenGlesLibs = -llibEGL -llibGLESv2 HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
CSF_psapi = -lPsapi CSF_psapi = -lPsapi
CSF_winmm = -lwinmm CSF_winmm = -lwinmm
CSF_d3d9 = -ld3d9 CSF_d3d9 = -ld3d9
@@ -47,12 +46,12 @@ win32 {
} else:mac { } else:mac {
CSF_dl = -ldl CSF_dl = -ldl
CSF_objc = -lobjc CSF_objc = -lobjc
CSF_OpenGlLibs = -framework OpenGL
CSF_OpenGlesLibs = -framework OpenGLES
iphoneos { iphoneos {
CSF_Appkit = -framework UIKit CSF_Appkit = -framework UIKit
CSF_OpenGlLibs = -framework OpenGLES
} else { } else {
CSF_Appkit = -framework AppKit CSF_Appkit = -framework AppKit
CSF_OpenGlLibs = -framework OpenGL
} }
CSF_IOKit = -framework IOKit CSF_IOKit = -framework IOKit
CSF_TclLibs = -framework Tcl CSF_TclLibs = -framework Tcl
@@ -60,31 +59,26 @@ win32 {
} else { } else {
CSF_dl = -ldl CSF_dl = -ldl
CSF_ThreadLibs = -lpthread -lrt CSF_ThreadLibs = -lpthread -lrt
CSF_OpenGlesLibs = -lEGL -lGLESv2 CSF_OpenGlLibs = -lGL
CSF_TclTkLibs = -ltk8.6 CSF_TclTkLibs = -lX11 -ltk8.6
HAVE_XLIB { CSF_XwLibs = -lX11 -lXext -lXmu -lXi
CSF_OpenGlLibs = -lGL CSF_MotifLibs = -lX11
CSF_XwLibs = -lX11 CSF_fontconfig = -lfontconfig
} else { HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
CSF_OpenGlLibs = -lGL -lEGL
}
HAVE_FREETYPE { CSF_fontconfig = -lfontconfig }
} }
for (aCfgIter, CONFIG) { for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_") aRes = $$find(aCfgIter, "^HAVE_")
!equals(aCfgIter, "HAVE_GLES2") { count(aRes, 1) {
count(aRes, 1) { DEFINES += $$aCfgIter
DEFINES += $$aCfgIter
}
} }
} }
# Define the list of standard OCCT file extensions # Define the list of standard OCCT file extensions
aHxxRegex = ^.*\.(hxx|h|lxx|gxx)$ aHxxRegex = ^.*\.(hxx|h|lxx|gxx)$
aPxxRegex = ^.*\.(pxx)$ aPxxRegex = ^.*\.(pxx)$
aCxxRegex = ^.*\.(cxx|cpp|c)$ aCxxRegex = ^.*\.(cxx|c)$
mac { aCxxRegex = ^.*\.(cxx|cpp|c|m|mm)$ } mac { aCxxRegex = ^.*\.(cxx|c|m|mm)$ }
# Auxiliary function for probing file extension # Auxiliary function for probing file extension
defineTest (occCheckExtension) { defineTest (occCheckExtension) {
@@ -109,12 +103,6 @@ for (anExternLib, anExternLibs) {
count(hasCsf, 1) { count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n") aList = $$split($$anExternLib, "\n")
LIBS += $$aList LIBS += $$aList
equals(anExternLib, "CSF_OpenGlLibs") {
DEFINES += "HAVE_OPENGL"
}
equals(anExternLib, "CSF_OpenGlesLibs") {
DEFINES += "HAVE_GLES2"
}
} else { } else {
LIBS += -l$$anExternLib LIBS += -l$$anExternLib
} }
@@ -132,31 +120,21 @@ for (aPackage, aPackages) {
} }
} }
# extend clean with versioned .so files
!win32 { !win32 {
aVerList = $$split(VERSION, ".") aVerList = $$split(VERSION, ".")
aVerMaj = $$member(aVerList, 0) aVerMaj = $$member(aVerList, 0)
aVerMin = $$member(aVerList, 1) aVerMin = $$member(aVerList, 1)
aVerMic = $$member(aVerList, 2) aVerMic = $$member(aVerList, 2)
equals(TEMPLATE, app) { equals(TEMPLATE, app) {
QMAKE_CLEAN += $$DESTDIR/$${TARGET} QMAKE_CLEAN += $$DESTDIR/$${TARGET}
} else { } else {
mac { 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}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.dylib
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.$${aVerMaj}.$${aVerMin}.$${aVerMic}.dylib
} else { } 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
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj} QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}
QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin} QMAKE_CLEAN += $$DESTDIR/lib$${TARGET}.so.$${aVerMaj}.$${aVerMin}

View File

@@ -9,10 +9,6 @@
# - Open project in Qt Creator, and call "Run qmake". # - 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. # - 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. # - "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 TEMPLATE = subdirs
exists(custom.auto.pri) { include(custom.auto.pri) } exists(custom.auto.pri) { include(custom.auto.pri) }
exists(custom.pri) { include(custom.pri) } exists(custom.pri) { include(custom.pri) }

View File

@@ -1,39 +0,0 @@
<?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

@@ -1,2 +0,0 @@
*custom.bat
*custom.sh

View File

@@ -1,269 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of OCCT for Android platform.
rem android_custom.bat should be configured with paths
rem to CMake, 3rd-parties, Android NDK and MinGW make tool.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "anNdkPath="
set "aFreeType="
set "aRapidJson="
set "aDraco="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=1"
set "isStatic=0"
rem Minimal Android platform and CPU architectures
set "anNdkApiLevel=21"
set "anNdkAbiList=armeabi-v7a x86 arm64-v8a x86_64"
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
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"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0android_custom.bat" call "%~dp0android_custom.bat"
set "aCompiler=gcc"
set "aCppLib=gnustl_shared"
if not exist "%anNdkPath%/sources/cxx-stl/gnu-libstdc++" (
if exist "%anNdkPath%/sources/cxx-stl/llvm-libc++" (
set "aCompiler=clang"
set "aCppLib=c++_shared"
)
)
set "aLibType=Shared"
if ["%isStatic%"] == ["1"] set "aLibType=Static"
set "aDestDir=%aBuildRoot%\android-%aCompiler%"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aDestDir%"
)
)
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
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 (
call :cmakeGenerate "%anNdkApiLevel%" "%%s"
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-android"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "anApi=%~1"
set "anAbi=%~2"
if ["%anApi%"] == [""] (
set "anApi=21"
if ["%anAbi%"] == ["armeabi-v7a"] ( set "anApi=16" )
if ["%anAbi%"] == ["x86"] ( set "anApi=16" )
)
set "aPlatformAndCompiler=android-%anAbi%-%aCompiler%"
set "aWorkDir=%aBuildRoot%\%aPlatformAndCompiler%-make"
set "aLogFile=%aBuildRoot%\build-%aPlatformAndCompiler%.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%, API level %anApi%>> %aLogFile%
pushd "%aWorkDir%"
set "aFreeTypeLibName=libfreetype.so"
if exist "%aFreeType%/libs/%anAbi%/libfreetype.a" ( set "aFreeTypeLibName=libfreetype.a" )
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for Android %anAbi%, API level %anApi%...
cmake -G "MinGW Makefiles" ^
-D CMAKE_SYSTEM_NAME:STRING="Android" ^
-D CMAKE_ANDROID_NDK="%anNdkPath%" ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D CMAKE_ANDROID_ARCH_ABI:STRING="%anAbi%" ^
-D CMAKE_SYSTEM_VERSION:STRING="%anApi%" ^
-D CMAKE_ANDROID_STL_TYPE="%aCppLib%" ^
-D BUILD_LIBRARY_TYPE:STRING="%aLibType%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_LIB:STRING="libs/%anAbi%" ^
-D INSTALL_DIR_CMAKE:STRING="libs/%anAbi%/cmake/opencascade" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-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%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/libs/%anAbi%" ^
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="%aFreeType%/libs/%anAbi%/%aFreeTypeLibName%" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR_draco:PATH="%aDraco%/libs/%anAbi%" ^
"%aCasSrc%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
)
set "aTimeGEN=%TIME%"
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set "aTimeBUILD=%TIME%"
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
goto :eof
:computeDuration
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
rem convert hours:minutes:seconds:ms into duration
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
set /A aDurHH=%aDurTotalSec% / 360000
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
goto :eof

View File

@@ -1,34 +0,0 @@
rem Environment configuration template for android_build.bat (to be renamed as android_custom.bat)
rem Paths to 3rd-party tools and libraries
rem call c:\TDM-GCC-64\mingwvars.bat
rem set "PATH=c:\CMake\bin;%PATH%"
rem set "anNdkPath=c:/android-ndk-r12"
rem set "aFreeType=c:/freetype-2.7.1-android"
rem set "aRapidJson=c:/rapidjson-1.1.0"
rem set "aDraco=c:/draco-1.4.1-android"
rem Uncomment to customize building steps
rem set "aBuildRoot=%~dp0..\..\work"
rem set "toCMake=1"
rem set "toClean=0"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "isStatic=0"
rem Minimal Android platform and CPU architectures
rem set "anNdkApiLevel=21"
rem set "anNdkAbiList=arm64-v8a x86_64"
rem OCCT Modules to build
rem set "BUILD_ModelingData=ON"
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"
rem set "USE_DRACO=ON"

View File

@@ -1,49 +0,0 @@
rem Environment configuration template for cmake_gen.bat (to be renamed as cmake_gen_custom.bat)
set "OCCT3RDPARTY=%SrcRoot%\..\3rdparty"
set VS=14
set VSDATA=2015
rem Leave VSPLATFORM empty to build for x86 platform
set VSPLATFORM=Win64
rem ------------------------------------
rem Uncomment to customize building steps
rem ------------------------------------
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
rem set BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
rem set BUILD_USE_PCH=OFF
rem set BUILD_FORCE_RelWithDebInfo=OFF
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
rem set BUILD_MODULE_Visualization=ON
rem set USE_D3D=OFF
rem set USE_FFMPEG=OFF
rem set USE_FREEIMAGE=OFF
rem set USE_GLES2=OFF
rem set USE_RAPIDJSON=OFF
rem set USE_DRACO=OFF
rem set USE_TBB=OFF
rem set USE_VTK=OFF

View File

@@ -1,44 +0,0 @@
# Environment configuration template for cmake_gen.sh (to be renamed as cmake_gen_custom.sh)
OCCT3RDPARTY="$SrcRoot/../3rdparty"
FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
# ------------------------------------
# Uncomment to customize building steps
# ------------------------------------
#BUILD_DIR=build
#INSTALL_DIR="$SrcRoot/install"
#BUILD_DOC_Overview=OFF
#BUILD_Inspector=OFF
#BUILD_LIBRARY_TYPE=Shared
#BUILD_RELEASE_DISABLE_EXCEPTIONS=ON
#BUILD_WITH_DEBUG=OFF
#BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
# Use semicolon-separated list of toolkits if you want to disable all modules
# 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
#BUILD_MODULE_Visualization=ON
#USE_FFMPEG=OFF
#USE_FREEIMAGE=OFF
#USE_GLES2=OFF
#USE_RAPIDJSON=OFF
#USE_DRACO=OFF
#USE_TBB=OFF
#USE_VTK=OFF
# This is to add any additional arguments to cmake
#AUX_ARGS=

View File

@@ -1,90 +0,0 @@
@echo off
rem Auxiliary script for semi-automated building of OCCT using cmake.
rem cmake_custom.bat should be configured with VS version and path to 3rd-parties.
rem OCCT3RDPARTY must be specified as mandatory dependency.
setlocal
set "SrcRoot=%~dp0..\.."
set VS=14
set VSDATA=2015
set VSPLATFORM=Win64
set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
set "OCCT3RDPARTY="
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
set BUILD_USE_PCH=OFF
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
set BUILD_MODULE_Visualization=ON
set USE_D3D=OFF
set USE_FFMPEG=OFF
set USE_FREEIMAGE=OFF
set USE_GLES2=OFF
set USE_RAPIDJSON=OFF
set USE_DRACO=OFF
set USE_TBB=OFF
set USE_VTK=OFF
if exist "%~dp0cmake_custom.bat" call "%~dp0cmake_custom.bat"
if not "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA% %VSPLATFORM%"
if "%VSPLATFORM%"=="" set "arch_compile=Visual Studio %VS% %VSDATA%"
set "INSTALL_DIR=%INSTALL_DIR:\=/%"
set "OCCT3RDPARTY=%OCCT3RDPARTY:\=/%"
set "BUILD_DIR=%SrcRoot%\%BUILD_DIR%"
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
pushd "%BUILD_DIR%"
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% ^
-D BUILD_USE_PCH:BOOL=%BUILD_USE_PCH% ^
-D BUILD_FORCE_RelWithDebInfo:BOOL=%BUILD_FORCE_RelWithDebInfo% ^
-D INSTALL_DIR:PATH="%INSTALL_DIR%" ^
-D USE_D3D:BOOL=%USE_D3D% ^
-D USE_FFMPEG:BOOL=%USE_FFMPEG% ^
-D USE_FREEIMAGE:BOOL=%USE_FREEIMAGE% ^
-D USE_GLES2:BOOL=%USE_GLES2% ^
-D USE_RAPIDJSON:BOOL=%USE_RAPIDJSON% ^
-D USE_DRACO:BOOL=%USE_DRACO% ^
-D USE_TBB:BOOL=%USE_TBB% ^
-D USE_VTK:BOOL=%USE_VTK% ^
"%SrcRoot%"
popd
endlocal

View File

@@ -1,90 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT using cmake.
# cmake_custom.sh should be configured with path to 3rd-parties.
# OCCT3RDPARTY and FREETYPE_DIR must be specified as mandatory dependencies.
ScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SrcRoot="${ScriptDir}/../.."
INSTALL_DIR="$SrcRoot/install"
BUILD_DIR=build
DEB=
CMAKE_BUILD_TYPE=Release
if [ "$1" = "-d" ]; then
DEB=d
BUILD_DIR=${BUILD_DIR}-deb
CMAKE_BUILD_TYPE=Debug
fi
INSTALL_DIR_BIN=lin64/gcc/bin$DEB
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
BUILD_MODULE_Visualization=ON
USE_FFMPEG=OFF
USE_FREEIMAGE=OFF
USE_GLES2=OFF
USE_RAPIDJSON=OFF
USE_DRACO=OFF
USE_TBB=OFF
USE_VTK=OFF
AUX_ARGS=
if [ -f "${ScriptDir}/cmake_custom.sh" ]; then
. "${ScriptDir}/cmake_custom.sh"
fi
BUILD_DIR="$SrcRoot/$BUILD_DIR"
if [ ! -d "$BUILD_DIR" ]; then mkdir -p "$BUILD_DIR"; fi
pushd "$BUILD_DIR"
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-D 3RDPARTY_DIR:PATH="$OCCT3RDPARTY" \
-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 \
-D INSTALL_DIR:PATH="$INSTALL_DIR" \
-D INSTALL_DIR_LAYOUT:STRING=Windows \
-D INSTALL_DIR_BIN:STRING=$INSTALL_DIR_BIN \
-D INSTALL_DIR_LIB:STRING=$INSTALL_DIR_LIB \
-D USE_FFMPEG:BOOL=$USE_FFMPEG \
-D USE_FREEIMAGE:BOOL=$USE_FREEIMAGE \
-D USE_GLES2:BOOL=$USE_GLES2 \
-D USE_RAPIDJSON:BOOL=$USE_RAPIDJSON \
-D USE_DRACO:BOOL=$USE_DRACO \
-D USE_TBB:BOOL=$USE_TBB \
-D USE_VTK:BOOL=$USE_VTK \
$AUX_ARGS "$SrcRoot"
popd

View File

@@ -1,269 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT for iOS platform.
# macos_custom.sh should be configured with paths to CMake and other 3rd-parties.
# FreeType should be specified as mandatory dependency.
aScriptDir=${BASH_SOURCE%/*}
if [ -d "$aScriptDir" ]; then cd "$aScriptDir"; fi
aScriptDir="$PWD"
aCasSrc=${aScriptDir}/../..
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
export aBuildRoot=work
# paths to pre-built 3rd-parties
export aFreeType=
export aFreeImage=
export aRapidJson=
export aDraco=
# build stages to perform
export isStatic=1
export toCMake=1
export toClean=1
export toMake=1
export toInstall=1
export toPack=0
export toPackFat=0
export toDebug=0
export BUILD_ModelingData=ON
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
export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export IPHONEOS_DEPLOYMENT_TARGET=8.0
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
export anAbiList="iPhoneOS|arm64"
if [[ -f "${aScriptDir}/ios_custom.sh" ]]; then
source "${aScriptDir}/ios_custom.sh"
fi
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")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
set -o pipefail
aBuildType="Release"
aBuildTypePrefix=
if [[ $toDebug == 1 ]]; then
aBuildType="Debug"
aBuildTypePrefix="-debug"
fi
aLibType="Shared"
if [[ $isStatic == 1 ]]; then
aLibType="Static"
fi
function buildArch {
anAbi=$1
aPlatformSdk=$2
aPlatformAndCompiler=${aPlatformSdk}-${anAbi}${aBuildTypePrefix}-clang
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
fi
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
pushd "$aWorkDir"
aTimeZERO=$SECONDS
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
fi
}
aSysRoot="/Applications/Xcode.app/Contents/Developer/Platforms/${aPlatformSdk}.platform/Developer/SDKs/${aPlatformSdk}.sdk"
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for iOS...
cmake -G "Unix Makefiles" \
-D CMAKE_SYSTEM_NAME="iOS" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_OSX_DEPLOYMENT_TARGET:STRING="$IPHONEOS_DEPLOYMENT_TARGET" \
-D CMAKE_OSX_SYSROOT:PATH="$aSysRoot" \
-D CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
-D BUILD_LIBRARY_TYPE:STRING="$aLibType" \
-D INSTALL_DIR:PATH="$aDestDir" \
-D INSTALL_DIR_INCLUDE:STRING="inc" \
-D INSTALL_DIR_LIB:STRING="lib" \
-D INSTALL_DIR_RESOURCE:STRING="src" \
-D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \
-D USE_FREETYPE:BOOL="$USE_FREETYPE" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="$aFreeType/lib" \
-D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \
-D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \
-D USE_DRACO:BOOL="$USE_DRACO" \
-D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \
-D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \
-D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \
-D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="$aFreeImage/lib" \
-D 3RDPARTY_FREEIMAGE_LIBRARY:FILEPATH="$aFreeImage/lib/libfreeimage.a" \
-D BUILD_MODULE_FoundationClasses:BOOL="ON" \
-D BUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-D BUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-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"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
echo Platform: ${aPlatformSdk} ABI: ${anAbi} Build: ${aBuildType} IPHONEOS_DEPLOYMENT_TARGET: ${IPHONEOS_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd
}
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
echo Platform: ${aPlatform} ABI: ${anArch} Build: ${aBuildType}
buildArch $anArch $aPlatform
done
# create a FAT archive
if [[ $toPackFat == 1 ]]; then
for aPlatIter in iPhoneOS iPhoneSimulator
do
aSuffixFat=${aPlatIter}${aBuildTypePrefix}-clang
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
# merge per-arch builds into fat builds
hasPlatform=0
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
if [[ $aPlatIter != ${aPlatform} ]]; then
continue
fi
aSuffixThin=${aPlatform}-${anArch}${aBuildTypePrefix}-clang
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
if [[ $hasPlatform == 0 ]]; then
hasPlatform=1
echo Packing FAT archive for platform: ${aPlatform}
rm -r -f "$aFatDir"
mkdir -p "$aFatDir"
rsync -r --exclude '*.a' "$anArchDir/" "$aFatDir"
rm -f "$aFatDir/build_target.txt"
for aLibIter in $anArchDir/lib/*.a; do
aLibName=`basename $aLibIter`
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
done
else
for aLibIter in $aFatDir/lib/*.a; do
aLibName=`basename $aLibIter`
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
#lipo -info "$aFatDir/lib/$aLibName"
done
fi
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
done
# create an archive
for anArchIter in $anAbiList
do
IFS="|" read -r aPlatform anArch <<< "$anArchIter"
if [[ $aPlatIter != ${aPlatform} ]]; then
continue
fi
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aFatDir}/../${anArchName} &>/dev/null
pushd "$aFatDir"
tar -jcf ${aFatDir}/../${anArchName} *
popd
break
done
done
fi

View File

@@ -1,31 +0,0 @@
# environment configuration template for ios_build.sh (to be renamed as ios_custom_env.sh)
export PATH=/Applications/CMake.app/Contents/bin:$PATH
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-ios"
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-ios"
export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
# Uncomment to customize building steps
#export isStatic=0
#export toCMake=1
#export toClean=1
#export toMake=1
#export toInstall=1
#export toPack=0
#export toPackFat=1
#export toDebug=0
#export BUILD_ModelingData=ON
#export BUILD_ModelingAlgorithms=ON
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON
#export USE_FREEIMAGE=ON
#export IPHONEOS_DEPLOYMENT_TARGET=8.0
#export anAbiList="iPhoneOS|arm64 iPhoneSimulator|arm64 iPhoneSimulator|x86_64"
#export anAbiList="iPhoneOS|arm64"

View File

@@ -1,270 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT for macOS platform.
# macos_custom.sh should be configured with paths to CMake and other 3rd-parties.
# FreeType should be specified as mandatory dependency.
aScriptDir=${BASH_SOURCE%/*}
if [ -d "$aScriptDir" ]; then cd "$aScriptDir"; fi
aScriptDir="$PWD"
aCasSrc=${aScriptDir}/../..
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
export aBuildRoot=work
# paths to pre-built 3rd-parties
export aFreeType=
export aFreeImage=
export aRapidJson=
export aDraco=
# build stages to perform
export isStatic=0
export toCMake=1
export toClean=1
export toMake=1
export toInstall=1
export toPack=0
export toPackFat=0
export toDebug=0
export BUILD_ModelingData=ON
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
export USE_FREEIMAGE=ON
export USE_RAPIDJSON=OFF
export USE_DRACO=OFF
export MACOSX_DEPLOYMENT_TARGET=10.10
#export anAbiList="arm64 x86_64"
export anAbiList="x86_64"
aPlatform="macos"
if [[ -f "${aScriptDir}/macos_custom.sh" ]]; then
source "${aScriptDir}/macos_custom.sh"
fi
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")
MONTH=$(date +"%m")
DAY=$(date +"%d")
aRevision=-${YEAR}-${MONTH}-${DAY}
#aRevision=-${aGitBranch}
set -o pipefail
aBuildType="Release"
aBuildTypePrefix=
if [[ $toDebug == 1 ]]; then
aBuildType="Debug"
aBuildTypePrefix="-debug"
fi
aLibType="Shared"
aLibExt="dylib"
if [[ $isStatic == 1 ]]; then
aLibType="Static"
aLibExt="a"
fi
function buildArch {
anAbi=$1
aPlatformAndCompiler=${aPlatform}-${anAbi}${aBuildTypePrefix}-clang
aWorkDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}-make"
aDestDir="${aCasSrc}/${aBuildRoot}/${aPlatformAndCompiler}"
aLogFile="${aCasSrc}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [[ $toCMake == 1 ]] && [[ $toClean == 1 ]]; then
rm -r -f "$aWorkDir"
rm -r -f "$aDestDir"
fi
mkdir -p "$aWorkDir"
mkdir -p "$aDestDir"
rm -f "$aLogFile"
# include some information about OCCT into archive
echo \<pre\>> "${aWorkDir}/VERSION.html"
git status >> "${aWorkDir}/VERSION.html"
git log -n 100 >> "${aWorkDir}/VERSION.html"
echo \</pre\>>> "${aWorkDir}/VERSION.html"
pushd "$aWorkDir"
aTimeZERO=$SECONDS
function logDuration {
if [[ $1 == 1 ]]; then
aDur=$(($4 - $3))
echo $2 time: $aDur sec>> "$aLogFile"
fi
}
# (re)generate Make files
if [[ $toCMake == 1 ]]; then
echo Configuring OCCT for macOS...
cmake -G "Unix Makefiles" \
-D CMAKE_OSX_ARCHITECTURES:STRING="$anAbi" \
-D CMAKE_BUILD_TYPE:STRING="$aBuildType" \
-D BUILD_LIBRARY_TYPE:STRING="$aLibType" \
-D INSTALL_DIR:PATH="$aDestDir" \
-D INSTALL_DIR_INCLUDE:STRING="inc" \
-D INSTALL_DIR_LIB:STRING="lib" \
-D INSTALL_DIR_RESOURCE:STRING="src" \
-D INSTALL_NAME_DIR:STRING="@executable_path/../Frameworks" \
-D USE_FREETYPE:BOOL="$USE_FREETYPE" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="$aFreeType/lib" \
-D 3RDPARTY_FREETYPE_LIBRARY:FILEPATH="$aFreeType/lib/libfreetype.dylib" \
-D USE_RAPIDJSON:BOOL="$USE_RAPIDJSON" \
-D 3RDPARTY_RAPIDJSON_DIR:PATH="$aRapidJson" \
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="$aRapidJson/include" \
-D USE_DRACO:BOOL="$USE_DRACO" \
-D 3RDPARTY_DRACO_DIR:PATH="$aDraco" \
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="$aDraco/include" \
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="$aDraco/lib" \
-D USE_FREEIMAGE:BOOL="$USE_FREEIMAGE" \
-D 3RDPARTY_FREEIMAGE_DIR:PATH="$aFreeImage" \
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="$aFreeImage/include" \
-D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="$aFreeImage/lib" \
-D 3RDPARTY_FREEIMAGE_LIBRARY:FILEPATH="$aFreeImage/lib/libfreeimage.a" \
-D BUILD_MODULE_FoundationClasses:BOOL="ON" \
-D BUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-D BUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-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"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeGEN=$SECONDS
logDuration $toCMake "Generation" $aTimeZERO $aTimeGEN
# clean up from previous build
if [[ $toClean == 1 ]]; then
make clean
fi
# build the project
if [[ $toMake == 1 ]]; then
echo Building OCCT...
make -j $aNbJobs 2>&1 | tee -a "$aLogFile"
aResult=$?; if [[ $aResult != 0 ]]; then exit $aResult; fi
fi
aTimeBUILD=$SECONDS
logDuration $toMake "Building" $aTimeGEN $aTimeBUILD
logDuration $toMake "Total building" $aTimeZERO $aTimeBUILD
# install the project
if [[ $toInstall == 1 ]]; then
echo Installing OCCT into $aDestDir...
make install 2>&1 | tee -a "$aLogFile"
cp -f "$aWorkDir/VERSION.html" "$aDestDir/VERSION.html"
echo Platform: macOS ABI: ${anAbi} Build: ${aBuildType} MACOSX_DEPLOYMENT_TARGET: ${MACOSX_DEPLOYMENT_TARGET} > "$aDestDir/build_target.txt"
fi
aTimeINSTALL=$SECONDS
logDuration $toInstall "Install" $aTimeBUILD $aTimeINSTALL
# create an archive
if [[ $toPack == 1 ]]; then
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aPlatformAndCompiler}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aDestDir}/../${anArchName} &>/dev/null
pushd "$aDestDir"
tar -jcf ${aDestDir}/../${anArchName} *
popd
fi
aTimePACK=$SECONDS
logDuration $toPack "Packing archive" $aTimeINSTALL $aTimePACK
# finished
DURATION=$(($aTimePACK - $aTimeZERO))
echo Total time: $DURATION sec
logDuration 1 "Total" $aTimeZERO $aTimePACK
popd
}
for anArchIter in $anAbiList
do
echo Platform: macOS ABI: ${anArchIter} Build: ${aBuildType}
buildArch $anArchIter
done
# create a FAT archive
if [[ $toPackFat == 1 ]]; then
aSuffixFat=${aPlatform}${aBuildTypePrefix}-clang
aFatDir="${aCasSrc}/${aBuildRoot}/${aSuffixFat}"
# merge per-arch builds into fat builds
hasPlatform=0
for anArchIter in $anAbiList
do
aSuffixThin=${aPlatform}-${anArchIter}${aBuildTypePrefix}-clang
anArchDir="${aCasSrc}/${aBuildRoot}/${aSuffixThin}"
if [[ $hasPlatform == 0 ]]; then
hasPlatform=1
echo Packing FAT archive
rm -r -f "$aFatDir"
mkdir -p "$aFatDir"
if [[ $isStatic == 1 ]]; then
rsync -r -l --exclude '*.a' "$anArchDir/" "$aFatDir"
else
rsync -r -l --exclude '*.dylib' "$anArchDir/" "$aFatDir"
fi
rm -f "$aFatDir/build_target.txt"
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
rm $aFatDir/bin/$aDrawExe
lipo "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
fi
for aLibIter in $anArchDir/lib/*.$aLibExt; do
aLibName=`basename $aLibIter`
if [[ -L "$anArchDir/lib/$aLibName" ]]; then
cp -a "$anArchDir/lib/$aLibName" "$aFatDir/lib/"
else
lipo "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
fi
done
else
if [[ -L "$anArchDir/bin/DRAWEXE" ]]; then
aDrawExe=$(readlink "$anArchDir/bin/DRAWEXE")
lipo "$aFatDir/bin/$aDrawExe" "$anArchDir/bin/$aDrawExe" -output "$aFatDir/bin/$aDrawExe" -create
fi
for aLibIter in $aFatDir/lib/*.$aLibExt; do
aLibName=`basename $aLibIter`
if [[ ! -L "$anArchDir/lib/$aLibName" ]]; then
lipo "$aFatDir/lib/$aLibName" "$anArchDir/lib/$aLibName" -output "$aFatDir/lib/$aLibName" -create
#lipo -info "$aFatDir/lib/$aLibName"
fi
done
fi
cat "$anArchDir/build_target.txt" >> "$aFatDir/build_target.txt"
done
# create an archive
anArchName=occt-${anOcctVersion}${anOcctVerSuffix}${aRevision}-${aSuffixFat}.tar.bz2
echo Creating an archive ${aCasSrc}/${aBuildRoot}/${anArchName}...
rm ${aFatDir}/../${anArchName} &>/dev/null
pushd "$aFatDir"
tar -jcf ${aFatDir}/../${anArchName} *
popd
fi

View File

@@ -1,32 +0,0 @@
# environment configuration template for macos_build.sh (to be renamed as macos_custom_env.sh)
export PATH=/Applications/CMake.app/Contents/bin:$PATH
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.10.4-macos"
export aFreeImage="$aSrcRoot/../3rdparty/freeimage-3.18-macos"
export aRapidJson="$aSrcRoot/../3rdparty/rapidjson-1.1.0"
export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
# Uncomment to customize building steps
#export aBuildRoot=work
#export toCMake=1
#export toClean=1
#export toMake=1
#export toInstall=1
#export toPack=1
#export toPackFat=1
#export BUILD_ModelingData=ON
#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_RAPIDJSON=ON
#export USE_DRACO=ON
#export USE_FREEIMAGE=ON
#export MACOSX_DEPLOYMENT_TARGET=10.10
#export anAbiList=arm64
#export anAbiList=x86_64
#export anAbiList="arm64 x86_64"

View File

@@ -1,269 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of OCCT for Mingw-w64 platform.
rem mingw_custom.bat should be configured with paths to CMake, 3rd-parties and MinGW.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aMingwVars="
set "aFreeType="
set "aFreeImage="
set "aRapidJson="
set "aDraco="
set "aTclTk="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=0"
set "toDebug=0"
set "isStatic=0"
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
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
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_FREEIMAGE=ON"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0mingw_custom.bat" call "%~dp0mingw_custom.bat"
if not ["%aMingwVars%"] == [""] ( call "%aMingwVars%" )
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
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"
set "aBuildTypePrefix="
set "aLibType=Shared"
if ["%isStatic%"] == ["1"] set "aLibType=Static"
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-mingw64%aBuildTypePrefix%"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
echo Copying dependencies...
for %%i in (libstdc++-6.dll libwinpthread-1.dll libgcc_s_seh-1.dll) do (
if "%%~$PATH:i" == "" (
echo "Error: could not find %%i"
) else (
xcopy /Y "%%~$PATH:i" "%aTarget%\win64\gcc\bin"
)
)
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=mingw64%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
rmdir /S /Q %aDestDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
pushd "%aWorkDir%"
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for MinGW-w64...
cmake -G "MinGW Makefiles" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D BUILD_LIBRARY_TYPE:STRING="%aLibType%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-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" ^
-D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
-D 3RDPARTY_TCL_DLL_DIR:PATH="%aTclTk%/bin" ^
-D 3RDPARTY_TK_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TK_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^
-D 3RDPARTY_TK_LIBRARY_DIR:PATH="%aTclTk%/lib" ^
-D 3RDPARTY_TK_DLL_DIR:PATH="%aTclTk%/bin" ^
-D USE_D3D:BOOL="ON" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="%aFreeType%/lib" ^
-D USE_FREEIMAGE:BOOL="%USE_FREEIMAGE%" ^
-D 3RDPARTY_FREEIMAGE_DIR:PATH="%aFreeImage%" ^
-D 3RDPARTY_FREEIMAGE_INCLUDE_DIR:FILEPATH="%aFreeImage%/include" ^
-D 3RDPARTY_FREEIMAGE_LIBRARY_DIR:PATH="%aFreeImage%/lib" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^
"%aCasSrc%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
)
set "aTimeGEN=%TIME%"
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set "aTimeBUILD=%TIME%"
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
goto :eof
:computeDuration
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
rem convert hours:minutes:seconds:ms into duration
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
set /A aDurHH=%aDurTotalSec% / 360000
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
goto :eof

View File

@@ -1,30 +0,0 @@
rem Environment configuration template for mingw_build.bat (to be renamed as mingw_custom.bat)
set "aCmakeBin=%ProgramW6432%\CMake\bin"
set "aFreeType=%aCasSrc%/../3rdparty/freetype-2.6.3-mingw-64"
set "aTclTk=%aCasSrc%/../3rdparty/tcltk-8.6.4-mingw-64"
set "aFreeImage=%aCasSrc%/../3rdparty/freeimage-3.17-0-mingw-64"
set "aRapidJson=%aCasSrc%/../3rdparty/rapidjson-1.1.0"
set "aDraco=%aCasSrc%/../3rdparty/draco-1.4-1-mingw-64"
set "aMingwVars=c:\mingw-8.3.0-msys2\mingwvars.bat"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=1"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "toDebug=0"
rem set "BUILD_ModelingData=ON"
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"
rem set "USE_DRACO=ON"
rem set "USE_FREEIMAGE=ON"

View File

@@ -1,335 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of OCCT for WASM platform.
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
rem FreeType should be specified as mandatory dependency.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aFreeType="
set "aRapidJson="
set "aDraco="
set "aTcl="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toPack=0"
set "toDebug=0"
set "toBuildSample=0"
set "sourceMapBase="
rem OCCT Modules to build
set "BUILD_ModelingData=ON"
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
set "USE_FREETYPE=ON"
set "USE_RAPIDJSON=OFF"
set "USE_DRACO=OFF"
set "USE_PTHREADS=OFF"
rem Archive tool
set "THE_7Z_PARAMS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on"
set "THE_7Z_PATH=%ProgramW6432%\7-Zip\7z.exe"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "anOcctVerSuffix="
set "anOcctVersion=0.0.0"
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"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if errorlevel 1 (
if not ["%1"] == ["-nopause"] (
pause
)
exit /B 1
goto :eof
)
for /F "skip=1 delims=" %%F in ('
wmic PATH Win32_LocalTime GET Day^,Month^,Year /FORMAT:TABLE
') do (
for /F "tokens=1-3" %%L in ("%%F") do (
set DAY00=0%%L
set MONTH00=0%%M
set YEAR=%%N
)
)
set DAY00=%DAY00:~-2%
set MONTH00=%MONTH00:~-2%
set "aRevision=-%YEAR%-%MONTH00%-%DAY00%"
rem set "aRevision=-%aGitBranch%"
set "anArchName=occt-%anOcctVersion%%anOcctVerSuffix%%aRevision%-wasm32%aBuildTypePrefix%"
set "aTarget=%aBuildRoot%\%anArchName%"
if ["%toPack%"] == ["1"] (
echo Creating archive %anArchName%.7z
rmdir /S /Q "%aTarget%"
if not exist "%aTarget%" ( mkdir "%aTarget%" )
if exist "%aBuildRoot%/%anArchName%.7z" del "%aBuildRoot%/%anArchName%.7z"
xcopy /S /Y "%aDestDir%\*" "%aTarget%\"
if ["%toBuildSample%"] == ["1"] (
if not exist "%aTarget%\sample" ( mkdir "%aTarget%\sample" )
xcopy /S /Y "%aDestDirSmpl%\*" "%aTarget%\sample\"
)
"%THE_7Z_PATH%" a -r %THE_7Z_PARAMS% "%aBuildRoot%/%anArchName%.7z" "%aTarget%"
)
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aWorkDir=%aBuildRoot%\occt-%aPlatformAndCompiler%-make"
set "aDestDir=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aLogFile=%aBuildRoot%\occt-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDir%"
rmdir /S /Q %aDestDir%"
)
)
if not exist "%aWorkDir%" ( mkdir "%aWorkDir%" )
if exist "%aLogFile%" ( del "%aLogFile%" )
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toBuildSample%"] == ["1"] (
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDirSmpl%"
rmdir /S /Q %aDestDirSmpl%"
)
)
if not exist "%aWorkDirSmpl%" ( mkdir "%aWorkDirSmpl%" )
if exist "%aLogFileSmpl%" ( del "%aLogFileSmpl%" )
)
rem include some information about OCCT into archive
echo ^<pre^>> "%aWorkDir%\VERSION.html"
git status >> "%aWorkDir%\VERSION.html"
git log -n 100 >> "%aWorkDir%\VERSION.html"
echo ^</pre^>>> "%aWorkDir%\VERSION.html"
echo Start building OCCT for %aPlatformAndCompiler%
echo Start building OCCT for %aPlatformAndCompiler%>> %aLogFile%
echo --->> %aLogFile%
call emcc --version >> %aLogFile%
echo --->> %aLogFile%
pushd "%aWorkDir%"
set "aTimeZERO=%TIME%"
if ["%toCMake%"] == ["1"] (
echo Configuring OCCT for WASM...
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D BUILD_LIBRARY_TYPE:STRING="Static" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D INSTALL_DIR:PATH="%aDestDir%" ^
-D INSTALL_DIR_INCLUDE:STRING="inc" ^
-D INSTALL_DIR_RESOURCE:STRING="src" ^
-D BUILD_MODULE_FoundationClasses:BOOL="ON" ^
-D BUILD_MODULE_ModelingData:BOOL="%BUILD_ModelingData%" ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL="%BUILD_ModelingAlgorithms%" ^
-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%" ^
-D 3RDPARTY_FREETYPE_DIR:PATH="%aFreeType%" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="%aFreeType%/include" ^
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="%aFreeType%/include" ^
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
-D USE_DRACO:BOOL="%USE_DRACO%" ^
-D 3RDPARTY_DRACO_DIR:PATH="%aDraco%" ^
-D 3RDPARTY_DRACO_INCLUDE_DIR:FILEPATH="%aDraco%/include" ^
-D 3RDPARTY_DRACO_LIBRARY_DIR:PATH="%aDraco%/lib" ^
-D 3RDPARTY_DRACO_LIBRARY:FILEPATH="%aDraco%/lib/libdraco.a" ^
-D USE_TK:BOOL="OFF" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTcl%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:PATH="%aTcl%/include" ^
-D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTcl%/lib" ^
-D 3RDPARTY_TCL_LIBRARY:FILEPATH="%aTcl%/lib/libtcl.a" ^
"%aCasSrc%"
if errorlevel 1 (
popd
exit /B 1
goto :eof
)
)
set "aTimeGEN=%TIME%"
call :computeDuration %aTimeZERO% %aTimeGEN%
if ["%toCMake%"] == ["1"] (
echo Generation time: %DURATION%
echo Generation time: %DURATION%>> "%aLogFile%"
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFile%"
if errorlevel 1 (
type "%aLogFile%"
popd
exit /B 1
goto :eof
)
type "%aLogFile%"
)
set "aTimeBUILD=%TIME%"
call :computeDuration %aTimeGEN% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Building time: %DURATION%
echo Building time: %DURATION%>> "%aLogFile%"
)
call :computeDuration %aTimeZERO% %aTimeBUILD%
if ["%toMake%"] == ["1"] (
echo Total building time: %DURATION%
echo Total building time: %DURATION%>> "%aLogFile%"
)
if ["%toInstall%"] == ["1"] (
echo Installing into %aDestDir%...
mingw32-make install 2>> "%aLogFile%"
copy /Y "%aWorkDir%\VERSION.html" "%aDestDir%\VERSION.html"
)
set "aTimeINSTALL=%TIME%"
call :computeDuration "%aTimeBUILD%" "%aTimeINSTALL%"
if ["%toInstall%"] == ["1"] (
echo Install time: %DURATION%
echo Install time: %DURATION%>> "%aLogFile%"
)
call :computeDuration "%aTimeZERO%" "%aTimeINSTALL%"
echo Total time: %DURATION%
echo Total time: %DURATION%>> "%aLogFile%"
popd
if ["%toBuildSample%"] == ["0"] (
goto :eof
)
pushd "%aWorkDirSmpl%"
if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDir%/lib/cmake/opencascade" ^
-D freetype_DIR:PATH="%aFreeType%/lib/cmake/freetype" ^
"%aSrcRootSmpl%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
type "%aLogFileSmpl%"
)
if ["%toInstall%"] == ["1"] (
mingw32-make install 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
)
popd
goto :eof
:computeDuration
set "aTimeFrom=%~1"
set "aTimeEnd=%~2"
rem handle time before 10AM (win10 - remove empty space at the beginning)
if "%aTimeFrom:~0,1%"==" " set "aTimeFrom=%aTimeFrom:~1%"
if "%aTimeEnd:~0,1%"==" " set "aTimeEnd=%aTimeEnd:~1%"
rem handle time before 10AM (win7 - add 0 at the beginning)
if "%aTimeFrom:~1,1%"==":" set "aTimeFrom=0%aTimeFrom%"
if "%aTimeEnd:~1,1%"==":" set "aTimeEnd=0%aTimeEnd%"
rem convert hours:minutes:seconds:ms into duration
set /A aTimeFrom=(1%aTimeFrom:~0,2%-100)*360000 + (1%aTimeFrom:~3,2%-100)*6000 + (1%aTimeFrom:~6,2%-100)*100 + (1%aTimeFrom:~9,2%-100)
set /A aTimeEnd= (1%aTimeEnd:~0,2%-100)*360000 + (1%aTimeEnd:~3,2%-100)*6000 + (1%aTimeEnd:~6,2%-100)*100 + (1%aTimeEnd:~9,2%-100)
set /A aDurTotalSec=%aTimeEnd%-%aTimeFrom%
if %aTimeEnd% LSS %aTimeFrom% set set /A aDurTotalSec=%aTimeFrom%-%aTimeEnd%
set /A aDurHH=%aDurTotalSec% / 360000
set /A aDurMM=(%aDurTotalSec% - %aDurHH%*360000) / 6000
set /A aDurSS=(%aDurTotalSec% - %aDurHH%*360000 - %aDurMM%*6000) / 100
if %aDurHH% LSS 10 set aDurHH=0%aDurHH%
if %aDurMM% LSS 10 set aDurMM=0%aDurMM%
if %aDurSS% LSS 10 set aDurSS=0%aDurSS%
set "DURATION=%aDurHH%:%aDurMM%:%aDurSS%"
goto :eof

View File

@@ -1,129 +0,0 @@
#!/bin/bash
# Auxiliary script for semi-automated building of OCCT for WASM platform.
# wasm_custom.sh should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
# FreeType should be specified as mandatory dependency.
export aScriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export aSrcRoot="${aScriptDir}/../.."
export aBuildRoot=work
export aNbJobs=${NUMBER_OF_PROCESSORS}
export toCMake=1
export toClean=0
export toMake=1
export toInstall=1
export BUILD_ModelingData=ON
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"
fi
. "${EMSDK_ROOT}/emsdk_env.sh"
export aToolchain="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
export aGitBranch=`git symbolic-ref --short HEAD`
echo "Compilation OCCT branch : $aGitBranch"
export aPlatformAndCompiler=wasm
export aWorkDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}-make"
if [ ! -d "${aWorkDir}" ]; then
mkdir -p "${aWorkDir}"
fi
export aDestDir="${aSrcRoot}/${aBuildRoot}/${aPlatformAndCompiler}"
if [ ! -d "${aDestDir}" ]; then
mkdir -p "${aDestDir}"
fi
export aLogFile="${aSrcRoot}/${aBuildRoot}/build-${aPlatformAndCompiler}.log"
if [ -f "${aLogFile}" ]; then
rm "${aLogFile}"
fi
echo Start building OCCT for ${aPlatformAndCompiler}
echo Start building OCCT for ${aPlatformAndCompiler}>> "${aLogFile}"
pushd "${aWorkDir}"
pwd
echo toCMake=${toCMake}
if [ "${toCMake}" = "1" ]; then
echo "Configuring OCCT for WASM..."
echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-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}"
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DBUILD_LIBRARY_TYPE:STRING="Static" \
-DINSTALL_DIR:PATH="${aDestDir}" \
-DINSTALL_DIR_INCLUDE:STRING="inc" \
-DINSTALL_DIR_RESOURCE:STRING="src" \
-D3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-DBUILD_MODULE_FoundationClasses:BOOL="ON" \
-DBUILD_MODULE_ModelingData:BOOL="${BUILD_ModelingData}" \
-DBUILD_MODULE_ModelingAlgorithms:BOOL="${BUILD_ModelingAlgorithms}" \
-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}"
if [ $? -ne 0 ]; then
echo "Problem during configuration"
popd
exit 1
fi
fi
if [ "${toClean}" = "1" ]; then
make clean
fi
if [ "${toMake}" = "1" ]; then
echo Building...
make -j ${aNbJobs} 2>> "${aLogFile}"
if [ $? -ne 0 ]; then
echo "Problem during make operation"
popd
exit 1
fi
echo "${aLogFile}"
fi
if [ "${toInstall}" = "1" ]; then
echo Installing into ${aDestDir}
make install 2>> "${aLogFile}"
fi
popd

View File

@@ -1,30 +0,0 @@
rem Environment configuration template for wasm_build.bat (to be renamed as wasm_custom.bat)
set "EMSDK_ROOT=%aCasSrc%\..\emsdk"
set "aFreeType=%aCasSrc%\..\3rdparty\freetype-2.7.1-wasm32"
rem set "aRapidJson=%aCasSrc%\..\3rdparty\rapidjson-1.1.0"
rem set "aDraco=%aCasSrc%\..\3rdparty\draco-1.4.1-wasm32"
rem set "aCmakeBin=%ProgramW6432%\CMake\bin"
rem Uncomment to customize building steps
rem set "aBuildRoot=work"
rem set "toCMake=1"
rem set "toClean=1"
rem set "toMake=1"
rem set "toInstall=1"
rem set "toPack=1"
rem set "toDebug=1"
rem set "toBuildSample=1"
rem Source map base (should point to server where C++ sources will be copied)
rem enables -g4 debug building option for WebGL sample and allows navigating C++ source code within JavaScript debugger.
rem set "sourceMapBase=http://localhost:9090/"
rem set "BUILD_ModelingData=ON"
rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_DETools=OFF"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"
rem set "USE_PTHREADS=ON"

View File

@@ -1,17 +0,0 @@
# environment configuration template for occ_build_wasm.sh (to be renamed as wasm_custom_env.sh)
export aFreeType="$aSrcRoot/../3rdparty/freetype-2.7.1-wasm"
export EMSDK_ROOT="$aSrcRoot/../emsdk"
# Uncomment to customize building steps
#export aBuildRoot=work
#export toCMake=1
#export toClean=0
#export toMake=1
#export toInstall=1
#export BUILD_ModelingData=ON
#export BUILD_ModelingAlgorithms=ON
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF

View File

@@ -1,117 +0,0 @@
@echo OFF
rem Auxiliary script for semi-automated building of WebGL sample.
rem wasm_custom.bat should be configured with paths to CMake, 3rd-parties and Emscripten SDK.
rem FreeType should be specified as mandatory dependency.
set "aCasSrc=%~dp0..\.."
set "aBuildRoot=%aCasSrc%\work"
set aNbJobs=%NUMBER_OF_PROCESSORS%
rem Paths to 3rd-party tools and libraries
set "aCmakeBin="
set "aFreeType="
rem Build stages to perform
set "toCMake=1"
set "toClean=0"
set "toMake=1"
set "toInstall=1"
set "toDebug=0"
set "sourceMapBase="
set "USE_PTHREADS=OFF"
rem Configuration file
if exist "%~dp0wasm_custom.bat" call "%~dp0wasm_custom.bat"
call "%EMSDK_ROOT%\emsdk_env.bat"
set "aToolchain=%EMSDK%/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
if not ["%aCmakeBin%"] == [""] ( set "PATH=%aCmakeBin%;%PATH%" )
set "aBuildType=Release"
set "aBuildTypePrefix="
set "anExtraCxxFlags="
if /I ["%USE_PTHREADS%"] == ["ON"] (
set "anExtraCxxFlags=-pthread"
set "aBuildTypePrefix=%aBuildTypePrefix%-pthread"
)
if ["%toDebug%"] == ["1"] (
set "aBuildType=Debug"
set "aBuildTypePrefix=%aBuildTypePrefix%-debug"
)
call :cmakeGenerate
if not ["%1"] == ["-nopause"] (
pause
)
goto :eof
:cmakeGenerate
set "aPlatformAndCompiler=wasm32%aBuildTypePrefix%"
set "aDestDirOcct=%aBuildRoot%\occt-%aPlatformAndCompiler%"
set "aSrcRootSmpl=%aCasSrc%\samples\webgl"
set "aWorkDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-make"
set "aDestDirSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%"
set "aLogFileSmpl=%aBuildRoot%\sample-%aPlatformAndCompiler%-build.log"
if ["%toCMake%"] == ["1"] (
if ["%toClean%"] == ["1"] (
rmdir /S /Q %aWorkDirSmpl%"
rmdir /S /Q %aDestDirSmpl%"
)
)
if not exist "%aWorkDirSmpl%" ( mkdir "%aWorkDirSmpl%" )
if exist "%aLogFileSmpl%" ( del "%aLogFileSmpl%" )
pushd "%aWorkDirSmpl%"
if ["%toCMake%"] == ["1"] (
cmake -G "MinGW Makefiles" ^
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="%aToolchain%" ^
-D CMAKE_BUILD_TYPE:STRING="%aBuildType%" ^
-D CMAKE_CXX_FLAGS="%anExtraCxxFlags%" ^
-D CMAKE_INSTALL_PREFIX:PATH="%aDestDirSmpl%" ^
-D SOURCE_MAP_BASE:STRING="%sourceMapBase%" ^
-D OpenCASCADE_DIR:PATH="%aDestDirOcct%/lib/cmake/opencascade" ^
-D freetype_DIR:PATH="%aFreeType%/lib/cmake/freetype" ^
"%aSrcRootSmpl%"
if errorlevel 1 (
popd
pause
exit /B
goto :eof
)
)
if ["%toClean%"] == ["1"] (
mingw32-make clean
)
if ["%toMake%"] == ["1"] (
echo Building...
mingw32-make -j %aNbJobs% 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
type "%aLogFileSmpl%"
)
if ["%toInstall%"] == ["1"] (
mingw32-make install 2>> "%aLogFileSmpl%"
if errorlevel 1 (
type "%aLogFileSmpl%"
popd
pause
exit /B
goto :eof
)
)
popd
goto :eof

31
adm/svgdiff.bat Normal file
View File

@@ -0,0 +1,31 @@
@echo off
rem Script to diff SVG images visually (as PNG) in TortoiseGit client
rem
rem It assumes that Inkscape and TortoiseGitIDiff executables are either
rem installed in default locations in Program Files, or are accessible by PATH
rem
rem To use this script for diffing SVG images, open TortoiseGit settings
rem (Start -> Programs -> TortoiseGit -> Settings), select "Diff Viewer",
rem click button "Advanced..." on the right tab and then add new record:
rem - Extension: .svg
rem - External program: <path to OCCT>\adm\svgdiff.bat %base %mine %bname %yname
rem Remove double quotes around arguments
set "f1=%1"
set "f2=%2"
set "f1=%f1:~1,-1%.png"
set "f2=%f2:~1,-1%.png"
rem Check if Inkscape and TortoiseGit are installed in default locations in
rem ProgramFiles; if not, assume they still may be accessible by PATH
set "inkscape=%ProgramFiles%\Inkscape\inkscape.exe"
if not exist "%inkscape%" set inkscape=inkscape.exe
set "tgitidiff=%ProgramFiles%\TortoiseGit\bin\TortoiseGitIDiff.exe"
if not exist "%tgitidiff%" set tgitidiff=TortoiseGitIDiff.exe
rem Convert SVG to PNG using Inkscape
"%inkscape%" -e "%f1%" %1
"%inkscape%" -e "%f2%" %2
rem Call Tortoise differ
"%tgitidiff%" /left:"%f1%" /right:"%f2%" /lefttitle:%3 /righttitle:%4

View File

@@ -21,7 +21,6 @@ set (OpenCASCADE_DEVELOPMENT_VERSION "@OCC_VERSION_DEVELOPMENT@")
# This is made to support different locations of CMake files: # This is made to support different locations of CMake files:
# - in UNIX style: $INSTALL_DIR/lib/cmake/opencascade-<version> # - in UNIX style: $INSTALL_DIR/lib/cmake/opencascade-<version>
# - in Windows style: $INSTALL_DIR/cmake # - in Windows style: $INSTALL_DIR/cmake
# - in Android style: $INSTALL_DIR/libs/$CMAKE_ANDROID_ARCH_ABI/cmake/opencascade-<version>
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component (OpenCASCADE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH) get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$") if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$")
@@ -30,10 +29,6 @@ endif()
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$") if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$")
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH) get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif() endif()
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$")
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif()
# Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data # Set OpenCASCADE paths to headers, binaries, libraries, resources, tests, samples, data
set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_BIN@") set (OpenCASCADE_BINARY_DIR "${OpenCASCADE_INSTALL_PREFIX}/@INSTALL_DIR_BIN@")

View File

@@ -1,40 +0,0 @@
@echo off
setlocal
rem Setup environment
call "%~dp0env.bat" %1 %2 %3
rem Define path to project file
set "PRJFILE=%~dp0OCCT.sln"
if "%VCVER%" == "vc8" (
call "%VS80COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc9" (
call "%VS90COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc10" (
call "%VS100COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc11" (
call "%VS110COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc12" (
call "%VS120COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc14" (
call "%VS140COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc141" (
call "%VS141COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc142" (
call "%VS142COMNTOOLS%/vsvars32.bat" > nul
) else if "%VCVER%" == "vc143" (
call "%VS143COMNTOOLS%/vsvars32.bat" > nul
) else (
echo Error: wrong VS identifier
exit /B
)
set BUILDCONFIG=Release
if "%CASDEB%"=="i" set BUILDCONFIG=RelWithDebInfo
if "%CASDEB%"=="d" set BUILDCONFIG=Debug
if "%ARCH%"=="32" set PLATFORM=win32
if "%ARCH%"=="64" set PLATFORM=x64
msbuild "%PRJFILE%" /m /fl /flp:LogFile="build_%BUILDCONFIG%.log" /p:Configuration=%BUILDCONFIG% /p:Platform=%PLATFORM% /p:BuildProjectReferences=false
endlocal

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