Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 140236c774 | |||
| cc3d7dfbf0 | |||
| 112c15ed75 | |||
| a08b04a079 | |||
| 811bf87d0e | |||
| 93c3ef7b2f | |||
| ad94f88217 | |||
| c2f7d03413 | |||
| f2b2c8b4e7 | |||
| f9688fbde7 | |||
| 51621458b5 | |||
| c25ed7e162 | |||
| 2a4335302f | |||
| 69ed88ac2c | |||
| 1f946e6c9a | |||
| ac76ba280d | |||
| ceab748ba1 | |||
| e1232a5e6e | |||
| 5cc0693e61 | |||
| 387b19eed9 | |||
| 18ff9bcf26 | |||
| 5da8804871 | |||
| dbeb4d2f5d | |||
| d2d0b7f018 | |||
| c28d5659a0 | |||
| 812c1e0f56 | |||
| 99f719e81c | |||
| da58eb2681 | |||
| c084eef7a3 | |||
| 24036a8046 | |||
| db8729ec74 | |||
| 015d6396ff | |||
| 6df100f5b7 | |||
| 7cb9ba470c | |||
| 1e6f84a59c | |||
| 2292eecb4e | |||
| 5fc5203ff7 | |||
| e8547f7588 | |||
| eade03c006 | |||
| cef5e6f4ab | |||
| 9331c0d939 | |||
| decc354b80 | |||
| f24c64c96c | |||
| 689f6595fb | |||
| 3a2e799300 | |||
| c643e5e340 | |||
| 8ee6153f4b | |||
| bf38d42f15 | |||
| 6fa8bba4fd | |||
| 33c85ba1f2 | |||
| 9f200d4404 | |||
| 50f6650fac | |||
| 5db5fc3886 | |||
| 28ca0cf7b1 | |||
| b470cfeaf1 | |||
| 352678f4e2 | |||
| f87ed0c454 | |||
| c42a4cb21c | |||
| f638619964 | |||
| 8dc3b71989 | |||
| 4984bd9f05 | |||
| 27c893f71f | |||
| 6c51bebf14 | |||
| 32d45ac97d | |||
| a46cc55da1 | |||
| d11bec9688 | |||
| 0069419c8b | |||
| b06c0ccd86 | |||
| c85023415a | |||
| db858e1f0a | |||
| 010a632e5d | |||
| 9d7793ecb9 | |||
| 418ebb7958 | |||
| e30f7bf920 | |||
| 1b26292d3c | |||
| 0afcf099df | |||
| 691c0709be | |||
| 05d35e1e6f | |||
| 1edab5611b | |||
| e5beb5ab2b | |||
| c67d9b0ee9 | |||
| 6ce250ddf8 | |||
| 75acf045a6 | |||
| 2a254e937f | |||
| 444de2c8af | |||
| fd60f29965 | |||
| 217c8630f6 | |||
| dc48c5debd | |||
| a8606ce05c | |||
| adbe29f1dc | |||
| 3b09334501 | |||
| e909322fb9 | |||
| a304bcc59a | |||
| 83d0fa6730 | |||
| 9d54041102 |
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"phabricator.uri" : "http://pha.geofinder.eu/"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
version: 2
|
||||
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/test
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
command: docker pull condaforge/linux-anvil
|
||||
- run:
|
||||
# Run, test and (if we have a BINSTAR_TOKEN) upload the distributions.
|
||||
command: ./package/conda/run_docker_build.sh
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build_and_test:
|
||||
jobs:
|
||||
- build
|
||||
+9
-11
@@ -4,21 +4,21 @@ AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignOperands: DontAlign
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
AfterStruct: true
|
||||
AfterControlStatement: Never
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
@@ -31,7 +31,7 @@ BraceWrapping:
|
||||
SplitEmptyRecord: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakInheritanceList: BeforeColon
|
||||
ColumnLimit: 100
|
||||
CompactNamespaces: false
|
||||
@@ -39,15 +39,13 @@ ContinuationIndentWidth: 4
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
InsertBraces: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
ReflowComments: false
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
---
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,boost-*,bugprone-*,
|
||||
performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*,
|
||||
concurrency-*,-modernize-use-trailing-return-type, -modernize-use-nodiscard,
|
||||
-readability-redundant-access-specifiers,-readability-qualified-auto'
|
||||
concurrency-*,-modernize-use-trailing-return-type, -modernize-use-nodiscard'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
AnalyzeTemporaryDtors: false
|
||||
|
||||
@@ -56,20 +56,3 @@ b13088664fea77e6ac4779dddfdea7aac3c50b30
|
||||
bedf9207023d6d594f2c03d2a8d799b34759a8fb
|
||||
132a1d7e55eadd0cb5a09760d471780eb5bd9340
|
||||
3ef438eaf03f840958a2f7a9ec585a3d2728e447
|
||||
c726b69d7ede5b1af82407c515e14375f3358be3
|
||||
390e09db3258e4807a3d4b2993c1723480ae5350
|
||||
57d0c2000ae29d3160e0aa908ed1e027b321e36a
|
||||
b389f6e602eb42c07c21f37fbcd451e28dd9fbc4
|
||||
48365a1df5286c7a5608cd3a5cce0def5e4d5380
|
||||
dc5b3cb495002951c3a36c928c55108b0999bc3e
|
||||
875f9eaad6a59abd70775c0b67a7f10d92128a5a
|
||||
7a8a453746a8e4a845219948591fd17f4494a067
|
||||
8b31d7deb09077bc0cce0ecf6de02c94db262a67
|
||||
4a7e1b6d9b12df211cf6fbec61cc8544e4c6bf9d
|
||||
129d5882a729327a72b57ec695bb376e84205bd0
|
||||
2ae7cc4a94c1ab1dfc0264367c5da4716ea02bfe
|
||||
987b4bda2ac8570969dc07fa887bda420f77e441
|
||||
ec899d75c6abf45d7ee4dd91ea0f8141a9818446
|
||||
233a337ca5d693e4773fecf1de14325752afd658
|
||||
9271b6d433578f65df9b469131ece4e4bdbb19aa
|
||||
2637527e3a4e132506e8c074b752721d66ae146a
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#git archive --worktree-attributes --prefix=freecad-0.13/ --output=freecad.tar.gz HEAD
|
||||
acinclude.m4 export-ignore
|
||||
autogen.sh export-ignore
|
||||
build.sh export-ignore
|
||||
BuildAll.bat export-ignore
|
||||
BuildRelease.ini export-ignore
|
||||
BuildRelease.py export-ignore
|
||||
configure.ac export-ignore
|
||||
Makefile.am export-ignore
|
||||
mkinstalldirs export-ignore
|
||||
package export-ignore
|
||||
fc.sh export-ignore
|
||||
UpdateResources.bat export-ignore
|
||||
BuildVersion.bat export-ignore
|
||||
*.sln export-ignore
|
||||
WindowsInstaller export-ignore
|
||||
JtReader export-ignore
|
||||
mefisto.patch export-ignore
|
||||
Version.h.in export-subst
|
||||
|
||||
+1
-1
@@ -9,4 +9,4 @@ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: ["https://wiki.freecad.org/Donate"]
|
||||
custom: ["https://wiki.freecadweb.org/Donate"]
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
name: Request a Backport
|
||||
description: Suggest that a commit from the main development branch be backported to the next point release
|
||||
title: "[Backport] "
|
||||
labels: ["needs triage", "backport"]
|
||||
body:
|
||||
- type: input
|
||||
id: pull_request
|
||||
attributes:
|
||||
label: Original PR
|
||||
description: A link to the PR that contains the commits to be backported
|
||||
placeholder: https://github.com/FreeCAD/FreeCAD/pulls/1234
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description and Justification
|
||||
description: Why should this PR (or individual commit) be backported?
|
||||
placeholder: Please explain why this PR or commit should be backported to the next point release.
|
||||
@@ -0,0 +1,93 @@
|
||||
name: 🐛 Report a Bug
|
||||
description: File a bug report
|
||||
title: "[Bug] <title>"
|
||||
labels: ["🐛 bug", "needs triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for taking the time to file a bug report! Please make sure you've posted about your issue in the FreeCAD Forums before submitting here.
|
||||
- type: checkboxes
|
||||
id: existing_issue
|
||||
attributes:
|
||||
label: Is there an existing issue for this?
|
||||
description: Please search to see if an issue already exists for the bug you encountered.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: input
|
||||
id: forum_link
|
||||
attributes:
|
||||
label: Forums discussion
|
||||
description: |
|
||||
Please start a discussion about your issue at [the FreeCAD Forum](https://forum.freecad.org) and wait for confirmation there before creating an issue.
|
||||
**Note:** Bug reports without a prior forum discussion will most likely not be accepted.
|
||||
placeholder: Paste link to forum discussion here
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version of FreeCAD are you running?
|
||||
options:
|
||||
- 0.20 (Release)
|
||||
- 0.21 (Development)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: full_version
|
||||
attributes:
|
||||
label: Full version info
|
||||
description: Please use the About FreeCAD dialog to copy your full version information and paste it here.
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: wb
|
||||
attributes:
|
||||
label: Subproject(s) affected?
|
||||
options:
|
||||
- Addon Manager
|
||||
- Arch
|
||||
- Core
|
||||
- Draft
|
||||
- Expressions
|
||||
- FEM
|
||||
- File formats
|
||||
- GCS
|
||||
- OpenSCAD
|
||||
- Part
|
||||
- PartDesign
|
||||
- Path
|
||||
- Project Tools & Websites
|
||||
- Sketcher
|
||||
- Spreadsheet
|
||||
- Techdraw
|
||||
- Other (specify in description)
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Issue description
|
||||
description: Please include as much detail as possible so that testers can reproduce the bug
|
||||
placeholder: Description of the problem
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: anything_else
|
||||
attributes:
|
||||
label: Anything else?
|
||||
description: |
|
||||
Links? References? Anything that will give us more context about the issue you are encountering!
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. To attach a FCStd file, ZIP it first (GitHub won't recognize the extension otherwise).
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/FreeCAD/FreeCAD/blob/master/CODE_OF_CONDUCT.md)
|
||||
options:
|
||||
- label: I agree to follow this project's Code of Conduct
|
||||
required: true
|
||||
@@ -0,0 +1,73 @@
|
||||
name: 🌱 Feature Request
|
||||
description: Submit an idea for a new feature
|
||||
title: "[Feature Request] <title>"
|
||||
labels: ["feature", "needs triage"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for taking the time to request a feature! Please make sure you've posted about your idea in the FreeCAD Forums before submitting here.
|
||||
- type: checkboxes
|
||||
id: existing_issue
|
||||
attributes:
|
||||
label: Is there an existing request for this?
|
||||
description: Please search to see if a request already exists for your suggestion
|
||||
options:
|
||||
- label: I have searched the existing requests
|
||||
required: true
|
||||
- type: input
|
||||
id: forum_link
|
||||
attributes:
|
||||
label: Forums discussion
|
||||
description: Please start a discussion about your idea at [the FreeCAD Forum](https://forum.freecad.org) and wait for confirmation there before creating a request.
|
||||
placeholder: Paste link to forum discussion here
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: wb
|
||||
attributes:
|
||||
label: Subproject(s) affected?
|
||||
options:
|
||||
- Addon Manager
|
||||
- Arch
|
||||
- Core
|
||||
- Draft
|
||||
- Expressions
|
||||
- FEM
|
||||
- File formats
|
||||
- GCS
|
||||
- OpenSCAD
|
||||
- Part
|
||||
- PartDesign
|
||||
- Path
|
||||
- Project Tools & Websites
|
||||
- Sketcher
|
||||
- Spreadsheet
|
||||
- Techdraw
|
||||
- Other (specify in description)
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Idea description
|
||||
description: Please include as much detail as possible so that developers understand the request
|
||||
placeholder: Description of the feature
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: anything_else
|
||||
attributes:
|
||||
label: Anything else?
|
||||
description: |
|
||||
Links? References? Anything that will give us more context about your idea.
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. To attach a FCStd file, ZIP it first (GitHub won't recognize the extension otherwise).
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/FreeCAD/FreeCAD/blob/master/CODE_OF_CONDUCT.md)
|
||||
options:
|
||||
- label: I agree to follow this project's Code of Conduct
|
||||
required: true
|
||||
@@ -1,80 +0,0 @@
|
||||
name: Report a Problem
|
||||
description: File an problem report
|
||||
title: "[Problem] "
|
||||
labels: ["needs triage"]
|
||||
body:
|
||||
- type: checkboxes
|
||||
id: existing_issue
|
||||
attributes:
|
||||
label: Is there an existing issue for this?
|
||||
description: Please search to see if an issue already exists for the problem you encountered.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: What version of FreeCAD are you running?
|
||||
options:
|
||||
- 0.20 (Release)
|
||||
- 0.21 (Development)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: full_version
|
||||
attributes:
|
||||
label: Full version info
|
||||
description: Please use the About FreeCAD dialog to copy your full version information and paste it here.
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: wb
|
||||
attributes:
|
||||
label: Subproject(s) affected?
|
||||
options:
|
||||
- Addon Manager
|
||||
- Arch
|
||||
- Core
|
||||
- Draft
|
||||
- Expressions
|
||||
- FEM
|
||||
- File formats
|
||||
- GCS
|
||||
- OpenSCAD
|
||||
- Part
|
||||
- PartDesign
|
||||
- Path
|
||||
- Project Tools & Websites
|
||||
- Sketcher
|
||||
- Spreadsheet
|
||||
- Techdraw
|
||||
- Other (specify in description)
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Problem description
|
||||
description: Describe the problem and how it impacts user experience, workflow, maintainability or speed of the code. If the problem appears to be a bug with the current functionality, provide as test case or recipe that reproduces the error.
|
||||
placeholder: Description of the problem
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: anything_else
|
||||
attributes:
|
||||
label: Anything else?
|
||||
description: |
|
||||
Links? References? Anything that will give us more context about the issue you are encountering!
|
||||
If there is a discussion about the problem on the forum, provide link(s) here.
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. To attach a FCStd file, ZIP it first (GitHub won't recognize the extension otherwise).
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/FreeCAD/FreeCAD/blob/master/CODE_OF_CONDUCT.md)
|
||||
options:
|
||||
- label: I agree to follow this project's Code of Conduct
|
||||
required: true
|
||||
@@ -2,4 +2,4 @@ blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 💬 START HERE -- FreeCAD Forum
|
||||
url: https://forum.freecad.org/
|
||||
about: You are encouraged to discuss the problem you are seeing on the FreeCAD Forums before opening an issue on GitHub
|
||||
about: Please start a topic at the forums first and wait for others to confirm your issue before creating a bug report on GitHub
|
||||
@@ -1,8 +1,14 @@
|
||||
Thank you for creating a pull request to contribute to FreeCAD! Place an "X" in between the brackets below to "check off" to confirm that you have satisfied the requirement, or ask for help in the [FreeCAD forum](https://forum.freecadweb.org/viewforum.php?f=10) if there is something you don't understand.
|
||||
Thank you for creating a pull request to contribute to FreeCAD! To ease integration, we ask you to conform to the following items. Pull requests which don't satisfy all the items below might be rejected. If you are in doubt with any of the items below, don't hesitate to ask for help in the [FreeCAD forum](https://forum.freecadweb.org/viewforum.php?f=10)!
|
||||
|
||||
- [ ] Your Pull Request meets the requirements outlined in section 5 of [CONTRIBUTING.md](https://github.com/FreeCAD/FreeCAD/blob/master/CONTRIBUTING.md) for a Valid PR
|
||||
- [ ] Your pull request is confined strictly to a single module. That is, all the files changed by your pull request are either in `App`, `Base`, `Gui` or one of the `Mod` subfolders. If you need to make changes in several locations, make several pull requests and wait for the first one to be merged before submitting the next ones
|
||||
- [ ] In case your pull request does more than just fixing small bugs, make sure you discussed your ideas with other developers on the FreeCAD forum
|
||||
- [ ] Your branch is [rebased](https://git-scm.com/docs/git-rebase) on latest master `git pull --rebase upstream master`
|
||||
- [ ] All FreeCAD unit tests are confirmed to pass by running `./bin/FreeCAD --run-test 0`
|
||||
- [ ] All commit messages are [well-written](https://chris.beams.io/posts/git-commit/) ex: `Fixes typo in Draft Move command text`
|
||||
- [ ] Your pull request is well written and has a good description, and its title starts with the module name, ex: `Draft: Fixed typos`
|
||||
- [ ] Commit messages include `issue #<id>` or `fixes #<id>` where `<id>` is the issue ID number from our [Issues database](https://github.com/FreeCAD/FreeCAD/issues) in case a particular commit solves or is related to an existing issue. Ex: `Draft: fix typos - fixes #4805`
|
||||
|
||||
Please remember to update the Wiki with the features added or changed once this PR is merged.
|
||||
And please remember to update the Wiki with the features added or changed once this PR is merged.
|
||||
**Note**: If you don't have wiki access, then please mention your contribution on the [1.0 Changelog Forum Thread](https://forum.freecad.org/viewtopic.php?f=10&t=69438).
|
||||
|
||||
---
|
||||
|
||||
@@ -7,7 +7,6 @@ alocation
|
||||
anid
|
||||
anormal
|
||||
apoints
|
||||
aply
|
||||
appy
|
||||
ba
|
||||
beginn
|
||||
@@ -33,7 +32,6 @@ froms
|
||||
hist
|
||||
indicies
|
||||
inout
|
||||
isnt
|
||||
ist
|
||||
itsel
|
||||
lod
|
||||
@@ -72,6 +70,5 @@ uptodate
|
||||
usind
|
||||
vas
|
||||
vertexes
|
||||
vew
|
||||
wallthickness
|
||||
zuser
|
||||
+1
-1
@@ -31,7 +31,7 @@ WB MeshPart:
|
||||
WB OpenSCAD:
|
||||
- 'src/Mod/OpenSCAD/**/*'
|
||||
|
||||
WB Part:
|
||||
WB Part:
|
||||
- 'src/Mod/Part/**/*'
|
||||
|
||||
WB PartDesign:
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This workflow is a complementary one to the master CI.
|
||||
# It aims at doing cleanup operations after a CI workflow ran.
|
||||
# Being triggered when the master workflow ends allows it to run with necessary privileges.
|
||||
# Indeed it always run with push-like rights even for PR events.
|
||||
|
||||
# In order to work, this cleanup workflow imposes name formatting for caches
|
||||
# Caches that have to be cleaned (typically compiler caches) shall be named as below :
|
||||
# ${MARK}-${CONTEXT}-${REF}-${ID}
|
||||
# with :
|
||||
# ${MARK} => A mark identifying a cache to be cleaned, defined as being "FC" (without quotes)
|
||||
# ${CONTEXT} => A string identifying cache saving context, typically OS name or compiler name
|
||||
# ${REF} => The full reference of the branch owning the cache (starting with "/refs/pull/" or "/refs/heads/")
|
||||
# ${ID} => A cache unique identifier, generally an ascending number, in no case containing a '-' (hyphen) sign
|
||||
|
||||
name: FreeCAD CI cleaner
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [FreeCAD master CI]
|
||||
types:
|
||||
- completed
|
||||
|
||||
env:
|
||||
dryrun: false
|
||||
|
||||
concurrency:
|
||||
group: FC-CI-cleaner
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
|
||||
CachesCleanup:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
logdir: /tmp/log/
|
||||
steps:
|
||||
- name: Make needed directories
|
||||
run: |
|
||||
mkdir -p ${{ env.logdir }}
|
||||
- name: Get existing caches for the repo
|
||||
run: |
|
||||
curl -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches > ${{ env.logdir }}caches.json
|
||||
- name: Extract pull request caches
|
||||
run: |
|
||||
# Extract caches of which names starts with MARK and contains "/refs/pull/"
|
||||
jq ".actions_caches | map(select(.key | startswith(\"FC-\"))) | map(select(.key | contains(\"refs/pull/\")))" ${{ env.logdir }}caches.json > ${{ env.logdir }}pulls.json
|
||||
- name: Extract and delete pull request obsolete cache IDs
|
||||
run: |
|
||||
# Group the caches by MARK-CONTEXT-REF, sort by ascending last access datetime and keep all but the last as to be deleted
|
||||
# As a consequence, for pull requests, only the most recent cache is kept (one for each context and for each PR)
|
||||
PRID=$(jq "group_by(.key | .[:rindex(\"-\")]) | .[] | sort_by(.last_accessed_at) | .[:-1][].id" ${{ env.logdir }}pulls.json)
|
||||
for id in $PRID
|
||||
do
|
||||
echo "Trying to delete pull request obsolete cache ID : $id"
|
||||
if [ ${{ env.dryrun }} == "false" ]
|
||||
then
|
||||
curl -X DELETE -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id
|
||||
else
|
||||
echo "DRYRUN: executing : curl -X DELETE -H \"Accept: application/vnd.github+json\" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id"
|
||||
fi
|
||||
done
|
||||
- name: Extract push caches
|
||||
run: |
|
||||
# Extract caches of which names starts with MARK and contains "/refs/heads/"
|
||||
jq ".actions_caches | map(select(.key | startswith(\"FC-\"))) | map(select(.key | contains(\"refs/heads/\")))" ${{ env.logdir }}caches.json > ${{ env.logdir }}pushes.json
|
||||
- name: Extract and delete push obsolete cache IDs
|
||||
run: |
|
||||
# Group the caches by MARK-CONTEXT-REF, sort by ascending last access datetime, keep all but the last 2 and keep all accessed for more than 1 hour as to be deleted
|
||||
# As a consequence, for pushes (repo branches), at least 2 caches (for each context and for each branch) are kept, others are deleted if they have been useless for more than 1 hour
|
||||
PSID=$(jq "group_by(.key | .[:rindex(\"-\")]) | .[] | sort_by(.last_accessed_at) | .[:-2][] | select((.last_accessed_at | if contains(\".\") then .[:rindex(\".\")]+\"Z\" else . end | fromdateiso8601) < (now | floor - 3600)) | .id" ${{ env.logdir }}pushes.json)
|
||||
for id in $PSID
|
||||
do
|
||||
echo "Trying to delete push obsolete cache ID : $id"
|
||||
if [ ${{ env.dryrun }} == "false" ]
|
||||
then
|
||||
curl -X DELETE -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id
|
||||
else
|
||||
echo "DRYRUN: executing : curl -X DELETE -H \"Accept: application/vnd.github+json\" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/caches/$id"
|
||||
fi
|
||||
done
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ github.job }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
@@ -1,74 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This is the master workflow for CI of FreeCAD.
|
||||
# It (only) aims at properly organizing the sub-workflows.
|
||||
|
||||
name: FreeCAD master CI
|
||||
|
||||
on: [workflow_dispatch, push, pull_request]
|
||||
|
||||
concurrency:
|
||||
group: FC-CI-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
|
||||
Prepare:
|
||||
uses: ./.github/workflows/sub_prepare.yml
|
||||
with:
|
||||
artifactBasename: Prepare-${{ github.run_id }}
|
||||
|
||||
Ubuntu_20-04:
|
||||
needs: [Prepare]
|
||||
uses: ./.github/workflows/sub_buildUbuntu2004.yml
|
||||
with:
|
||||
artifactBasename: Ubuntu_20-04-${{ github.run_id }}
|
||||
|
||||
Ubuntu_22-04:
|
||||
needs: [Prepare]
|
||||
uses: ./.github/workflows/sub_buildUbuntu2204.yml
|
||||
with:
|
||||
artifactBasename: Ubuntu_22-04-${{ github.run_id }}
|
||||
|
||||
Windows:
|
||||
needs: [Prepare]
|
||||
uses: ./.github/workflows/sub_buildWindows.yml
|
||||
with:
|
||||
artifactBasename: Windows-${{ github.run_id }}
|
||||
|
||||
Lint:
|
||||
needs: [Prepare]
|
||||
uses: ./.github/workflows/sub_lint.yml
|
||||
with:
|
||||
artifactBasename: Lint-${{ github.run_id }}
|
||||
changedFiles: ${{ needs.Prepare.outputs.changedFiles }}
|
||||
changedCppFiles: ${{ needs.Prepare.outputs.changedCppFiles }}
|
||||
changedPythonFiles: ${{ needs.Prepare.outputs.changedPythonFiles }}
|
||||
|
||||
WrapUp:
|
||||
needs: [Prepare, Ubuntu_20-04, Ubuntu_22-04, Windows, Lint]
|
||||
if: always()
|
||||
uses: ./.github/workflows/sub_wrapup.yml
|
||||
with:
|
||||
previousSteps: ${{ toJSON(needs) }}
|
||||
@@ -1,73 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
name: build
|
||||
description: "Linux: build application"
|
||||
|
||||
inputs:
|
||||
builddir:
|
||||
description: "Directory where build will happen"
|
||||
required: true
|
||||
logFile:
|
||||
description: "Path for log file"
|
||||
required: true
|
||||
errorFile:
|
||||
description: "Path to error file"
|
||||
required: true
|
||||
reportFile:
|
||||
description: "Path for report file"
|
||||
required: true
|
||||
extraParameters:
|
||||
description: "Extra parameters to CMake build"
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Build
|
||||
id: build
|
||||
shell: bash
|
||||
run: |
|
||||
(stdbuf -oL -eL cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }}) \
|
||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
||||
- name: Write report
|
||||
shell: bash
|
||||
if: always()
|
||||
run: |
|
||||
if [ ${{ steps.build.outcome }} == 'success' ]
|
||||
then
|
||||
echo "<details><summary>:heavy_check_mark: CMake build succeeded</summary>" >> ${{ inputs.reportFile }}
|
||||
else
|
||||
echo "<details><summary>:fire: CMake build failed</summary>" >> ${{ inputs.reportFile }}
|
||||
fi
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo "Build Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
echo "Build Log (only built targets reported):" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
cat ${{ inputs.logFile }} | sed -ne "/Built target/p" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
echo "</details>">> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
@@ -1,78 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
name: configure
|
||||
description: "Linux: configure CMake"
|
||||
|
||||
inputs:
|
||||
sourcedir:
|
||||
description: "Directory where sources are stored"
|
||||
required: false
|
||||
default: ./
|
||||
builddir:
|
||||
description: "Directory where build will happen"
|
||||
required: true
|
||||
logFile:
|
||||
description: "Path for log file"
|
||||
required: true
|
||||
errorFile:
|
||||
description: "Path to error file"
|
||||
required: true
|
||||
reportFile:
|
||||
description: "Path for report file"
|
||||
required: true
|
||||
extraParameters:
|
||||
description: "Extra parameters to CMake configure"
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Configure CMake
|
||||
id: configure
|
||||
shell: bash
|
||||
run: |
|
||||
(stdbuf -oL -eL cmake -S ${{ inputs.sourcedir }} -B ${{ inputs.builddir }} -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ${{inputs.extraParameters }}) \
|
||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
||||
- name: Write report
|
||||
shell: bash
|
||||
if: always()
|
||||
run: |
|
||||
if [ ${{ steps.configure.outcome }} == 'success' ]
|
||||
then
|
||||
echo "<details><summary>:heavy_check_mark: CMake configure succeeded</summary>" >> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo "Configure Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
else
|
||||
echo "<details><summary>:fire: CMake configure failed</summary>" >> ${{ inputs.reportFile }}
|
||||
fi
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo "Configure Log (only final configuration values reported):" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
cat ${{ inputs.logFile }} | sed -ne "/^ *==/,/^====/p" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
echo "</details>">> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
@@ -1,44 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
name: generateCacheKey
|
||||
description: "Linux: generates a cache key taking into account distro and compiler"
|
||||
|
||||
inputs:
|
||||
compiler:
|
||||
description: "Binary name/path of compiler to be used"
|
||||
required: true
|
||||
outputs:
|
||||
cacheKey:
|
||||
description: "Cache key with distro and compiler version"
|
||||
value: ${{ steps.generateCacheKey.outputs.cacheKey }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- id: generateCacheKey
|
||||
shell: bash
|
||||
run: |
|
||||
cacheKey=$(lsb_release -ds | tr -d ' ')-$( basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion)
|
||||
echo "Generated cache key : $cacheKey"
|
||||
echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT
|
||||
@@ -1,73 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
name: install
|
||||
description: "Linux: install application"
|
||||
|
||||
inputs:
|
||||
builddir:
|
||||
description: "Directory where build is stored"
|
||||
required: true
|
||||
logFile:
|
||||
description: "Path for log file"
|
||||
required: true
|
||||
errorFile:
|
||||
description: "Path to error file"
|
||||
required: true
|
||||
reportFile:
|
||||
description: "Path for report file"
|
||||
required: true
|
||||
extraParameters:
|
||||
description: "Extra parameters to CMake install"
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install
|
||||
id: install
|
||||
shell: bash
|
||||
run: |
|
||||
(stdbuf -oL -eL sudo cmake --install ${{ inputs.builddir }} ${{ inputs.extraParameters }}) \
|
||||
2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }}
|
||||
- name: Write report
|
||||
shell: bash
|
||||
if: always()
|
||||
run: |
|
||||
if [ ${{ steps.install.outcome }} == 'success' ]
|
||||
then
|
||||
echo "<details><summary>:heavy_check_mark: CMake install succeeded</summary>" >> ${{ inputs.reportFile }}
|
||||
else
|
||||
echo "<details><summary>:fire: CMake install failed</summary>" >> ${{ inputs.reportFile }}
|
||||
fi
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo "Install Error Log (stderr output):" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
echo "Install Error Log (stdout output trimmed to the last 100 Lines):" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
tail -n 100 ${{ inputs.logFile }} >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
echo "</details>">> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
@@ -1,79 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 The FreeCAD Project Association *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# !!! Each step running a single test shall have an'id' defined so its report will be output
|
||||
|
||||
name: Run all C++ Tests
|
||||
description: "Run all C++ tests, generating logs and reports for each"
|
||||
|
||||
inputs:
|
||||
reportdir:
|
||||
description: "Report directory where logs will be stored"
|
||||
required: true
|
||||
builddir:
|
||||
description: "Build directory where tests are located"
|
||||
required: true
|
||||
reportFile:
|
||||
description: "Path for report file"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: C++ core tests
|
||||
id: core
|
||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
||||
with:
|
||||
testCommand: ${{ inputs.builddir }}/tests/Tests_run --gtest_output=json:${{ inputs.reportdir }}core_gtest_results.json
|
||||
testLogFile: ${{ inputs.reportdir }}core_gtest_test_log.txt
|
||||
testName: Core
|
||||
- name: C++ Sketcher tests
|
||||
id: sketcher
|
||||
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
|
||||
with:
|
||||
testCommand: ${{ inputs.builddir }}/tests/Sketcher_tests_run --gtest_output=json:${{ inputs.reportdir }}sketcher_gtest_results.json
|
||||
testLogFile: ${{ inputs.reportdir }}sketcher_gtest_test_log.txt
|
||||
testName: Sketcher
|
||||
- name: Compose summary report based on test results
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
# Print global result
|
||||
if [ ${{ job.status }} != "success" ]
|
||||
then
|
||||
echo "<details><summary>:fire: C++ tests failed</summary>" >> ${{ inputs.reportFile }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: C++ tests succeeded</summary>" >> ${{ inputs.reportFile }}
|
||||
fi
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo "<blockquote>" >> ${{ inputs.reportFile }}
|
||||
#Extract individual results
|
||||
cat > /tmp/data << "EOD"
|
||||
${{ toJSON(steps) }}
|
||||
EOD
|
||||
echo "$(jq -r ".[].outputs.reportText" /tmp/data)" >> ${{ inputs.reportFile }}
|
||||
# Close report
|
||||
echo "</blockquote>" >> ${{ inputs.reportFile }}
|
||||
echo "</details>" >> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * Copyright (c) 2023 FreeCAD Project Association *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
name: runCPPTests
|
||||
description: "Run C++ tests, generate log and report"
|
||||
|
||||
inputs:
|
||||
testCommand:
|
||||
description: "Test command to be run"
|
||||
required: true
|
||||
testLogFile:
|
||||
description: "Path for the command-line output of the tests"
|
||||
required: true
|
||||
testName:
|
||||
description: "A descriptive name for the test suite"
|
||||
required: true
|
||||
outputs:
|
||||
reportText:
|
||||
description: "Report text"
|
||||
value: ${{ steps.report.outputs.reportText }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Run C++ tests
|
||||
shell: bash
|
||||
run: stdbuf -oL -eL ${{ inputs.testCommand }} |& tee -a ${{ inputs.testLogFile }}
|
||||
- name: Parse test results
|
||||
if: always()
|
||||
id: report
|
||||
shell: bash
|
||||
run: |
|
||||
result=$(sed -ne "/Global test environment tear-down/,/^$/{/^$/d;p}" ${{ inputs.testLogFile }})
|
||||
if grep -qF "[ FAILED ]" <<< $result
|
||||
then
|
||||
reportText="<details><summary>:fire: GTest C++ test suite '${{ inputs.testName }}' failed</summary>\n"
|
||||
else
|
||||
reportText="<details><summary>:heavy_check_mark: GTest C++ test suite '${{ inputs.testName }}' succeeded</summary>\n"
|
||||
fi
|
||||
reportText+="\n"
|
||||
reportText+="Results\n"
|
||||
reportText+="\n"
|
||||
reportText+='```\n'
|
||||
reportText+="$result\n"
|
||||
reportText+='```\n'
|
||||
reportText+="</details>\n"
|
||||
reportText+="\n"
|
||||
echo "reportText<<EOD" >> $GITHUB_OUTPUT
|
||||
echo -e "$reportText" >> $GITHUB_OUTPUT
|
||||
echo "EOD" >> $GITHUB_OUTPUT
|
||||
echo -e "$reportText"
|
||||
@@ -1,81 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
name: runPythonTests
|
||||
description: "Run Python tests, generate log and report"
|
||||
|
||||
inputs:
|
||||
testDescription:
|
||||
description: "Test description text, will be used on report"
|
||||
required: true
|
||||
testCommand:
|
||||
description: "Test command to be run"
|
||||
required: true
|
||||
logFile:
|
||||
description: "Path for log file"
|
||||
required: true
|
||||
reportFile:
|
||||
description: "Path for report file"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Run tests
|
||||
id: runTests
|
||||
shell: bash
|
||||
run: |
|
||||
stdbuf -oL -eL ${{ inputs.testCommand }} |& sed -Ee "/[[:blank:]]*\([[:digit:]]{1,3} %\)[[:blank:]]*/d" | tee -a ${{ inputs.logFile }}
|
||||
- name: Write report
|
||||
shell: bash
|
||||
if: always()
|
||||
run: |
|
||||
sed -ne "/^\(FAILED\|ERROR\):/,/^[[:blank:]]*$/bF; /^Traceback/,/^[^[:blank:]]/{/^Traceback/bT; /^[^[:blank:]]/G; bT}; b; :T w ${{ inputs.logFile }}_tracebacks" -e "b; :F w ${{ inputs.logFile }}_failedtests" ${{ inputs.logFile }}
|
||||
icon=""
|
||||
if [ $( cat ${{ inputs.logFile }}_tracebacks | wc -l ) -gt 0 ]
|
||||
then
|
||||
icon=" :fire:"
|
||||
fi
|
||||
if [ ${{ steps.runTests.outcome }} == 'success' ]
|
||||
then
|
||||
echo "<details><summary>:heavy_check_mark: ${{ inputs.testDescription }} succeeded$icon</summary>" >> ${{ inputs.reportFile }}
|
||||
else
|
||||
echo "<details><summary>:fire: ${{ inputs.testDescription }} failed$icon</summary>" >> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo "Failed tests" >> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
cat ${{ inputs.logFile }}_failedtests >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
fi
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
if [ $( cat ${{ inputs.logFile }}_tracebacks | wc -l ) -gt 0 ]
|
||||
then
|
||||
echo "Uncaught tracebacks -- these tracebacks appeared during test but didn't fail a test --" >> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
cat ${{ inputs.logFile }}_tracebacks >> ${{ inputs.reportFile }}
|
||||
echo '```' >> ${{ inputs.reportFile }}
|
||||
fi
|
||||
echo "</details>">> ${{ inputs.reportFile }}
|
||||
echo "" >> ${{ inputs.reportFile }}
|
||||
@@ -1,78 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This action aims at speeding up CI and reduce dependency to external resources
|
||||
# by creating a cache of Ccache needed binaries then using it for CI runs rather
|
||||
# than downloading every time.
|
||||
#
|
||||
# If it needs to be updated to another version, the process it to change
|
||||
# 'downloadpath' and 'version' inputs below then delete the existing cache
|
||||
# from Github interface so a new one is generated using new values.
|
||||
|
||||
name: getCcache
|
||||
description: "Windows: tries to get a cached version of Ccache and create one if fails"
|
||||
|
||||
inputs:
|
||||
ccachebindir:
|
||||
description: "Directory where ccache binaries shall be stored"
|
||||
required: true
|
||||
# Below inputs shall generally not be provided as they won't be used if a cached version exists
|
||||
# They are mainly used because Github do not support adding env variables in a composite action
|
||||
ccachedownloadpath:
|
||||
description: "Path where to download ccache"
|
||||
required: false
|
||||
default: https://github.com/ccache/ccache/releases/download/v4.7.4/
|
||||
ccacheversion:
|
||||
description: "Ccache version to be downloaded"
|
||||
required: false
|
||||
default: ccache-4.7.4-windows-x86_64
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Create destination directory
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ inputs.ccachebindir }}
|
||||
- name: Get cached version
|
||||
uses: actions/cache/restore@v3
|
||||
id: getCached
|
||||
with:
|
||||
path: ${{ inputs.ccachebindir }}
|
||||
key: ccacheforwin
|
||||
- name: Download ccache
|
||||
shell: bash
|
||||
if: steps.getCached.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
curl -L -o ccache.zip ${{ inputs.ccachedownloadpath }}${{ inputs.ccacheversion }}.zip
|
||||
7z x ccache.zip -o"ccachetemp" -r -y
|
||||
cp -a ccachetemp/${{ inputs.ccacheversion }}/ccache.exe ${{ inputs.ccachebindir }}
|
||||
cp -a ccachetemp/${{ inputs.ccacheversion }}/ccache.exe ${{ inputs.ccachebindir }}/cl.exe
|
||||
rm ccache.zip
|
||||
rm -rf ccachetemp
|
||||
- name: Save version to cache
|
||||
if: steps.getCached.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: ${{ inputs.ccachebindir }}
|
||||
key: ${{ steps.getCached.outputs.cache-primary-key }}
|
||||
@@ -1,76 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This action aims at speeding up CI and reduce dependency to external resources
|
||||
# by creating a cache of Libpack needed files then using it for CI runs rather
|
||||
# than downloading every time.
|
||||
#
|
||||
# If it needs to be updated to another version, the process it to change
|
||||
# 'downloadpath' and 'version' inputs below then delete the existing cache
|
||||
# from Github interface so a new one is generated using new values.
|
||||
|
||||
name: getLibpack
|
||||
description: "Windows: tries to get a cached version of Libpack and create one if fails"
|
||||
|
||||
inputs:
|
||||
libpackdir:
|
||||
description: "Directory where libpack files shall be stored"
|
||||
required: true
|
||||
# Below inputs shall generally not be provided as they won't be used if a cached version exists
|
||||
# They are mainly used because Github do not support adding env variables in a composite action
|
||||
libpackdownloadurl:
|
||||
description: "URL where to download libpack"
|
||||
required: false
|
||||
default: https://github.com/FreeCAD/FreeCAD-LibPack/releases/download/2.8.2/LibPack-OCC76-V2-8.7z
|
||||
libpackname:
|
||||
description: "Libpack name (once downloaded)"
|
||||
required: false
|
||||
default: LibPack-OCC76-V2
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Create destination directory
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${{ inputs.libpackdir }}
|
||||
- name: Get cached version
|
||||
uses: actions/cache/restore@v3
|
||||
id: getCached
|
||||
with:
|
||||
path: ${{ inputs.libpackdir }}
|
||||
key: libpackforwin
|
||||
- name: Download libpack
|
||||
shell: bash
|
||||
if: steps.getCached.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
curl -L -o libpack.7z ${{ inputs.libpackdownloadurl }}
|
||||
7z x libpack.7z -o"libpacktemp" -r -y
|
||||
mv libpacktemp/${{ inputs.libpackname }}/* ${{ inputs.libpackdir }}
|
||||
rm -rf libpacktemp
|
||||
- name: Save version to cache
|
||||
if: steps.getCached.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: ${{ inputs.libpackdir }}
|
||||
key: ${{ steps.getCached.outputs.cache-primary-key }}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
# GitHub Action to automate the identification of common misspellings in text files.
|
||||
# https://github.com/codespell-project/actions-codespell
|
||||
# https://github.com/codespell-project/codespell
|
||||
|
||||
name: Codespell
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
codespell:
|
||||
name: Check for spelling errors
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v12.2
|
||||
|
||||
- name: List all changed files
|
||||
run: |
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||
echo "$file was changed"
|
||||
done
|
||||
|
||||
- uses: codespell-project/actions-codespell@master
|
||||
with:
|
||||
check_filenames: true
|
||||
ignore_words_file: .github/codespellignore
|
||||
skip: ./.git,*.po,*.ts,*.svg,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/
|
||||
path: ${{ steps.changed-files.outputs.all_changed_files }}
|
||||
@@ -21,4 +21,4 @@ jobs:
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
configuration-path: ".github/labels.yml"
|
||||
sync-labels: false
|
||||
sync-labels: false
|
||||
@@ -1,249 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This is a build and test workflow for CI of FreeCAD.
|
||||
# This workflow aims at building and testing FreeCAD on Ubuntu 20.04 using GCC.
|
||||
|
||||
name: Build Ubuntu 20.04
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
artifactBasename:
|
||||
type: string
|
||||
required: true
|
||||
testOnBuildDir:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
allowedToFail:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
outputs:
|
||||
reportFile:
|
||||
value: ${{ jobs.Build.outputs.reportFile }}
|
||||
|
||||
jobs:
|
||||
|
||||
Build:
|
||||
runs-on: ubuntu-20.04
|
||||
continue-on-error: ${{ inputs.allowedToFail }}
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/ccache
|
||||
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config
|
||||
CCACHE_MAXSIZE: 1G
|
||||
CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime
|
||||
CCACHE_COMPRESS: true
|
||||
CCACHE_COMPRESSLEVEL: 1
|
||||
CC: /usr/bin/gcc
|
||||
CXX: /usr/bin/g++
|
||||
#CC: /usr/bin/clang
|
||||
#CXX: /usr/bin/clang++
|
||||
builddir: ${{ github.workspace }}/build/
|
||||
logdir: /tmp/logs/
|
||||
reportdir: /tmp/report/
|
||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
outputs:
|
||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
||||
|
||||
steps:
|
||||
- name: Checking out source code
|
||||
uses: actions/checkout@v3
|
||||
- name: Install FreeCAD dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
doxygen \
|
||||
graphviz \
|
||||
imagemagick \
|
||||
libboost-date-time-dev \
|
||||
libboost-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-graph-dev \
|
||||
libboost-iostreams-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-python-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-serialization-dev \
|
||||
libboost-thread-dev \
|
||||
libcoin-dev \
|
||||
libeigen3-dev \
|
||||
libgts-bin \
|
||||
libgts-dev \
|
||||
libkdtree++-dev \
|
||||
libmedc-dev \
|
||||
libocct-data-exchange-dev \
|
||||
libocct-ocaf-dev \
|
||||
libocct-visualization-dev \
|
||||
libopencv-dev \
|
||||
libproj-dev \
|
||||
libpyside2-dev \
|
||||
libqt5opengl5-dev \
|
||||
libqt5svg5-dev \
|
||||
libqt5x11extras5-dev \
|
||||
libqt5xmlpatterns5-dev \
|
||||
libshiboken2-dev \
|
||||
libspnav-dev \
|
||||
libvtk7-dev \
|
||||
libx11-dev \
|
||||
libxerces-c-dev \
|
||||
libzipios++-dev \
|
||||
netgen \
|
||||
netgen-headers \
|
||||
occt-draw \
|
||||
pyqt5-dev-tools \
|
||||
pyside2-tools \
|
||||
python3-dev \
|
||||
python3-git \
|
||||
python3-markdown \
|
||||
python3-matplotlib \
|
||||
python3-packaging \
|
||||
python3-pivy \
|
||||
python3-ply \
|
||||
python3-pyside2.qtcore \
|
||||
python3-pyside2.qtgui \
|
||||
python3-pyside2.qtnetwork \
|
||||
python3-pyside2.qtsvg \
|
||||
python3-pyside2.qtwebengine \
|
||||
python3-pyside2.qtwebenginecore \
|
||||
python3-pyside2.qtwebenginewidgets \
|
||||
python3-pyside2.qtwebchannel \
|
||||
python3-pyside2.qtwidgets \
|
||||
qtbase5-dev \
|
||||
qttools5-dev \
|
||||
qtwebengine5-dev \
|
||||
shiboken2 \
|
||||
swig \
|
||||
ccache \
|
||||
xvfb
|
||||
- name: Make needed directories, files and initializations
|
||||
id: Init
|
||||
run: |
|
||||
mkdir -p ${{ env.CCACHE_DIR }}
|
||||
mkdir -p ${{ env.CCACHE_CONFIGPATH }}
|
||||
mkdir -p ${{ env.builddir }}
|
||||
mkdir -p ${{ env.logdir }}
|
||||
mkdir -p ${{ env.reportdir }}
|
||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
||||
- name: Generate cache key
|
||||
id: genCacheKey
|
||||
uses: ./.github/workflows/actions/linux/generateCacheKey
|
||||
with:
|
||||
compiler: ${{ env.CXX }}
|
||||
- name: Restore Compiler Cache
|
||||
uses: pat-s/always-upload-cache@v3
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-
|
||||
- name: Print CCache statistics before build, reset stats and print config
|
||||
run: |
|
||||
ccache -s
|
||||
ccache -z
|
||||
ccache -p
|
||||
- name: CMake Configure
|
||||
uses: ./.github/workflows/actions/linux/configure
|
||||
with:
|
||||
builddir: ${{ env.builddir }}
|
||||
logFile: ${{ env.logdir }}Cmake.log
|
||||
errorFile: ${{ env.logdir }}CmakeErrors.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: CMake Build
|
||||
uses: ./.github/workflows/actions/linux/build
|
||||
with:
|
||||
builddir: ${{ env.builddir }}
|
||||
logFile: ${{ env.logdir }}Build.log
|
||||
errorFile: ${{ env.logdir }}BuildErrors.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: Print ccache statistics after Build
|
||||
run: |
|
||||
ccache -s
|
||||
- name: FreeCAD CLI tests on build dir
|
||||
if: inputs.testOnBuildDir
|
||||
timeout-minutes: 10
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "CLI tests on build dir"
|
||||
testCommand: ${{ env.builddir }}bin/FreeCADCmd -t 0
|
||||
logFile: ${{ env.logdir }}TestCLIBuild.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: FreeCAD GUI tests on build dir
|
||||
if: inputs.testOnBuildDir
|
||||
timeout-minutes: 15
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "GUI tests on build dir"
|
||||
testCommand: xvfb-run ${{ env.builddir }}/bin/FreeCAD -t 0
|
||||
logFile: ${{ env.logdir }}TestGUIBuild.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: C++ tests
|
||||
timeout-minutes: 1
|
||||
uses: ./.github/workflows/actions/runCPPTests/runAllTests
|
||||
with:
|
||||
reportdir: ${{ env.reportdir }}
|
||||
builddir: ${{ env.builddir }}
|
||||
reportFile: ${{ env.reportdir }}${{ env.reportfilename }}
|
||||
- name: CMake Install
|
||||
uses: ./.github/workflows/actions/linux/install
|
||||
with:
|
||||
builddir: ${{ env.builddir }}
|
||||
logFile: ${{ env.logdir }}Install.log
|
||||
errorFile: ${{ env.logdir }}InstallErrors.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: FreeCAD CLI tests on install
|
||||
timeout-minutes: 10
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "CLI tests on install"
|
||||
testCommand: FreeCADCmd -t 0
|
||||
logFile: ${{ env.logdir }}TestCLIInstall.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: FreeCAD GUI tests on install
|
||||
timeout-minutes: 15
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "GUI tests on install"
|
||||
testCommand: xvfb-run FreeCAD -t 0
|
||||
logFile: ${{ env.logdir }}TestGUIInstall.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
/var/crash/*FreeCAD*
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
${{env.reportdir}}${{ env.reportfilename }}
|
||||
@@ -1,247 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This is a build and test workflow for CI of FreeCAD.
|
||||
# This workflow aims at building and testing FreeCAD on Ubuntu 22.04 using Clang.
|
||||
|
||||
name: Build Ubuntu 22.04
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
artifactBasename:
|
||||
type: string
|
||||
required: true
|
||||
testOnBuildDir:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
allowedToFail:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
outputs:
|
||||
reportFile:
|
||||
value: ${{ jobs.Build.outputs.reportFile }}
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
runs-on: ubuntu-22.04
|
||||
continue-on-error: ${{ inputs.allowedToFail }}
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/ccache
|
||||
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config
|
||||
CCACHE_MAXSIZE: 1G
|
||||
CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime
|
||||
CCACHE_COMPRESS: true
|
||||
CCACHE_COMPRESSLEVEL: 1
|
||||
#CC: /usr/bin/gcc
|
||||
#CXX: /usr/bin/g++
|
||||
CC: /usr/bin/clang
|
||||
CXX: /usr/bin/clang++
|
||||
builddir: ${{ github.workspace }}/build/
|
||||
logdir: /tmp/logs/
|
||||
reportdir: /tmp/report/
|
||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
outputs:
|
||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
||||
|
||||
steps:
|
||||
- name: Checking out source code
|
||||
uses: actions/checkout@v3
|
||||
- name: Install FreeCAD dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
doxygen \
|
||||
graphviz \
|
||||
imagemagick \
|
||||
libboost-date-time-dev \
|
||||
libboost-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-graph-dev \
|
||||
libboost-iostreams-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-python-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-serialization-dev \
|
||||
libboost-thread-dev \
|
||||
libcoin-dev \
|
||||
libeigen3-dev \
|
||||
libgts-bin \
|
||||
libgts-dev \
|
||||
libkdtree++-dev \
|
||||
libmedc-dev \
|
||||
libocct-data-exchange-dev \
|
||||
libocct-ocaf-dev \
|
||||
libocct-visualization-dev \
|
||||
libopencv-dev \
|
||||
libproj-dev \
|
||||
libpyside2-dev \
|
||||
libqt5opengl5-dev \
|
||||
libqt5svg5-dev \
|
||||
libqt5x11extras5-dev \
|
||||
libqt5xmlpatterns5-dev \
|
||||
libshiboken2-dev \
|
||||
libspnav-dev \
|
||||
libvtk7-dev \
|
||||
libx11-dev \
|
||||
libxerces-c-dev \
|
||||
libzipios++-dev \
|
||||
netgen \
|
||||
netgen-headers \
|
||||
occt-draw \
|
||||
pyqt5-dev-tools \
|
||||
pyside2-tools \
|
||||
python3-dev \
|
||||
python3-git \
|
||||
python3-markdown \
|
||||
python3-matplotlib \
|
||||
python3-packaging \
|
||||
python3-pivy \
|
||||
python3-ply \
|
||||
python3-pyside2.qtcore \
|
||||
python3-pyside2.qtgui \
|
||||
python3-pyside2.qtnetwork \
|
||||
python3-pyside2.qtsvg \
|
||||
python3-pyside2.qtwebengine \
|
||||
python3-pyside2.qtwebenginecore \
|
||||
python3-pyside2.qtwebenginewidgets \
|
||||
python3-pyside2.qtwebchannel \
|
||||
python3-pyside2.qtwidgets \
|
||||
qtbase5-dev \
|
||||
qttools5-dev \
|
||||
qtwebengine5-dev \
|
||||
shiboken2 \
|
||||
swig \
|
||||
ccache \
|
||||
xvfb
|
||||
- name: Make needed directories, files and initializations
|
||||
id: Init
|
||||
run: |
|
||||
mkdir -p ${{ env.CCACHE_DIR }}
|
||||
mkdir -p ${{ env.CCACHE_CONFIGPATH }}
|
||||
mkdir -p ${{ env.builddir }}
|
||||
mkdir -p ${{ env.logdir }}
|
||||
mkdir -p ${{ env.reportdir }}
|
||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
||||
- name: Generate cache key
|
||||
id: genCacheKey
|
||||
uses: ./.github/workflows/actions/linux/generateCacheKey
|
||||
with:
|
||||
compiler: ${{ env.CXX }}
|
||||
- name: Restore Compiler Cache
|
||||
uses: pat-s/always-upload-cache@v3
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-
|
||||
FC-${{ steps.genCacheKey.outputs.cacheKey }}-
|
||||
- name: Print CCache statistics before build, reset stats and print config
|
||||
run: |
|
||||
ccache -s
|
||||
ccache -z
|
||||
ccache -p
|
||||
- name: CMake Configure
|
||||
uses: ./.github/workflows/actions/linux/configure
|
||||
with:
|
||||
builddir: ${{ env.builddir }}
|
||||
logFile: ${{ env.logdir }}Cmake.log
|
||||
errorFile: ${{ env.logdir }}CmakeErrors.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: CMake Build
|
||||
uses: ./.github/workflows/actions/linux/build
|
||||
with:
|
||||
builddir: ${{ env.builddir }}
|
||||
logFile: ${{ env.logdir }}Build.log
|
||||
errorFile: ${{ env.logdir }}BuildErrors.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: Print ccache statistics after Build
|
||||
run: |
|
||||
ccache -s
|
||||
- name: FreeCAD CLI tests on build dir
|
||||
if: inputs.testOnBuildDir
|
||||
timeout-minutes: 10
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "CLI tests on build dir"
|
||||
testCommand: ${{ env.builddir }}bin/FreeCADCmd -t 0
|
||||
logFile: ${{ env.logdir }}TestCLIBuild.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: FreeCAD GUI tests on build dir
|
||||
if: inputs.testOnBuildDir
|
||||
timeout-minutes: 15
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "GUI tests on build dir"
|
||||
testCommand: xvfb-run ${{ env.builddir }}/bin/FreeCAD -t 0
|
||||
logFile: ${{ env.logdir }}TestGUIBuild.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: C++ tests
|
||||
timeout-minutes: 1
|
||||
uses: ./.github/workflows/actions/runCPPTests/runAllTests
|
||||
with:
|
||||
reportdir: ${{ env.reportdir }}
|
||||
builddir: ${{ env.builddir }}
|
||||
reportFile: ${{ env.reportdir }}${{ env.reportfilename }}
|
||||
- name: CMake Install
|
||||
uses: ./.github/workflows/actions/linux/install
|
||||
with:
|
||||
builddir: ${{ env.builddir }}
|
||||
logFile: ${{ env.logdir }}Install.log
|
||||
errorFile: ${{ env.logdir }}InstallErrors.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: FreeCAD CLI tests on install
|
||||
timeout-minutes: 10
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "CLI tests on install"
|
||||
testCommand: FreeCADCmd -t 0
|
||||
logFile: ${{ env.logdir }}TestCLIInstall.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: FreeCAD GUI tests on install
|
||||
timeout-minutes: 15
|
||||
uses: ./.github/workflows/actions/runPythonTests
|
||||
with:
|
||||
testDescription: "GUI tests on install"
|
||||
testCommand: xvfb-run FreeCAD -t 0
|
||||
logFile: ${{ env.logdir }}TestGUIInstall.log
|
||||
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
/var/crash/*FreeCAD*
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
${{env.reportdir}}${{ env.reportfilename }}
|
||||
@@ -1,146 +0,0 @@
|
||||
# ***************************************************************************
|
||||
# * Copyright (c) 2023 0penBrain *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program is distributed in the hope that it will be useful, *
|
||||
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
# * GNU Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This is a build and test workflow for CI of FreeCAD.
|
||||
# This workflow aims at building and testing FreeCAD on Windows using MSVC.
|
||||
|
||||
name: Build Windows
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
artifactBasename:
|
||||
type: string
|
||||
required: true
|
||||
allowedToFail:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
outputs:
|
||||
reportFile:
|
||||
value: ${{ jobs.Build.outputs.reportFile }}
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
runs-on: windows-latest
|
||||
continue-on-error: ${{ inputs.allowedToFail }}
|
||||
env:
|
||||
CCACHE_DIR: C:/FC/cache/
|
||||
CCACHE_COMPILERCHECK: "%compiler%" # default:mtime
|
||||
CCACHE_MAXSIZE: 1G
|
||||
CCACHE_COMPRESS: true
|
||||
CCACHE_COMPRESSLEVEL: 1
|
||||
CCACHE_NOHASHDIR: true
|
||||
CCACHE_DIRECT: true
|
||||
#CCACHE_SLOPPINESS: "pch_defines,time_macros" # Can't get PCH to work on Windows
|
||||
CCACHE_LOGFILE: C:/logs/ccache.log
|
||||
## Have to use C:\ because not enough space on workspace drive
|
||||
builddir: C:/FC/build/
|
||||
libpackdir: C:/FC/libpack/
|
||||
ccachebindir: C:/FC/ccache/
|
||||
logdir: C:/logs/
|
||||
reportdir: C:/report/
|
||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
||||
outputs:
|
||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
||||
|
||||
steps:
|
||||
- name: Checking out source code
|
||||
uses: actions/checkout@v3
|
||||
- name: Make needed directories, files and initializations
|
||||
id: Init
|
||||
run: |
|
||||
mkdir ${{ env.CCACHE_DIR }}
|
||||
mkdir ${{ env.ccachebindir }}
|
||||
mkdir ${{ env.libpackdir }}
|
||||
mkdir ${{ env.builddir }}
|
||||
mkdir ${{ env.logdir }}
|
||||
mkdir ${{ env.reportdir }}
|
||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
||||
- name: Get Ccache
|
||||
uses: ./.github/workflows/actions/windows/getCcache
|
||||
with:
|
||||
ccachebindir: ${{ env.ccachebindir }}
|
||||
- name: Get Libpack
|
||||
uses: ./.github/workflows/actions/windows/getLibpack
|
||||
with:
|
||||
libpackdir: ${{ env.libpackdir }}
|
||||
- name: Restore compiler cache
|
||||
uses: pat-s/always-upload-cache@v3
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-Windows-${{ github.ref }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
FC-Windows-${{ github.ref }}-
|
||||
FC-Windows-
|
||||
- name: Print Ccache statistics before build, reset stats and print config
|
||||
run: |
|
||||
. $env:ccachebindir\ccache -s
|
||||
. $env:ccachebindir\ccache -z
|
||||
. $env:ccachebindir\ccache -p
|
||||
- name: Append Libpack bin directory to Path
|
||||
if: false # Disabled because not enough to set FREECAD_COPY_LIBPACK_BIN_TO_BUILD=OFF
|
||||
run: |
|
||||
echo "${{ env.libpackdir }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
- name: Configuring CMake
|
||||
run: >
|
||||
cmake -B"${{ env.builddir }}" .
|
||||
-DCMAKE_VS_NO_COMPILE_BATCHING=ON
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DFREECAD_USE_PCH=OFF
|
||||
-DFREECAD_RELEASE_PDB=OFF
|
||||
-DFREECAD_LIBPACK_DIR="${{ env.libpackdir }}"
|
||||
-DPYTHON_DEBUG_LIBRARY="${{ env.libpackdir }}bin/libs/python38_d.lib"
|
||||
-DPYTHON_EXECUTABLE="${{ env.libpackdir }}bin/python.exe"
|
||||
-DPYTHON_INCLUDE_DIR="${{ env.libpackdir }}bin/include"
|
||||
-DPYTHON_LIBRARY="${{ env.libpackdir }}bin/libs/python38.lib"
|
||||
-DXercesC_INCLUDE_DIR="${{ env.libpackdir }}include"
|
||||
-DXercesC_LIBRARY_RELEASE="${{ env.libpackdir }}lib/xerces-c_3.lib"
|
||||
-DXercesC_LIBRARY_DEBUG="${{ env.libpackdir }}lib/xerces-c_3D.lib"
|
||||
-DFREECAD_COPY_DEPEND_DIRS_TO_BUILD=ON
|
||||
-DFREECAD_COPY_LIBPACK_BIN_TO_BUILD=OFF
|
||||
-DFREECAD_COPY_PLUGINS_BIN_TO_BUILD=ON
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.3
|
||||
- name: Compiling sources
|
||||
run: |
|
||||
cd $env:builddir
|
||||
msbuild ALL_BUILD.vcxproj /m /p:Configuration=Release /p:TrackFileAccess=false /p:CLToolPath=${{ env.ccachebindir }}
|
||||
- name: Print Ccache statistics after build
|
||||
run: |
|
||||
. $env:ccachebindir\ccache -s
|
||||
- name: Move libpack bin folder to build folder # Shorter in time than copying with CMake FREECAD_COPY_LIBPACK_BIN_TO_BUILD
|
||||
run: |
|
||||
Move-Item -Force -Path ${{ env.libpackdir }}bin -Destination ${{ env.builddir }}
|
||||
- name: C++ unit tests
|
||||
if: false # Disabled because seems to not exist on Windows build
|
||||
timeout-minutes: 1
|
||||
run: |
|
||||
. ${{ env.builddir }}\test\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}\unitTests.log
|
||||
- name: FreeCAD CLI tests
|
||||
run: |
|
||||
. ${{ env.builddir }}\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}\integrationTests.log
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
@@ -1,773 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This is the lint workflow for CI of FreeCAD
|
||||
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
artifactBasename:
|
||||
type: string
|
||||
required: true
|
||||
changedFiles:
|
||||
type: string
|
||||
required: true
|
||||
changedCppFiles:
|
||||
type: string
|
||||
required: true
|
||||
changedPythonFiles:
|
||||
type: string
|
||||
required: true
|
||||
checkLineendings:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
lineendingsFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkWhitespace:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
whitespaceFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkTabs:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
tabsFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkQtConnections:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
qtConnectionsFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkCpplint:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
cpplintFilters:
|
||||
default: -build/c++11,-build/header_guard,-build/include,-build/include_alpha,-build/include_order,-build/include_subdir,-build/include_what_you_use,-build/namespaces,-legal/copyright,-readability/braces,-readability-braces-around-statements,-readability/casting,-readability/namespace,-readability/todo,-runtime/indentation_namespace,-runtime/int,-runtime/references,-whitespace/blank_line,-whitespace/braces,-whitespace/comma,-whitespace/comments,-whitespace/end_of_line,-whitespace/indent,-whitespace/line_length,-whitespace/newline,-whitespace/operators,-whitespace/parens,-whitespace/semicolon,-whitespace/tab,-whitespace/todo
|
||||
type: string
|
||||
required: false
|
||||
cpplintLineLength:
|
||||
default: 120
|
||||
type: string
|
||||
required: false
|
||||
cpplintFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkPylint:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
pylintDisable:
|
||||
default: C0302,C0303 # Trailing whitespaces (C0303) are already checked
|
||||
type: string
|
||||
required: false
|
||||
pylintFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkBlack:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
blackFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkClangFormat:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
clangStyle:
|
||||
default: file # for .clang-format file
|
||||
type: string
|
||||
required: false
|
||||
clangFormatFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkSpelling:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
listIgnoredMisspelling:
|
||||
default: .github/codespellignore
|
||||
type: string
|
||||
required: false
|
||||
spellingIgnore:
|
||||
default: ./.git,*.po,*.ts,*.svg,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/
|
||||
type: string
|
||||
required: false
|
||||
codespellFailSilent:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
checkClangTidy:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
clangTidyChecks:
|
||||
default: # empty to use the .clang-tidy file
|
||||
type: string
|
||||
required: false
|
||||
clangTidyFailSilent:
|
||||
default: true # warnings or notes will never fail the CI, only errors
|
||||
type: boolean
|
||||
required: false
|
||||
checkClazy: # for the Message codes see: https://invent.kde.org/sdk/clazy#list-of-checks
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
clazyChecks:
|
||||
default: level1
|
||||
type: string
|
||||
required: false
|
||||
clazyFailSilent:
|
||||
default: true # warnings or notes will never fail the CI, only errors
|
||||
type: boolean
|
||||
required: false
|
||||
checkClazyQT6:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
clazyQT6Checks:
|
||||
default: qt6-deprecated-api-fixes,qt6-header-fixes,qt6-qhash-signature,qt6-fwd-fixes,missing-qobject-macro # for QT6 Porting https://invent.kde.org/sdk/clazy#list-of-checks
|
||||
type: string
|
||||
required: false
|
||||
QT6Branch: # branch to check for QT6 Porting
|
||||
default: master
|
||||
type: string
|
||||
required: false
|
||||
clazyQT6FailSilent:
|
||||
default: true # warnings or notes will never fail the CI, only errors
|
||||
type: boolean
|
||||
required: false
|
||||
outputs:
|
||||
reportFile:
|
||||
value: ${{ jobs.Lint.outputs.reportFile }}
|
||||
|
||||
jobs:
|
||||
|
||||
Lint:
|
||||
if: inputs.changedFiles != ''
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
logdir: /tmp/logs/
|
||||
fixesdir: /tmp/fixes/
|
||||
reportdir: /tmp/report/
|
||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
outputs:
|
||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
||||
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- name: Make needed directories, files and initializations
|
||||
id: Init
|
||||
run: |
|
||||
mkdir -p ${{ env.logdir }}
|
||||
mkdir -p ${{ env.fixesdir }}
|
||||
mkdir -p ${{ env.reportdir }}
|
||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
||||
# Run generic lints
|
||||
- name: Check for non Unix line ending
|
||||
if: inputs.checkLineendings && always()
|
||||
continue-on-error: ${{ inputs.lineendingsFailSilent }}
|
||||
run: |
|
||||
lineendings=0
|
||||
for file in ${{ inputs.changedFiles }}
|
||||
do
|
||||
# Check for DOS or MAC line endings
|
||||
if [[ $(file -b $file) =~ "with CR" ]]
|
||||
then
|
||||
echo "::warning file=$file,title=$file::File has non Unix line endings"
|
||||
echo "$file has non Unix line endings" >> ${{ env.logdir }}lineendings.log
|
||||
((lineendings=lineendings+1))
|
||||
fi
|
||||
done
|
||||
echo "Found $lineendings line ending errors"
|
||||
# Write the report
|
||||
if [ $lineendings -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:information_source: Found $lineendings problems with line endings</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}lineendings.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo ":heavy_check_mark: No line ending problem found " >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $lineendings -eq 0 ]
|
||||
- name: Check for trailing whitespaces
|
||||
if: inputs.checkWhitespace && always()
|
||||
continue-on-error: ${{ inputs.whitespaceFailSilent }}
|
||||
run: |
|
||||
whitespaceErrors=0
|
||||
exclude="*[.md]"
|
||||
for file in ${{ inputs.changedFiles }}
|
||||
do
|
||||
# Check for trailing whitespaces
|
||||
grep -nIHE --exclude="$exclude" " $" $file | sed -e "s/$/<-- trailing whitespace/" >> ${{ env.logdir }}whitespace.log || true
|
||||
done
|
||||
# Write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}whitespace.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/grepMatcherWarning.json"
|
||||
cat ${{ env.logdir }}whitespace.log
|
||||
echo "::remove-matcher owner=grepMatcher-warning::"
|
||||
whitespaceErrors=$(wc -l < ${{ env.logdir }}whitespace.log)
|
||||
fi
|
||||
echo "Found $whitespaceErrors whitespace errors"
|
||||
# Write the report
|
||||
if [ $whitespaceErrors -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:information_source: Found $whitespaceErrors trailing whitespace</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}whitespace.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo ":heavy_check_mark: No trailing whitespace found " >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $whitespaceErrors -eq 0 ]
|
||||
- name: Check for Tab usage
|
||||
if: inputs.checkTabs && always()
|
||||
continue-on-error: ${{ inputs.tabsFailSilent }}
|
||||
run: |
|
||||
tabErrors=0
|
||||
exclude="*[.md]"
|
||||
# Check for Tab usage
|
||||
for file in ${{ steps.changed-files.outputs.all_changed_files }}
|
||||
do
|
||||
grep -nIHE --exclude="$exclude" $'\t' $file | sed -e "s/$/ <-- contains tab/" >> ${{ env.logdir }}tab.log || true
|
||||
done
|
||||
# Write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}tab.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/grepMatcherWarning.json"
|
||||
cat ${{ env.logdir }}tab.log
|
||||
echo "::remove-matcher owner=grepMatcher-warning::"
|
||||
tabErrors=$(wc -l < ${{ env.logdir }}tab.log)
|
||||
fi
|
||||
echo "Found $tabErrors tab errors"
|
||||
# Write the report
|
||||
if [ $tabErrors -gt 0 ]; then
|
||||
echo "<details><summary>:information_source: Found $tabErrors tabs, better to use spaces</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}tab.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo ":heavy_check_mark: No tabs found" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $tabErrors -eq 0 ]
|
||||
# Run Python lints
|
||||
- name: Pylint
|
||||
if: inputs.checkPylint && inputs.changedPythonFiles != '' && always()
|
||||
continue-on-error: ${{ inputs.pylintFailSilent }}
|
||||
run: |
|
||||
pylintErrors=0
|
||||
pylintWarnings=0
|
||||
pylintRefactorings=0
|
||||
pylintConventions=0
|
||||
pip install pylint
|
||||
# List enabled pylint checks
|
||||
pylint --list-msgs-enabled > ${{ env.logdir }}pylint-enabled-checks.log
|
||||
# Run pylint on all python files
|
||||
set +e
|
||||
pylint --disable=${{ inputs.pylintDisable }} ${{ inputs.changedPythonFiles }} > ${{ env.logdir }}pylint.log
|
||||
exitCode=$?
|
||||
set -e
|
||||
# If pylint has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}pylint.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/pylintError.json"
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/pylintWarning.json"
|
||||
cat ${{ env.logdir }}pylint.log
|
||||
echo "::remove-matcher owner=pylint-error::"
|
||||
echo "::remove-matcher owner=pylint-warning::"
|
||||
pylintErrors=$( grep -oP '(?<=error \|)\d+' ${{ env.logdir }}pylint.log) || true # grep returns 0 if no match is found
|
||||
pylintWarnings=$( grep -oP '(?<=warning \|)\d+' ${{ env.logdir }}pylint.log) || true
|
||||
pylintRefactorings=$( grep -oP '(?<=refactor \|)\d+' ${{ env.logdir }}pylint.log) || true
|
||||
pylintConventions=$( grep -oP '(?<=convention \|)\d+' ${{ env.logdir }}pylint.log) || true
|
||||
fi
|
||||
echo "Found $pylintErrors errors, $pylintWarnings warnings, $pylintRefactorings refactorings, $pylintConventions conventions"
|
||||
# Write the report
|
||||
if [ $pylintErrors -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:fire: Pylint found :fire: $pylintErrors errors, :warning: $pylintWarnings warnings, :construction: $pylintRefactorings refactorings and :pencil2: $pylintConventions conventions</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ $pylintWarnings -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:warning: Pylint found :warning: $pylintWarnings warnings, :construction: $pylintRefactorings refactorings and :pencil2: $pylintConventions conventions</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ $pylintRefactorings -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:construction: Pylint found :construction: $pylintRefactorings refactorings and :pencil2: $pylintConventions conventions</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ $pylintConventions -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:pencil2: Pylint found :pencil2: $pylintConventions conventions</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: No pylint errors found </summary> " >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# List enabled checks in the report
|
||||
echo "<details><summary>:information_source: Enabled checks</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}pylint-enabled-checks.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}pylint.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $pylintErrors -eq 0 ]
|
||||
- name: Black (Python)
|
||||
if: inputs.checkBlack && inputs.changedPythonFiles != '' && always()
|
||||
continue-on-error: ${{ inputs.blackFailSilent }}
|
||||
run: |
|
||||
blackReformats=0
|
||||
blackFails=0
|
||||
pip install black
|
||||
set +e
|
||||
black --check ${{ inputs.changedPythonFiles }} &> ${{ env.logdir }}black.log
|
||||
exitCode=$?
|
||||
set -e
|
||||
# If black has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}black.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/blackWarning.json"
|
||||
cat ${{ env.logdir }}black.log
|
||||
echo "::remove-matcher owner=black-warning::"
|
||||
blackReformats=$( grep -oP '\d+(?= fil.+ would be reformatted)' ${{ env.logdir }}black.log) || true # grep returns 0 if no match is found
|
||||
blackFails=$( grep -oP '\d+(?= fil.+ would fail to reformat)' ${{ env.logdir }}black.log) || true
|
||||
fi
|
||||
echo "Found $blackReformats files would be reformatted and $blackFails files would fail to reformat"
|
||||
# Write the report
|
||||
if [ $blackReformats -gt 0 ] || [ $blackFails -gt 0 ] #FIXME purpose of testing $blackFails as we don't use it then
|
||||
then
|
||||
echo "<details><summary>:pencil2: Black would reformat $blackReformats files</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: Black would reformat no file</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}black.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $exitCode -eq 0 ]
|
||||
# Run C++ lints
|
||||
- name: Install FreeCAD dependencies
|
||||
if: inputs.changedCppFiles != '' && always()
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
doxygen \
|
||||
graphviz \
|
||||
imagemagick \
|
||||
libboost-date-time-dev \
|
||||
libboost-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-graph-dev \
|
||||
libboost-iostreams-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-python-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-serialization-dev \
|
||||
libboost-thread-dev \
|
||||
libcoin-dev \
|
||||
libeigen3-dev \
|
||||
libgts-bin \
|
||||
libgts-dev \
|
||||
libkdtree++-dev \
|
||||
libmedc-dev \
|
||||
libocct-data-exchange-dev \
|
||||
libocct-ocaf-dev \
|
||||
libocct-visualization-dev \
|
||||
libopencv-dev \
|
||||
libproj-dev \
|
||||
libpyside2-dev \
|
||||
libqt5opengl5-dev \
|
||||
libqt5svg5-dev \
|
||||
libqt5x11extras5-dev \
|
||||
libqt5xmlpatterns5-dev \
|
||||
libshiboken2-dev \
|
||||
libspnav-dev \
|
||||
libvtk7-dev \
|
||||
libx11-dev \
|
||||
libxerces-c-dev \
|
||||
libzipios++-dev \
|
||||
netgen \
|
||||
netgen-headers \
|
||||
occt-draw \
|
||||
pyqt5-dev-tools \
|
||||
pyside2-tools \
|
||||
python3-dev \
|
||||
python3-git \
|
||||
python3-markdown \
|
||||
python3-matplotlib \
|
||||
python3-packaging \
|
||||
python3-pivy \
|
||||
python3-ply \
|
||||
python3-pyside2.qtcore \
|
||||
python3-pyside2.qtgui \
|
||||
python3-pyside2.qtnetwork \
|
||||
python3-pyside2.qtsvg \
|
||||
python3-pyside2.qtwebengine \
|
||||
python3-pyside2.qtwebenginecore \
|
||||
python3-pyside2.qtwebenginewidgets \
|
||||
python3-pyside2.qtwebchannel \
|
||||
python3-pyside2.qtwidgets \
|
||||
qtbase5-dev \
|
||||
qttools5-dev \
|
||||
qtwebengine5-dev \
|
||||
shiboken2 \
|
||||
swig \
|
||||
ccache \
|
||||
xvfb
|
||||
- name: Run CMake # This is needed for Clang tools to work correctly
|
||||
if: inputs.changedCppFiles != '' && always()
|
||||
run: |
|
||||
mkdir build && cmake -S ./ -B ./build/ -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE
|
||||
- name: Check old Qt string-based connections (https://wiki.qt.io/New_Signal_Slot_Syntax)
|
||||
if: inputs.checkQtConnections && inputs.changedCppFiles != '' && always()
|
||||
continue-on-error: ${{ inputs.qtConnectionsFailSilent }}
|
||||
run: |
|
||||
qtconnectionSyntax=0
|
||||
exclude="*[.md,.log,.ts,.git]"
|
||||
# Check all files for QT string-based connections
|
||||
for file in ${{ inputs.changedFiles }} #TODO does this makes sense in Python files ?
|
||||
do
|
||||
grep -nIHE --exclude="$exclude" $' SIGNAL| SLOT' $file | sed -e "s/$/ <--Consider using Functor-Based Connections/" >> ${{ env.logdir }}qtConnections.log || true #TODO seems to trigger false positives
|
||||
done
|
||||
# Write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}qtConnections.log ]; then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/grepMatcherWarning.json"
|
||||
cat ${{ env.logdir }}qtConnections.log
|
||||
echo "::remove-matcher owner=grepMatcher-warning::"
|
||||
qtconnectionSyntax=$(wc -l < ${{ env.logdir }}qtConnections.log)
|
||||
fi
|
||||
echo "Found $qtconnectionSyntax QT string-based connections"
|
||||
# Write the report
|
||||
if [ $qtconnectionSyntax -gt 0 ]; then
|
||||
echo "<details><summary>:information_source: Found $qtconnectionSyntax QT string-based connections :arrow_right: consider using QT functor-Based Connections</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# documentation link
|
||||
echo "For more information see: https://wiki.qt.io/New_Signal_Slot_Syntax or https://github.com/FreeCAD/FreeCAD/issues/6166" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}qtConnections.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo ":heavy_check_mark: No string-based connections found " >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $qtconnectionSyntax -eq 0 ]
|
||||
- name: Cpplint
|
||||
if: inputs.checkCpplint && inputs.changedCppFiles != '' && always()
|
||||
continue-on-error: ${{ inputs.cpplintFailSilent }}
|
||||
run: |
|
||||
cpplintErrors=0
|
||||
pip install cpplint
|
||||
# Run cpplint
|
||||
for file in ${{ inputs.changedCppFiles }}
|
||||
do
|
||||
cpplint --filter=${{ inputs.cpplintFilters }} --linelength=${{ inputs.cpplintLineLength }} $file &>> ${{ env.logdir }}cpplint.log || true
|
||||
done
|
||||
# If cpplint has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ ${{ env.logdir }}cpplint.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/cpplint.json"
|
||||
cat ${{ env.logdir }}cpplint.log
|
||||
echo "::remove-matcher owner=cpplint::"
|
||||
cpplintErrors=$(grep -nIHE "\[[0-9]\]$" ${{ env.logdir }}cpplint.log | wc -l ) || true
|
||||
fi
|
||||
echo "Found $cpplintErrors cpplint errors"
|
||||
# Write the report
|
||||
if [ $cpplintErrors -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:warning: CppLint found $cpplintErrors errors / warnings</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: No cpplint errors found </summary> " >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}cpplint.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $cpplintErrors -eq 0 ]
|
||||
- name: Clang-format
|
||||
if: inputs.checkClangFormat && inputs.changedCppFiles != '' && always()
|
||||
continue-on-error: ${{ inputs.clangFormatFailSilent }}
|
||||
run: |
|
||||
clangFormatErrors=0
|
||||
# Run clang-format on all cpp files
|
||||
clang-format --dry-run --ferror-limit=1 --verbose --style=${{ inputs.clangStyle }} ${{ inputs.changedCppFiles }} &>> ${{ env.logdir }}clang-format.log || true
|
||||
# If clang-format has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}clang-format.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/clang.json"
|
||||
cat ${{ env.logdir }}clang-format.log
|
||||
echo "::remove-matcher owner=clang::"
|
||||
clangFormatErrors=$(grep -nIHE "\[-Wclang-format-violations]$" ${{ env.logdir }}clang-format.log | wc -l ) || true
|
||||
fi
|
||||
echo "Found $clangFormatErrors clang-format errors"
|
||||
# Write the report
|
||||
if [ $clangFormatErrors -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:pencil2: Clang-format would reformat $clangFormatErrors files</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: Clang-format would reformat no file</summary> " >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}clang-format.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $clangFormatErrors -eq 0 ]
|
||||
- name: Codespell
|
||||
if: inputs.checkSpelling && always()
|
||||
continue-on-error: ${{ inputs.codespellFailSilent }}
|
||||
run: |
|
||||
pip install codespell
|
||||
wget https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt
|
||||
#wget https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary_rare.txt
|
||||
set +e
|
||||
misspellings=$( { codespell --quiet-level 3 --summary --count --ignore-words ${{ inputs.listIgnoredMisspelling }} --skip ${{ inputs.spellingIgnore }} -D dictionary.txt ${{ inputs.changedFiles }} > ${{ env.logdir }}codespell.log ; } 2>&1 )
|
||||
set -e
|
||||
# If codespell has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}codespell.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/codespell.json"
|
||||
cat ${{ env.logdir }}codespell.log
|
||||
echo "::remove-matcher owner=codespell::"
|
||||
fi
|
||||
echo "Found $misspellings misspellings"
|
||||
# Write the report
|
||||
if [ $misspellings -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:pencil2: Codespell found $misspellings misspellings</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: Codespell found no misspellings</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "To ignore false positives, append the word to the [.github/codespellignore](https://github.com/FreeCAD/FreeCAD/blob/master/.github/codespellignore) file (lowercase)" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}codespell.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $misspellings -eq 0 ]
|
||||
- name: Clang-tidy
|
||||
if: inputs.checkClangTidy && inputs.changedCppFiles != '' && always()
|
||||
continue-on-error: ${{ inputs.clangTidyFailSilent }}
|
||||
run: |
|
||||
clangTidyErrors=0
|
||||
clangTidyWarnings=0
|
||||
clangTidyNotes=0
|
||||
sudo apt-get install -y --no-install-recommends clang-tidy
|
||||
#TODO: check where this "clang-tidy.yaml" goes ; shall this be put in the fixes ?
|
||||
clang-tidy --quiet --format-style=${{ inputs.clangStyle }} --export-fixes=clang-tidy.yaml -checks=${{ inputs.clangTidyChecks }} -p build/ --explain-config &>> ${{ env.logdir }}clang-tidy-enabled-checks.log
|
||||
# Run clang-tidy on all cpp files
|
||||
set +e
|
||||
clang-tidy --quiet --format-style=${{ inputs.clangStyle }} --export-fixes=clang-tidy.yaml -checks=${{ inputs.clangTidyChecks }} -p build/ ${{ inputs.changedCppFiles }} &>> ${{ env.logdir }}clang-tidy.log
|
||||
exitCode=$?
|
||||
set -e
|
||||
# If clang-tidy has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}clang-tidy.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/clang.json"
|
||||
cat ${{ env.logdir }}clang-tidy.log
|
||||
echo "::remove-matcher owner=clang::"
|
||||
clangTidyErrors=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): error: .+$" ${{ env.logdir }}clang-tidy.log | wc -l ) || true
|
||||
clangTidyWarnings=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): warning: .+$" ${{ env.logdir }}clang-tidy.log | wc -l ) || true
|
||||
clangTidyNotes=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): note: .+$" ${{ env.logdir }}clang-tidy.log | wc -l ) || true
|
||||
fi
|
||||
echo "Found $clangTidyErrors errors, $clangTidyWarnings warnings, $clangTidyNotes notes"
|
||||
# Write the report
|
||||
if [ $clangTidyErrors -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:fire: Clang-Tidy found :fire: $clangTidyErrors errors, :warning: $clangTidyWarnings warnings and :pencil2: $clangTidyNotes notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ $clangTidyWarnings -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:warning: Clang-Tidy found :warning: $clangTidyWarnings warnings and :pencil2: $clangTidyNotes notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ $clangTidyNotes -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:pencil2: Clang-Tidy found :pencil2: $clangTidyNotes notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: Clang-Tidy found no errors, warnings or notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# List enabled checks in the report
|
||||
echo "<details><summary>:information_source: Enabled checks</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}clang-tidy-enabled-checks.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}clang-tidy.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $clangTidyErrors -eq 0 ]
|
||||
- name: Clazy
|
||||
if: inputs.checkClazy && inputs.changedCppFiles != '' && always()
|
||||
continue-on-error: ${{ inputs.clazyFailSilent }}
|
||||
run: |
|
||||
clazyErrors=0
|
||||
clazyWarnings=0
|
||||
clazyNotes=0
|
||||
sudo apt-get install -y --no-install-recommends clazy
|
||||
#TODO: check where this "clazy.yaml" goes ; shall this be put in the fixes ?
|
||||
# Run clazy on all cpp files
|
||||
clazy-standalone --export-fixes=clazy.yaml -checks=${{ inputs.clazyChecks }} -p build/ ${{ inputs.changedCppFiles }} &>> ${{ env.logdir }}clazy.log || true
|
||||
# If clazy has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}clazy.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/clang.json"
|
||||
cat ${{ env.logdir }}clazy.log
|
||||
echo "::remove-matcher owner=clang::"
|
||||
clazyErrors=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): error: .+$" ${{ env.logdir }}clazy.log | wc -l ) || true
|
||||
clazyWarnings=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): warning: .+$" ${{ env.logdir }}clazy.log | wc -l ) || true
|
||||
clazyNotes=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): note: .+$" ${{ env.logdir }}clazy.log | wc -l ) || true
|
||||
fi
|
||||
echo "Found $clazyErrors errors, $clazyWarnings warnings, $clazyNotes notes"
|
||||
# Write the report
|
||||
if [ "$clazyErrors" -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:fire: Clazy found :fire: $clazyErrors errors, :warning: $clazyWarnings warnings and :pencil2: $clazyNotes notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ "$clazyWarnings" -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:warning: Clazy found :warning: $clazyWarnings warnings and :pencil2: $clazyNotes notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ "$clazyNotes" -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:pencil2: Clazy found :pencil2: $clazyNotes notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: Clazy found no errors, warnings or notes</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "[List of checks](https://github.com/KDE/clazy#list-of-checks), [This explains some of the clazy warnings](https://www.kdab.com/uncovering-32-qt-best-practices-compile-time-clazy/) " >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}clazy.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $clazyErrors -eq 0 ]
|
||||
- name: Clazy-QT6
|
||||
if: inputs.checkClazyQT6 && inputs.changedCppFiles != '' && github.ref == inputs.QT6Branch && always()
|
||||
continue-on-error: ${{ inputs.clazyQT6FailSilent }}
|
||||
run: |
|
||||
clazyQT6Errors=0
|
||||
clazyQT6Warnings=0
|
||||
clazyQT6Notes=0
|
||||
sudo apt-get install -y --no-install-recommends clazy
|
||||
#TODO: check where this "clazyQT6.yaml" goes ; shall this be put in the fixes ?
|
||||
# Run clazy checks for Qt6 on all cpp files
|
||||
clazy-standalone --export-fixes=clazyQT6.yaml -checks=${{ inputs.clazyQT6Checks }} -p build/ ${{ inputs.changedCppFiles }} &>> ${{ env.logdir }}clazyQT6.log || true
|
||||
# If clazy has run successfully, write the Log to the console with the Problem Matchers
|
||||
if [ -f ${{ env.logdir }}clazyQT6.log ]
|
||||
then
|
||||
echo "::add-matcher::${{ runner.workspace }}/FreeCAD/.github/problemMatcher/clang.json"
|
||||
cat ${{ env.logdir }}clazyQT6.log
|
||||
echo "::remove-matcher owner=clang::"
|
||||
clazyQT6Errors=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): error: .+$" ${{ env.logdir }}clazyQT6.log | wc -l ) || true
|
||||
clazyQT6Warnings=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): warning: .+$" ${{ env.logdir }}clazyQT6.log | wc -l ) || true
|
||||
clazyQT6Notes=$(grep -nIHE "^(.+):([0-9]+):([0-9]+): note: .+$" ${{ env.logdir }}clazyQT6.log | wc -l ) || true
|
||||
fi
|
||||
echo "Found $clazyQT6Errors errors, $clazyQT6Warnings warnings, $clazyQT6Notes notes"
|
||||
# Write the report
|
||||
if [ "$clazyQT6Errors" -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:fire: Clazy found :fire: $clazyQT6Errors errors, :warning: $clazyQT6Warnings warnings and :pencil2: $clazyQT6Notes notes for porting to QT6</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ "$clazyQT6Warnings" -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:warning: Clazy found :warning: $clazyQT6Warnings warnings and :pencil2: $clazyQT6Notes notes for porting to QT6</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
elif [ "$clazyNotes" -gt 0 ]
|
||||
then
|
||||
echo "<details><summary>:pencil2: Clazy found :pencil2: $clazyQT6Notes notes for porting to QT6</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
else
|
||||
echo "<details><summary>:heavy_check_mark: Clazy found no errors, warnings or notes for porting to QT6</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
fi
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}clazyQT6.log >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo '```' >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
[ $clazyQT6Errors -eq 0 ]
|
||||
- name: Upload logs and fixes
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
${{ env.fixesdir }}
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
${{env.reportdir}}${{ env.reportfilename }}
|
||||
@@ -1,162 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This is the pre-check workflow for CI of FreeCAD.
|
||||
# It aims at running some basic checks about the workflow run ...
|
||||
# ... and gathering some data needed for the next steps.
|
||||
|
||||
name: Prepare
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
artifactBasename:
|
||||
type: string
|
||||
required: true
|
||||
dontFailOnOldRebase:
|
||||
default: true
|
||||
type: boolean
|
||||
required: false
|
||||
maxRebaseHours:
|
||||
default: "48"
|
||||
type: string
|
||||
required: false
|
||||
outputs:
|
||||
reportFile:
|
||||
value: ${{ jobs.Prepare.outputs.reportFile }}
|
||||
changedFiles:
|
||||
value: ${{ jobs.Prepare.outputs.changedFiles }}
|
||||
changedPythonFiles:
|
||||
value: ${{ jobs.Prepare.outputs.changedPythonFiles }}
|
||||
changedCppFiles:
|
||||
value: ${{ jobs.Prepare.outputs.changedCppFiles }}
|
||||
|
||||
jobs:
|
||||
|
||||
Prepare:
|
||||
env:
|
||||
isPR: ${{ github.event_name == 'pull_request' }}
|
||||
isPush: ${{ github.event_name == 'push' }}
|
||||
logdir: /tmp/logs/
|
||||
reportdir: /tmp/report/
|
||||
reportfilename: ${{ inputs.artifactBasename }}-report.md
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
outputs:
|
||||
reportFile: ${{ steps.Init.outputs.reportFile }}
|
||||
changedFiles: ${{ steps.Output.outputs.changedFiles }}
|
||||
changedPythonFiles: ${{ steps.Output.outputs.changedPythonFiles }}
|
||||
changedCppFiles: ${{ steps.Output.outputs.changedCppFiles }}
|
||||
|
||||
steps:
|
||||
- name: Make needed directories, files and initializations
|
||||
id: Init
|
||||
run: |
|
||||
mkdir -p ${{ env.logdir }}
|
||||
mkdir -p ${{ env.reportdir }}
|
||||
commitCnt=0
|
||||
touch ${{ env.logdir }}changedFiles.lst ${{ env.logdir }}changedCppFiles.lst ${{ env.logdir }}changedPythonFiles.lst
|
||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
||||
- name: Determine base and head SHA in case of PR
|
||||
if: env.isPR == 'true'
|
||||
run: |
|
||||
baseSha=${{ github.event.pull_request.base.sha }}
|
||||
headSha=${{ github.event.pull_request.head.sha }}
|
||||
echo "baseSha=$baseSha" >> $GITHUB_ENV
|
||||
echo "headSha=$headSha" >> $GITHUB_ENV
|
||||
echo "This CI run is performed on a Pull Request" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "Base SHA is $baseSha, Head SHA is $headSha" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: Check if PR has been recently rebased
|
||||
if: env.isPR == 'true'
|
||||
continue-on-error: ${{ inputs.dontFailOnOldRebase }}
|
||||
run: |
|
||||
baseDate=$(curl -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/commits/$baseSha | jq -r '.commit.committer.date')
|
||||
dateDiff=$(( ( $(date +%s) - $(date -d $baseDate +%s) ) / 3600 ))
|
||||
echo "Pull request is based on a $dateDiff hour-old commit" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
# Exit the step with appropriate code
|
||||
if [ $dateDiff -gt ${{ inputs.maxRebaseHours }} ]
|
||||
then
|
||||
echo -n ":warning: Pull request should be rebased" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
exit 1
|
||||
fi
|
||||
- name: Determine base and head SHA in case of push
|
||||
if: env.isPush == 'true'
|
||||
run: |
|
||||
baseSha=${{ github.event.before }}
|
||||
headSha=${{ github.event.after }}
|
||||
echo "headSha=$headSha" >> $GITHUB_ENV
|
||||
if [ $baseSha -eq 0 ]
|
||||
then
|
||||
echo "This CI run is performed on a Push that created a new branch : files changed will be ignored" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "Head SHA is $headSha" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "isPush='false'" >> $GITHUB_ENV
|
||||
else
|
||||
echo "This CI run is performed on a Push" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "Base SHA is $baseSha, Head SHA is $headSha" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "baseSha=$baseSha" >> $GITHUB_ENV
|
||||
fi
|
||||
- name: Get compare between head and base
|
||||
if: env.isPR == 'true' || env.isPush == 'true'
|
||||
run: |
|
||||
echo "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/compare/$baseSha...$headSha"
|
||||
curl -H "Accept: application/vnd.github+json" -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/compare/$baseSha...$headSha > ${{ env.logdir }}compare.json
|
||||
- name: Get number of commits in the changeset
|
||||
if: env.isPR == 'true' || env.isPush == 'true'
|
||||
run: |
|
||||
commitCnt=$(jq -re '.ahead_by' ${{ env.logdir }}compare.json)
|
||||
echo "Changeset is composed of $commitCnt commit(s)" | tee -a ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: Get files modified in changeset #TODO check what happens with deleted file in the subsequent process
|
||||
if: env.isPR == 'true' || env.isPush == 'true'
|
||||
run: |
|
||||
jq '.files[] | if .status != "removed" then .filename else empty end' ${{ env.logdir }}compare.json > ${{ env.logdir }}changedFiles.lst
|
||||
grep -E '\.(py|py3)"' ${{ env.logdir }}changedFiles.lst > ${{ env.logdir }}changedPythonFiles.lst || true
|
||||
grep -E '\.(c|c\+\+|cc|cpp|cu|cuh|cxx|h|h\+\+|hh|hpp|hxx)"' ${{ env.logdir }}changedFiles.lst > ${{ env.logdir }}changedCppFiles.lst || true
|
||||
# Write the report
|
||||
echo "::group::Modified files in changeset (removed files are ignored) :" ; cat ${{ env.logdir }}changedFiles.lst ; echo "::endgroup::"
|
||||
echo "<details><summary>Modified files (removed files are ignored):</summary>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
cat ${{ env.logdir }}changedFiles.lst >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "</details>" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
echo "" >> ${{env.reportdir}}${{ env.reportfilename }}
|
||||
- name: Transmitting outputs
|
||||
id: Output
|
||||
run: |
|
||||
echo "changedFiles=$(cat ${{ env.logdir }}changedFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||
echo "changedPythonFiles=$(cat ${{ env.logdir }}changedPythonFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||
echo "changedCppFiles=$(cat ${{ env.logdir }}changedCppFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
${{env.reportdir}}${{ env.reportfilename }}
|
||||
@@ -1,117 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
# ***************************************************************************
|
||||
# * *
|
||||
# * Copyright (c) 2023 0penBrain. *
|
||||
# * *
|
||||
# * This file is part of FreeCAD. *
|
||||
# * *
|
||||
# * FreeCAD is free software: you can redistribute it and/or modify it *
|
||||
# * under the terms of the GNU Lesser General Public License as *
|
||||
# * published by the Free Software Foundation, either version 2.1 of the *
|
||||
# * License, or (at your option) any later version. *
|
||||
# * *
|
||||
# * FreeCAD is distributed in the hope that it will be useful, but *
|
||||
# * WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
# * Lesser General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Lesser General Public *
|
||||
# * License along with FreeCAD. If not, see *
|
||||
# * <https://www.gnu.org/licenses/>. *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
|
||||
# This is a generic wrapup workflow that only aims at gathering reports and ...
|
||||
# ... presenting them as a unified summary
|
||||
#
|
||||
# It expects steps to be summarized to be presented a JSON input formatted ...
|
||||
# ... as the "needs" context of Github :
|
||||
# https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
|
||||
# In addition to standard "result", each step shall have a string entry in "outputs" ...
|
||||
# ... named "reportFile" containing the name of the corresponding report. The ...
|
||||
# ... report file shall be available in an artifact with the same name.
|
||||
|
||||
name: WrapUp
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
previousSteps:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
|
||||
WrapUp:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
artifactsDownloadDir: /tmp/artifacts/
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Make needed directories, files and initializations
|
||||
run: |
|
||||
mkdir -p ${{ env.artifactsDownloadDir }}
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: ${{ env.artifactsDownloadDir }}
|
||||
- name: Save input data to file
|
||||
run: |
|
||||
cat > data << "EOD"
|
||||
${{ inputs.previousSteps }}
|
||||
EOD
|
||||
- name: Compute the report
|
||||
run: |
|
||||
echo "usedArtifacts<<EOD" >> $GITHUB_ENV
|
||||
for step in $(jq -r "keys_unsorted | .[]" data)
|
||||
do
|
||||
echo "Processing step $step"
|
||||
result=$(jq -r ".\"$step\".result" data)
|
||||
icon=":heavy_check_mark:"
|
||||
if [ $result == 'failure' ]
|
||||
then
|
||||
icon=":x:"
|
||||
elif [ $result == 'cancelled' ]
|
||||
then
|
||||
icon=":no_entry_sign:"
|
||||
elif [ $result == 'skipped' ]
|
||||
then
|
||||
icon=":white_check_mark:"
|
||||
fi
|
||||
echo "### $icon $step step" >> report.md
|
||||
if [ $result == 'skipped' ]
|
||||
then
|
||||
echo "Step was skipped, no report was generated" | tee -a report.md
|
||||
continue
|
||||
elif [ $result == 'cancelled' ]
|
||||
then
|
||||
echo "Step was cancelled when executing, report may be incomplete" | tee -a report.md
|
||||
fi
|
||||
report=$(jq -r ".\"$step\".outputs.reportFile" data)
|
||||
if [ $report ]
|
||||
then
|
||||
echo "Report for step $step is $report"
|
||||
echo "$report" >> $GITHUB_ENV
|
||||
if [ $(find ${{ env.artifactsDownloadDir }} -type f -name $report | wc -l) -eq 1 ]
|
||||
then
|
||||
find ${{ env.artifactsDownloadDir }} -type f -name $report -exec cat {} \; >> report.md
|
||||
else
|
||||
echo "No or several files found for report $report, not printing" | tee -a report.md
|
||||
echo "Below files found :"
|
||||
find ${{ env.artifactsDownloadDir }} -type f -name $report
|
||||
fi
|
||||
else
|
||||
echo "Report file was not set by step $step" | tee -a report.md
|
||||
fi
|
||||
echo "" >> report.md
|
||||
done
|
||||
echo "EOD" >> $GITHUB_ENV
|
||||
cat report.md >> $GITHUB_STEP_SUMMARY
|
||||
- name: Delete used artifacts
|
||||
continue-on-error: true
|
||||
uses: geekyeggo/delete-artifact@v2
|
||||
with:
|
||||
name: |
|
||||
${{ env.usedArtifacts }}
|
||||
@@ -10,13 +10,11 @@
|
||||
*.lib
|
||||
*.pch
|
||||
*.vcproj
|
||||
*.kdev4
|
||||
*.exp
|
||||
*.dep
|
||||
*.manifest
|
||||
*.o
|
||||
*.orig
|
||||
*.output
|
||||
qrc_*.cpp
|
||||
BuildLog.htm
|
||||
cmake_install.cmake
|
||||
@@ -37,10 +35,8 @@ install_manifest.txt
|
||||
/Mod/
|
||||
/ZERO_CHECK.dir/
|
||||
/build/
|
||||
/cmake-build*/
|
||||
/src/Tools/offlinedoc/localwiki/
|
||||
/src/Tools/offlinedoc/*.txt
|
||||
/conda/environment.yml
|
||||
OpenSCAD_rc.py
|
||||
tags
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Wrn:
|
||||
Err:
|
||||
Cannot find icon:
|
||||
@@ -1,33 +0,0 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
files: |
|
||||
(?x)^(
|
||||
tests/src
|
||||
)
|
||||
exclude: |
|
||||
(?x)^(
|
||||
.*vcproj.*|
|
||||
.*vcxproj.*|
|
||||
src|
|
||||
tests/src
|
||||
)
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v3.4.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- id: mixed-line-ending
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.12.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ['--line-length', '100']
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v15.0.7
|
||||
hooks:
|
||||
- id: clang-format
|
||||
@@ -3,7 +3,7 @@
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=yes
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
# Load and enable all available extensions. Use --list-extensions to see a list
|
||||
# all available extensions.
|
||||
@@ -57,7 +57,7 @@ ignore-patterns=^\.#
|
||||
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||
# and thus existing member attributes cannot be deduced by static analysis). It
|
||||
# supports qualified module names, as well as Unix pattern matching.
|
||||
ignored-modules=FreeCAD,FreeCADGui
|
||||
ignored-modules=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
@@ -82,7 +82,7 @@ persistent=yes
|
||||
|
||||
# Minimum Python version to use for version dependent checks. Will default to
|
||||
# the version used to run pylint.
|
||||
py-version=3.8
|
||||
py-version=3.10
|
||||
|
||||
# Discover python modules and packages in the file system subtree.
|
||||
recursive=no
|
||||
@@ -227,7 +227,7 @@ const-naming-style=UPPER_CASE
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=4
|
||||
docstring-min-length=-1
|
||||
|
||||
# Naming style matching correct function names.
|
||||
function-naming-style=snake_case
|
||||
@@ -352,7 +352,7 @@ ignored-parents=
|
||||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=15
|
||||
max-attributes=7
|
||||
|
||||
# Maximum number of boolean expressions in an if statement (see R0916).
|
||||
max-bool-expr=5
|
||||
@@ -376,14 +376,14 @@ max-returns=6
|
||||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=1
|
||||
min-public-methods=2
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when caught.
|
||||
overgeneral-exceptions=builtins.BaseException,
|
||||
builtins.Exception
|
||||
overgeneral-exceptions=BaseException,
|
||||
Exception
|
||||
|
||||
|
||||
[FORMAT]
|
||||
@@ -426,7 +426,7 @@ allow-any-import-level=
|
||||
allow-wildcard-with-all=no
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma.
|
||||
deprecated-modules=PySide2
|
||||
deprecated-modules=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of external dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
|
||||
Executable
+357
@@ -0,0 +1,357 @@
|
||||
######
|
||||
#
|
||||
# Travis-CI configuration file for FreeCAD.
|
||||
#
|
||||
# This build configuration will build and test FreeCAD on both Linux
|
||||
# and Mac OS X. For Mac OS X, this configuration will also package
|
||||
# and deploy the build to GitHub provided the following prerequisites
|
||||
# are satisfied:
|
||||
#
|
||||
# GH_TOKEN is defined as a secure environment variable and contains a
|
||||
# a valid GitHub OAUTH token with repo_deployment scope.
|
||||
# NOTE: Define this env using the Travis-CI Repo Settings UI
|
||||
#
|
||||
# FREECAD_RELEASE: A GitHub Release with this identifier exists in the
|
||||
# repo. The Travis job will deploy the OS X build to this
|
||||
# GitHub release name as a release asset.
|
||||
#
|
||||
# DEPLOY: Repo setting to deploy (defaults to no deploy to reduce
|
||||
# Travis build times. Set DEPLOY=1 to enable in repo settings.
|
||||
######
|
||||
env:
|
||||
global:
|
||||
- GENERATOR="Unix Makefiles"
|
||||
- CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}
|
||||
# - FREECAD_RELEASE="0.18"
|
||||
# - DEPLOY_RELEASE=${DEPLOY_RELEASE:-$FREECAD_RELEASE}
|
||||
# - OSX_PORTS_CACHE=${OSX_PORTS_CACHE:-FreeCAD/FreeCAD-ports-cache}
|
||||
# - DEPLOY=${DEPLOY:-0}
|
||||
|
||||
# jobs:
|
||||
# chunk.io key (if needed, obtain it with Yorik, PrzemoF, Kunda1)
|
||||
# secure: MJu0ZU/9Yqut6bUkHoSrXTV/c/WhCLR0KnHKCsnEU081PYoukzH6ngzgKk7/trAH2In080d/ra4B2OmTNl/LAgV6DXKFY9dO1aG8QwcrHgaMPf0pHYUy/OfwQSFYFByQDV2OEMAHcIWc/dtNkzK2QUi44Kn7d0GtSEiN4s816lriWtjg0vmEGAU8MjvcAGss4gKyn05Xm1NUCYPKgpgIHsywLbpE76lv0eOYoosEuKv5Q9Pb4FMQts02+JUlqE8eY4ZZ3nV8iQbgIDdseOSA7Ixn05zWjU/ZRZ74TrYxMnzfUAwQcJe9OcqoESq+pPWQt5HYG66VmeVxQim1gmsiDASH51U/nswKt0Q4bISj3tVk0YZMFV8Ax+SzPvLEmFZJQGfgO1mg7HdNcz9N9G5JHPawrV19DwYIEFbAw8MCSAoIXFOcPQZUWXCbtjm7NO9vCjMrqyVJMDD9L8omvQajHoajuHbOT8KB250gFokeLj3z8yu++Tz+IrZX5inUMrXsARVt/ALXpi8rJPXmoFMpMUjyWmDPqPWlnqUhLtTtEtKpuOWP8ZnWVwkg4QYOUhCy95C1okJSGkG+ylHWncWfY4mS+UBT525laoh+GOhH+sRW+p2xkI21xGFRqg1oHjjgY1yIYF6nnSHPzxMBRYmZwagyXsjkFG5FPMWR2oYk0Yg
|
||||
|
||||
git:
|
||||
depth: 5000
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/479456663cdf5c84e4d8
|
||||
on_success: always
|
||||
on_failure: always
|
||||
on_start: change
|
||||
|
||||
# Inject osx build into matrix - needed to specify image/dist
|
||||
jobs:
|
||||
# allow_failures:
|
||||
# - python: 3.7
|
||||
fast_finish: true # https://blog.travis-ci.com/2013-11-27-fast-finishing-builds
|
||||
include:
|
||||
- if: type != pull_request
|
||||
os: linux
|
||||
dist: bionic
|
||||
language: cpp
|
||||
compiler: clang
|
||||
cache: ccache
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
packages:
|
||||
- clang-10
|
||||
env:
|
||||
- CC=clang-10
|
||||
- CXX=clang++-10
|
||||
- CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON"
|
||||
- CACHE_NAME=JOB1
|
||||
|
||||
- os: linux
|
||||
dist: bionic
|
||||
language: cpp
|
||||
compiler: gcc-10
|
||||
cache: ccache
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages:
|
||||
- gcc-10
|
||||
- g++-10
|
||||
env:
|
||||
- CC=gcc-10
|
||||
- CXX=g++-10
|
||||
- CC_FOR_BUILD=gcc-10
|
||||
- CXX_FOR_BUILD=g++-10
|
||||
- CMAKE_ARGS="-DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_C_COMPILER=/usr/bin/cc -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_FEM_NETGEN=ON"
|
||||
- CACHE_NAME=JOB2
|
||||
|
||||
# - os: osx
|
||||
# osx_image: xcode11.6
|
||||
# language: cpp
|
||||
# cache:
|
||||
# - ccache: true
|
||||
# - directories:
|
||||
# - $HOME/.ccache
|
||||
# - $HOME/Library/Caches/Homebrew
|
||||
# - /usr/local/Homebrew
|
||||
# env:
|
||||
# - CMAKE_OPTS="-DBUILD_QT5=ON -DBUILD_ENABLE_CXX_STD='C++17' -DUSE_PYTHON3=1 -DCMAKE_CXX_FLAGS='-Wno-deprecated-declarations' -DBUILD_FEM_NETGEN=1 -DBUILD_FEM=1 -DBUILD_TECHDRAW=0 -DCMAKE_PREFIX_PATH='/usr/local/opt/qt/lib/cmake;/usr/local/opt/nglib/Contents/Resources' -DBUILD_FEM_NETGEN:BOOL=ON -DFREECAD_USE_EXTERNAL_KDL=ON -DCMAKE_BUILD_TYPE=Release"
|
||||
# - PATH=/usr/local/bin:$PATH
|
||||
# - CACHE_NAME=OSX1
|
||||
|
||||
- os: windows
|
||||
language: cpp
|
||||
env:
|
||||
- CMAKE_OPTS="-DBUILD_FEM_NETGEN=OFF -DFREECAD_RELEASE_PDB=OFF -DFREECAD_RELEASE_SEH=OFF"
|
||||
- GENERATOR="Visual Studio 15 2017 Win64"
|
||||
- PYTHON_MAJOR_VERSION=3
|
||||
- MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
|
||||
- TEST_PATH="C:\Users\travis\build\FreeCAD\FreeCAD\build\bin"
|
||||
- CLCACHE_PATH="C:\Users\travis\build\FreeCAD\FreeCAD"
|
||||
- VS15=true
|
||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||
- CCACHE_COMPRESS=1
|
||||
- CCACHE_DIR=$HOME/.ccache
|
||||
- CACHE_NAME=JOB5
|
||||
# enable this if clcache extended log is needed
|
||||
#- CLCACHE_LOG=1
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/clcache
|
||||
|
||||
# - language: python
|
||||
# python: 3.7
|
||||
# dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
|
||||
# before_install: true
|
||||
# install: python3 -m pip install flake8
|
||||
# # fail the build if there are Python syntax errors or undefined names
|
||||
# script: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
|
||||
|
||||
before_cache:
|
||||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
|
||||
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi
|
||||
|
||||
before_install:
|
||||
# - eval "$(curl -fsSL "https://raw.githubusercontent.com/${OSX_PORTS_CACHE}/v${FREECAD_RELEASE}/travis-helpers.sh")"
|
||||
- |
|
||||
case "${TRAVIS_OS_NAME}" in
|
||||
|
||||
"linux")
|
||||
# Daily PPA for OCCT, Pivy, Netgen, PySide ... packages
|
||||
sudo apt-add-repository -y ppa:freecad-maintainers/freecad-daily
|
||||
sudo apt-get update -qq
|
||||
# Build deps
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
python-dev \
|
||||
python-pyside \
|
||||
python-matplotlib \
|
||||
python3-dev \
|
||||
python3-pyside \
|
||||
python3-matplotlib \
|
||||
libboost1.65-dev \
|
||||
libboost-filesystem1.65-dev \
|
||||
libboost-program-options1.65-dev \
|
||||
libboost-python1.65-dev \
|
||||
libboost-regex1.65-dev \
|
||||
libboost-signals1.65-dev \
|
||||
libboost-system1.65-dev \
|
||||
libboost-thread1.65-dev \
|
||||
libxerces-c-dev \
|
||||
libocct-data-exchange-dev \
|
||||
libocct-ocaf-dev \
|
||||
libocct-visualization-dev \
|
||||
libvtk7-dev \
|
||||
libmedc-dev \
|
||||
pybind11-dev \
|
||||
swig \
|
||||
qt4-qmake \
|
||||
libqt4-opengl-dev \
|
||||
libqtwebkit-dev \
|
||||
qtbase5-dev \
|
||||
libqt5xmlpatterns5-dev \
|
||||
libqt5svg5-dev \
|
||||
libqt5opengl5-dev \
|
||||
qttools5-dev \
|
||||
qtwebengine5-dev \
|
||||
libcoin80-dev \
|
||||
libpyside-dev \
|
||||
libpyside2-dev \
|
||||
libshiboken-dev \
|
||||
libshiboken2-dev \
|
||||
pyside-tools \
|
||||
pyside2-tools \
|
||||
doxygen \
|
||||
graphviz \
|
||||
libnglib-dev \
|
||||
netgen \
|
||||
netgen-headers \
|
||||
libmetis-dev \
|
||||
libspnav-dev
|
||||
# Runtime deps
|
||||
sudo apt-get install -y --no-install-recommends freecad-daily-python3 python-pivy python3-pivy python-ply python3-ply
|
||||
|
||||
# Use newer Eigen to suppress warnings
|
||||
# https://github.com/FreeCAD/FreeCAD/pull/3485
|
||||
wget http://mirrors.kernel.org/ubuntu/pool/universe/e/eigen3/libeigen3-dev_3.3.7-2_all.deb
|
||||
sudo dpkg -i libeigen3-dev_3.3.7-2_all.deb
|
||||
|
||||
export DISPLAY=:99.0
|
||||
sh -e /etc/init.d/xvfb start
|
||||
|
||||
export INSTALLED_APP_PATH="/usr/local/bin/FreeCAD"
|
||||
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/netgen/:$LD_LIRBARY_PATH
|
||||
;;
|
||||
|
||||
"osx")
|
||||
xcodebuild -version -sdk
|
||||
brew --config
|
||||
brew install ccache
|
||||
brew install coreutils
|
||||
brew update >/dev/null
|
||||
brew --config
|
||||
brew update
|
||||
brew upgrade
|
||||
brew install python@3.9
|
||||
brew unlink python@3.8
|
||||
brew link --overwrite --force python@3.9
|
||||
rm /usr/local/bin/python
|
||||
ln -s /usr/local/bin/python3 /usr/local/bin/python
|
||||
pip3 install six
|
||||
pip3 install pyyaml
|
||||
pip3 install ply
|
||||
export PATH=/usr/local/bin:$PATH
|
||||
brew reinstall vtk@8.2
|
||||
brew link --force vtk@8.2
|
||||
which python
|
||||
python --version
|
||||
brew install boost
|
||||
brew install boost-python3
|
||||
brew tap FreeCAD/freecad
|
||||
brew install freecad/freecad/coin
|
||||
brew install freecad/freecad/nglib
|
||||
brew install freecad/freecad/med-file
|
||||
brew install freecad/freecad/opencamlib
|
||||
brew install freecad/freecad/shiboken2
|
||||
brew install freecad/freecad/pyside2
|
||||
brew install freecad/freecad/pyside2-tools
|
||||
brew install freecad/freecad/pivy
|
||||
brew install freecad/freecad/matplotlib
|
||||
|
||||
##Install the 3DConnexion frameworks
|
||||
if [ ! -d /Library/Frameworks/3DconnexionClient.framework ]; then
|
||||
curl -o /tmp/3dFW.dmg -L 'https://download.3dconnexion.com/drivers/mac/10-6-6_360DF97D-ED08-4ccf-A55E-0BF905E58476/3DxWareMac_v10-6-6_r3234.dmg'
|
||||
hdiutil attach -readonly /tmp/3dFW.dmg
|
||||
sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
|
||||
diskutil eject /Volumes/3Dconnexion\ Software
|
||||
fi
|
||||
export CMAKE_OPTS="${CMAKE_OPTS} -DFREECAD_CREATE_MAC_APP=OFF"
|
||||
export INSTALLED_APP_PATH="/usr/local/MacOS/FreeCAD"
|
||||
|
||||
export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_USE_EXTERNAL_KDL=ON"
|
||||
brew link --overwrite matplotlib
|
||||
if [ -f "/usr/local/Cellar/opencascade/7.4.0_1/include/opencascade/Standard_Macro.hxx" ]; then
|
||||
sed '1,$s/\[\[nodiscard\]\]//' /usr/local/Cellar/opencascade/7.4.0_1/include/opencascade/Standard_Macro.hxx > /tmp/Standard_Macro.hxx && cp /tmp/Standard_Macro.hxx /usr/local/Cellar/opencascade/7.4.0_1/include/opencascade/Standard_Macro.hxx ;
|
||||
fi
|
||||
;;
|
||||
|
||||
"windows")
|
||||
#choco install -y python
|
||||
#py -m pip install --quiet --upgrade pip
|
||||
#py -m pip install git+https://github.com/frerich/clcache.git@v4.2.0
|
||||
curl -L https://github.com/frerich/clcache/releases/download/v4.2.0/clcache-4.2.0.zip --output clcache-4.2.0.zip
|
||||
7z x clcache-4.2.0.zip > /dev/null
|
||||
export PATH=$CLCACHE_PATH:$PATH
|
||||
export PATH=$TEST_PATH:$PATH
|
||||
#reset clcache hit stats
|
||||
cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -z'
|
||||
# clcache stats before compilation
|
||||
cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
|
||||
|
||||
curl -L https://github.com/FreeCAD/FreeCAD/releases/download/0.19.1/FreeCADLibs_12.5.3_x64_VC17.7z --output FreeCADLibs.7z
|
||||
7z x FreeCADLibs.7z -oFreeCADLibs > /dev/null
|
||||
rm -f FreeCADLibs.7z
|
||||
export FREECAD_LIBPACK_DIR="$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.5.3_x64_VC17"
|
||||
|
||||
export CMAKE_ARGS="${CMAKE_OPTS} -DFREECAD_LIBPACK_DIR=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.5.3_x64_VC17 -DPYTHON_EXECUTABLE=$TRAVIS_BUILD_DIR\FreeCADLibs\FreeCADLibs_12.5.3_x64_VC17\bin\python.exe \
|
||||
-DBUILD_QT5=TRUE"
|
||||
export PATH=$MSBUILD_PATH:$PATH
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Invalid or unsupported operating system ${TRAVIS_OS_NAME}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
install:
|
||||
####
|
||||
# Build FreeCAD with cmake options set above for each platform
|
||||
##
|
||||
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export PATH="/usr/local/bin:/usr/local/opt/ccache/libexec:$PATH"; fi
|
||||
- echo ${CMAKE_ARGS}
|
||||
- mkdir build && cd build && cmake -Wno-dev -G"${GENERATOR}" ${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ../
|
||||
|
||||
script:
|
||||
####
|
||||
# Install FreeCAD and run unit tests. Test failures will fail the build
|
||||
##
|
||||
# MSBuild.exe /m FreeCAD.sln
|
||||
- |
|
||||
if [ "${TRAVIS_OS_NAME}" == "windows" ]; then
|
||||
# https://travis-ci.community/t/vcvarsall-bat-freezes-on-new-1809-based-windows-images/7098/6
|
||||
# call msbuild using clcache
|
||||
#cmd.exe //C '"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64 && MSBuild.exe FreeCAD.sln /p:CLToolExe=clcache.exe /p:TrackFileAccess=false /p:CLToolPath=C:\Users\travis\build\FreeCAD\FreeCAD /m:2 /nologo /verbosity:minimal /p:Configuration=Release /p:Platform=x64'
|
||||
cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\.travis\build.bat'
|
||||
# ls -lahR
|
||||
mkdir bin/
|
||||
mv ../FreeCADLibs/FreeCADLibs_12.5.3_x64_VC17/bin/* bin/
|
||||
du -hs bin/
|
||||
# show clcache hit stats
|
||||
cmd.exe //C 'C:\Users\travis\build\FreeCAD\FreeCAD\clcache.exe -s'
|
||||
# run the tests
|
||||
#cmd.exe //C 'cd C:\Users\travis\build\FreeCAD\FreeCAD\build\bin && FreeCADCmd.exe --run-test 0'
|
||||
# Make build fail if ANY of the following fails
|
||||
#set -ev
|
||||
winpty.exe -Xallow-non-tty -Xplain /C/Users/travis/build/FreeCAD/FreeCAD/build/bin/FreeCADCmd.exe --run-test 0 | tee runlog.txt
|
||||
grep -q FAILED runlog.txt ; [ $? == 1 ] && echo "Build succeeded and tests passed!" || ( echo "Tests failed!" && false )
|
||||
else
|
||||
# Stop compiling (GCC) after 2 hrs 50 min (3 hrs limit).
|
||||
# Preserves created ccache for the next build job.
|
||||
# if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo timeout -k 175m 170m make -j2 install || true; fi
|
||||
# if [ "${TRAVIS_OS_NAME}" == "osx" ]; then sudo gtimeout -s KILL make -j2 install; fi
|
||||
cat $HOME/.ccache/ccache.conf
|
||||
ccache -z -s
|
||||
df -h
|
||||
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then export PATH="/usr/local/opt/ccacche/libexec:$PATH"; sudo gtimeout -s KILL 7200 make -j2; [ $? == 124 ] && { ccache -s; return 0; } fi
|
||||
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then sudo timeout -k 175m 170m make -j2 install || true; fi
|
||||
sudo make -j2 install
|
||||
ccache -s
|
||||
${INSTALLED_APP_PATH} --console --run-test 0 || travis_terminate 1
|
||||
${INSTALLED_APP_PATH} --log-file /tmp/FreeCAD_installed.log &
|
||||
sleep 10 && pkill FreeCAD
|
||||
cat /tmp/FreeCAD_installed.log
|
||||
grep --file=../.log_errors /tmp/FreeCAD_installed.log ; [ $? == 1 ] && echo "No errors from .log_errors file found in the log after start from /usr/local/bin" || ( echo "Error from .log_errors found!" && false )
|
||||
fi
|
||||
|
||||
#after_success:
|
||||
# Package and deploy the build to GitHub. This will only run for builds on
|
||||
# master (i.e. pull requests are only built and tested but not deployed).
|
||||
#
|
||||
# GH_TOKEN must be set in order to deploy releases to GitHub
|
||||
#
|
||||
#- |
|
||||
# if [ "${TRAVIS_OS_NAME}" == "osx" -a "${TRAVIS_PULL_REQUEST}" == "false" -a "${DEPLOY}" == "1" ]; then
|
||||
# brew ls --versions jq || brew install jq
|
||||
# npm install -g appdmg
|
||||
# export VSN=$(python ${TRAVIS_BUILD_DIR}/src/Tools/ArchiveNameFromVersionHeader.py ${TRAVIS_BUILD_DIR}/build/src/Build/Version.h)
|
||||
# export DEPLOYMENT_ARCHIVE=${VSN}-${QT}.dmg
|
||||
# appdmg ${TRAVIS_BUILD_DIR}/src/MacAppBundle/DiskImage/layout.json "${DEPLOYMENT_ARCHIVE}"
|
||||
# deployContext=$(create_helper_context repo=${TRAVIS_REPO_SLUG} auth_token=${GH_TOKEN} release=${DEPLOY_RELEASE})
|
||||
# gitHub_deploy_asset_to_release_named $deployContext ${DEPLOYMENT_ARCHIVE}
|
||||
# gitHub_prune_assets_for_release_named $deployContext "-${QT}" 1
|
||||
# fi
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
echo on
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" amd64
|
||||
|
||||
MSBuild.exe FreeCAD.sln /p:CLToolExe=clcache.exe /p:TrackFileAccess=false /p:CLToolPath=C:\Users\travis\build\FreeCAD\FreeCAD /m:2 /nologo /verbosity:minimal /p:Configuration=Release /p:Platform=x64
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "FreeCAD",
|
||||
"includePath": ["${workspaceFolder}/**"],
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"configurationProvider": "ms-vscode.cmake-tools"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "FreeCAD Linux",
|
||||
"compilers": {
|
||||
"C": "${workspaceFolder}/.conda/freecad/bin/cc",
|
||||
"CXX": "${workspaceFolder}/.conda/freecad/bin/c++"
|
||||
},
|
||||
"environmentSetupScript": "${workspaceFolder}/.vscode/env.sh"
|
||||
},
|
||||
{
|
||||
"name": "FreeCAD macOS",
|
||||
"compilers": {
|
||||
"C": "${workspaceFolder}/.conda/freecad/bin/clang",
|
||||
"CXX": "${workspaceFolder}/.conda/freecad/bin/clang++"
|
||||
},
|
||||
"environmentSetupScript": "${workspaceFolder}/.vscode/env.sh"
|
||||
}
|
||||
]
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source activate freecad
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-vscode.cpptools-extension-pack",
|
||||
"ms-python.python"
|
||||
]
|
||||
}
|
||||
Vendored
-48
@@ -1,48 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "C/C++: Linux: build and debug FreeCAD",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/build/bin/FreeCAD",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"preLaunchTask": "CMake: build"
|
||||
},
|
||||
{
|
||||
"name": "C/C++: macOS: build and debug FreeCAD",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/build/bin/FreeCAD",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "lldb",
|
||||
"preLaunchTask": "CMake: build"
|
||||
},
|
||||
{
|
||||
"name": "Python: Remote Attach",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"preLaunchTask": "conda: activate environment",
|
||||
"redirectOutput": true,
|
||||
"connect": {
|
||||
"host": "localhost",
|
||||
"port": 5678
|
||||
},
|
||||
"pathMappings": [
|
||||
{
|
||||
"localRoot": "${workspaceFolder}",
|
||||
"remoteRoot": "${workspaceFolder}"
|
||||
}
|
||||
],
|
||||
"justMyCode": false
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"__config": "cpp",
|
||||
"iosfwd": "cpp",
|
||||
"vector": "cpp",
|
||||
"tuple": "cpp"
|
||||
},
|
||||
"editor.formatOnType": true,
|
||||
"cmake.preferredGenerators": ["Ninja", "NMake Makefiles"],
|
||||
"cmake.cmakePath": "${workspaceFolder}/.conda/freecad/bin/cmake",
|
||||
"cmake.configureSettings": {
|
||||
"BUILD_WITH_CONDA:BOOL": "ON",
|
||||
"BUILD_FEM_NETGEN:BOOL": "ON",
|
||||
"FREECAD_USE_PYBIND11:BOOL": "ON",
|
||||
"FREECAD_USE_EXTERNAL_SMESH:BOOL": "ON"
|
||||
}
|
||||
}
|
||||
Vendored
-58
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "shell",
|
||||
"label": "conda: activate environment",
|
||||
"command": "activate freecad",
|
||||
"problemMatcher": [],
|
||||
"detail": "Activate conda environment",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"type": "cmake",
|
||||
"label": "CMake: configure",
|
||||
"command": "configure",
|
||||
"problemMatcher": [],
|
||||
"detail": "CMake template configure task",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"type": "cmake",
|
||||
"label": "CMake: build",
|
||||
"command": "build",
|
||||
"targets": ["all"],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [],
|
||||
"detail": "CMake template build task"
|
||||
},
|
||||
{
|
||||
"type": "cmake",
|
||||
"label": "CMake: test",
|
||||
"command": "test",
|
||||
"problemMatcher": [],
|
||||
"detail": "CMake template test task",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"type": "cmake",
|
||||
"label": "CMake: clean",
|
||||
"command": "clean",
|
||||
"problemMatcher": [],
|
||||
"detail": "CMake template clean task",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"type": "cmake",
|
||||
"label": "CMake: clean rebuild",
|
||||
"command": "cleanRebuild",
|
||||
"targets": ["all"],
|
||||
"problemMatcher": [],
|
||||
"detail": "CMake template clean rebuild task",
|
||||
"group": "build"
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
||||
@@ -222,7 +222,7 @@ cmake \
|
||||
-DBUILD_FEM=1 \
|
||||
-DBUILD_TECHDRAW=0 \
|
||||
-DFREECAD_USE_EXTERNAL_KDL=ON \
|
||||
-DFREECAD_CREATE_MAC_APP=OFF \
|
||||
-DFREECAD_CREATE_MAC_APP=OFF
|
||||
-DCMAKE_PREFIX_PATH="/usr/local/opt/qt/lib/cmake;/usr/local/opt/nglib/Contents/Resources;/usr/local/opt/vtk@8.2/lib/cmake;/usr/local;" .
|
||||
```
|
||||
|
||||
@@ -294,6 +294,6 @@ mv freecadd freecad;
|
||||
|
||||
[lnk1]: <http://brew.sh>
|
||||
[lnk2]: <https://github.com/FreeCAD/homebrew-freecad>
|
||||
[lnk3]: <https://forum.freecad.org/viewtopic.php?f=4&t=51981#p446796>
|
||||
[lnk3]: <https://forum.freecadweb.org/viewtopic.php?f=4&t=51981#p446796>
|
||||
[lnk4]: <https://gist.github.com/ipatch/6116824ab1f2a99b526cb07e43317b91#gistcomment-3577066>
|
||||
[lnk5]: <https://github.com/Homebrew/homebrew-core/pull/67615>
|
||||
+11
-31
@@ -1,7 +1,5 @@
|
||||
# As of January 2023 we require CMake 3.16.3
|
||||
# see https://forum.freecad.org/viewtopic.php?f=10&t=72173
|
||||
# for further info why
|
||||
cmake_minimum_required(VERSION 3.16.3 FATAL_ERROR)
|
||||
# March 2021, the oldest we have to support : Ununtu 18.04 LTS
|
||||
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
|
||||
|
||||
# policy CMP0072 was introduced with CMake 3.11
|
||||
# relates to FindOpenGL module
|
||||
@@ -10,27 +8,22 @@ if (POLICY CMP0072)
|
||||
set(OpenGL_GL_PREFERENCE LEGACY)
|
||||
endif(POLICY CMP0072)
|
||||
|
||||
if (BUILD_WITH_CONDA AND WIN32)
|
||||
option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" OFF)
|
||||
else()
|
||||
option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON)
|
||||
endif()
|
||||
|
||||
if(FREECAD_USE_CCACHE)
|
||||
find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
|
||||
if(CCACHE_PROGRAM)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||
endif()
|
||||
find_program(CCACHE_PROGRAM ccache) #This check should occur before project()
|
||||
if(CCACHE_PROGRAM)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||
endif()
|
||||
|
||||
project(FreeCAD)
|
||||
|
||||
set(PACKAGE_VERSION_NAME "Vulcan")
|
||||
set(PACKAGE_VERSION_MAJOR "0")
|
||||
set(PACKAGE_VERSION_MINOR "21")
|
||||
set(PACKAGE_VERSION_PATCH "2") # number of patch release (e.g. "4" for the 0.18.4 release)
|
||||
set(PACKAGE_VERSION_SUFFIX "") # either "dev" for development snapshot or "" (empty string)
|
||||
set(PACKAGE_BUILD_VERSION "0") # used when the same FreeCAD version will be re-released (for example using an updated LibPack)
|
||||
set(PACKAGE_VERSION_PATCH "0")
|
||||
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
|
||||
|
||||
set(FREECAD_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
|
||||
|
||||
set(FREECAD_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
|
||||
set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
|
||||
|
||||
@@ -49,7 +42,6 @@ InitializeFreeCADBuildOptions()
|
||||
CheckInterModuleDependencies()
|
||||
FreeCADLibpackChecks()
|
||||
SetupDoxygen()
|
||||
SetupLibFmt()
|
||||
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
SetupPython()
|
||||
SetupPCL()
|
||||
@@ -100,16 +92,4 @@ BuildAndInstallDesignerPlugin()
|
||||
|
||||
CreatePackagingTargets()
|
||||
|
||||
if(MSVC AND FREECAD_LIBPACK_USE AND LIBPACK_FOUND)
|
||||
CopyLibpackDirectories()
|
||||
endif()
|
||||
|
||||
if (ENABLE_DEVELOPER_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
PrintFinalReport()
|
||||
|
||||
message("\n=================================================\n"
|
||||
"Now run 'cmake --build ${CMAKE_BINARY_DIR}' to build ${PROJECT_NAME}\n"
|
||||
"=================================================\n")
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ further defined and clarified by project maintainers.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting any of the community admins or moderators at
|
||||
https://forum.freecad.org/memberlist.php?mode=team . All
|
||||
https://forum.freecadweb.org/memberlist.php?mode=team . All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
-100
@@ -1,100 +0,0 @@
|
||||
# FreeCAD Contribution Process (FCP)
|
||||
|
||||
FreeCAD's contribution process is inspired by the Collective Code Construction Contract which itself is an evolution of the github.com Fork and Pull Model.
|
||||
|
||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
|
||||
|
||||
|
||||
## 0. Status
|
||||
|
||||
FreeCAD is in a transition period. The following are to be regarded as GUIDELINES for contribution submission and acceptance. For historical reasons, the actual process MAY diverge from this process during the transition. Such deviations SHOULD be noted and discussed whenever possible.
|
||||
|
||||
## 1. Goals
|
||||
|
||||
The FreeCAD Contribution Process is expressed here with the following specific goals in mind:
|
||||
|
||||
1. To provide transparency and fairness in the contribution process.
|
||||
2. To allow contributions to be included as quickly as possible.
|
||||
3. To preserve and improve the code quality while encouraging appropriate experimentation and risk-taking.
|
||||
4. To minimize dependence on individual Contributors by encouraging a large pool of active Contributors.
|
||||
5. To be inclusive of many viewpoints and to harness a diverse set of skills.
|
||||
6. To provide an encouraging environment where Contributors learn and improve their skills.
|
||||
7. To protect the free and open nature of the FreeCAD project.
|
||||
|
||||
## 2. Fundamentals
|
||||
|
||||
1. FreeCAD uses the git distributed revision control system.
|
||||
2. Source code for the main application and related subprojects is hosted on github.com in the FreeCAD organization.
|
||||
3. Problems are discrete, well-defined limitations or bugs.
|
||||
4. FreeCAD uses GitHub's issue-tracking system to track problems and contributions. For help requests and general discussions, use the project forum.
|
||||
5. Contributions are sets of code changes that resolve a single problem.
|
||||
6. FreeCAD uses the Pull Request workflow for evaluating and accepting contributions.
|
||||
|
||||
## 3. Roles
|
||||
1. "User": A member of the wider FreeCAD community who uses the software.
|
||||
2. "Contributor": A person who submits a contribution that resolves a previously identified problem. Contributors do not have commit access to the repository unless they are also Maintainers. Everyone, without distinction or discrimination, SHALL have an equal right to become a Contributor.
|
||||
3. "Maintainer": A person who merges contributions. Maintainers may or may not be Contributors. Their role is to enforce the process. Maintainers have commit access to the repository.
|
||||
4. "Administrator": Administrators have additional authority to maintain the list of designated Maintainers.
|
||||
|
||||
## 4. Licensing, Ownership, and Credit
|
||||
1. FreeCAD is distributed under the Lesser General Public License, version 2, or superior (LGPL2+). Additional details can be found in the LICENSE file.
|
||||
2. All contributions to FreeCAD MUST use a compatible license.
|
||||
3. All contributions are owned by their authors unless assigned to another.
|
||||
4. FreeCAD does not have a mandatory copyright assignment policy.
|
||||
5. A Contributor who wishes to be identified in the Credits section of the application "About" dialog is responsible for identifying themselves. They should modify the Contributors file and submit a PR with a single commit for this modification only. The contributors file is found at https://github.com/FreeCAD/FreeCAD/blob/master/src/Doc/CONTRIBUTORS
|
||||
6. A contributor who does not wish to assume the copyright of their contribution MAY choose to assign it to the [FreeCAD project association](https://fpa.freecad.org) by mentioning **Copyright (c) 2022 The FreeCAD project association <fpa@freecad.org>** in the file's license code block.
|
||||
|
||||
## 5. Contribution Requirements
|
||||
|
||||
1. Contributions are submitted in the form of Pull Requests (PR).
|
||||
2. Maintainers and Contributors MUST have a GitHub account and SHOULD use their real names or a well-known alias.
|
||||
3. If the GitHub username differs from the username on the FreeCAD Forum, effort SHOULD be taken to avoid confusion.
|
||||
4. A PR SHOULD be a minimal and accurate answer to exactly one identified and agreed-on problem.
|
||||
5. A PR SHOULD refrain from adding additional dependencies to the FreeCAD project unless no other option is available.
|
||||
6. Code submissions MUST adhere to the code style guidelines of the project if these are defined.
|
||||
7. If a PR contains multiple commits, each commit MUST compile cleanly when merged with all previous commits of the same PR. Each commit SHOULD add value to the history of the project. Checkpoint commits SHOULD be squashed.
|
||||
8. A PR SHALL NOT include non-trivial code from other projects unless the Contributor is the original author of that code.
|
||||
9. A PR MUST compile cleanly and pass project self-tests on all target platforms.
|
||||
10. Each commit message in a PR MUST succinctly explain what the commit achieves. The commit message SHALL follow the suggestions in the `git commit --help` documentation, section DISCUSSION.
|
||||
11. The PR message MUST consist of a single short line, the PR Title, summarizing the problem being solved, followed by a blank line and then the proposed solution in the Body. If a PR consists of more than one commit, the PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed.
|
||||
12. A “Valid PR” is one which satisfies the above requirements.
|
||||
|
||||
## 6. Process
|
||||
|
||||
1. Change on the project follows the pattern of accurately identifying problems and applying minimal, accurate solutions to these problems.
|
||||
2. To request changes, a User logs an issue on the project GitHub issue tracker.
|
||||
3. The User or Contributor SHOULD write the issue by describing the problem they face or observe. Links to the forum or other resources are permitted but the issue SHOULD be complete and accurate and SHOULD NOT require the reader to visit the forum or any other platform to understand what is being described.
|
||||
4. Issue authors SHOULD strive to describe the minimum acceptable condition.
|
||||
5. Issue authors SHOULD focus on User tasks and avoid comparisons to other software solutions.
|
||||
6. The User or Contributor SHOULD seek consensus on the accuracy of their observation and the value of solving the problem.
|
||||
7. To submit a solution to a problem, a Contributor SHALL create a pull request back to the project.
|
||||
8. Contributors and Maintainers SHALL NOT commit changes directly to the target branch.
|
||||
9. To discuss a proposed solution, Users MAY comment on the Pull Request in GitHub. Forum conversations regarding the solution SHOULD be discouraged and conversation redirected to the Pull Request or the related issue.
|
||||
10. To accept or reject a Pull Request, a Maintainer SHALL use GitHub's interface.
|
||||
11. Maintainers SHOULD NOT merge their own PRs except:
|
||||
1. in exceptional cases, such as non-responsiveness from other Maintainers for an extended period.
|
||||
2. If the Maintainer is also the primary developer of the workbench or subsystem.
|
||||
|
||||
12. Maintainers SHALL merge valid PRs from other Contributors rapidly.
|
||||
13. Maintainers MAY, at their discretion merge PRs that have not met all criteria to be considered valid to:
|
||||
1. end fruitless discussions
|
||||
2. capture toxic contributions in the historical record
|
||||
3. engage with the Contributor on improving their contribution quality.
|
||||
14. Maintainers SHALL NOT make value judgments on correct contributions.
|
||||
15. Any Contributor who has value judgments on a PR SHOULD express these via their own PR.
|
||||
16. The User who created an issue SHOULD close the issue after checking the PR is successful.
|
||||
17. Maintainers SHOULD close issues that are left open without action or update for an unreasonable period.
|
||||
|
||||
## 7. Branches and Releases
|
||||
|
||||
1. The project SHALL have one branch (“master”) that always holds the latest in-progress version and SHOULD always build.
|
||||
2. The project SHALL NOT use topic branches for any reason. Personal forks MAY use topic branches.
|
||||
3. To make a stable release a Maintainer SHALL tag the repository. Stable releases SHALL always be released from the repository master.
|
||||
|
||||
## 8. Project Administration
|
||||
|
||||
1. The project Administrators will manage the set of project Maintainers. They SHALL maintain a sufficiently large pool of Maintainers to ensure their succession and permit timely review of contributions.
|
||||
2. Contributors who have a history of successful PRs and have demonstrated continued professionalism should be invited to be Maintainers.
|
||||
3. Administrators SHOULD remove Maintainers who are inactive for an extended period, or who repeatedly fail to apply this process accurately.
|
||||
4. The list of Maintainers SHALL be publicly accessible and reflective of current activity on the project.
|
||||
5. Administrators SHOULD block or ban “bad actors” who cause stress, animosity, or confusion to others in the project. This SHOULD be done after public discussion, with a chance for all parties to speak. A bad actor is someone who repeatedly ignores the rules and culture of the project, who is hostile or offensive, who impedes the productive exchange of information, and who is unable to self-correct their behavior when asked to do so by others.
|
||||
+1106
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
@@ -0,0 +1,55 @@
|
||||
#ifndef LIBRARY_VERSIONS_H
|
||||
#define LIBRARY_VERSIONS_H
|
||||
|
||||
/* LibraryVersions.h. Generated from LibraryVersions.h.cmake by cmake. */
|
||||
|
||||
#cmakedefine HAVE_OCC_VERSION
|
||||
|
||||
#if defined(HAVE_OCC_VERSION)
|
||||
# include <${OCC_INCLUDE_DIR}/Standard_Version.hxx>
|
||||
#endif
|
||||
|
||||
|
||||
/* No need for Boost (version info is always included in the source) */
|
||||
/* No need for Python (version info is always included in the source) */
|
||||
/* No need for Qt (version info is always included in the source) */
|
||||
/* No need for zlib (version info is always included in the source) */
|
||||
|
||||
// No CMake version info for SMESH, libarea, Zipios, or KDL
|
||||
|
||||
// Coin3D
|
||||
constexpr char * FC_COIN3D_VERSION = "${COIN3D_VERSION}";
|
||||
|
||||
// Eigen3
|
||||
constexpr char * FC_EIGEN3_VERSION = "${EIGEN3_VERSION}";
|
||||
|
||||
// FreeType
|
||||
constexpr char * FC_FREETYPE_VERSION = "${FREETYPE_VERSION_STRING}";
|
||||
|
||||
// pcl
|
||||
constexpr char * FC_PCL_VERSION = "${PCL_VERSION}";
|
||||
|
||||
// PyCXX
|
||||
constexpr char * FC_PYCXX_VERSION = "${PYCXX_VERSION}";
|
||||
|
||||
// PySide
|
||||
constexpr char * FC_PYSIDE_VERSION = "${PySide2_VERSION}";
|
||||
|
||||
// PyBind
|
||||
constexpr char * FC_PYBIND11_VERSION = "${pybind11_VERSION}";
|
||||
|
||||
// Shiboken
|
||||
constexpr char * FC_SHIBOKEN_VERSION = "${Shiboken2_VERSION}";
|
||||
|
||||
// vtk
|
||||
constexpr char * FC_VTK_VERSION = "${VTK_VERSION}";
|
||||
|
||||
// Xerces-C
|
||||
constexpr char * FC_XERCESC_VERSION = "${XercesC_VERSION}";
|
||||
|
||||
// Pivy
|
||||
constexpr char * FC_PIVY_VERSION = "${PIVY_VERSION}";
|
||||
|
||||
|
||||
#endif // LIBRARY_VERSIONS_H
|
||||
|
||||
@@ -1,16 +1,58 @@
|
||||
<a href="https://freecad.org"><img src="https://www.freecad.org/svg/icon-freecad.svg" height="100px" width="100px"></a>
|
||||
<h6 align="center"><img src="FreeCAD-toponaming-logo.png"/></h6>
|
||||
|
||||
### Your own 3D parametric modeler
|
||||
<h1 align="center">FreeCAD Topological Naming (toponaming) Branch</h1>
|
||||
|
||||
[Website](https://www.freecad.org) •
|
||||
[Documentation](https://wiki.freecad.org) •
|
||||
[Forum](https://forum.freecad.org/) •
|
||||
[Bug tracker](https://github.com/FreeCAD/FreeCAD/issues) •
|
||||
[Git repository](https://github.com/FreeCAD/FreeCAD) •
|
||||
[Blog](https://blog.freecad.org)
|
||||
### About
|
||||
|
||||
This branch is dedicated to integrating code that improves the [topological naming problem](https://wiki.freecad.org/Topological_naming_problem) in FreeCAD. There have been several attempts to address it over the years within FreeCAD. In reality, toponaming is an issue that no modern CAD software is fully immune to. This is because the solutions are complex.
|
||||
|
||||
Thanks to an independent developer named Zheng Lei ('realthunder'), who has gone the farthest in the effort of fixing toponaming in FreeCAD, and has provided a proof of concept fix in his own branch named 'Link' branch.
|
||||
|
||||
* [@Realthunder](https://github.com/realthunder)'s Link branch: https://github.com/realthunder/FreeCAD
|
||||
* Official FreeCAD main ('master') branch: https://github.com/FreeCAD/FreeCAD/
|
||||
* Official FreeCAD toponaming git repository: https://github.com/FreeCAD/FreeCAD/tree/development/toponaming
|
||||
|
||||
|
||||
[](https://github.com/freecad/freecad/releases/latest) [](https://crowdin.com/project/freecad) [](https://liberapay.com/FreeCAD)
|
||||
### Objective
|
||||
|
||||
Per the FreeCAD developer meetings that occurred during the pre-release of v0.20, 'toponaming' was identified as one of the main targets for merge in the v0.21/v1.0 release cycle.
|
||||
|
||||
### Contributing
|
||||
|
||||
During this development cycle there will be nightly builds provided for testers to test and report results back to the developers.
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Expand this section to learn about testing toponaming on different platforms/distros</summary>
|
||||
|
||||
#### Linux
|
||||
|
||||
##### Snap packages
|
||||
A nightly Snap package of the 'toponaming' branch will be available to testers. Refer to the [Snap wiki page](https://wiki.freecad.org/Ubuntu_Snap#Notes)
|
||||
|
||||
#### Windows
|
||||
|
||||
TBD
|
||||
|
||||
#### macOS
|
||||
|
||||
TBD
|
||||
|
||||
#### FreeBSD
|
||||
|
||||
N/A
|
||||
|
||||
</details>
|
||||
|
||||
<!--
|
||||
[Website](https://www.freecadweb.org) •
|
||||
[Documentation](https://wiki.freecadweb.org) •
|
||||
[Forum](https://forum.freecadweb.org/) •
|
||||
[Bug tracker](https://www.freecadweb.org/tracker/) •
|
||||
[Git repository](https://github.com/FreeCAD/FreeCAD)
|
||||
|
||||
|
||||
[](https://github.com/freecad/freecad/releases/latest) [![Master][freecad-master-status]][gitlab-branch-master] [](https://crowdin.com/project/freecad) [](https://gitter.im/freecad/freecad?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://lgtm.com/projects/g/FreeCAD/FreeCAD/context:python) [](https://lgtm.com/projects/g/FreeCAD/FreeCAD/context:cpp) [](https://liberapay.com/FreeCAD)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/1828501/174066870-1692005b-f8d7-43fb-a289-6d2f07f73d7f.png" width="800"/>
|
||||
|
||||
@@ -51,7 +93,20 @@ software center application.
|
||||
|
||||
For development releases check the [weekly-builds page](https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds).
|
||||
|
||||
Other options are described at the [wiki Download page](https://wiki.freecad.org/Download).
|
||||
Other options are described at the [wiki Download page](https://wiki.freecadweb.org/Download).
|
||||
|
||||
Build Status
|
||||
------------
|
||||
|
||||
| Master | 0.20 | Translation |
|
||||
|:------:|:----:|:-----------:|
|
||||
|[![Master][freecad-master-status]][gitlab-branch-master]|[![0.20][freecad-0.20-status]][gitlab-branch-0.20]|[](https://crowdin.com/project/freecad)|
|
||||
|
||||
[freecad-0.20-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/releases/FreeCAD-0-20/pipeline.svg
|
||||
[freecad-master-status]: https://gitlab.com/freecad/FreeCAD-CI/badges/master/pipeline.svg
|
||||
[gitlab-branch-0.20]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/releases/FreeCAD-0-20
|
||||
[gitlab-branch-master]: https://gitlab.com/freecad/FreeCAD-CI/-/commits/master
|
||||
[travis-builds]: https://travis-ci.org/FreeCAD/FreeCAD/builds
|
||||
|
||||
Compiling
|
||||
---------
|
||||
@@ -66,18 +121,17 @@ you will usually have to compile them yourself.
|
||||
|
||||
The pages below contain up-to-date build instructions:
|
||||
|
||||
- [Linux](https://wiki.freecad.org/Compile_on_Linux)
|
||||
- [Windows](https://wiki.freecad.org/Compile_on_Windows)
|
||||
- [macOS](https://wiki.freecad.org/Compile_on_MacOS)
|
||||
- [Cygwin](https://wiki.freecad.org/Compile_on_Cygwin)
|
||||
- [MinGW](https://wiki.freecad.org/Compile_on_MinGW)
|
||||
- [Linux](https://wiki.freecadweb.org/Compile_on_Linux)
|
||||
- [Windows](https://wiki.freecadweb.org/Compile_on_Windows)
|
||||
- [macOS](https://wiki.freecadweb.org/Compile_on_MacOS)
|
||||
- [Cygwin](https://wiki.freecadweb.org/Compile_on_Cygwin)
|
||||
- [MinGW](https://wiki.freecadweb.org/Compile_on_MinGW)
|
||||
|
||||
|
||||
Reporting Issues
|
||||
---------
|
||||
|
||||
To report an issue please:
|
||||
|
||||
- First post to forum to verify the issue;
|
||||
- Link forum thread to bug tracker ticket and vice-a-versa;
|
||||
- Use the most updated stable or development versions of FreeCAD;
|
||||
@@ -86,16 +140,9 @@ To report an issue please:
|
||||
- Upload an example file to demonstrate problem.
|
||||
|
||||
For more detail see:
|
||||
|
||||
- [Bug Tracker](https://github.com/FreeCAD/FreeCAD/issues)
|
||||
- [Reporting Issues and Requesting Features](https://github.com/FreeCAD/FreeCAD/issues/new/choose)
|
||||
- [Contributing](https://github.com/FreeCAD/FreeCAD/blob/master/CONTRIBUTING.md)
|
||||
- [Help Forum](https://forum.freecad.org/viewforum.php?f=3)
|
||||
- [Developers Handbook](https://freecad.github.io/DevelopersHandbook/)
|
||||
|
||||
The [FPA](https://fpa.freecad.org) offers developers the opportunity
|
||||
to apply for a grant to work on projects of their choosing. Check
|
||||
[jobs and funding](https://blog.freecad.org/jobs/) to know more.
|
||||
- [Wiki Page about the Bug Tracker](https://wiki.freecadweb.org/Tracker)
|
||||
- [Bug Tracker](https://tracker.freecadweb.org)
|
||||
- [Help Forum](https://forum.freecadweb.org/viewforum.php?f=3)
|
||||
|
||||
|
||||
Usage & Getting help
|
||||
@@ -105,14 +152,14 @@ The FreeCAD wiki contains documentation on
|
||||
general FreeCAD usage, Python scripting, and development. These
|
||||
pages might help you get started:
|
||||
|
||||
- [Getting started](https://wiki.freecad.org/Getting_started)
|
||||
- [Features list](https://wiki.freecad.org/Feature_list)
|
||||
- [Frequent questions](https://wiki.freecad.org/FAQ/en)
|
||||
- [Workbenches](https://wiki.freecad.org/Workbenches)
|
||||
- [Scripting](https://wiki.freecad.org/Power_users_hub)
|
||||
- [Development](https://wiki.freecad.org/Developer_hub)
|
||||
- [Getting started](https://wiki.freecadweb.org/Getting_started)
|
||||
- [Features list](https://wiki.freecadweb.org/Feature_list)
|
||||
- [Frequent questions](https://wiki.freecadweb.org/FAQ/en)
|
||||
- [Workbenches](https://wiki.freecadweb.org/Workbenches)
|
||||
- [Scripting](https://wiki.freecadweb.org/Power_users_hub)
|
||||
- [Development](https://wiki.freecadweb.org/Developer_hub)
|
||||
|
||||
The [FreeCAD forum](https://forum.freecad.org) is also a great place
|
||||
The [FreeCAD forum](https://forum.freecadweb.org) is also a great place
|
||||
to find help and solve specific problems you might encounter when
|
||||
learning to use FreeCAD.
|
||||
|
||||
@@ -122,3 +169,5 @@ learning to use FreeCAD.
|
||||
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="91px">
|
||||
</a> and <a href="https://www.kipro-pcb.com/">KiCad Services Corp.</a>
|
||||
</p>
|
||||
|
||||
-->
|
||||
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
The FreeCAD project is a FOSS (Free and Open-Source Software) project that has a community of thousands of users and
|
||||
hundreds of developers worldwide. We encourage responsible reporting of security vulnerabilities that may affect users
|
||||
of this software, and will endeavor to address these vulnerabilities when they are discovered.
|
||||
|
||||
## Bounties
|
||||
|
||||
FreeCAD does not have a program to pay bounties for security bugs. If you discover a vulnerability that affects a part
|
||||
of the FreeCAD project (either directly in FreeCAD, in a library it depends on, or in any of the various other
|
||||
subprojects such as our website, forums, etc.) we ask you to join the large community of volunteer contributors and
|
||||
file a report about the issue.
|
||||
|
||||
Note that funds may be available from the [FreeCAD Project Association (FPA)](https://fpa.freecad.org) to pursue
|
||||
security research and/or the development of fixes to any vulnerabilities discovered. However, vulnerabilities held as
|
||||
hostage in demands for "bounties" will not be entertained. Contact the FPA at fpa@freecad.org for more information.
|
||||
|
||||
## Supported Versions
|
||||
|
||||
FreeCAD implements security fixes to the current release series, and to the current development on the master branch.
|
||||
|
||||
| Version | Supported |
|
||||
|---------| ------------------ |
|
||||
| 0.21 | :white_check_mark: |
|
||||
| 0.20.2 | :white_check_mark: |
|
||||
| < 0.20 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
To report a vulnerability use GitHub's security reporting tool:
|
||||
https://github.com/FreeCAD/FreeCAD/security/advisories/new
|
||||
|
||||
@@ -9,6 +9,4 @@
|
||||
#define SMESH_VERSION_PATCH ${SMESH_VERSION_PATCH}
|
||||
#define SMESH_VERSION_TWEAK ${SMESH_VERSION_TWEAK}
|
||||
|
||||
#define SMESH_VERSION_STR "${SMESH_VERSION_MAJOR}.${SMESH_VERSION_MINOR}.${SMESH_VERSION_PATCH}.${SMESH_VERSION_TWEAK}"
|
||||
|
||||
#endif // SMESH_VERSION_H
|
||||
@@ -0,0 +1,66 @@
|
||||
#version:
|
||||
|
||||
image: Visual Studio 2017
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
# APPVEYOR_SAVE_CACHE_ON_ERROR: true
|
||||
generator: "Visual Studio 15 2017 Win64"
|
||||
ARCH: "Win64"
|
||||
Compiler: "MSVC2017"
|
||||
|
||||
cache: c:\users\appveyor\clcache -> appveyor.yml
|
||||
|
||||
configuration:
|
||||
#- Debug
|
||||
- Release
|
||||
|
||||
clone_depth: 1600
|
||||
|
||||
# scripts that are called at very beginning, before repo cloning
|
||||
#init:
|
||||
|
||||
#before_build:
|
||||
|
||||
# scripts that run after cloning repository
|
||||
#todo cleanup libpacks on the FreeCAD-ports-cache repo
|
||||
install:
|
||||
- cd C:\projects\freecad
|
||||
- if [%ARCH%] == [Win64] (appveyor DownloadFile https://github.com/apeltauer/FreeCAD/releases/download/LibPack_12.1/FreeCADLibs_12.1.2_x64_VC15.7z)
|
||||
- if [%ARCH%] == [Win64] (
|
||||
powershell -Command 7z x FreeCADLibs_12.1.2_x64_VC15.7z -oFreeCADLibs > nul &&
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat")
|
||||
- set PATH=c:\Python37;c:\Python37\Scripts;%PATH%
|
||||
- pip install clcache
|
||||
- clcache -z
|
||||
- clcache -s
|
||||
|
||||
build_script:
|
||||
- cd C:\projects\freecad
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -DFREECAD_LIBPACK_DIR=C:\projects\freecad\FreeCADLibs
|
||||
-DBUILD_FEM_NETGEN=OFF
|
||||
-DFREECAD_RELEASE_PDB=OFF
|
||||
-G "%generator%" ..
|
||||
- mkdir bin
|
||||
- xcopy C:\projects\freecad\FreeCADLibs\bin C:\projects\freecad\build\bin /E /Q
|
||||
- ps: fsutil behavior set disablelastaccess 0 # Enable Access time feature on Windows (for clcache)
|
||||
- msbuild FreeCAD.sln /p:TrackFileAccess=false /p:CLToolExe=clcache.exe /p:CLToolPath=c:\Python37\Scripts\ /m
|
||||
- ps: fsutil behavior set disablelastaccess 1
|
||||
- clcache -s
|
||||
|
||||
#after_build:
|
||||
- cd C:\projects\freecad\build\bin\
|
||||
- FreeCADCmd.exe --run-test 0
|
||||
|
||||
#artifacts:
|
||||
|
||||
test: off # to avoid discovering tests
|
||||
|
||||
#
|
||||
# The following section automatically uploads artifacts
|
||||
# whenever a tag is created on the master branch.
|
||||
#
|
||||
#deploy:
|
||||
Executable
+91
@@ -0,0 +1,91 @@
|
||||
##!/usr/bin/env bash
|
||||
#
|
||||
# MacOS Build Script for FreeCAD using Conda.
|
||||
# This is intended for developer use.
|
||||
#
|
||||
# Copyright (c) 2020 by Jeffrey Zampieron. All rights reserved.
|
||||
#
|
||||
# License: LGPLv2.1
|
||||
#
|
||||
# References:
|
||||
# - Conda: https://conda.io/projects/conda/en/latest/user-guide/install/index.html
|
||||
# - Conda Build: https://docs.conda.io/projects/conda-build/en/latest/install-conda-build.html
|
||||
|
||||
###########################################################################
|
||||
# Script wide setup.
|
||||
###########################################################################
|
||||
# The Conda environment name
|
||||
FCENV=freecad_dev
|
||||
# The cmake build directory
|
||||
HOST=$(uname)
|
||||
|
||||
###########################################################################
|
||||
# Env Checks
|
||||
###########################################################################
|
||||
if [[ ${HOST} =~ "Linux" ]]; then
|
||||
# Linux specific checks here
|
||||
echo "Linux specific checks..."
|
||||
elif [[ ${HOST} =~ "Darwin" ]]; then
|
||||
# OSX specific checks here.
|
||||
echo "OS X specific checks..."
|
||||
which xcrun
|
||||
if [ $? != 0 ]; then
|
||||
echo "xcrun not found... install XCode command line tools..."
|
||||
echo "using: xcode-select --install"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "unknown host env... probably won't work. Aborting build."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
###########################################################################
|
||||
# Conda Setup
|
||||
###########################################################################
|
||||
which conda
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to find conda executable. Please install."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${CONDA_DEFAULT_ENV}" =~ "${FCENV}" ]]; then
|
||||
echo "Already in env"
|
||||
elif [[ -z "${CONDA_DEFAULT_ENV}" ]]; then
|
||||
echo "Not in conda env... activating"
|
||||
eval "$(conda shell.bash hook)"
|
||||
conda activate ${FCENV}
|
||||
else
|
||||
# Assume we are in some other env.
|
||||
echo "In ${CONDA_DEFAULT_ENV}, attempting switch to ${FCENV}"
|
||||
eval "$(conda shell.bash hook)"
|
||||
conda deactivate
|
||||
conda activate ${FCENV}
|
||||
fi
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to activate conda env: ${FCENV} ... creating"
|
||||
|
||||
if [[ ${HOST} =~ "Linux" ]]; then
|
||||
echo "Linux"
|
||||
conda env create -f environment-linux.yml
|
||||
elif [[ ${HOST} =~ "Darwin" ]]; then
|
||||
echo "OS X"
|
||||
conda env create -f environment-osx.yml
|
||||
else
|
||||
echo "Unknown Host: ${HOST}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
conda activate ${FCENV}
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to create conda environment and activate it."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "${CONDA_PREFIX}" ]; then
|
||||
echo "Failed to find CONDA_PREFIX variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PREFIX="${CONDA_PREFIX}" ./conda/build.sh
|
||||
@@ -0,0 +1,125 @@
|
||||
# Try to find Coin3D
|
||||
# Once done this will define
|
||||
#
|
||||
# COIN3D_FOUND - system has Coin3D - Open Inventor
|
||||
# COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
|
||||
# COIN3D_LIBRARIES - Link this to use Coin3D
|
||||
#
|
||||
|
||||
SET( COIN3D_FOUND "NO" )
|
||||
|
||||
IF (WIN32)
|
||||
IF (CYGWIN OR MINGW)
|
||||
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
${CMAKE_INCLUDE_PATH}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/usr/include/coin
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COIN3D_LIBRARIES Coin
|
||||
${CMAKE_LIBRARY_PATH}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
|
||||
ELSE (CYGWIN OR MINGW)
|
||||
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/include"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COIN3D_LIBRARY_DEBUG coin2d
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COIN3D_LIBRARY_RELEASE
|
||||
NAMES
|
||||
coin2
|
||||
Coin4
|
||||
PATHS
|
||||
${CMAKE_LIBRARY_PATH}
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\Coin3D\\2;Installation Path]/lib"
|
||||
)
|
||||
|
||||
IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||
SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE}
|
||||
debug ${COIN3D_LIBRARY_DEBUG})
|
||||
ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||
IF (COIN3D_LIBRARY_DEBUG)
|
||||
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG})
|
||||
ENDIF (COIN3D_LIBRARY_DEBUG)
|
||||
IF (COIN3D_LIBRARY_RELEASE)
|
||||
SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE})
|
||||
ENDIF (COIN3D_LIBRARY_RELEASE)
|
||||
ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE)
|
||||
|
||||
IF (COIN3D_LIBRARIES)
|
||||
# ADD_DEFINITIONS ( -DCOIN_NOT_DLL )
|
||||
#ELSE (COIN3D_LIBRARIES)
|
||||
# SET (COIN3D_LIBRARIES coin2d CACHE STRING "Coin3D Library (Debug) - Open Inventor API")
|
||||
ENDIF (COIN3D_LIBRARIES)
|
||||
|
||||
ENDIF (CYGWIN OR MINGW)
|
||||
|
||||
ELSE (WIN32)
|
||||
IF(APPLE)
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
/Library/Frameworks/Inventor.framework/Headers
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
FIND_LIBRARY(COIN3D_LIBRARIES Coin
|
||||
/Library/Frameworks/Inventor.framework/Libraries
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
)
|
||||
SET(COIN3D_LIBRARIES "-framework Coin3d" CACHE STRING "Coin3D library for OSX")
|
||||
ELSE(APPLE)
|
||||
# Try to use pkg-config first...
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(COIN3D Coin)
|
||||
# ... then fall back to manual lookup
|
||||
IF(NOT COIN3D_FOUND)
|
||||
FIND_PATH(COIN3D_INCLUDE_DIRS Inventor/So.h
|
||||
${CMAKE_INCLUDE_PATH}
|
||||
/usr/include/Coin3
|
||||
/usr/include
|
||||
/usr/include/coin
|
||||
/usr/local/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COIN3D_LIBRARIES Coin
|
||||
${CMAKE_LIBRARY_PATH}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
PATH_SUFFIXES Coin2 Coin3
|
||||
)
|
||||
ENDIF(NOT COIN3D_FOUND)
|
||||
ENDIF(APPLE)
|
||||
|
||||
ENDIF (WIN32)
|
||||
|
||||
|
||||
IF(COIN3D_LIBRARIES)
|
||||
SET( COIN3D_FOUND "YES" )
|
||||
message(STATUS "Coin3D libraries found")
|
||||
|
||||
IF(NOT COIN3D_VERSION)
|
||||
file(READ "${COIN3D_INCLUDE_DIRS}/Inventor/C/basic.h" _coin3d_basic_h)
|
||||
string(REGEX MATCH "define[ \t]+COIN_MAJOR_VERSION[ \t]+([0-9?])" _coin3d_major_version_match "${_coin3d_basic_h}")
|
||||
set(COIN3D_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+COIN_MINOR_VERSION[ \t]+([0-9?])" _coin3d_minor_version_match "${_coin3d_basic_h}")
|
||||
set(COIN3D_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+COIN_MICRO_VERSION[ \t]+([0-9?])" _coin3d_micro_version_match "${_coin3d_basic_h}")
|
||||
set(COIN3D_MICRO_VERSION "${CMAKE_MATCH_1}")
|
||||
set(COIN3D_VERSION "${COIN3D_MAJOR_VERSION}.${COIN3D_MINOR_VERSION}.${COIN3D_MICRO_VERSION}")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT PIVY_VERSION)
|
||||
execute_process (COMMAND ${Python3_EXECUTABLE} -c "import pivy as p; print(p.__version__,end='')" OUTPUT_VARIABLE PIVY_VERSION)
|
||||
ENDIF()
|
||||
|
||||
ENDIF(COIN3D_LIBRARIES)
|
||||
|
||||
@@ -54,8 +54,28 @@ IF (COIN3D_FOUND)
|
||||
${CMAKE_BINARY_DIR}/src/Doc
|
||||
)
|
||||
IF( EXISTS ${COIN3D_DOC_TAGFILE})
|
||||
SET( COIN3D_DOC_FOUND "YES" )
|
||||
SET( COIN3D_DOC_FOUND "YES"
|
||||
)
|
||||
#ELSE( EXISTS ${COIN3D_DOC_TAGFILE})
|
||||
# find_program(WGET_PROG wget
|
||||
# )
|
||||
# IF( EXISTS ${WGET_PROG})
|
||||
# execute_process(COMMAND ${WGET_PROG}
|
||||
# -P ${CMAKE_BINARY_DIR}/src/Doc
|
||||
# ${COIN3D_DOC_PATH}/coin.tag
|
||||
# )
|
||||
# find_file(COIN3D_DOC_TAGFILE coin.tag
|
||||
# ${CMAKE_BINARY_DIR}/src/Doc
|
||||
# )
|
||||
# IF( EXISTS ${COIN3D_DOC_TAGFILE})
|
||||
# SET( COIN3D_DOC_FOUND "YES"
|
||||
# )
|
||||
# ENDIF( EXISTS ${COIN3D_DOC_TAGFILE})
|
||||
#
|
||||
# ENDIF( EXISTS ${WGET_PROG})
|
||||
|
||||
ENDIF( EXISTS ${COIN3D_DOC_TAGFILE})
|
||||
|
||||
ENDIF( EXISTS ${COIN3D_DOC_PATH})
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
if(NOT Eigen3_FIND_VERSION)
|
||||
if(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
set(Eigen3_FIND_VERSION_MAJOR 3)
|
||||
set(Eigen3_FIND_VERSION_MAJOR 2)
|
||||
endif(NOT Eigen3_FIND_VERSION_MAJOR)
|
||||
if(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
set(Eigen3_FIND_VERSION_MINOR 0)
|
||||
set(Eigen3_FIND_VERSION_MINOR 91)
|
||||
endif(NOT Eigen3_FIND_VERSION_MINOR)
|
||||
if(NOT Eigen3_FIND_VERSION_PATCH)
|
||||
set(Eigen3_FIND_VERSION_PATCH 0)
|
||||
|
||||
+43
-43
@@ -3,10 +3,10 @@
|
||||
#
|
||||
# The following variables are optionally searched for defaults
|
||||
# OpenCV_ROOT_DIR: Base directory of OpenCv tree to use.
|
||||
# OpenCV_FIND_REQUIRED_COMPONENTS : FIND_PACKAGE(OpenCV COMPONENTS ..)
|
||||
# OpenCV_FIND_REQUIRED_COMPONENTS : FIND_PACKAGE(OpenCV COMPONENTS ..)
|
||||
# compatible interface. typically CV CXCORE CVAUX HIGHGUI CVCAM .. etc.
|
||||
#
|
||||
# The following are set after configuration is done:
|
||||
# The following are set after configuration is done:
|
||||
# OpenCV_FOUND
|
||||
# OpenCV_INCLUDE_DIR
|
||||
# OpenCV_LIBRARIES
|
||||
@@ -16,10 +16,10 @@
|
||||
# OPENCV_* uppercase replaced by case sensitive OpenCV_*
|
||||
# OPENCV_EXE_LINKER_FLAGS
|
||||
# OPENCV_INCLUDE_DIR : replaced by plural *_DIRS
|
||||
#
|
||||
# 2004/05 Jan Woetzel, Friso, Daniel Grest
|
||||
#
|
||||
# 2004/05 Jan Woetzel, Friso, Daniel Grest
|
||||
# 2006/01 complete rewrite by Jan Woetzel
|
||||
# 1006/09 2nd rewrite introducing ROOT_DIR and PATH_SUFFIXES
|
||||
# 1006/09 2nd rewrite introducing ROOT_DIR and PATH_SUFFIXES
|
||||
# to handle multiple installed versions gracefully by Jan Woetzel
|
||||
#
|
||||
# tested with:
|
||||
@@ -42,14 +42,14 @@ IF (NOT OpenCV_FIND_COMPONENTS)
|
||||
SET(OpenCV_FIND_REQUIRED_COMPONENTS CV CXCORE CVAUX HIGHGUI )
|
||||
IF (WIN32)
|
||||
LIST(APPEND OpenCV_FIND_REQUIRED_COMPONENTS CVCAM ) # WIN32 only actually
|
||||
ENDIF(WIN32)
|
||||
ENDIF(WIN32)
|
||||
ENDIF (NOT OpenCV_FIND_COMPONENTS)
|
||||
|
||||
|
||||
# typical root dirs of installations, exactly one of them is used
|
||||
SET (OpenCV_POSSIBLE_ROOT_DIRS
|
||||
"${OpenCV_ROOT_DIR}"
|
||||
"$ENV{OpenCV_ROOT_DIR}"
|
||||
"$ENV{OpenCV_ROOT_DIR}"
|
||||
"$ENV{OPENCV_DIR}" # only for backward compatibility deprecated by ROOT_DIR
|
||||
"$ENV{OPENCV_HOME}" # only for backward compatibility
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Intel(R) Open Source Computer Vision Library_is1;Inno Setup: App Path]"
|
||||
@@ -59,17 +59,17 @@ SET (OpenCV_POSSIBLE_ROOT_DIRS
|
||||
)
|
||||
|
||||
|
||||
# MIP Uni Kiel /opt/net network installation
|
||||
# MIP Uni Kiel /opt/net network installation
|
||||
# get correct prefix for current gcc compiler version for gcc 3.x 4.x
|
||||
IF (${CMAKE_COMPILER_IS_GNUCXX})
|
||||
IF (NOT OpenCV_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Checking GNUCXX version 3/4 to determine OpenCV /opt/net/ path")
|
||||
ENDIF (NOT OpenCV_FIND_QUIETLY)
|
||||
EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE CXX_COMPILER_VERSION)
|
||||
EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE CXX_COMPILER_VERSION)
|
||||
IF (CXX_COMPILER_VERSION MATCHES ".*3\\.[0-9].*")
|
||||
SET(IS_GNUCXX3 TRUE)
|
||||
LIST(APPEND OpenCV_POSSIBLE_ROOT_DIRS /opt/net/gcc33/OpenCV )
|
||||
ENDIF(CXX_COMPILER_VERSION MATCHES ".*3\\.[0-9].*")
|
||||
ENDIF(CXX_COMPILER_VERSION MATCHES ".*3\\.[0-9].*")
|
||||
IF (CXX_COMPILER_VERSION MATCHES ".*4\\.[0-9].*")
|
||||
SET(IS_GNUCXX4 TRUE)
|
||||
LIST(APPEND OpenCV_POSSIBLE_ROOT_DIRS /opt/net/gcc41/OpenCV )
|
||||
@@ -79,15 +79,15 @@ ENDIF (${CMAKE_COMPILER_IS_GNUCXX})
|
||||
#DBG_MSG("DBG (OpenCV_POSSIBLE_ROOT_DIRS=${OpenCV_POSSIBLE_ROOT_DIRS}")
|
||||
|
||||
#
|
||||
# select exactly ONE OpenCV base directory/tree
|
||||
# select exactly ONE OpenCV base directory/tree
|
||||
# to avoid mixing different version headers and libs
|
||||
#
|
||||
FIND_PATH(OpenCV_ROOT_DIR
|
||||
NAMES
|
||||
FIND_PATH(OpenCV_ROOT_DIR
|
||||
NAMES
|
||||
cv/include/cv.h # windows
|
||||
include/opencv/cv.h # linux /opt/net
|
||||
include/cv/cv.h
|
||||
include/cv.h
|
||||
include/cv/cv.h
|
||||
include/cv.h
|
||||
PATHS ${OpenCV_POSSIBLE_ROOT_DIRS})
|
||||
DBG_MSG("OpenCV_ROOT_DIR=${OpenCV_ROOT_DIR}")
|
||||
|
||||
@@ -106,7 +106,7 @@ SET(OpenCV_INCDIR_SUFFIXES
|
||||
otherlibs/_graphics/include
|
||||
)
|
||||
|
||||
# library linkdir suffixes appended to OpenCV_ROOT_DIR
|
||||
# library linkdir suffixes appended to OpenCV_ROOT_DIR
|
||||
SET(OpenCV_LIBDIR_SUFFIXES
|
||||
lib
|
||||
OpenCV/lib
|
||||
@@ -119,56 +119,56 @@ SET(OpenCV_LIBDIR_SUFFIXES
|
||||
# find incdir for each lib
|
||||
#
|
||||
FIND_PATH(OpenCV_CV_INCLUDE_DIR
|
||||
NAMES cv.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
NAMES cv.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
|
||||
FIND_PATH(OpenCV_CXCORE_INCLUDE_DIR
|
||||
FIND_PATH(OpenCV_CXCORE_INCLUDE_DIR
|
||||
NAMES cxcore.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
|
||||
FIND_PATH(OpenCV_CVAUX_INCLUDE_DIR
|
||||
FIND_PATH(OpenCV_CVAUX_INCLUDE_DIR
|
||||
NAMES cvaux.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
|
||||
FIND_PATH(OpenCV_HIGHGUI_INCLUDE_DIR
|
||||
NAMES highgui.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
FIND_PATH(OpenCV_HIGHGUI_INCLUDE_DIR
|
||||
NAMES highgui.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
|
||||
FIND_PATH(OpenCV_CVCAM_INCLUDE_DIR
|
||||
NAMES cvcam.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
FIND_PATH(OpenCV_CVCAM_INCLUDE_DIR
|
||||
NAMES cvcam.h
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} )
|
||||
|
||||
#
|
||||
# find sbsolute path to all libraries
|
||||
# find sbsolute path to all libraries
|
||||
# some are optionally, some may not exist on Linux
|
||||
#
|
||||
FIND_LIBRARY(OpenCV_CV_LIBRARY
|
||||
FIND_LIBRARY(OpenCV_CV_LIBRARY
|
||||
NAMES cv opencv
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATHS ${OpenCV_ROOT_DIR}
|
||||
PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_CVAUX_LIBRARY
|
||||
NAMES cvaux
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_CVCAM_LIBRARY
|
||||
FIND_LIBRARY(OpenCV_CVCAM_LIBRARY
|
||||
NAMES cvcam
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_CVHAARTRAINING_LIBRARY
|
||||
NAMES cvhaartraining
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_CXCORE_LIBRARY
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_CXCORE_LIBRARY
|
||||
NAMES cxcore
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_CXTS_LIBRARY
|
||||
FIND_LIBRARY(OpenCV_CXTS_LIBRARY
|
||||
NAMES cxts
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_HIGHGUI_LIBRARY
|
||||
FIND_LIBRARY(OpenCV_HIGHGUI_LIBRARY
|
||||
NAMES highgui
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_ML_LIBRARY
|
||||
FIND_LIBRARY(OpenCV_ML_LIBRARY
|
||||
NAMES ml
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
FIND_LIBRARY(OpenCV_TRS_LIBRARY
|
||||
FIND_LIBRARY(OpenCV_TRS_LIBRARY
|
||||
NAMES trs
|
||||
PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} )
|
||||
|
||||
@@ -181,7 +181,7 @@ SET(OpenCV_FOUND ON)
|
||||
DBG_MSG("OpenCV_FIND_REQUIRED_COMPONENTS=${OpenCV_FIND_REQUIRED_COMPONENTS}")
|
||||
FOREACH(NAME ${OpenCV_FIND_REQUIRED_COMPONENTS} )
|
||||
|
||||
# only good if header and library both found
|
||||
# only good if header and library both found
|
||||
IF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
|
||||
LIST(APPEND OpenCV_INCLUDE_DIRS ${OpenCV_${NAME}_INCLUDE_DIR} )
|
||||
LIST(APPEND OpenCV_LIBRARIES ${OpenCV_${NAME}_LIBRARY} )
|
||||
@@ -192,13 +192,13 @@ FOREACH(NAME ${OpenCV_FIND_REQUIRED_COMPONENTS} )
|
||||
"\nOpenCV_${NAME}_LIBRARY=${OpenCV_${NAME}_LIBRARY} ")
|
||||
SET(OpenCV_FOUND OFF)
|
||||
ENDIF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY)
|
||||
|
||||
|
||||
ENDFOREACH(NAME)
|
||||
|
||||
DBG_MSG("OpenCV_INCLUDE_DIRS=${OpenCV_INCLUDE_DIRS}")
|
||||
DBG_MSG("OpenCV_LIBRARIES=${OpenCV_LIBRARIES}")
|
||||
|
||||
# get the link directory for rpath to be used with LINK_DIRECTORIES:
|
||||
# get the link directory for rpath to be used with LINK_DIRECTORIES:
|
||||
IF (OpenCV_CV_LIBRARY)
|
||||
GET_FILENAME_COMPONENT(OpenCV_LINK_DIRECTORIES ${OpenCV_CV_LIBRARY} PATH)
|
||||
ENDIF (OpenCV_CV_LIBRARY)
|
||||
@@ -239,7 +239,7 @@ IF(NOT OpenCV_FOUND)
|
||||
MESSAGE(FATAL_ERROR
|
||||
"OpenCV required but some headers or libs not found. Please specify it's location with OpenCV_ROOT_DIR env. variable.")
|
||||
ELSE(OpenCV_FIND_REQUIRED)
|
||||
MESSAGE(STATUS
|
||||
MESSAGE(STATUS
|
||||
"ERROR: OpenCV was not found.")
|
||||
ENDIF(OpenCV_FIND_REQUIRED)
|
||||
ENDIF(NOT OpenCV_FIND_QUIETLY)
|
||||
|
||||
@@ -53,7 +53,7 @@ else(PYCXX_INCLUDE_DIR)
|
||||
endif(PyCXX_FIND_REQUIRED)
|
||||
endif(NOT PYCXX_INCLUDE_DIR)
|
||||
endif(PYCXX_INCLUDE_DIR)
|
||||
|
||||
|
||||
# find the sources directory
|
||||
if(PYCXX_SOURCE_DIR)
|
||||
# source directory specified, they'd better be there
|
||||
@@ -117,7 +117,7 @@ if(PYCXX_FOUND)
|
||||
${PYCXX_SOURCE_DIR}/cxxsupport.cxx
|
||||
${PYCXX_SOURCE_DIR}/IndirectPythonInterface.cxx
|
||||
)
|
||||
if(NOT ${PYCXX_VERSION} VERSION_LESS 6.3.0)
|
||||
if(NOT ${PYCXX_VERSION} VERSION_LESS 7.0.0)
|
||||
list(APPEND PYCXX_SOURCES
|
||||
${PYCXX_SOURCE_DIR}/cxx_exceptions.cxx)
|
||||
add_definitions(-DPYCXX_6_2_COMPATIBILITY)
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
# Try to find PySide2 utilities, PYSIDE2UIC and PYSIDE2RCC:
|
||||
# PYSIDE_UIC_EXECUTABLE - Location of PYSIDE2UIC executable
|
||||
# PYSIDE_RCC_EXECUTABLE - Location of PYSIDE2RCC executable
|
||||
# PYSIDE_TOOLS_FOUND - PySide2 utilities found.
|
||||
# PYSIDE2UICBINARY - Location of PYSIDE2UIC executable
|
||||
# PYSIDE2RCCBINARY - Location of PYSIDE2RCC executable
|
||||
# PYSIDE2_TOOLS_FOUND - PySide2 utilities found.
|
||||
|
||||
# Also provides macro similar to FindQt4.cmake's WRAP_UI and WRAP_RC,
|
||||
# for the automatic generation of Python code from Qt4's user interface
|
||||
# ('.ui') and resource ('.qrc') files. These macros are called:
|
||||
# - PYSIDE_WRAP_UI
|
||||
# - PYSIDE_WRAP_RC
|
||||
|
||||
IF(PYSIDE2UICBINARY AND PYSIDE2RCCBINARY)
|
||||
# Already in cache, be silent
|
||||
set(PYSIDE2_TOOLS_FOUND_QUIETLY TRUE)
|
||||
ENDIF(PYSIDE2UICBINARY AND PYSIDE2RCCBINARY)
|
||||
|
||||
if(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
#pyside2 tools are often in same location as python interpreter
|
||||
@@ -16,32 +27,88 @@ FIND_PACKAGE(Qt5 COMPONENTS Core Widgets)
|
||||
|
||||
IF(Qt5Core_VERSION VERSION_LESS 5.14)
|
||||
# Legacy (< 5.14)
|
||||
FIND_PROGRAM(PYSIDE2_UIC_EXECUTABLE NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} pyuic5 HINTS ${PYSIDE_BIN_DIR})
|
||||
FIND_PROGRAM(PYSIDE2_RCC_EXECUTABLE NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} pyrcc5 HINTS ${PYSIDE_BIN_DIR})
|
||||
FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} pyuic5 HINTS ${PYSIDE_BIN_DIR})
|
||||
FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} pyrcc5 HINTS ${PYSIDE_BIN_DIR})
|
||||
set(UICOPTIONS "")
|
||||
set(RCCOPTIONS "")
|
||||
ELSE()
|
||||
# New (>= 5.14)
|
||||
if (TARGET Qt::uic)
|
||||
get_property(PYSIDE2_UIC_EXECUTABLE TARGET Qt::uic PROPERTY LOCATION)
|
||||
get_property(PYSIDE2UICBINARY TARGET Qt::uic PROPERTY LOCATION)
|
||||
set(UICOPTIONS "--generator=python")
|
||||
endif()
|
||||
if (TARGET Qt::rcc)
|
||||
get_property(PYSIDE2_RCC_EXECUTABLE TARGET Qt::rcc PROPERTY LOCATION)
|
||||
get_property(PYSIDE2RCCBINARY TARGET Qt::rcc PROPERTY LOCATION)
|
||||
set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
|
||||
endif()
|
||||
ENDIF()
|
||||
ENDIF(Qt5Core_VERSION VERSION_LESS 5.14)
|
||||
|
||||
set(PYSIDE_RCC_EXECUTABLE ${PYSIDE2_RCC_EXECUTABLE})
|
||||
set(PYSIDE_UIC_EXECUTABLE ${PYSIDE2_UIC_EXECUTABLE})
|
||||
set(PySideTools_VERSION 2)
|
||||
MACRO(PYSIDE_WRAP_UI outfiles)
|
||||
if (NOT PYSIDE2UICBINARY)
|
||||
message(FATAL_ERROR "Qt uic is required for generating ${ARGN}")
|
||||
endif()
|
||||
FOREACH(it ${ARGN})
|
||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py)
|
||||
#ADD_CUSTOM_TARGET(${it} ALL
|
||||
# DEPENDS ${outfile}
|
||||
#)
|
||||
if(WIN32 OR APPLE)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDE2UICBINARY} ${UICOPTIONS} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
else()
|
||||
# Especially on Open Build Service we don't want changing date like
|
||||
# pyside2-uic generates in comments at beginning., which is why
|
||||
# we follow the tool command with a POSIX-friendly sed.
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND "${PYSIDE2UICBINARY}" ${UICOPTIONS} "${infile}" -o "${outfile}"
|
||||
COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
|
||||
MAIN_DEPENDENCY "${infile}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${outfiles} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_UI)
|
||||
|
||||
if(PYSIDE_RCC_EXECUTABLE AND PYSIDE_UIC_EXECUTABLE)
|
||||
set(PYSIDE_TOOLS_FOUND TRUE)
|
||||
MACRO(PYSIDE_WRAP_RC outfiles)
|
||||
if (NOT PYSIDE2RCCBINARY)
|
||||
message(FATAL_ERROR "Qt rcc is required for generating ${ARGN}")
|
||||
endif()
|
||||
FOREACH(it ${ARGN})
|
||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py")
|
||||
#ADD_CUSTOM_TARGET(${it} ALL
|
||||
# DEPENDS ${outfile}
|
||||
#)
|
||||
if(WIN32 OR APPLE)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDE2RCCBINARY} ${RCCOPTIONS} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
else()
|
||||
# Especially on Open Build Service we don't want changing date like
|
||||
# pyside-rcc generates in comments at beginning, which is why
|
||||
# we follow the tool command with in-place sed.
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
|
||||
COMMAND "${PYSIDE2RCCBINARY}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
|
||||
COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
|
||||
MAIN_DEPENDENCY "${infile}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${outfiles} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_RC)
|
||||
|
||||
if(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY)
|
||||
set(PYSIDE2_TOOLS_FOUND TRUE)
|
||||
if (NOT PySide2Tools_FIND_QUIETLY)
|
||||
message(STATUS "Found PySide2 tools: ${PYSIDE_UIC_EXECUTABLE}, ${PYSIDE_RCC_EXECUTABLE}")
|
||||
message(STATUS "Found PySide2 tools: ${PYSIDE2UICBINARY}, ${PYSIDE2RCCBINARY}")
|
||||
endif (NOT PySide2Tools_FIND_QUIETLY)
|
||||
else()
|
||||
else(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY)
|
||||
if(PySide2Tools_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "PySide2 tools could not be found, but are required.")
|
||||
else(PySide2Tools_FIND_REQUIRED)
|
||||
@@ -49,4 +116,4 @@ else()
|
||||
message(STATUS "PySide2 tools: not found.")
|
||||
endif (NOT PySide2Tools_FIND_QUIETLY)
|
||||
endif(PySide2Tools_FIND_REQUIRED)
|
||||
endif()
|
||||
endif(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY)
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
# Try to find PYSIDE6 utilities, PYSIDE6UIC and PYSIDE6RCC:
|
||||
# PYSIDE_UIC_EXECUTABLE - Location of PYSIDE6UIC executable
|
||||
# PYSIDE_RCC_EXECUTABLE - Location of PYSIDE6RCC executable
|
||||
# PYSIDE_TOOLS_FOUND - PYSIDE6 utilities found.
|
||||
|
||||
if (TARGET Qt6::uic)
|
||||
get_target_property(PYSIDE6_UIC_EXECUTABLE Qt6::uic LOCATION)
|
||||
set(UICOPTIONS "--generator=python")
|
||||
endif()
|
||||
if (TARGET Qt6::rcc)
|
||||
get_target_property(PYSIDE6_RCC_EXECUTABLE Qt6::rcc LOCATION)
|
||||
set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
|
||||
endif()
|
||||
|
||||
set(PYSIDE_RCC_EXECUTABLE ${PYSIDE6_RCC_EXECUTABLE})
|
||||
set(PYSIDE_UIC_EXECUTABLE ${PYSIDE6_UIC_EXECUTABLE})
|
||||
set(PySideTools_VERSION 6)
|
||||
|
||||
if(PYSIDE_RCC_EXECUTABLE AND PYSIDE_UIC_EXECUTABLE)
|
||||
set(PYSIDE_TOOLS_FOUND TRUE)
|
||||
if (NOT PYSIDE6Tools_FIND_QUIETLY)
|
||||
message(STATUS "Found PYSIDE6 tools: ${PYSIDE_UIC_EXECUTABLE}, ${PYSIDE_RCC_EXECUTABLE}")
|
||||
endif ()
|
||||
else()
|
||||
if(PYSIDE6Tools_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "PYSIDE6 tools could not be found, but are required.")
|
||||
else()
|
||||
if (NOT PYSIDE6Tools_FIND_QUIETLY)
|
||||
message(STATUS "PYSIDE6 tools: not found.")
|
||||
endif ()
|
||||
endif()
|
||||
endif()
|
||||
@@ -6,7 +6,7 @@
|
||||
# OCULUS_LIBRARIES
|
||||
#
|
||||
# Copyright (c) 2012 I-maginer
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU Lesser General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
@@ -42,11 +42,11 @@ IF(OCULUS_ROOT)
|
||||
${OCULUS_INCLUDE_SEARCH_DIRS}
|
||||
${OCULUS_ROOT}/include
|
||||
)
|
||||
SET(OCULUS_LIBRARY_SEARCH_RELEASE_DIRS
|
||||
SET(OCULUS_LIBRARY_SEARCH_RELEASE_DIRS
|
||||
${OCULUS_LIBRARY_SEARCH_DIRS}
|
||||
${OCULUS_ROOT}/Lib/x64/VS2012
|
||||
)
|
||||
SET(OCULUS_LIBRARY_SEARCH_DEBUG_DIRS
|
||||
SET(OCULUS_LIBRARY_SEARCH_DEBUG_DIRS
|
||||
${OCULUS_LIBRARY_SEARCH_DIRS}
|
||||
${OCULUS_ROOT}/Lib/x64/VS2012
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ find_package(VTK REQUIRED)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
add_definitions(-DSALOME_USE_64BIT_IDS)
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
|
||||
IF (CMAKE_COMPILER_IS_GNUCC)
|
||||
FIND_PATH(SMESH_INCLUDE_DIR SMESH_Mesh.hxx
|
||||
# These are default search paths, why specify them?
|
||||
@@ -27,7 +27,7 @@ ENDIF (CMAKE_COMPILER_IS_GNUCC)
|
||||
IF(SMESH_INCLUDE_DIR)
|
||||
SET(SMESH_INC_ROOT "${SMESH_INCLUDE_DIR}/..")
|
||||
# Append extra include dirs
|
||||
SET(SMESH_INCLUDE_DIR
|
||||
SET(SMESH_INCLUDE_DIR
|
||||
"${SMESH_INCLUDE_DIR};
|
||||
${SMESH_INC_ROOT}/Controls;
|
||||
${SMESH_INC_ROOT}/Driver;
|
||||
@@ -53,7 +53,7 @@ SET(SMESH_FOUND FALSE)
|
||||
IF(SMESH_LIBRARY)
|
||||
SET(SMESH_FOUND TRUE)
|
||||
GET_FILENAME_COMPONENT(SMESH_LIBRARY_DIR ${SMESH_LIBRARY} PATH)
|
||||
set(SMESH_LIBRARIES
|
||||
set(SMESH_LIBRARIES
|
||||
${SMESH_LIBRARY_DIR}/libDriver.so
|
||||
${SMESH_LIBRARY_DIR}/libDriverDAT.so
|
||||
${SMESH_LIBRARY_DIR}/libDriverSTL.so
|
||||
|
||||
@@ -29,8 +29,8 @@ macro(CheckInterModuleDependencies)
|
||||
REQUIRES_MODS(BUILD_FLAT_MESH BUILD_MESH_PART)
|
||||
REQUIRES_MODS(BUILD_OPENSCAD BUILD_MESH_PART BUILD_DRAFT)
|
||||
REQUIRES_MODS(BUILD_PART_DESIGN BUILD_SKETCHER)
|
||||
# REQUIRES_MODS(BUILD_PATH BUILD_PART BUILD_MESH BUILD_ROBOT)
|
||||
REQUIRES_MODS(BUILD_PATH BUILD_PART BUILD_MESH)
|
||||
REQUIRES_MODS(BUILD_PATH BUILD_PART BUILD_MESH BUILD_ROBOT)
|
||||
REQUIRES_MODS(BUILD_RAYTRACING BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_REVERSEENGINEERING BUILD_PART BUILD_MESH)
|
||||
REQUIRES_MODS(BUILD_ROBOT BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_SANDBOX BUILD_PART BUILD_MESH)
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
# ADAPTED FOR FREECAD FROM VTK'S vtkQt.cmake
|
||||
# ORIGINAL VTK COPYRIGHT NOTICE FOLLOWS (BSD 3-CLAUSE)
|
||||
#
|
||||
# /*=========================================================================
|
||||
#
|
||||
# Program: Visualization Toolkit
|
||||
# Module: Copyright.txt
|
||||
#
|
||||
# Copyright (c) 1993-2015 Ken Martin, Will Schroeder, Bill Lorensen
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
|
||||
# of any contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# =========================================================================*/
|
||||
|
||||
|
||||
# FREECAD_QT_VERSION is used to choose between Qt5 and Qt6.
|
||||
|
||||
# If it is set to Auto(default), FreeCAD finds and uses the
|
||||
# version installed on the system. If both versions are
|
||||
# found, Qt5 is preferred.
|
||||
|
||||
# The output variable is FREECAD_QT_MAJOR_VERSION, which will be either 5 or 6
|
||||
|
||||
macro(ChooseQtVersion)
|
||||
set(freecad_supported_qt_versions "Auto" 5 6)
|
||||
|
||||
# The following `if` check can be removed once CMake 3.21 is required and
|
||||
# the policy CMP0126 is set to NEW.
|
||||
if (NOT DEFINED FREECAD_QT_VERSION)
|
||||
set(FREECAD_QT_VERSION "Auto" CACHE
|
||||
STRING "Expected Qt major version. Valid values are Auto, 5, 6.")
|
||||
set_property(CACHE FREECAD_QT_VERSION PROPERTY STRINGS "${freecad_supported_qt_versions}")
|
||||
endif()
|
||||
|
||||
if(FREECAD_LIBPACK_USE)
|
||||
if (NOT Qt5_DIR OR Qt5_DIR STREQUAL "Qt5_DIR-NOTFOUND")
|
||||
message(STATUS "Using Qt5 directory from LibPack in ${FREECAD_LIBPACK_DIR}/lib/cmake/Qt5")
|
||||
set(Qt5_DIR ${FREECAD_LIBPACK_DIR}/lib/cmake/Qt5)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT FREECAD_QT_VERSION STREQUAL "Auto")
|
||||
if (NOT FREECAD_QT_VERSION IN_LIST freecad_supported_qt_versions)
|
||||
message(FATAL_ERROR
|
||||
"Supported Qt versions are \"${freecad_supported_qt_versions}\". But "
|
||||
"FREECAD_QT_VERSION is set to ${FREECAD_QT_VERSION}.")
|
||||
endif ()
|
||||
set(_FREECAD_QT_VERSION "${FREECAD_QT_VERSION}")
|
||||
else ()
|
||||
find_package(Qt5 QUIET COMPONENTS Core)
|
||||
set(_FREECAD_QT_VERSION 5)
|
||||
if (NOT Qt5_FOUND)
|
||||
find_package(Qt6 QUIET COMPONENTS Core)
|
||||
if (NOT Qt6_FOUND)
|
||||
message(FATAL_ERROR
|
||||
"Could not find a valid Qt installation. Consider setting Qt5_DIR or Qt6_DIR (as needed).")
|
||||
endif ()
|
||||
set(_FREECAD_QT_VERSION 6)
|
||||
endif ()
|
||||
endif ()
|
||||
set(FREECAD_QT_MAJOR_VERSION "${_FREECAD_QT_VERSION}" CACHE INTERNAL
|
||||
"Major version number for the Qt installation used.")
|
||||
message(STATUS "Compiling with Qt ${FREECAD_QT_MAJOR_VERSION}")
|
||||
endmacro()
|
||||
@@ -17,9 +17,9 @@ macro(CompilerChecksAndSetups)
|
||||
add_definitions(-DHAVE_SNPRINTF)
|
||||
endif()
|
||||
|
||||
# Allow developers to use Boost < 1.65
|
||||
# Allow developers to use Boost < 1.55
|
||||
if (NOT BOOST_MIN_VERSION)
|
||||
set(BOOST_MIN_VERSION 1.65)
|
||||
set(BOOST_MIN_VERSION 1.55)
|
||||
endif()
|
||||
|
||||
# For older cmake versions the variable 'CMAKE_CXX_COMPILER_VERSION' is missing
|
||||
@@ -46,6 +46,10 @@ macro(CompilerChecksAndSetups)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+17")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+14")
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
elseif (${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+11")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif()
|
||||
|
||||
# Log the compiler and version
|
||||
@@ -53,7 +57,7 @@ macro(CompilerChecksAndSetups)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
|
||||
include(${CMAKE_SOURCE_DIR}/cMake/ConfigureChecks.cmake)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
|
||||
# For now only set pedantic option for clang
|
||||
@@ -98,7 +102,4 @@ macro(CompilerChecksAndSetups)
|
||||
add_definitions(-DBOOST_PP_VARIADICS=1)
|
||||
message(STATUS "Force BOOST_PP_VARIADICS=1 for clang")
|
||||
endif()
|
||||
|
||||
set (COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS} BOOST_NO_CXX98_FUNCTION_BASE)
|
||||
|
||||
endmacro(CompilerChecksAndSetups)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
macro(CopyLibpackDirectories)
|
||||
# Copy libpack dependency directories to build folder for user as part of overall build process
|
||||
if(FREECAD_COPY_DEPEND_DIRS_TO_BUILD)
|
||||
message(STATUS "=======================================\n"
|
||||
"Copying libpack dependency directories to build directory for Windows MSVC build.\n")
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/assistant.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/qt.conf DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/translations)
|
||||
message(STATUS "... end copying.\n=======================================\n")
|
||||
endif()
|
||||
|
||||
if(COPY_LIBPACK_BIN_TO_BUILD)
|
||||
if(FREECAD_COPY_LIBPACK_BIN_TO_BUILD)
|
||||
message("=======================================\n"
|
||||
"Copying libpack 'bin' directory to build directory.\n")
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_BINARY_DIR})
|
||||
message("... done copying libpack 'bin' directory.\n=======================================\n")
|
||||
endif()
|
||||
if(FREECAD_COPY_PLUGINS_BIN_TO_BUILD)
|
||||
message(STATUS "=======================================\n"
|
||||
"Copying plugins to build directory.")
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/translations)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf "[Paths]\nPrefix=..\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(FREECAD_INSTALL_DEPEND_DIRS)
|
||||
# Test install command for installing/copying directories
|
||||
message(STATUS "=======================================")
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_INSTALL_PREFIX}/translations)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
message(STATUS "Created install commands for INSTALL target.\n")
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -18,24 +18,24 @@ macro(FreeCADLibpackChecks)
|
||||
endif(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
|
||||
# -------------------------------- PyCXX --------------------------------
|
||||
|
||||
find_package(PyCXX REQUIRED)
|
||||
find_package(PyCXX REQUIRED)
|
||||
|
||||
# -------------------------------- Swig ----------------------------------
|
||||
|
||||
find_package(SWIG)
|
||||
find_package(SWIG)
|
||||
|
||||
if(NOT SWIG_FOUND)
|
||||
message("==================================================\n"
|
||||
"SWIG not found, don't build SWIG binding for pivy.\n"
|
||||
"==================================================\n")
|
||||
endif(NOT SWIG_FOUND)
|
||||
if(NOT SWIG_FOUND)
|
||||
message("==================================================\n"
|
||||
"SWIG not found, don't build SWIG binding for pivy.\n"
|
||||
"==================================================\n")
|
||||
endif(NOT SWIG_FOUND)
|
||||
|
||||
# -------------------------------- Salome SMESH --------------------------
|
||||
|
||||
if(NOT FREECAD_USE_EXTERNAL_SMESH)
|
||||
set(SMESH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/3rdParty/salomesmesh/inc)
|
||||
endif()
|
||||
if(NOT FREECAD_USE_EXTERNAL_SMESH)
|
||||
set(SMESH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/3rdParty/salomesmesh/inc)
|
||||
endif()
|
||||
|
||||
endif(FREECAD_LIBPACK_USE)
|
||||
endif(FREECAD_LIBPACK_USE)
|
||||
|
||||
endmacro(FreeCADLibpackChecks)
|
||||
|
||||
@@ -8,9 +8,9 @@ macro(InitializeFreeCADBuildOptions)
|
||||
option(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF)
|
||||
option(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF)
|
||||
option(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF)
|
||||
option(FREECAD_USE_EXTERNAL_FMT "Use system installed fmt library if available instead of fetching the source." ON)
|
||||
option(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON)
|
||||
option(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF)
|
||||
option(FREECAD_TOPONAMING_BRANDING "Enable branding for TopoNaming branch" ON)
|
||||
option(BUILD_WITH_CONDA "Set ON if you build FreeCAD with conda" OFF)
|
||||
option(BUILD_DYNAMIC_LINK_PYTHON "If OFF extension-modules do not link against python-libraries" ON)
|
||||
option(INSTALL_TO_SITEPACKAGES "If ON the freecad root namespace (python) is installed into python's site-packages" OFF)
|
||||
@@ -26,6 +26,7 @@ macro(InitializeFreeCADBuildOptions)
|
||||
option(FREECAD_RELEASE_PDB "Create PDB files for Release version." ON)
|
||||
option(FREECAD_RELEASE_SEH "Enable Structured Exception Handling for Release version." ON)
|
||||
option(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." ON)
|
||||
option(FREECAD_LIBPACK_USEPYSIDE "Use PySide in LibPack rather to PyQt and Swig." ON)
|
||||
option(FREECAD_USE_PCH "Activate precompiled headers where it's used." ON)
|
||||
|
||||
if (DEFINED ENV{FREECAD_LIBPACK_DIR})
|
||||
@@ -55,14 +56,13 @@ macro(InitializeFreeCADBuildOptions)
|
||||
endif()
|
||||
else()
|
||||
message("Libpack NOT found.\nIf you intend to use a Windows libpack, set the FREECAD_LIBPACK_DIR to the libpack directory.")
|
||||
message(STATUS "Visit: https://github.com/FreeCAD/FreeCAD-Libpack/releases/ for Windows libpack downloads.")
|
||||
message(STATUS "Visit: https://github.com/apeltauer/FreeCAD/releases/ for Windows libpack downloads.")
|
||||
endif()
|
||||
else(MSVC)
|
||||
option(FREECAD_LIBPACK_USE "Use the LibPack to Build FreeCAD (only Win32 so far)." OFF)
|
||||
set(FREECAD_LIBPACK_DIR "" CACHE PATH "Directory of the FreeCAD LibPack")
|
||||
endif(MSVC)
|
||||
|
||||
ChooseQtVersion()
|
||||
option(BUILD_QT5 "Build with Qt5." ON)
|
||||
|
||||
# https://blog.kitware.com/constraining-values-with-comboboxes-in-cmake-cmake-gui/
|
||||
set(FREECAD_USE_OCC_VARIANT "Community Edition" CACHE STRING "Official OpenCASCADE version or community edition")
|
||||
@@ -71,6 +71,14 @@ macro(InitializeFreeCADBuildOptions)
|
||||
"Community Edition"
|
||||
)
|
||||
|
||||
if (BUILD_QT5)
|
||||
set(FREECAD_USE_QTWEBMODULE "Automatic" CACHE STRING "Qt Webkit or Qt WebEngine")
|
||||
set_property(CACHE FREECAD_USE_QTWEBMODULE PROPERTY STRINGS
|
||||
"Automatic"
|
||||
"Qt Webkit"
|
||||
"Qt WebEngine"
|
||||
)
|
||||
endif()
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/QtOpenGL.h.cmake ${CMAKE_BINARY_DIR}/src/QtOpenGL.h)
|
||||
|
||||
option(BUILD_DESIGNER_PLUGIN "Build and install the designer plugin" OFF)
|
||||
@@ -104,22 +112,25 @@ macro(InitializeFreeCADBuildOptions)
|
||||
option(BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF)
|
||||
option(BUILD_ADDONMGR "Build the FreeCAD addon manager module" ON)
|
||||
option(BUILD_ARCH "Build the FreeCAD Architecture module" ON)
|
||||
option(BUILD_COMPLETE "Build the FreeCAD complete module" OFF)
|
||||
option(BUILD_DRAFT "Build the FreeCAD draft module" ON)
|
||||
option(BUILD_DRAWING "Build the FreeCAD drawing module" OFF)
|
||||
option(BUILD_IDF "Build the FreeCAD idf module" ON)
|
||||
option(BUILD_IMAGE "Build the FreeCAD image module" ON)
|
||||
option(BUILD_IMPORT "Build the FreeCAD import module" ON)
|
||||
option(BUILD_INSPECTION "Build the FreeCAD inspection module" ON)
|
||||
option(BUILD_JTREADER "Build the FreeCAD jt reader module" OFF)
|
||||
option(BUILD_MATERIAL "Build the FreeCAD material module" ON)
|
||||
option(BUILD_MESH "Build the FreeCAD mesh module" ON)
|
||||
option(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON)
|
||||
option(BUILD_FLAT_MESH "Build the FreeCAD flat mesh module" ON)
|
||||
option(BUILD_FLAT_MESH "Build the FreeCAD flat mesh module" OFF)
|
||||
option(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON)
|
||||
option(BUILD_PART "Build the FreeCAD part module" ON)
|
||||
option(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON)
|
||||
option(BUILD_PATH "Build the FreeCAD path module" ON)
|
||||
option(BUILD_PLOT "Build the FreeCAD plot module" ON)
|
||||
option(BUILD_POINTS "Build the FreeCAD points module" ON)
|
||||
option(BUILD_RAYTRACING "Build the FreeCAD ray tracing module" ON)
|
||||
option(BUILD_REVERSEENGINEERING "Build the FreeCAD reverse engineering module" ON)
|
||||
option(BUILD_ROBOT "Build the FreeCAD robot module" ON)
|
||||
option(BUILD_SHOW "Build the FreeCAD Show module (helper module for visibility automation)" ON)
|
||||
@@ -133,7 +144,6 @@ macro(InitializeFreeCADBuildOptions)
|
||||
option(BUILD_SURFACE "Build the FreeCAD surface module" ON)
|
||||
option(BUILD_VR "Build the FreeCAD Oculus Rift support (need Oculus SDK 4.x or higher)" OFF)
|
||||
option(BUILD_CLOUD "Build the FreeCAD cloud module" OFF)
|
||||
option(ENABLE_DEVELOPER_TESTS "Build the FreeCAD unit tests suit" ON)
|
||||
|
||||
if(MSVC)
|
||||
option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
|
||||
|
||||
@@ -1,185 +1,267 @@
|
||||
macro(PrintFinalReport)
|
||||
# -------------------------------- The final report ----------------------------------
|
||||
|
||||
# name and value
|
||||
macro(simple)
|
||||
set(name ${ARGV0})
|
||||
set(value ${ARGV1})
|
||||
if(NOT value)
|
||||
set(value "-undefined-")
|
||||
endif()
|
||||
string(APPEND name ": ")
|
||||
string(SUBSTRING ${name} 0 28 nameStr)
|
||||
list(APPEND simpleLines "${nameStr} ${value}")
|
||||
endmacro()
|
||||
message(STATUS "\n==============\n"
|
||||
"Summary report\n"
|
||||
"==============\n")
|
||||
if (DEFINED CMAKE_BUILD_TYPE)
|
||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||
endif()
|
||||
|
||||
# just a value
|
||||
macro(value)
|
||||
unset(val)
|
||||
set(name ${ARGV0})
|
||||
if(${name})
|
||||
set(val ${${name}}) # name has a value
|
||||
elseif(DEFINED ${name})
|
||||
set(val "OFF ") #!
|
||||
endif()
|
||||
simple(${name} ${val})
|
||||
endmacro()
|
||||
|
||||
# conditional data
|
||||
macro(conditional)
|
||||
set(name ${ARGV0})
|
||||
set(condition ${ARGV1})
|
||||
set(ifFalse ${ARGV2})
|
||||
set(ifTrue ${ARGV3})
|
||||
if(${condition})
|
||||
set(out ${ifTrue})
|
||||
else()
|
||||
set(out ${ifFalse})
|
||||
endif()
|
||||
simple(${name} ${out})
|
||||
endmacro()
|
||||
|
||||
function(section_begin name)
|
||||
unset(simpleLines PARENT_SCOPE)
|
||||
message("\n ==============\n"
|
||||
" ${name}\n"
|
||||
" ==============\n")
|
||||
endfunction()
|
||||
|
||||
function(section_end)
|
||||
list(SORT simpleLines CASE INSENSITIVE)
|
||||
foreach(line ${simpleLines})
|
||||
message(STATUS ${line})
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
############## System ####################
|
||||
|
||||
section_begin(System)
|
||||
|
||||
simple(Compiler "${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_VERSION})")
|
||||
value(CMAKE_VERSION)
|
||||
simple(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
simple(bindir ${CMAKE_INSTALL_BINDIR})
|
||||
simple(datadir ${CMAKE_INSTALL_DATADIR})
|
||||
simple(docdir ${CMAKE_INSTALL_DOCDIR})
|
||||
simple(includedir ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
simple(libdir ${CMAKE_INSTALL_LIBDIR})
|
||||
simple(Python "${Python3_VERSION} [${PYTHON_EXECUTABLE}] Suffix: [${PYTHON_CONFIG_SUFFIX}]")
|
||||
value(BLAS)
|
||||
|
||||
section_end()
|
||||
|
||||
############## Config ####################
|
||||
|
||||
section_begin(Config)
|
||||
|
||||
value(CMAKE_CXX_STANDARD)
|
||||
value(CMAKE_CXX_FLAGS)
|
||||
value(CMAKE_BUILD_TYPE)
|
||||
value(ENABLE_DEVELOPER_TESTS)
|
||||
value(FREECAD_USE_FREETYPE)
|
||||
value(FREECAD_USE_EXTERNAL_SMESH)
|
||||
value(BUILD_SMESH)
|
||||
value(BUILD_VR)
|
||||
value(CMAKE_PREFIX_PATH)
|
||||
value(FREECAD_QT_VERSION)
|
||||
value(PYTHON_EXECUTABLE)
|
||||
value(PYTHON_LIBRARY)
|
||||
value(FREECAD_CREATE_MAC_APP)
|
||||
value(FREECAD_USE_PYBIND11)
|
||||
value(FREECAD_USE_EXTERNAL_KDL)
|
||||
value(BUILD_FEM)
|
||||
value(BUILD_WEB)
|
||||
value(BUILD_GUI)
|
||||
value(BUILD_START)
|
||||
value(BUILD_TECHDRAW)
|
||||
value(CMAKE_INSTALL_PREFIX)
|
||||
value(USE_CUDA)
|
||||
value(USE_OPENCV)
|
||||
value(FREECAD_LIBPACK_USE)
|
||||
|
||||
section_end()
|
||||
|
||||
################ Libraries ##################
|
||||
|
||||
section_begin(Libraries)
|
||||
message(STATUS "Compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_VERSION})")
|
||||
message(STATUS "Flags: ${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "Standard: Requires C++${CMAKE_CXX_STANDARD}")
|
||||
|
||||
# Qt5 needs/sets PYTHON_CONFIG_SUFFIX regarding Shiboken
|
||||
conditional(pybind11 pybind11_FOUND "not enabled" ${pybind11_VERSION})
|
||||
simple(Boost ${Boost_VERSION})
|
||||
simple(XercesC "${XercesC_VERSION} [${XercesC_LIBRARIES}] [${XercesC_INCLUDE_DIRS}]")
|
||||
simple(ZLIB "${ZLIB_VERSION_STRING}")
|
||||
simple(OCC "${OCC_VERSION_STRING} [${OCC_LIBRARY_DIR}] [${OCC_INCLUDE_DIR}]")
|
||||
simple(OCC_Libs "[${OCC_LIBRARIES}]")
|
||||
message(STATUS "Python: ${PYTHON_VERSION_STRING} [${PYTHON_EXECUTABLE}] [${PYTHON_CONFIG_SUFFIX}]")
|
||||
|
||||
if(DEFINED PCL_FOUND)
|
||||
message(STATUS "PCL: ${PCL_VERSION}")
|
||||
else(DEFINED PCL_FOUND)
|
||||
message(STATUS "PCL: not enabled")
|
||||
endif(DEFINED PCL_FOUND)
|
||||
|
||||
if(DEFINED pybind11_FOUND)
|
||||
message(STATUS "pybind11: ${pybind11_VERSION}")
|
||||
else(DEFINED pybind11_FOUND)
|
||||
message(STATUS "pybind11: not enabled")
|
||||
endif(DEFINED pybind11_FOUND)
|
||||
|
||||
message(STATUS "Boost: ${Boost_VERSION}")
|
||||
|
||||
message(STATUS "XercesC: ${XercesC_VERSION} [${XercesC_LIBRARIES}] [${XercesC_INCLUDE_DIRS}]")
|
||||
|
||||
message(STATUS "ZLIB: ${ZLIB_VERSION_STRING}")
|
||||
|
||||
message(STATUS "PyCXX: ${PYCXX_VERSION} [${PYCXX_INCLUDE_DIR}]")
|
||||
|
||||
message(STATUS "OCC: ${OCC_VERSION_STRING} [${OCC_LIBRARIES}] [${OCC_LIBRARY_DIR}] [${OCC_INCLUDE_DIR}]")
|
||||
|
||||
if(BUILD_SMESH)
|
||||
if(FREECAD_USE_EXTERNAL_SMESH)
|
||||
simple(SMESH "${SMESH_VERSION_MAJOR}.${SMESH_VERSION_MINOR}.${SMESH_VERSION_PATCH}.${SMESH_VERSION_TWEAK}")
|
||||
else()
|
||||
simple(SMESH "${SMESH_VERSION_MAJOR}.${SMESH_VERSION_MINOR}.${SMESH_VERSION_PATCH}.${SMESH_VERSION_TWEAK} build internal")
|
||||
simple(MEDFile "${MEDFILE_VERSION} [${MEDFILE_LIBRARIES}] [${MEDFILE_INCLUDE_DIRS}]")
|
||||
simple(HDF5 ${HDF5_VERSION})
|
||||
simple(VTK ${VTK_VERSION})
|
||||
endif()
|
||||
else()
|
||||
simple(SMESH "do not build")
|
||||
endif()
|
||||
conditional(NETGEN NETGEN_FOUND
|
||||
"not enabled"
|
||||
"${NETGEN_VERSION_MAJOR}.${NETGEN_VERSION_MINOR}.${NETGEN_VERSION_PATCH} (${NETGEN_VERSION}) [${NETGEN_DEFINITIONS}] [${NETGEN_CXX_FLAGS}] [${NGLIB_INCLUDE_DIR}] [${NGLIB_LIBRARIES}] [${NETGEN_INCLUDE_DIRS}]"
|
||||
)
|
||||
#simple(OpenCV ${OpenCV_VERSION})
|
||||
conditional(SWIG SWIG_FOUND "not found" ${SWIG_VERSION})
|
||||
conditional(Eigen3 EIGEN3_FOUND "not found" ${EIGEN3_VERSION})
|
||||
conditional(QtConcurrent BUILD_GUI "not needed" ${QtConcurrent_VERSION})
|
||||
simple(QtCore ${QtCore_VERSION})
|
||||
simple(QtNetwork ${QtNetwork_VERSION})
|
||||
conditional(QtOpenGL BUILD_GUI "not needed" ${QtOpenGL_VERSION})
|
||||
conditional(QtPrintSupport BUILD_GUI "not needed" ${QtPrintSupport_VERSION})
|
||||
conditional(QtSvg BUILD_GUI "not needed" ${QtSvg_VERSION})
|
||||
conditional(QtUiTools BUILD_GUI "not needed" ${QtUiTools_VERSION})
|
||||
conditional(QtWidgets BUILD_GUI "not needed" ${QtWidgets_VERSION})
|
||||
simple(QtXml ${QtXml_VERSION})
|
||||
message(STATUS "SMESH: ${SMESH_VERSION_MAJOR}.${SMESH_VERSION_MINOR}.${SMESH_VERSION_PATCH}.${SMESH_VERSION_TWEAK}")
|
||||
else(FREECAD_USE_EXTERNAL_SMESH)
|
||||
message(STATUS "SMESH: ${SMESH_VERSION_MAJOR}.${SMESH_VERSION_MINOR}.${SMESH_VERSION_PATCH}.${SMESH_VERSION_TWEAK} build internal")
|
||||
message(STATUS "MEDFile: ${MEDFILE_VERSION} [${MEDFILE_LIBRARIES}] [${MEDFILE_INCLUDE_DIRS}]")
|
||||
message(STATUS "HDF5: ${HDF5_VERSION}")
|
||||
message(STATUS "VTK: ${VTK_VERSION}")
|
||||
endif(FREECAD_USE_EXTERNAL_SMESH)
|
||||
else(BUILD_SMESH)
|
||||
message(STATUS "SMESH: do not build")
|
||||
endif(BUILD_SMESH)
|
||||
|
||||
if(DEFINED NETGEN_FOUND)
|
||||
message(STATUS "NETGEN: ${NETGEN_VERSION_MAJOR}.${NETGEN_VERSION_MINOR}.${NETGEN_VERSION_PATCH} (${NETGEN_VERSION}) [${NETGEN_DEFINITIONS}] [${NETGEN_CXX_FLAGS}] [${NGLIB_INCLUDE_DIR}] [${NGLIB_LIBRARIES}] [${NETGEN_INCLUDE_DIRS}]")
|
||||
else(DEFINED NETGEN_FOUND)
|
||||
message(STATUS "NETGEN: not enabled")
|
||||
endif(DEFINED NETGEN_FOUND)
|
||||
|
||||
#message(STATUS "OpenCV: ${OpenCV_VERSION}")
|
||||
|
||||
if(DEFINED SWIG_FOUND)
|
||||
message(STATUS "SWIG: ${SWIG_VERSION}")
|
||||
else(DEFINED SWIG_FOUND)
|
||||
message(STATUS "SWIG: not found")
|
||||
endif(DEFINED SWIG_FOUND)
|
||||
|
||||
if(DEFINED EIGEN3_FOUND)
|
||||
message(STATUS "Eigen3 ${EIGEN3_VERSION}")
|
||||
else(DEFINED EIGEN3_FOUND)
|
||||
message(STATUS "Eigen3: not found")
|
||||
endif(DEFINED EIGEN3_FOUND)
|
||||
|
||||
message(STATUS "Qt5Core: ${Qt5Core_VERSION}")
|
||||
message(STATUS "Qt5Network: ${Qt5Network_VERSION}")
|
||||
message(STATUS "Qt5Xml: ${Qt5Xml_VERSION}")
|
||||
message(STATUS "Qt5XmlPatterns: ${Qt5XmlPatterns_VERSION}")
|
||||
if (BUILD_GUI)
|
||||
conditional(QtWebEngineWidgets BUILD_WEB "not needed (BUILD_WEB is OFF)" ${QtWebEngineWidgets_VERSION})
|
||||
conditional(DesignerPlugin BUILD_DESIGNER_PLUGIN
|
||||
"not built (BUILD_DESIGNER_PLUGIN is OFF)"
|
||||
"[${DESIGNER_PLUGIN_LOCATION}/${libFreeCAD_widgets}]"
|
||||
)
|
||||
else()
|
||||
simple(QtWebKitWidgets "not needed")
|
||||
endif()
|
||||
conditional(Shiboken Shiboken${SHIBOKEN_MAJOR_VERSION}_FOUND "not found" "${Shiboken_VERSION} [${SHIBOKEN_INCLUDE_DIR}]")
|
||||
conditional(PySide PySide${PYSIDE_MAJOR_VERSION}_FOUND "not found" "${PySide_VERSION} [${PYSIDE_INCLUDE_DIR}]")
|
||||
conditional(PySideTools PYSIDE_TOOLS_FOUND
|
||||
"not found"
|
||||
"v: ${PySideTools_VERSION} uic: [${PYSIDE_UIC_EXECUTABLE}] rcc: [${PYSIDE_RCC_EXECUTABLE}]"
|
||||
)
|
||||
message(STATUS "Qt5Widgets: ${Qt5Widgets_VERSION}")
|
||||
message(STATUS "Qt5PrintSupport: ${Qt5PrintSupport_VERSION}")
|
||||
message(STATUS "Qt5OpenGL: ${Qt5OpenGL_VERSION}")
|
||||
message(STATUS "Qt5Svg: ${Qt5Svg_VERSION}")
|
||||
message(STATUS "Qt5UiTools: ${Qt5UiTools_VERSION}")
|
||||
message(STATUS "Qt5Concurrent: ${Qt5Concurrent_VERSION}")
|
||||
if(BUILD_WEB)
|
||||
if (Qt5WebKitWidgets_FOUND)
|
||||
message(STATUS "Qt5WebKitWidgets: ${Qt5WebKitWidgets_VERSION}")
|
||||
endif()
|
||||
if (Qt5WebEngineWidgets_FOUND)
|
||||
message(STATUS "Qt5WebEngineWidgets: ${Qt5WebEngineWidgets_VERSION}")
|
||||
endif()
|
||||
else(BUILD_WEB)
|
||||
message(STATUS "Qt5WebKitWidgets: not needed (BUILD_WEB)")
|
||||
message(STATUS "Qt5WebEngineWidgets: not needed (BUILD_WEB)")
|
||||
endif(BUILD_WEB)
|
||||
if(BUILD_DESIGNER_PLUGIN)
|
||||
message(STATUS "Designer plugin: ${DESIGNER_PLUGIN_LOCATION}/${libFreeCAD_widgets}")
|
||||
else(BUILD_DESIGNER_PLUGIN)
|
||||
message(STATUS "Designer plugin: not built per user request (BUILD_DESIGNER_PLUGIN)")
|
||||
endif(BUILD_DESIGNER_PLUGIN)
|
||||
if(${Qt5WinExtras_FOUND})
|
||||
message(STATUS "Qt5WinExtras: ${Qt5WinExtras_VERSION}")
|
||||
endif()
|
||||
|
||||
else(BUILD_GUI)
|
||||
message(STATUS "Qt5Widgets: not needed")
|
||||
message(STATUS "Qt5PrintSupport: not needed")
|
||||
message(STATUS "Qt5OpenGL: not needed")
|
||||
message(STATUS "Qt5Svg: not needed")
|
||||
message(STATUS "Qt5UiTools: not needed")
|
||||
message(STATUS "Qt5Concurrent: not needed")
|
||||
message(STATUS "Qt5WebKitWidgets: not needed")
|
||||
endif(BUILD_GUI)
|
||||
|
||||
if(DEFINED MACPORTS_PREFIX)
|
||||
if(DEFINED Shiboken_FOUND)
|
||||
message(STATUS "Shiboken: ${Shiboken_VERSION} [${SHIBOKEN_INCLUDE_DIR}]")
|
||||
else(DEFINED Shiboken_FOUND)
|
||||
message(STATUS "Shiboken: not found (only searched if MACPORTS_PREFIX is defined)")
|
||||
endif(DEFINED Shiboken_FOUND)
|
||||
if(DEFINED PySide_FOUND)
|
||||
message(STATUS "PySide: ${PySide_VERSION} [${PYSIDE_INCLUDE_DIR}]")
|
||||
if(NOT PYSIDE_INCLUDE_DIR)
|
||||
message(STATUS " IncludeDir: Unable to find, python version mismatch?")
|
||||
endif(NOT PYSIDE_INCLUDE_DIR)
|
||||
else(DEFINED PySide_FOUND)
|
||||
message(STATUS "PySide: not found (only searched if MACPORTS_PREFIX is defined)")
|
||||
endif(DEFINED PySide_FOUND)
|
||||
endif(DEFINED MACPORTS_PREFIX)
|
||||
|
||||
if(DEFINED Shiboken2_FOUND)
|
||||
message(STATUS "Shiboken2: ${Shiboken2_VERSION} [${Shiboken2_DIR}] [${SHIBOKEN_INCLUDE_DIR}]")
|
||||
else(DEFINED Shiboken2_FOUND)
|
||||
message(STATUS "Shiboken2: not found")
|
||||
endif(DEFINED Shiboken2_FOUND)
|
||||
if(DEFINED PySide2_FOUND)
|
||||
message(STATUS "PySide2: ${PySide2_VERSION} [${PYSIDE_INCLUDE_DIR}]")
|
||||
if(NOT PYSIDE_INCLUDE_DIR)
|
||||
message(STATUS " IncludeDir: Unable to find, python version mismatch?")
|
||||
endif(NOT PYSIDE_INCLUDE_DIR)
|
||||
else(DEFINED PySide2_FOUND)
|
||||
message(STATUS "PySide2: not found")
|
||||
endif(DEFINED PySide2_FOUND)
|
||||
if(DEFINED PYSIDE2_TOOLS_FOUND)
|
||||
message(STATUS "PySide2Tools: [${PYSIDE2UICBINARY}] [${PYSIDE2RCCBINARY}]")
|
||||
else(DEFINED PYSIDE2_TOOLS_FOUND)
|
||||
message(STATUS "PySide2Tools: not found")
|
||||
endif(DEFINED PYSIDE2_TOOLS_FOUND)
|
||||
|
||||
if(FREECAD_USE_FREETYPE)
|
||||
conditional(Freetype FREETYPE_FOUND "not found" ${FREETYPE_VERSION_STRING})
|
||||
else()
|
||||
simple(Freetype "disabled")
|
||||
endif()
|
||||
simple(OpenGL_Lib [${OPENGL_gl_LIBRARY}])
|
||||
simple(OpenGLU_Lib [${OPENGL_glu_LIBRARY}])
|
||||
simple(OpenGLU_Incl [${OPENGL_INCLUDE_DIR}])
|
||||
simple(Coin3D "${COIN3D_VERSION} [${COIN3D_LIBRARIES}] [${COIN3D_INCLUDE_DIRS}]")
|
||||
simple(pivy ${PIVY_VERSION})
|
||||
if(DEFINED FREETYPE_FOUND)
|
||||
message(STATUS "Freetype: ${FREETYPE_VERSION_STRING}")
|
||||
else(DEFINED FREETYPE_FOUND)
|
||||
message(STATUS "Freetype: not found")
|
||||
endif(DEFINED FREETYPE_FOUND)
|
||||
else(FREECAD_USE_FREETYPE)
|
||||
message(STATUS "Freetype: disabled")
|
||||
endif(FREECAD_USE_FREETYPE)
|
||||
|
||||
message(STATUS "OpenGL: ${OPENGL_gl_LIBRARY}")
|
||||
message(STATUS "OpenGLU: [${OPENGL_glu_LIBRARY}][${OPENGL_INCLUDE_DIR}]")
|
||||
|
||||
message(STATUS "Coin3D: ${COIN3D_VERSION} [${COIN3D_LIBRARIES}] [${COIN3D_INCLUDE_DIRS}]")
|
||||
message(STATUS "Pivy: ${PIVY_VERSION}")
|
||||
|
||||
|
||||
if (WIN32)
|
||||
#simple(SPNAV "not available yet for your OS") # FREECAD_USE_3DCONNEXION instead...
|
||||
else()
|
||||
conditional(SPNAV SPNAV_FOUND "not found" "[${SPNAV_LIBRARY}] [${SPNAV_INCLUDE_DIR}]")
|
||||
endif()
|
||||
conditional(Matplotlib MATPLOTLIB_FOUND "not found" "${MATPLOTLIB_VERSION} PathDirs: ${MATPLOTLIB_PATH_DIRS}")
|
||||
#message(STATUS "SPNAV: not available yet for your OS") # FREECAD_USE_3DCONNEXION instead...
|
||||
else(WIN32)
|
||||
if(DEFINED SPNAV_FOUND)
|
||||
message(STATUS "SPNAV: [${SPNAV_LIBRARY}] [${SPNAV_INCLUDE_DIR}]")
|
||||
else(DEFINED SPNAV_FOUND)
|
||||
message(STATUS "SPNAV: not found")
|
||||
endif(DEFINED SPNAV_FOUND)
|
||||
endif(WIN32)
|
||||
|
||||
if(MATPLOTLIB_FOUND)
|
||||
message(STATUS "Matplotlib: ${MATPLOTLIB_VERSION}")
|
||||
else(MATPLOTLIB_FOUND)
|
||||
message(STATUS "Matplotlib: not found")
|
||||
endif(MATPLOTLIB_FOUND)
|
||||
|
||||
if(BUILD_VR)
|
||||
conditional(Rift RIFT_FOUND "not found" ${Rift_VERSION})
|
||||
else()
|
||||
simple(Rift "not enabled (BUILD_VR)")
|
||||
if(DEFINED RIFT_FOUND)
|
||||
message(STATUS "Rift: ${Rift_VERSION}")
|
||||
else(DEFINED RIFT_FOUND)
|
||||
message(STATUS "Rift: not found")
|
||||
endif(DEFINED RIFT_FOUND)
|
||||
else(BUILD_VR)
|
||||
message(STATUS "Rift: not enabled (BUILD_VR)")
|
||||
endif(BUILD_VR)
|
||||
|
||||
if(DOXYGEN_FOUND)
|
||||
message(STATUS "Doxygen: ${DOXYGEN_VERSION}")
|
||||
message(STATUS "Language: ${DOXYGEN_LANGUAGE}")
|
||||
if(COIN3D_DOC_FOUND)
|
||||
message(STATUS "Coin3D_DOC: found [${COIN3D_DOC_PATH}]")
|
||||
else(COIN3D_DOC_FOUND)
|
||||
message(STATUS "Coin3D_DOC: not found")
|
||||
endif(COIN3D_DOC_FOUND)
|
||||
else(DOXYGEN_FOUND)
|
||||
message(STATUS "Doxygen: not found")
|
||||
endif(DOXYGEN_FOUND)
|
||||
|
||||
if(MSVC)
|
||||
# Copy libpack dependency directories to build folder for user as part of overall build process
|
||||
if(FREECAD_LIBPACK_USE AND LIBPACK_FOUND)
|
||||
if(FREECAD_COPY_DEPEND_DIRS_TO_BUILD)
|
||||
message(STATUS "=======================================\n"
|
||||
"Copying libpack dependency directories to build directory for Windows MSVC build.\n")
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/assistant.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/qt.conf DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/translations)
|
||||
message(STATUS "... end copying.\n=======================================\n")
|
||||
endif(FREECAD_COPY_DEPEND_DIRS_TO_BUILD)
|
||||
|
||||
if(COPY_LIBPACK_BIN_TO_BUILD)
|
||||
if(FREECAD_COPY_LIBPACK_BIN_TO_BUILD)
|
||||
message("=======================================\n"
|
||||
"Copying libpack 'bin' directory to build directory.\n")
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_BINARY_DIR})
|
||||
message("... done copying libpack 'bin' directory.\n=======================================\n")
|
||||
endif()
|
||||
if(FREECAD_COPY_PLUGINS_BIN_TO_BUILD)
|
||||
message(STATUS "=======================================\n"
|
||||
"Copying plugins to build directory.")
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/translations)
|
||||
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf "[Paths]\nPrefix=..\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(FREECAD_INSTALL_DEPEND_DIRS)
|
||||
# Test install command for installing/copying directories
|
||||
message(STATUS "=======================================")
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/iconengines DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_INSTALL_PREFIX}/translations)
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
message(STATUS "Created install commands for INSTALL target.\n")
|
||||
endif(FREECAD_INSTALL_DEPEND_DIRS)
|
||||
endif(FREECAD_LIBPACK_USE AND LIBPACK_FOUND)
|
||||
endif()
|
||||
conditional(Doxygen DOXYGEN_FOUND "not found" "${DOXYGEN_VERSION} Language: ${DOXYGEN_LANGUAGE}")
|
||||
conditional(Coin3D_DOC COIN3D_DOC_FOUND "not found" ${COIN3D_DOC_PATH})
|
||||
conditional(PYCXX PYCXX_FOUND "not found" "${PYCXX_VERSION} Incl: ${PYCXX_INCLUDE_DIR} Src:${PYCXX_SOURCE_DIR}")
|
||||
conditional(fmt fmt_FOUND "Sources downloaded to ${fmt_SOURCE_DIR}" "${fmt_VERSION}")
|
||||
|
||||
section_end()
|
||||
|
||||
endmacro()
|
||||
# Print message to start build process
|
||||
message("=================================================\n"
|
||||
"Now run 'cmake --build ${CMAKE_BINARY_DIR}' to build ${PROJECT_NAME}\n"
|
||||
"=================================================\n")
|
||||
endmacro(PrintFinalReport)
|
||||
|
||||
@@ -5,6 +5,6 @@ macro(SetLibraryVersions)
|
||||
set(HAVE_OCC_VERSION 1)
|
||||
endif(OCC_INCLUDE_DIR AND EXISTS ${OCC_INCLUDE_DIR}/Standard_Version.hxx)
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/LibraryVersions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/LibraryVersions.h)
|
||||
configure_file(LibraryVersions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/LibraryVersions.h)
|
||||
|
||||
endmacro(SetLibraryVersions)
|
||||
|
||||
@@ -1,39 +1,11 @@
|
||||
macro(SetupCoin3D)
|
||||
# -------------------------------- Coin3D --------------------------------
|
||||
|
||||
if (WIN32 AND MINGW)
|
||||
find_path(COIN3D_INCLUDE_DIRS Inventor/So.h)
|
||||
find_library(COIN3D_LIBRARIES Coin)
|
||||
endif ()
|
||||
|
||||
# Try MODULE mode
|
||||
find_package(Coin3D)
|
||||
find_package(Coin3D REQUIRED)
|
||||
if(NOT COIN3D_FOUND)
|
||||
# Try CONFIG mode
|
||||
find_package(Coin CONFIG REQUIRED)
|
||||
if (Coin_FOUND)
|
||||
set (COIN3D_INCLUDE_DIRS ${Coin_INCLUDE_DIR})
|
||||
set (COIN3D_LIBRARIES ${Coin_LIBRARIES})
|
||||
else()
|
||||
message(FATAL_ERROR "=================\n"
|
||||
"Coin3D not found.\n"
|
||||
"=================\n")
|
||||
endif()
|
||||
message(FATAL_ERROR "=================\n"
|
||||
"Coin3D not found.\n"
|
||||
"=================\n")
|
||||
endif(NOT COIN3D_FOUND)
|
||||
|
||||
IF(NOT COIN3D_VERSION)
|
||||
file(READ "${COIN3D_INCLUDE_DIRS}/Inventor/C/basic.h" _coin3d_basic_h)
|
||||
string(REGEX MATCH "define[ \t]+COIN_MAJOR_VERSION[ \t]+([0-9?])" _coin3d_major_version_match "${_coin3d_basic_h}")
|
||||
set(COIN3D_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+COIN_MINOR_VERSION[ \t]+([0-9?])" _coin3d_minor_version_match "${_coin3d_basic_h}")
|
||||
set(COIN3D_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+COIN_MICRO_VERSION[ \t]+([0-9?])" _coin3d_micro_version_match "${_coin3d_basic_h}")
|
||||
set(COIN3D_MICRO_VERSION "${CMAKE_MATCH_1}")
|
||||
set(COIN3D_VERSION "${COIN3D_MAJOR_VERSION}.${COIN3D_MINOR_VERSION}.${COIN3D_MICRO_VERSION}")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT PIVY_VERSION)
|
||||
execute_process (COMMAND ${Python3_EXECUTABLE} -c "import pivy as p; print(p.__version__,end='')" OUTPUT_VARIABLE PIVY_VERSION)
|
||||
ENDIF()
|
||||
|
||||
endmacro(SetupCoin3D)
|
||||
|
||||
@@ -11,14 +11,14 @@ macro(SetupEigen)
|
||||
"=================\n")
|
||||
endif(NOT EIGEN3_FOUND)
|
||||
|
||||
if (EIGEN3_FOUND AND ${EIGEN3_VERSION} VERSION_LESS "3.3.1")
|
||||
if (${EIGEN3_VERSION} VERSION_LESS "3.3.1")
|
||||
message(WARNING "Disable module flatmesh because it requires "
|
||||
"minimum Eigen3 version 3.3.1 but version ${EIGEN3_VERSION} was found")
|
||||
set (BUILD_FLAT_MESH OFF)
|
||||
endif()
|
||||
|
||||
# Older versions raise the warning -Wdeprecated-copy with clang10/gcc10
|
||||
if (EIGEN3_FOUND AND ${EIGEN3_VERSION} VERSION_LESS "3.3.8")
|
||||
if (${EIGEN3_VERSION} VERSION_LESS "3.3.8")
|
||||
unset(_flag_found CACHE)
|
||||
check_cxx_compiler_flag("-Wno-deprecated-copy" _flag_found)
|
||||
if (_flag_found)
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
macro(SetupLibFmt)
|
||||
|
||||
# This internet check idea is borrowed from:
|
||||
# https://stackoverflow.com/questions/62214621/how-to-check-for-internet-connection-with-cmake-automatically-prevent-fails-if
|
||||
|
||||
if(FREECAD_USE_EXTERNAL_FMT)
|
||||
find_package(fmt QUIET)
|
||||
endif()
|
||||
|
||||
if(fmt_FOUND)
|
||||
message(STATUS "find_package() was used to locate fmt version ${fmt_VERSION}")
|
||||
else()
|
||||
|
||||
message(STATUS "Checking for connection to GitHub...")
|
||||
if (WIN32)
|
||||
set(ping_command "ping /n 1 /w 3 github.com")
|
||||
else()
|
||||
set(ping_command "ping -c 1 -W 3 github.com")
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND ${ping_command}
|
||||
RESULT_VARIABLE NO_CONNECTION
|
||||
)
|
||||
if(NO_CONNECTION GREATER 0)
|
||||
set(FETCHCONTENT_UPDATES_DISCONNECTED ON)
|
||||
message(WARNING "NO INTERNET CONNECTION: Using disconnected mode for FetchContent updates")
|
||||
else()
|
||||
message(STATUS "GitHub connection established for FetchContent")
|
||||
set(FETCHCONTENT_UPDATES_DISCONNECTED OFF)
|
||||
endif()
|
||||
|
||||
include(FetchContent)
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
endif()
|
||||
FetchContent_Declare(fmt
|
||||
URL https://github.com/fmtlib/fmt/archive/refs/tags/9.1.0.zip
|
||||
URL_MD5 e6754011ff56bfc37631fcc90961e377
|
||||
)
|
||||
FetchContent_MakeAvailable(fmt)
|
||||
set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
if(${fmt_POPULATED})
|
||||
message(STATUS "fmt was downloaded using FetchContent into ${fmt_SOURCE_DIR}")
|
||||
else()
|
||||
message(ERROR "Failed to install the fmt library")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,21 +1,162 @@
|
||||
macro(SetupPython)
|
||||
# -------------------------------- Python --------------------------------
|
||||
|
||||
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
|
||||
# For building on OS X
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA)
|
||||
|
||||
# For backwards compatibility with old CMake scripts
|
||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||
set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
|
||||
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
|
||||
set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS})
|
||||
set(PYTHON_VERSION_STRING ${Python3_VERSION})
|
||||
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
|
||||
set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR})
|
||||
set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH})
|
||||
set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND})
|
||||
# If the user doesn't tell us which package manager they're using
|
||||
if(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
if (${PYTHON_VERSION_STRING} VERSION_LESS "3.8")
|
||||
message(FATAL_ERROR "To build FreeCAD you need at least Python 3.8\n")
|
||||
# Try to find MacPorts path
|
||||
find_program(MACPORTS_EXECUTABLE port)
|
||||
if(EXISTS ${MACPORTS_EXECUTABLE})
|
||||
string(REPLACE "/bin/port" ""
|
||||
MACPORTS_PREFIX ${MACPORTS_EXECUTABLE})
|
||||
message(STATUS "Detected MacPorts install at ${MACPORTS_PREFIX}")
|
||||
endif(EXISTS ${MACPORTS_EXECUTABLE})
|
||||
|
||||
# Try to find Homebrew path
|
||||
find_program(HOMEBREW_EXECUTABLE brew)
|
||||
if(EXISTS ${HOMEBREW_EXECUTABLE})
|
||||
string(REPLACE "/bin/brew" ""
|
||||
HOMEBREW_PREFIX ${HOMEBREW_EXECUTABLE})
|
||||
message(STATUS "Detected Homebrew install at ${HOMEBREW_PREFIX}")
|
||||
endif()
|
||||
|
||||
endif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
# In case someone tries to shoot themselves in the foot
|
||||
if(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
|
||||
message(SEND_ERROR
|
||||
"Multiple package management systems detected - ")
|
||||
message(SEND_ERROR
|
||||
"define either MACPORTS_PREFIX or HOMEBREW_PREFIX")
|
||||
|
||||
# No package manager
|
||||
elseif(NOT DEFINED MACPORTS_PREFIX AND NOT DEFINED HOMEBREW_PREFIX)
|
||||
message(SEND_ERROR
|
||||
"No package manager detected - install MacPorts or Homebrew")
|
||||
|
||||
# The hopefully-normal case - one package manager identified
|
||||
else(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
# Construct a list like python;python2.9;python2.8;...
|
||||
set(Python_ADDITIONAL_VERSIONS_REV ${Python_ADDITIONAL_VERSIONS})
|
||||
list(REVERSE Python_ADDITIONAL_VERSIONS_REV)
|
||||
set(_PYTHON_NAMES "python")
|
||||
foreach(_PYTHON_VERSION IN LISTS Python_ADDITIONAL_VERSIONS_REV)
|
||||
list(APPEND _PYTHON_NAMES "python${_PYTHON_VERSION}")
|
||||
endforeach(_PYTHON_VERSION)
|
||||
|
||||
# Find python in the package management systems, using names in that
|
||||
# list in decreasing priority. Note that a manually specified
|
||||
# PYTHON_EXECUTABLE still has prescedence over this.
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES ${_PYTHON_NAMES}
|
||||
PATHS ${MACPORTS_PREFIX} ${HOMEBREW_PREFIX}
|
||||
PATH_SUFFIXES /bin
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
endif(DEFINED MACPORTS_PREFIX AND DEFINED HOMEBREW_PREFIX)
|
||||
|
||||
# Warn user if we still only have the system Python
|
||||
string(FIND ${PYTHON_EXECUTABLE} "/usr/bin/python" _FIND_SYS_PYTHON)
|
||||
if(_FIND_SYS_PYTHON EQUAL 0)
|
||||
message(SEND_ERROR
|
||||
"Only found the stock Python, that's probably bad.")
|
||||
endif(_FIND_SYS_PYTHON EQUAL 0)
|
||||
|
||||
# Ask Python to tell us it's include directory, if nobody else has
|
||||
if(NOT DEFINED PYTHON_INCLUDE_DIR)
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
|
||||
"from distutils.sysconfig import get_python_inc;print(get_python_inc())"
|
||||
OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
|
||||
RESULT_VARIABLE PYTHON_INCLUDE_DIR_RESULT
|
||||
ERROR_QUIET)
|
||||
if(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
|
||||
message(SEND_ERROR "Failed to determine PYTHON_INCLUDE_DIR")
|
||||
endif(NOT PYTHON_INCLUDE_DIR_RESULT MATCHES 0)
|
||||
endif(NOT DEFINED PYTHON_INCLUDE_DIR)
|
||||
|
||||
# Similar for the Python library - there must be an easier way...
|
||||
if(NOT DEFINED PYTHON_LIBRARY)
|
||||
# Get the library path
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
|
||||
"from distutils import sysconfig;print(sysconfig.get_config_var('LIBDIR'))"
|
||||
OUTPUT_VARIABLE PYTHON_LIBRARY_DIR
|
||||
RESULT_VARIABLE PYTHON_LIBRARY_DIR_RESULT
|
||||
ERROR_QUIET)
|
||||
string(STRIP ${PYTHON_LIBRARY_DIR} PYTHON_LIBRARY_DIR)
|
||||
if(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
|
||||
message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
|
||||
endif(NOT PYTHON_LIBRARY_DIR_RESULT MATCHES 0)
|
||||
|
||||
# Get library filename - might not be safe to assume .dylib extension?
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
|
||||
"import sys;print('libpython%d.%d.dylib'%sys.version_info[0:2])"
|
||||
OUTPUT_VARIABLE PYTHON_LIBRARY_FILE
|
||||
RESULT_VARIABLE PYTHON_LIBRARY_FILE_RESULT
|
||||
ERROR_QUIET)
|
||||
string(STRIP ${PYTHON_LIBRARY_FILE} PYTHON_LIBRARY_FILE)
|
||||
if(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
|
||||
message(SEND_ERROR "Failed to determine PYTHON_LIBRARY")
|
||||
endif(NOT PYTHON_LIBRARY_FILE_RESULT MATCHES 0)
|
||||
|
||||
set(PYTHON_LIBRARY "${PYTHON_LIBRARY_DIR}/${PYTHON_LIBRARY_FILE}")
|
||||
|
||||
else(NOT DEFINED PYTHON_LIBRARY)
|
||||
# Used on MacPorts systems for finding Shiboken and PySide
|
||||
# TODO: When we start requiring minimum CMake version above
|
||||
# 2.8.11, change PATH below to DIRECTORY
|
||||
get_filename_component(PYTHON_LIBRARY_DIR ${PYTHON_LIBRARY} PATH)
|
||||
endif(NOT DEFINED PYTHON_LIBRARY)
|
||||
|
||||
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.12")
|
||||
set(Python_ADDITIONAL_VERSIONS ${Python_ADDITIONAL_VERSIONS} "3.10" "3.9" "3.8" "3.7" "3.6")
|
||||
find_package(PythonInterp REQUIRED)
|
||||
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
if (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
else (NOT DEFINED PYTHON_VERSION_STRING)
|
||||
find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
|
||||
endif(NOT DEFINED PYTHON_VERSION_STRING)
|
||||
if(NOT PYTHONLIBS_FOUND)
|
||||
message(FATAL_ERROR "=================================\n"
|
||||
"Python not found, install Python!\n"
|
||||
"=================================\n")
|
||||
endif()
|
||||
|
||||
# For forward compatibility with new CMake scripts
|
||||
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||
set(Python3_LIBRARIES ${PYTHON_LIBRARIES})
|
||||
set(Python3_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
|
||||
set(Python3_LIBRARY_DIRS ${PYTHON_LIBRARY_DIRS})
|
||||
set(Python3_VERSION ${PYTHON_VERSION_STRING})
|
||||
set(Python3_VERSION_MAJOR ${PYTHON_VERSION_MAJOR})
|
||||
set(Python3_VERSION_MINOR ${PYTHON_VERSION_MINOR})
|
||||
set(Python3_VERSION_PATCH ${PYTHON_VERSION_PATCH})
|
||||
set(Python3_Interpreter_FOUND ${PYTHONINTERP_FOUND})
|
||||
else()
|
||||
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
|
||||
|
||||
# For backwards compatibility with old CMake scripts
|
||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||
set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
|
||||
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
|
||||
set(PYTHON_LIBRARY_DIRS ${Python3_LIBRARY_DIRS})
|
||||
set(PYTHON_VERSION_STRING ${Python3_VERSION})
|
||||
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
|
||||
set(PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR})
|
||||
set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH})
|
||||
set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND})
|
||||
endif()
|
||||
|
||||
# prevent python3 lower than 3.6
|
||||
if (${PYTHON_VERSION_STRING} VERSION_LESS "3.6")
|
||||
message(FATAL_ERROR "To build FreeCAD you need at least Python 3.6\n")
|
||||
endif()
|
||||
|
||||
endmacro(SetupPython)
|
||||
|
||||
@@ -1,99 +1,38 @@
|
||||
# -------------------------------- Qt --------------------------------
|
||||
|
||||
set(FREECAD_QT_COMPONENTS Core Concurrent Network Xml)
|
||||
if (FREECAD_QT_MAJOR_VERSION EQUAL 5)
|
||||
list (APPEND FREECAD_QT_COMPONENTS XmlPatterns)
|
||||
elseif (FREECAD_QT_MAJOR_VERSION EQUAL 6)
|
||||
set (Qt6Core_MOC_EXECUTABLE Qt6::moc)
|
||||
find_package(Qt5Core REQUIRED)
|
||||
set(CMAKE_AUTOMOC TRUE)
|
||||
|
||||
# For FreeCAD 0.20, pegged to Ubuntu 18.04 LTS:
|
||||
if(${Qt5Core_VERSION} VERSION_LESS "5.9")
|
||||
message (FATAL_ERROR "FreeCAD v0.20 requires Qt5 5.9 or later")
|
||||
endif()
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5Xml REQUIRED)
|
||||
find_package(Qt5XmlPatterns REQUIRED)
|
||||
find_package(Qt5Concurrent REQUIRED)
|
||||
if(BUILD_GUI)
|
||||
if (FREECAD_QT_MAJOR_VERSION EQUAL 6)
|
||||
list (APPEND FREECAD_QT_COMPONENTS GuiTools)
|
||||
list (APPEND FREECAD_QT_COMPONENTS SvgWidgets)
|
||||
elseif (FREECAD_QT_MAJOR_VERSION EQUAL 5)
|
||||
if (WIN32)
|
||||
list (APPEND FREECAD_QT_COMPONENTS WinExtras)
|
||||
endif()
|
||||
endif()
|
||||
list (APPEND FREECAD_QT_COMPONENTS OpenGL PrintSupport Svg UiTools Widgets LinguistTools)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5PrintSupport REQUIRED)
|
||||
find_package(Qt5OpenGL REQUIRED)
|
||||
find_package(Qt5Svg REQUIRED)
|
||||
find_package(Qt5UiTools REQUIRED)
|
||||
if (BUILD_WEB)
|
||||
list (APPEND FREECAD_QT_COMPONENTS WebEngineWidgets)
|
||||
if (${FREECAD_USE_QTWEBMODULE} MATCHES "Qt Webkit")
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
elseif(${FREECAD_USE_QTWEBMODULE} MATCHES "Qt WebEngine")
|
||||
find_package(Qt5WebEngineWidgets REQUIRED)
|
||||
else() # Automatic
|
||||
find_package(Qt5WebEngineWidgets QUIET)
|
||||
if(NOT Qt5WebEngineWidgets_FOUND)
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(BUILD_DESIGNER_PLUGIN)
|
||||
list (APPEND FREECAD_QT_COMPONENTS Designer)
|
||||
find_package(Qt5Designer REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
if (ENABLE_DEVELOPER_TESTS)
|
||||
list (APPEND FREECAD_QT_COMPONENTS Test)
|
||||
endif ()
|
||||
|
||||
foreach(COMPONENT IN LISTS FREECAD_QT_COMPONENTS)
|
||||
find_package(Qt${FREECAD_QT_MAJOR_VERSION} REQUIRED COMPONENTS ${COMPONENT})
|
||||
set(Qt${COMPONENT}_LIBRARIES ${Qt${FREECAD_QT_MAJOR_VERSION}${COMPONENT}_LIBRARIES})
|
||||
set(Qt${COMPONENT}_INCLUDE_DIRS ${Qt${FREECAD_QT_MAJOR_VERSION}${COMPONENT}_INCLUDE_DIRS})
|
||||
set(Qt${COMPONENT}_FOUND ${Qt${FREECAD_QT_MAJOR_VERSION}${COMPONENT}_FOUND})
|
||||
set(Qt${COMPONENT}_VERSION ${Qt${FREECAD_QT_MAJOR_VERSION}${COMPONENT}_VERSION})
|
||||
endforeach()
|
||||
set(CMAKE_AUTOMOC TRUE)
|
||||
set(CMAKE_AUTOUIC TRUE)
|
||||
set(QtCore_MOC_EXECUTABLE ${Qt${FREECAD_QT_MAJOR_VERSION}Core_MOC_EXECUTABLE})
|
||||
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
|
||||
message(STATUS "Set up to compile with Qt ${Qt${FREECAD_QT_MAJOR_VERSION}Core_VERSION}")
|
||||
|
||||
# In Qt 5.15 they added more generic names for these functions: "backport" those new names
|
||||
# so we can migrate to using the non-version-named functions in all instances.
|
||||
if (Qt${FREECAD_QT_MAJOR_VERSION}Core_VERSION VERSION_LESS 5.15.0)
|
||||
message(STATUS "Manually creating qt_wrap_cpp() and qt_add_resources() to support Qt ${Qt${FREECAD_QT_MAJOR_VERSION}Core_VERSION}")
|
||||
|
||||
# Wrapper code adapted from Qt 6's Qt6CoreMacros.cmake file:
|
||||
function(qt_add_resources outfiles)
|
||||
qt5_add_resources("${outfiles}" ${ARGN})
|
||||
if(TARGET ${outfiles})
|
||||
cmake_parse_arguments(PARSE_ARGV 1 arg "" "OUTPUT_TARGETS" "")
|
||||
if (arg_OUTPUT_TARGETS)
|
||||
set(${arg_OUTPUT_TARGETS} ${${arg_OUTPUT_TARGETS}} PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(qt_wrap_cpp outfiles)
|
||||
qt5_wrap_cpp("${outfiles}" ${ARGN})
|
||||
set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(qt_add_translation _qm_files)
|
||||
qt5_add_translation("${_qm_files}" ${ARGN})
|
||||
set("${_qm_files}" "${${_qm_files}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
endif()
|
||||
|
||||
function(qt_find_and_add_translation _qm_files _tr_dir _qm_dir)
|
||||
file(GLOB _ts_files ${_tr_dir})
|
||||
set_source_files_properties(${_ts_files} PROPERTIES OUTPUT_LOCATION ${_qm_dir})
|
||||
qt_add_translation("${_qm_files}" ${_ts_files})
|
||||
set("${_qm_files}" "${${_qm_files}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(qt_create_resource_file outfile)
|
||||
set(QRC "<RCC>\n <qresource>\n")
|
||||
foreach (it ${ARGN})
|
||||
get_filename_component(qmfile "${it}" NAME)
|
||||
string(APPEND QRC " <file>translations/${qmfile}</file>")
|
||||
endforeach()
|
||||
string(APPEND QRC " </qresource>\n</RCC>\n")
|
||||
file(WRITE ${outfile} ${QRC})
|
||||
endfunction()
|
||||
|
||||
function(qt_create_resource_file_prefix outfile)
|
||||
set(QRC "<RCC>\n <qresource prefix=\"/translations\">\n")
|
||||
foreach (it ${ARGN})
|
||||
get_filename_component(qmfile "${it}" NAME)
|
||||
string(APPEND QRC " <file>${qmfile}</file>")
|
||||
endforeach()
|
||||
string(APPEND QRC " </qresource>\n</RCC>\n")
|
||||
file(WRITE ${outfile} ${QRC})
|
||||
endfunction()
|
||||
if(MSVC)
|
||||
find_package(Qt5WinExtras QUIET)
|
||||
endif()
|
||||
endif(BUILD_GUI)
|
||||
|
||||
@@ -4,7 +4,7 @@ macro(SetupSalomeSMESH)
|
||||
# Salome SMESH sources are under src/3rdParty now
|
||||
if(BUILD_SMESH)
|
||||
# set the internal smesh version:
|
||||
# see src/3rdParty/salomonemesh/CMakeLists.txt and commit https://github.com/FreeCAD/FreeCAD/commit/666a3e5 and https://forum.freecad.org/viewtopic.php?f=10&t=30838
|
||||
# see src/3rdParty/salomonemesh/CMakeLists.txt and commit https://github.com/FreeCAD/FreeCAD/commit/666a3e5 and https://forum.freecadweb.org/viewtopic.php?f=10&t=30838
|
||||
set(SMESH_VERSION_MAJOR 7)
|
||||
set(SMESH_VERSION_MINOR 7)
|
||||
set(SMESH_VERSION_PATCH 1)
|
||||
@@ -138,7 +138,7 @@ macro(SetupSalomeSMESH)
|
||||
endif()
|
||||
|
||||
set(SMESH_FOUND TRUE)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/SMESH_Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SMESH_Version.h)
|
||||
configure_file(SMESH_Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SMESH_Version.h)
|
||||
endif(BUILD_SMESH)
|
||||
|
||||
endmacro(SetupSalomeSMESH)
|
||||
|
||||
@@ -6,95 +6,70 @@ macro(SetupShibokenAndPyside)
|
||||
find_package(PySide REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
|
||||
endif(DEFINED MACPORTS_PREFIX)
|
||||
|
||||
if(FREECAD_QT_MAJOR_VERSION EQUAL 5)
|
||||
set(SHIBOKEN_MAJOR_VERSION 2)
|
||||
set(PYSIDE_MAJOR_VERSION 2)
|
||||
else()
|
||||
set(SHIBOKEN_MAJOR_VERSION ${FREECAD_QT_MAJOR_VERSION})
|
||||
set(PYSIDE_MAJOR_VERSION ${FREECAD_QT_MAJOR_VERSION})
|
||||
endif()
|
||||
|
||||
|
||||
# Shiboken2Config.cmake may explicitly set CMAKE_BUILD_TYPE to Release which causes
|
||||
# CMake to fail to create Makefiles for a debug build.
|
||||
# So as a workaround we save and restore the value after checking for Shiboken2.
|
||||
set (SAVE_BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
||||
find_package(Shiboken${SHIBOKEN_MAJOR_VERSION} QUIET)
|
||||
find_package(Shiboken2 QUIET)# REQUIRED
|
||||
set (CMAKE_BUILD_TYPE ${SAVE_BUILD_TYPE})
|
||||
if (Shiboken${SHIBOKEN_MAJOR_VERSION}_FOUND)
|
||||
# Shiboken config file was found but it may use the wrong Python version
|
||||
if (Shiboken2_FOUND)
|
||||
# Shiboken2 config file was found but it may use the wrong Python version
|
||||
# Try to get the matching config suffix and repeat finding the package
|
||||
set(SHIBOKEN_PATTERN .cpython-${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR})
|
||||
|
||||
file(GLOB SHIBOKEN_CONFIG "${Shiboken${SHIBOKEN_MAJOR_VERSION}_DIR}/Shiboken${SHIBOKEN_MAJOR_VERSION}Config${SHIBOKEN_PATTERN}*.cmake")
|
||||
file(GLOB SHIBOKEN_CONFIG "${Shiboken2_DIR}/Shiboken2Config${SHIBOKEN_PATTERN}*.cmake")
|
||||
if (SHIBOKEN_CONFIG)
|
||||
get_filename_component(SHIBOKEN_CONFIG_SUFFIX ${SHIBOKEN_CONFIG} NAME)
|
||||
string(SUBSTRING ${SHIBOKEN_CONFIG_SUFFIX} 15 -1 SHIBOKEN_CONFIG_SUFFIX)
|
||||
string(REPLACE ".cmake" "" PYTHON_CONFIG_SUFFIX ${SHIBOKEN_CONFIG_SUFFIX})
|
||||
message(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}")
|
||||
find_package(Shiboken${SHIBOKEN_MAJOR_VERSION} QUIET)
|
||||
get_filename_component(SHIBOKEN_CONFIG_SUFFIX ${SHIBOKEN_CONFIG} NAME)
|
||||
string(SUBSTRING ${SHIBOKEN_CONFIG_SUFFIX} 15 -1 SHIBOKEN_CONFIG_SUFFIX)
|
||||
string(REPLACE ".cmake" "" PYTHON_CONFIG_SUFFIX ${SHIBOKEN_CONFIG_SUFFIX})
|
||||
message(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}")
|
||||
find_package(Shiboken2 QUIET)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# pyside2 changed its cmake files, this is the dance we have
|
||||
# to dance to be compatible with the old (<5.12) and the new versions (>=5.12)
|
||||
if(NOT SHIBOKEN_INCLUDE_DIR AND TARGET Shiboken${SHIBOKEN_MAJOR_VERSION}::libshiboken)
|
||||
get_property(SHIBOKEN_INCLUDE_DIR TARGET Shiboken${SHIBOKEN_MAJOR_VERSION}::libshiboken PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif(NOT SHIBOKEN_INCLUDE_DIR AND TARGET Shiboken${SHIBOKEN_MAJOR_VERSION}::libshiboken)
|
||||
if(NOT SHIBOKEN_INCLUDE_DIR AND TARGET Shiboken2::libshiboken)
|
||||
get_property(SHIBOKEN_INCLUDE_DIR TARGET Shiboken2::libshiboken PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif(NOT SHIBOKEN_INCLUDE_DIR AND TARGET Shiboken2::libshiboken)
|
||||
|
||||
if(NOT SHIBOKEN_INCLUDE_DIR)
|
||||
find_pip_package(Shiboken${SHIBOKEN_MAJOR_VERSION})
|
||||
if (Shiboken${SHIBOKEN_MAJOR_VERSION}_FOUND)
|
||||
set(Shiboken_INCLUDE_DIR ${Shiboken${SHIBOKEN_MAJOR_VERSION}_INCLUDE_DIRS})
|
||||
set(Shiboken_LIBRARY ${Shiboken${SHIBOKEN_MAJOR_VERSION}_LIBRARIES})
|
||||
set(Shiboken_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
message("====================\n"
|
||||
"shiboken2 not found.\n"
|
||||
"====================\n")
|
||||
endif(NOT SHIBOKEN_INCLUDE_DIR)
|
||||
|
||||
find_package(PySide${PYSIDE_MAJOR_VERSION} QUIET)
|
||||
find_package(PySide2 QUIET)# REQUIRED
|
||||
|
||||
if(NOT PYSIDE_INCLUDE_DIR AND TARGET PySide${PYSIDE_MAJOR_VERSION}::pyside${PYSIDE_MAJOR_VERSION})
|
||||
get_property(PYSIDE_INCLUDE_DIR TARGET PySide${PYSIDE_MAJOR_VERSION}::pyside${PYSIDE_MAJOR_VERSION} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif(NOT PYSIDE_INCLUDE_DIR AND TARGET PySide${PYSIDE_MAJOR_VERSION}::pyside${PYSIDE_MAJOR_VERSION})
|
||||
if(NOT PYSIDE_INCLUDE_DIR AND TARGET PySide2::pyside2)
|
||||
get_property(PYSIDE_INCLUDE_DIR TARGET PySide2::pyside2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
endif(NOT PYSIDE_INCLUDE_DIR AND TARGET PySide2::pyside2)
|
||||
|
||||
if(NOT PYSIDE_INCLUDE_DIR)
|
||||
find_pip_package(PySide${PYSIDE_MAJOR_VERSION})
|
||||
if (PySide${PYSIDE_MAJOR_VERSION}_FOUND)
|
||||
set(PySide_INCLUDE_DIR ${PySide${PYSIDE_MAJOR_VERSION}_INCLUDE_DIRS})
|
||||
set(PySide_LIBRARY ${PySide${PYSIDE_MAJOR_VERSION}_LIBRARIES})
|
||||
set(PySide_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
message("==================\n"
|
||||
"PySide2 not found.\n"
|
||||
"==================\n")
|
||||
endif(NOT PYSIDE_INCLUDE_DIR)
|
||||
|
||||
find_package(PySide${PYSIDE_MAJOR_VERSION}Tools QUIET) # PySide utilities (uic & rcc executables)
|
||||
if(NOT PYSIDE_TOOLS_FOUND)
|
||||
find_package(PySide2Tools QUIET) #REQUIRED # PySide2 utilities (pyside2-uic & pyside2-rcc)
|
||||
if(NOT PYSIDE2_TOOLS_FOUND)
|
||||
message("=======================\n"
|
||||
"PySide${PYSIDE_MAJOR_VERSION}Tools not found.\n"
|
||||
"PySide2Tools not found.\n"
|
||||
"=======================\n")
|
||||
endif()
|
||||
endif(NOT PYSIDE2_TOOLS_FOUND)
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Ext/PySide)
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/__init__.py "# PySide wrapper\n"
|
||||
"from PySide${PYSIDE_MAJOR_VERSION} import __version__\n"
|
||||
"from PySide${PYSIDE_MAJOR_VERSION} import __version_info__\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtCore.py "from PySide${PYSIDE_MAJOR_VERSION}.QtCore import *\n\n"
|
||||
"from PySide2 import __version__\n"
|
||||
"from PySide2 import __version_info__\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtCore.py "from PySide2.QtCore import *\n\n"
|
||||
"#QCoreApplication.CodecForTr=0\n"
|
||||
"#QCoreApplication.UnicodeUTF8=1\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtNetwork.py "from PySide${PYSIDE_MAJOR_VERSION}.QtNetwork import *\n")
|
||||
if(BUILD_GUI)
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtGui.py "from PySide${PYSIDE_MAJOR_VERSION}.QtGui import *\n"
|
||||
"from PySide${PYSIDE_MAJOR_VERSION}.QtWidgets import *\n"
|
||||
"QHeaderView.setResizeMode = QHeaderView.setSectionResizeMode\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvg.py "from PySide${PYSIDE_MAJOR_VERSION}.QtSvg import *\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtUiTools.py "from PySide${PYSIDE_MAJOR_VERSION}.QtUiTools import *\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWidgets import *\n")
|
||||
if(PYSIDE_MAJOR_VERSION LESS 6)
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n")
|
||||
else()
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n"
|
||||
"from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineCore import QWebEnginePage\n")
|
||||
endif()
|
||||
endif()
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtGui.py "from PySide2.QtGui import *\n"
|
||||
"from PySide2.QtWidgets import *\n"
|
||||
"QHeaderView.setResizeMode = QHeaderView.setSectionResizeMode\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvg.py "from PySide2.QtSvg import *\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtUiTools.py "from PySide2.QtUiTools import *\n")
|
||||
|
||||
if(APPLE AND NOT BUILD_WITH_CONDA)
|
||||
install(
|
||||
@@ -116,148 +91,43 @@ macro(SetupShibokenAndPyside)
|
||||
if(SHIBOKEN_INCLUDE_DIR)
|
||||
option(FREECAD_USE_SHIBOKEN "Links to the shiboken library at build time. If OFF its Python module is imported at runtime" ON)
|
||||
else()
|
||||
message(WARNING "Shiboken${PYSIDE_MAJOR_VERSION} include files not found, FREECAD_USE_SHIBOKEN automatically set to OFF")
|
||||
option(FREECAD_USE_SHIBOKEN "Links to the shiboken library at build time. If OFF its Python module is imported at runtime" OFF)
|
||||
endif()
|
||||
|
||||
# Now try to import the shiboken Python module and print a warning if it can't be loaded
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -c "import shiboken${SHIBOKEN_MAJOR_VERSION}"
|
||||
# Now try to import the shiboken Python module and print a warning if it can't be loaded
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -c "import shiboken2"
|
||||
RESULT_VARIABLE FAILURE
|
||||
OUTPUT_VARIABLE PRINT_OUTPUT
|
||||
)
|
||||
|
||||
if(FAILURE)
|
||||
message(WARNING
|
||||
"==================================\n"
|
||||
"Shiboken${SHIBOKEN_MAJOR_VERSION} Python module not found.\n"
|
||||
"==================================\n")
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -c "import shiboken${SHIBOKEN_MAJOR_VERSION};print(shiboken${SHIBOKEN_MAJOR_VERSION}.__version__, end='')"
|
||||
RESULT_VARIABLE FAILURE
|
||||
OUTPUT_VARIABLE Shiboken_VERSION
|
||||
)
|
||||
|
||||
if(FAILURE)
|
||||
message("=================================\n"
|
||||
"shiboken Python module not found.\n"
|
||||
"=================================\n")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If PySide cannot be found the build option will be set to OFF
|
||||
if(PYSIDE_INCLUDE_DIR)
|
||||
option(FREECAD_USE_PYSIDE "Links to the PySide libraries at build time." ON)
|
||||
else()
|
||||
message(WARNING "PySide${PYSIDE_MAJOR_VERSION} include files not found, FREECAD_USE_PYSIDE automatically set to OFF")
|
||||
option(FREECAD_USE_PYSIDE "Links to the PySide libraries at build time." OFF)
|
||||
endif()
|
||||
|
||||
# Independent of the build option PySide modules must be loaded at runtime. Print a warning if it fails.
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -c "import PySide${PYSIDE_MAJOR_VERSION};import os;print(os.path.dirname(PySide${PYSIDE_MAJOR_VERSION}.__file__), end='')"
|
||||
COMMAND ${PYTHON_EXECUTABLE} -c "import PySide2;import os;print(os.path.dirname(PySide2.__file__), end='')"
|
||||
RESULT_VARIABLE FAILURE
|
||||
OUTPUT_VARIABLE PRINT_OUTPUT
|
||||
)
|
||||
if(FAILURE)
|
||||
message(WARNING
|
||||
"================================\n"
|
||||
"PySide${PYSIDE_MAJOR_VERSION} Python module not found.\n"
|
||||
message("================================\n"
|
||||
"PySide2 Python module not found.\n"
|
||||
"================================\n")
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -c "import PySide${PYSIDE_MAJOR_VERSION};print(PySide${PYSIDE_MAJOR_VERSION}.__version__, end='')"
|
||||
RESULT_VARIABLE FAILURE
|
||||
OUTPUT_VARIABLE PySide_VERSION
|
||||
)
|
||||
message(STATUS "PySide ${PySide_VERSION} Python module found at ${PRINT_OUTPUT}.\n")
|
||||
message(STATUS "===============================================\n"
|
||||
"PySide2 Python module found at ${PRINT_OUTPUT}.\n"
|
||||
"===============================================\n")
|
||||
endif()
|
||||
|
||||
endmacro(SetupShibokenAndPyside)
|
||||
|
||||
# Locate the include directory for a pip-installed package -- uses pip show to find the base pip
|
||||
# install directory, and then appends the package name and "/include" to the end
|
||||
macro(find_pip_package PACKAGE)
|
||||
execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} -m pip show ${PACKAGE}
|
||||
RESULT_VARIABLE FAILURE
|
||||
OUTPUT_VARIABLE PRINT_OUTPUT
|
||||
)
|
||||
if(NOT FAILURE)
|
||||
# Extract Name: and Location: lines and use them to construct the include directory
|
||||
string(REPLACE "\n" ";" PIP_OUTPUT_LINES ${PRINT_OUTPUT})
|
||||
foreach(LINE IN LISTS PIP_OUTPUT_LINES)
|
||||
STRING(FIND "${LINE}" "Name: " NAME_STRING_LOCATION)
|
||||
STRING(FIND "${LINE}" "Location: " LOCATION_STRING_LOCATION)
|
||||
if(${NAME_STRING_LOCATION} EQUAL 0)
|
||||
STRING(SUBSTRING "${LINE}" 6 -1 PIP_PACKAGE_NAME)
|
||||
elseif(${LOCATION_STRING_LOCATION} EQUAL 0)
|
||||
STRING(SUBSTRING "${LINE}" 9 -1 PIP_PACKAGE_LOCATION)
|
||||
endif()
|
||||
endforeach()
|
||||
file(TO_NATIVE_PATH "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/include" INCLUDE_DIR)
|
||||
file(TO_NATIVE_PATH "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/lib" LIBRARY)
|
||||
set(${PACKAGE}_INCLUDE_DIRS ${INCLUDE_DIR} PARENT_SCOPE)
|
||||
set(${PACKAGE}_LIBRARIES ${LIBRARY} PARENT_SCOPE)
|
||||
set(${PACKAGE}_FOUND ${LIBRARY} TRUE)
|
||||
message(STATUS "Found pip-installed ${PACKAGE} in ${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
# Macros similar to FindQt4.cmake's WRAP_UI and WRAP_RC, for the automatic generation of Python
|
||||
# code from Qt4's user interface ('.ui') and resource ('.qrc') files. These macros are called:
|
||||
# - PYSIDE_WRAP_UI
|
||||
# - PYSIDE_WRAP_RC
|
||||
|
||||
MACRO(PYSIDE_WRAP_UI outfiles)
|
||||
if (NOT PYSIDE_UIC_EXECUTABLE)
|
||||
message(FATAL_ERROR "Qt uic is required for generating ${ARGN}")
|
||||
endif()
|
||||
FOREACH(it ${ARGN})
|
||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py)
|
||||
if(WIN32 OR APPLE)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDE_UIC_EXECUTABLE} ${UICOPTIONS} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
else()
|
||||
# Especially on Open Build Service we don't want changing date like
|
||||
# pyside2-uic generates in comments at beginning., which is why
|
||||
# we follow the tool command with a POSIX-friendly sed.
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND "${PYSIDE_UIC_EXECUTABLE}" ${UICOPTIONS} "${infile}" -o "${outfile}"
|
||||
COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
|
||||
MAIN_DEPENDENCY "${infile}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${outfiles} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_UI)
|
||||
|
||||
MACRO(PYSIDE_WRAP_RC outfiles)
|
||||
if (NOT PYSIDE_RCC_EXECUTABLE)
|
||||
message(FATAL_ERROR "Qt rcc is required for generating ${ARGN}")
|
||||
endif()
|
||||
FOREACH(it ${ARGN})
|
||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py")
|
||||
#ADD_CUSTOM_TARGET(${it} ALL
|
||||
# DEPENDS ${outfile}
|
||||
#)
|
||||
if(WIN32 OR APPLE)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDE_RCC_EXECUTABLE} ${RCCOPTIONS} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
else()
|
||||
# Especially on Open Build Service we don't want changing date like
|
||||
# pyside-rcc generates in comments at beginning, which is why
|
||||
# we follow the tool command with in-place sed.
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
|
||||
COMMAND "${PYSIDE_RCC_EXECUTABLE}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
|
||||
COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
|
||||
MAIN_DEPENDENCY "${infile}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${outfiles} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_RC)
|
||||
|
||||
@@ -242,8 +242,8 @@ MACRO(SET_BIN_DIR ProjectName OutputName)
|
||||
if(WIN32)
|
||||
set_target_properties(${ProjectName} PROPERTIES DEBUG_OUTPUT_NAME ${OutputName}_d)
|
||||
else(WIN32)
|
||||
# FreeCADBase, SMDS, Driver and MEFISTO2 libs don't depend on parts from CMAKE_INSTALL_LIBDIR
|
||||
if(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2)$")
|
||||
# FreeCADBase, SMDS, Driver, MEFISTO2 and area-native libs don't depend on parts from CMAKE_INSTALL_LIBDIR
|
||||
if(NOT ${ProjectName} MATCHES "^(FreeCADBase|SMDS|Driver|MEFISTO2|area-native)$")
|
||||
if(${ARGC} STREQUAL 4)
|
||||
set_property(TARGET ${ProjectName} APPEND PROPERTY INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${ARGV3})
|
||||
elseif(NOT IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
@@ -44,7 +44,7 @@ set (Qt5XmlPatterns_DIR ${Qt5_ROOT_DIR}/lib/cmake/Qt5XmlPatterns CACHE PATH "")
|
||||
find_library(XercesC_LIBRARY_RELEASE xerces-c_3 "${FREECAD_LIBPACK_DIR}/lib")
|
||||
find_library(XercesC_LIBRARY_DEBUG xerces-c_3D "${FREECAD_LIBPACK_DIR}/lib")
|
||||
set (XercesC_LIBRARIES debug ${XercesC_LIBRARY_DEBUG} optimized ${XercesC_LIBRARY_RELEASE})
|
||||
set(XercesC_FOUND TRUE)
|
||||
set(XercesC_FOUND TRUE)
|
||||
|
||||
find_library(COIN3D_LIBRARY_RELEASE coin4 "${FREECAD_LIBPACK_DIR}/lib")
|
||||
find_library(COIN3D_LIBRARY_DEBUG coin4d "${FREECAD_LIBPACK_DIR}/lib")
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# gitlab CI config file
|
||||
|
||||
# this image is on dockerhub. Dockerfile is here: https://gitlab.com/PrzemoF/FreeCAD/-/blob/gitlab-v1/ci/Dockerfile
|
||||
image: freecadci/runner
|
||||
|
||||
stages: # List of stages for jobs, and their order of execution
|
||||
- build
|
||||
- test
|
||||
|
||||
before_script:
|
||||
- apt-get update -yqq
|
||||
# CCache Config
|
||||
- mkdir -p ccache
|
||||
- export CCACHE_BASEDIR=${PWD}
|
||||
- export CCACHE_DIR=${PWD}/ccache
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- ccache/
|
||||
|
||||
build-job: # This job runs in the build stage, which runs first.
|
||||
stage: build
|
||||
|
||||
script:
|
||||
- echo "Compiling the code..."
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ccache cmake ../
|
||||
- ccache cmake --build ./ -j$(nproc)
|
||||
- echo "Compile complete."
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- build/
|
||||
|
||||
test-job: # This job runs in the test stage.
|
||||
stage: test # It only starts when the job in the build stage completes successfully.
|
||||
script:
|
||||
- echo "Running unit tests... "
|
||||
- cd build/bin/
|
||||
# Testing currently doesn't work due to problems with libraries ot being visible by the binary.
|
||||
- ./FreeCADCmd -t 0
|
||||
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
FROM ubuntu:20.04
|
||||
MAINTAINER Przemo Firszt
|
||||
# This is the docker image definition used to build FreeCAD. It's currently accessible on:
|
||||
# https://hub.docker.com/repository/docker/freecadci/runner
|
||||
# on under name freecadci/runner when using docker
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update -y
|
||||
RUN apt-get update -y && apt-get install -y gnupg2
|
||||
RUN echo "deb http://ppa.launchpad.net/freecad-maintainers/freecad-daily/ubuntu focal main" >> /etc/apt/sources.list.d/freecad-daily.list
|
||||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 83193AA3B52FF6FCF10A1BBF005EAE8119BB5BCA
|
||||
RUN apt-get update -y
|
||||
|
||||
# those 3 are for debugging purposes only. Not required to build FreeCAD
|
||||
RUN apt-get install -y \
|
||||
vim \
|
||||
nano \
|
||||
bash
|
||||
|
||||
# Main set of FreeCAD dependencies. To be verified.
|
||||
RUN apt-get install -y \
|
||||
ccache \
|
||||
cmake \
|
||||
debhelper \
|
||||
dh-exec \
|
||||
dh-python \
|
||||
doxygen \
|
||||
git \
|
||||
graphviz \
|
||||
libboost-date-time-dev \
|
||||
libboost-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-filesystem1.71-dev \
|
||||
libboost-graph-dev \
|
||||
libboost-iostreams-dev \
|
||||
libboost-program-options-dev \
|
||||
libboost-program-options1.71-dev \
|
||||
libboost-python1.71-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-regex1.71-dev \
|
||||
libboost-serialization-dev \
|
||||
libboost-system1.71-dev \
|
||||
libboost-thread-dev \
|
||||
libboost-thread1.71-dev \
|
||||
libboost1.71-dev \
|
||||
libcoin-dev \
|
||||
libdouble-conversion-dev \
|
||||
libeigen3-dev \
|
||||
libglew-dev \
|
||||
libgts-bin \
|
||||
libgts-dev \
|
||||
libkdtree++-dev \
|
||||
liblz4-dev \
|
||||
libmedc-dev \
|
||||
libmetis-dev \
|
||||
libnglib-dev \
|
||||
libocct-data-exchange-dev \
|
||||
libocct-ocaf-dev \
|
||||
libocct-visualization-dev \
|
||||
libopencv-dev \
|
||||
libproj-dev \
|
||||
libpyside2-dev \
|
||||
libqt5opengl5 \
|
||||
libqt5opengl5-dev \
|
||||
libqt5svg5-dev \
|
||||
libqt5webkit5 \
|
||||
libqt5webkit5-dev \
|
||||
libqt5x11extras5-dev \
|
||||
libqt5xmlpatterns5-dev \
|
||||
libshiboken2-dev \
|
||||
libspnav-dev \
|
||||
libvtk7-dev \
|
||||
libvtk7.1p \
|
||||
libvtk7.1p-qt \
|
||||
libx11-dev \
|
||||
libxerces-c-dev \
|
||||
libzipios++-dev \
|
||||
lsb-release \
|
||||
nastran \
|
||||
netgen \
|
||||
netgen-headers \
|
||||
occt-draw \
|
||||
pybind11-dev \
|
||||
pyqt5-dev-tools \
|
||||
pyside2-tools \
|
||||
python3-dev \
|
||||
python3-matplotlib \
|
||||
python3-pivy \
|
||||
python3-ply \
|
||||
python3-pyqt5 \
|
||||
python3-pyside2.* \
|
||||
python3-pyside2.qtcore \
|
||||
python3-pyside2.qtgui \
|
||||
python3-pyside2.qtsvg \
|
||||
python3-pyside2.qtuitools \
|
||||
python3-pyside2.qtwidgets \
|
||||
python3-pyside2.qtxml \
|
||||
python3-requests \
|
||||
python3-yaml \
|
||||
qt5-default \
|
||||
qt5-qmake \
|
||||
qtbase5-dev \
|
||||
qttools5-dev \
|
||||
qtwebengine5-dev \
|
||||
swig
|
||||
|
||||
RUN apt-get update -y --fix-missing
|
||||
|
||||
# Clean
|
||||
RUN apt-get clean \
|
||||
&& rm /var/lib/apt/lists/* \
|
||||
/usr/share/doc/* \
|
||||
/usr/share/locale/* \
|
||||
/usr/share/man/* \
|
||||
/usr/share/info/* -fR
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
if "%FEATURE_DEBUG%"=="1" (
|
||||
set BUILD_TYPE="Debug"
|
||||
echo "#! building debug package !#") else (
|
||||
set BUILD_TYPE="Release")
|
||||
|
||||
|
||||
set "CFLAGS= "
|
||||
set "CXXFLAGS= "
|
||||
set "LDFLAGS_SHARED= ucrt.lib"
|
||||
|
||||
cmake -G "Ninja" ^
|
||||
-D BUID_WITH_CONDA:BOOL=ON ^
|
||||
-D CMAKE_BUILD_TYPE=%BUILD_TYPE% ^
|
||||
-D FREECAD_LIBPACK_USE:BOOL=OFF ^
|
||||
-D CMAKE_INSTALL_PREFIX:FILEPATH=%LIBRARY_PREFIX% ^
|
||||
-D CMAKE_PREFIX_PATH:FILEPATH=%LIBRARY_PREFIX% ^
|
||||
-D CMAKE_INCLUDE_PATH:FILEPATH=%LIBRARY_PREFIX%/include ^
|
||||
-D CMAKE_LIBRARY_PATH:FILEPATH=%LIBRARY_PREFIX%/lib ^
|
||||
-D CMAKE_INSTALL_LIBDIR:FILEPATH=%LIBRARY_PREFIX%/lib ^
|
||||
-D BUILD_QT5:BOOL=ON ^
|
||||
-D NETGENDATA:FILEPATH=%LIBRARY_PREFIX%/include/netgen ^
|
||||
-D NGLIB_INCLUDE_DIR:FILEPATH=%LIBRARY_PREFIX%/include/netgen ^
|
||||
-D BUILD_FEM_NETGEN:BOOL=ON ^
|
||||
-D OCC_INCLUDE_DIR:FILEPATH=%LIBRARY_PREFIX%/include/opencascade ^
|
||||
-D OCC_LIBRARY_DIR:FILEPATH=%LIBRARY_PREFIX%/lib ^
|
||||
-D OCC_LIBRARIES:FILEPATH=%LIBRARY_PREFIX%/lib ^
|
||||
-D FREECAD_USE_OCC_VARIANT="Official Version" ^
|
||||
-D OCC_OCAF_LIBRARIES:FILEPATH=%LIBRARY_PREFIX%/lib ^
|
||||
-D BUILD_REVERSEENGINEERING:BOOL=ON ^
|
||||
-D USE_BOOST_PYTHON:BOOL=OFF ^
|
||||
-D FREECAD_USE_PYBIND11:BOOL=ON ^
|
||||
-D SMESH_INCLUDE_DIR:FILEPATH=%LIBRARY_PREFIX%/include/smesh ^
|
||||
-D FREECAD_USE_EXTERNAL_SMESH:BOOL=ON ^
|
||||
-D BUILD_FLAT_MESH:BOOL=ON ^
|
||||
-D OCCT_CMAKE_FALLBACK:BOOL=ON ^
|
||||
-D PYTHON_EXECUTABLE:FILEPATH=%PREFIX%/python ^
|
||||
-D BUILD_DYNAMIC_LINK_PYTHON:BOOL=ON ^
|
||||
-D Boost_NO_BOOST_CMAKE:BOOL=ON ^
|
||||
-D FREECAD_USE_PCH:BOOL=OFF ^
|
||||
-D FREECAD_USE_PCL:BOOL=ON ^
|
||||
-D INSTALL_TO_SITEPACKAGES:BOOL=ON ^
|
||||
..
|
||||
|
||||
if errorlevel 1 exit 1
|
||||
ninja install
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
rmdir /s /q "%LIBRARY_PREFIX%\doc"
|
||||
ren %LIBRARY_PREFIX%\bin\FreeCAD.exe freecad.exe
|
||||
ren %LIBRARY_PREFIX%\bin\FreeCADCmd.exe freecadcmd.exe
|
||||
Executable
+84
@@ -0,0 +1,84 @@
|
||||
|
||||
HOST=$(uname)
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
if [[ ${FEATURE_DEBUG} = 1 ]]; then
|
||||
BUILD_TYPE="Debug"
|
||||
else
|
||||
BUILD_TYPE="Release"
|
||||
fi
|
||||
|
||||
declare -a CMAKE_PLATFORM_FLAGS
|
||||
|
||||
if [[ ${HOST} =~ "Linux" ]]; then
|
||||
echo "adding hacks for linux"
|
||||
# temporary workaround for vtk-cmake setup
|
||||
# should be applied @vtk-feedstock
|
||||
sed -i 's#/home/conda/feedstock_root/build_artifacts/vtk_.*_build_env/x86_64-conda_cos6-linux-gnu/sysroot/usr/lib.*;##g' ${PREFIX}/lib/cmake/vtk-8.2/Modules/vtkhdf5.cmake
|
||||
# temporary workaround for qt-cmake:
|
||||
sed -i 's|_qt5gui_find_extra_libs(EGL.*)|_qt5gui_find_extra_libs(EGL "EGL" "" "")|g' $PREFIX/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
|
||||
sed -i 's|_qt5gui_find_extra_libs(OPENGL.*)|_qt5gui_find_extra_libs(OPENGL "GL" "" "")|g' $PREFIX/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
|
||||
CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake")
|
||||
fi
|
||||
|
||||
|
||||
if [[ ${HOST} =~ "Darwin" ]]; then
|
||||
# add hacks for osx here!
|
||||
echo "adding hacks for osx"
|
||||
#ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
|
||||
|
||||
# install space-mouse
|
||||
if [ ! -d "/Library/Frameworks/3DconnexionClient.framework" ]; then
|
||||
echo "Installing 3D connexion spacemouse drivers."
|
||||
curl -o /tmp/3dFW.dmg -L 'https://download.3dconnexion.com/drivers/mac/10-6-6_360DF97D-ED08-4ccf-A55E-0BF905E58476/3DxWareMac_v10-6-6_r3234.dmg'
|
||||
hdiutil attach -readonly /tmp/3dFW.dmg
|
||||
sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
|
||||
diskutil eject /Volumes/3Dconnexion\ Software
|
||||
fi
|
||||
CMAKE_PLATFORM_FLAGS+=(-DFREECAD_USE_3DCONNEXION:BOOL=ON)
|
||||
CMAKE_PLATFORM_FLAGS+=(-D3DCONNEXIONCLIENT_FRAMEWORK:FILEPATH="/Library/Frameworks/3DconnexionClient.framework")
|
||||
fi
|
||||
|
||||
cmake \
|
||||
-G "Ninja" \
|
||||
-D BUID_WITH_CONDA:BOOL=ON \
|
||||
-D CMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||
-D CMAKE_INSTALL_PREFIX:FILEPATH=$PREFIX \
|
||||
-D CMAKE_PREFIX_PATH:FILEPATH=$PREFIX \
|
||||
-D CMAKE_LIBRARY_PATH:FILEPATH=$PREFIX/lib \
|
||||
-D CMAKE_INSTALL_LIBDIR:FILEPATH=$PREFIX/lib \
|
||||
-D CMAKE_INCLUDE_PATH:FILEPATH=$PREFIX/include \
|
||||
-D BUILD_QT5:BOOL=ON \
|
||||
-D FREECAD_USE_OCC_VARIANT="Official Version" \
|
||||
-D OCC_INCLUDE_DIR:FILEPATH=$PREFIX/include \
|
||||
-D USE_BOOST_PYTHON:BOOL=OFF \
|
||||
-D FREECAD_USE_PYBIND11:BOOL=ON \
|
||||
-D BUILD_ENABLE_CXX11:BOOL=ON \
|
||||
-D SMESH_INCLUDE_DIR:FILEPATH=$PREFIX/include/smesh \
|
||||
-D FREECAD_USE_EXTERNAL_SMESH=ON \
|
||||
-D BUILD_FLAT_MESH:BOOL=ON \
|
||||
-D BUILD_WITH_CONDA:BOOL=ON \
|
||||
-D PYTHON_EXECUTABLE:FILEPATH=$PREFIX/bin/python \
|
||||
-D BUILD_FEM_NETGEN:BOOL=ON \
|
||||
-D OCCT_CMAKE_FALLBACK:BOOL=OFF \
|
||||
-D FREECAD_USE_QT_DIALOG:BOOL=ON \
|
||||
-D BUILD_DYNAMIC_LINK_PYTHON:BOOL=OFF \
|
||||
-D Boost_NO_BOOST_CMAKE:BOOL=ON \
|
||||
-D FREECAD_USE_PCL:BOOL=ON \
|
||||
-D INSTALL_TO_SITEPACKAGES:BOOL=ON \
|
||||
${CMAKE_PLATFORM_FLAGS[@]} \
|
||||
..
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
echo "CMake failed to configure."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "FREECAD_USE_3DCONNEXION=${FREECAD_USE_3DCONNEXION}"
|
||||
|
||||
ninja install
|
||||
rm -r ${PREFIX}/share/doc/FreeCAD # smaller size of package!
|
||||
mv ${PREFIX}/bin/FreeCAD ${PREFIX}/bin/freecad
|
||||
mv ${PREFIX}/bin/FreeCADCmd ${PREFIX}/bin/freecadcmd
|
||||
@@ -1,5 +0,0 @@
|
||||
name: freecad
|
||||
channels:
|
||||
- conda-forge
|
||||
dependencies:
|
||||
- conda-devenv
|
||||
@@ -0,0 +1,6 @@
|
||||
channel_sources:
|
||||
- conda-forge,defaults
|
||||
channel_targets:
|
||||
- freecad dev
|
||||
MACOSX_DEPLOYMENT_TARGET: # [osx]
|
||||
- '10.12' # [osx]
|
||||
@@ -0,0 +1,16 @@
|
||||
# this one is important
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_PLATFORM Linux)
|
||||
|
||||
# specify the cross compiler
|
||||
set(CMAKE_C_COMPILER $ENV{CC})
|
||||
set(CMAKE_CXX_COMPILER $ENV{CXX})
|
||||
|
||||
# where is the target environment
|
||||
set(CMAKE_FIND_ROOT_PATH $ENV{PREFIX} $ENV{BUILD_PREFIX}/$ENV{HOST}/sysroot)
|
||||
|
||||
# search for programs in the build host directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
# for libraries and headers in the target directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
@@ -1,98 +0,0 @@
|
||||
name: freecad
|
||||
channels:
|
||||
- conda-forge
|
||||
dependencies:
|
||||
- kernel-headers_linux-64 # [linux and x86_64]
|
||||
- libdrm-cos6-x86_64 # [linux and x86_64]
|
||||
- libselinux-cos6-x86_64 # [linux and x86_64]
|
||||
- libsepol-cos6-x86_64 # [linux and x86_64]
|
||||
- libx11-common-cos6-x86_64 # [linux and x86_64]
|
||||
- libx11-cos6-x86_64 # [linux and x86_64]
|
||||
- libxau-cos6-x86_64 # [linux and x86_64]
|
||||
- libxcb-cos6-x86_64 # [linux and x86_64]
|
||||
- libxdamage-cos6-x86_64 # [linux and x86_64]
|
||||
- libxext-cos6-x86_64 # [linux and x86_64]
|
||||
- libxfixes-cos6-x86_64 # [linux and x86_64]
|
||||
- libxi-cos6-x86_64 # [linux and x86_64]
|
||||
- libxi-devel-cos6-x86_64 # [linux and x86_64]
|
||||
- libxxf86vm-cos6-x86_64 # [linux and x86_64]
|
||||
- mesa-dri-drivers-cos6-x86_64 # [linux and x86_64]
|
||||
- mesa-dri1-drivers-cos6-x86_64 # [linux and x86_64]
|
||||
- mesa-libegl-cos6-x86_64 # [linux and x86_64]
|
||||
- mesa-libegl-devel-cos6-x86_64 # [linux and x86_64]
|
||||
- mesa-libgl-cos6-x86_64 # [linux and x86_64]
|
||||
- mesa-libgl-devel-cos6-x86_64 # [linux and x86_64]
|
||||
- pixman-cos6-x86_64 # [linux and x86_64]
|
||||
- sysroot_linux-64 # [linux and x86_64]
|
||||
- xorg-x11-server-common-cos6-x86_64 # [linux and x86_64]
|
||||
- xorg-x11-server-xvfb-cos6-x86_64 # [linux and x86_64]
|
||||
- kernel-headers_linux-aarch64 # [linux and aarch64]
|
||||
- libdrm-cos7-aarch64 # [linux and aarch64]
|
||||
- libglvnd-cos7-aarch64 # [linux and aarch64]
|
||||
- libglvnd-glx-cos7-aarch64 # [linux and aarch64]
|
||||
- libselinux-cos7-aarch64 # [linux and aarch64]
|
||||
- libsepol-cos7-aarch64 # [linux and aarch64]
|
||||
- libx11-common-cos7-aarch64 # [linux and aarch64]
|
||||
- libx11-cos7-aarch64 # [linux and aarch64]
|
||||
- libxau-cos7-aarch64 # [linux and aarch64]
|
||||
- libxcb-cos7-aarch64 # [linux and aarch64]
|
||||
- libxdamage-cos7-aarch64 # [linux and aarch64]
|
||||
- libxext-cos7-aarch64 # [linux and aarch64]
|
||||
- libxfixes-cos7-aarch64 # [linux and aarch64]
|
||||
- libxi-cos7-aarch64 # [linux and aarch64]
|
||||
- libxi-devel-cos7-aarch64 # [linux and aarch64]
|
||||
- libxxf86vm-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-dri-drivers-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-khr-devel-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-libegl-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-libegl-devel-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-libgbm-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-libgl-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-libgl-devel-cos7-aarch64 # [linux and aarch64]
|
||||
- mesa-libglapi-cos7-aarch64 # [linux and aarch64]
|
||||
- pixman-cos7-aarch64 # [linux and aarch64]
|
||||
- sysroot_linux-aarch64 # [linux and aarch64]
|
||||
- xorg-x11-server-common-cos7-aarch64 # [linux and aarch64]
|
||||
- xorg-x11-server-xvfb-cos7-aarch64 # [linux and aarch64]
|
||||
- sed # [unix]
|
||||
- boost
|
||||
- boost-cpp
|
||||
- cmake
|
||||
- coin3d
|
||||
- compilers
|
||||
- conda-build
|
||||
- conda-devenv
|
||||
- conda-smithy
|
||||
- debugpy
|
||||
- doxygen
|
||||
- eigen
|
||||
- freetype
|
||||
- gmsh
|
||||
- graphviz
|
||||
- hdf5
|
||||
- libcxx<16
|
||||
- matplotlib
|
||||
- ninja
|
||||
- numpy
|
||||
- occt==7.6.3
|
||||
- openssl==3.0.*
|
||||
- pcl
|
||||
- pip
|
||||
- pivy
|
||||
- pkg-config
|
||||
- ply
|
||||
- pybind11
|
||||
- pyside2
|
||||
- python
|
||||
- pyyaml
|
||||
- qt
|
||||
- qt-main
|
||||
- qt-webengine
|
||||
- six
|
||||
- smesh==9.9
|
||||
- swig
|
||||
- vtk
|
||||
- xerces-c
|
||||
- zlib
|
||||
- pip:
|
||||
- ptvsd
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
{% set name = "freecad" %}
|
||||
{% set version = "0.19.pre" %}
|
||||
{% set build_number = 142 %}
|
||||
{% set build_number = build_number + 500 %} # [FEATURE_DEBUG]
|
||||
|
||||
package:
|
||||
name: {{ name }}
|
||||
version: {{ version }}
|
||||
|
||||
source:
|
||||
# JZ - For local building this is the setup.
|
||||
path: ../
|
||||
#git_url: https://github.com/FreeCAD/FreeCAD
|
||||
#git_tag: master
|
||||
patches:
|
||||
- windows_python_interface.patch
|
||||
|
||||
|
||||
build:
|
||||
number: {{ build_number }}
|
||||
skip: true # [py < 38]
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler("cxx") }}
|
||||
- {{ cdt('mesa-libgl-devel') }} # [linux]
|
||||
- {{ cdt('mesa-dri-drivers') }} # [linux]
|
||||
- {{ cdt('mesa-libegl-devel') }} # [linux]
|
||||
- {{ cdt('libselinux') }} # [linux]
|
||||
- {{ cdt('libxdamage') }} # [linux]
|
||||
- {{ cdt('libxfixes') }} # [linux]
|
||||
- {{ cdt('libxxf86vm') }} # [linux]
|
||||
- {{ cdt('libxcb') }} # [linux]
|
||||
- {{ cdt('libxext') }} # [linux]
|
||||
- {{ cdt('xorg-x11-server-xvfb') }} # [linux]
|
||||
- {{ cdt('libxau') }} # [linux]
|
||||
- {{ cdt('libxi-devel') }} # [linux]
|
||||
- cmake
|
||||
- ninja
|
||||
- git
|
||||
host:
|
||||
- boost-cpp
|
||||
- python
|
||||
- qt
|
||||
- occt
|
||||
- xerces-c
|
||||
- zlib
|
||||
- vtk
|
||||
- swig
|
||||
- eigen
|
||||
- pybind11
|
||||
- coin3d
|
||||
- pivy
|
||||
- pyside2
|
||||
- smesh
|
||||
- netgen 6.2.1808*
|
||||
- doxygen
|
||||
- hdf5
|
||||
- xorg-libxt # [linux]
|
||||
- freetype
|
||||
- libspnav # [linux]
|
||||
- pcl
|
||||
- six
|
||||
- ply
|
||||
- tbb-devel
|
||||
run:
|
||||
- {{ pin_compatible("pyside2") }}
|
||||
- vtk
|
||||
- occt
|
||||
- qt
|
||||
- xerces-c
|
||||
- zlib
|
||||
- boost-cpp
|
||||
- hdf5
|
||||
- python
|
||||
- coin3d
|
||||
- pivy
|
||||
- smesh
|
||||
- netgen 6.2.1808*
|
||||
- xorg-libxt # [linux]
|
||||
- freetype
|
||||
- numpy
|
||||
- six
|
||||
- pyyaml
|
||||
- libspnav # [linux]
|
||||
- pcl
|
||||
- ply
|
||||
run_constrained:
|
||||
- __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} # [osx]
|
||||
|
||||
#test:
|
||||
# commands:
|
||||
# - FreeCADCmd -t 0
|
||||
|
||||
about:
|
||||
home: https://www.freecadweb.org/
|
||||
license: LGPL2.1
|
||||
license_family: LGPL
|
||||
license_file: LICENSE
|
||||
summary: 'FreeCAD is a parametric 3D modeler made primarily to design real-life objects of any size. '
|
||||
description: |
|
||||
FreeCAD is a general purpose feature-based, parametric 3D modeler for
|
||||
CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering
|
||||
and product design but also fits a wider range of uses in engineering,
|
||||
such as architecture or other engineering specialities. It is 100% Open
|
||||
Source (LGPL2+ license) and extremely modular, allowing for very
|
||||
advanced extension and customization.
|
||||
FreeCAD is based on OpenCASCADE, a powerful geometry kernel, features an
|
||||
Open Inventor-compliant 3D scene representation model provided by the
|
||||
Coin 3D library, and a broad Python API. The interface is built with Qt.
|
||||
FreeCAD runs exactly the same way on Windows, Mac OSX, BSD and Linux
|
||||
platforms.
|
||||
doc_url: https://www.freecadweb.org/wiki/Main_Page
|
||||
dev_url: https://github.com/FreeCAD/FreeCAD
|
||||
|
||||
extra:
|
||||
recipe-maintainers:
|
||||
- looooo
|
||||
@@ -0,0 +1,31 @@
|
||||
diff --git a/src/Ext/freecad/CMakeLists.txt b/src/Ext/freecad/CMakeLists.txt
|
||||
index e03b5527e..d9004275b 100644
|
||||
--- a/src/Ext/freecad/CMakeLists.txt
|
||||
+++ b/src/Ext/freecad/CMakeLists.txt
|
||||
@@ -5,7 +5,9 @@ SET(PYTHON_MAIN_DIR ${python_libs})
|
||||
|
||||
set(NAMESPACE_INIT "${CMAKE_BINARY_DIR}/Ext/freecad/__init__.py")
|
||||
if (WIN32)
|
||||
- set(FREECAD_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
|
||||
+ get_filename_component(FREECAD_LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}"
|
||||
+ REALPATH BASE_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||
+ set( ${CMAKE_INSTALL_BINDIR})
|
||||
else()
|
||||
set(FREECAD_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
diff --git a/src/Ext/freecad/__init__.py.template b/src/Ext/freecad/__init__.py.template
|
||||
index 68ca151a5..d5360b252 100644
|
||||
--- a/src/Ext/freecad/__init__.py.template
|
||||
+++ b/src/Ext/freecad/__init__.py.template
|
||||
@@ -12,9 +12,9 @@ except ModuleNotFoundError:
|
||||
except KeyError:
|
||||
|
||||
# 2. we use the default freecad defined for this package
|
||||
- _path_to_freecad_libdir = "${CMAKE_INSTALL_LIBDIR}"
|
||||
+ _path_to_freecad_libdir = "${FREECAD_LIBRARY_INSTALL_DIR}"
|
||||
print("PATH_TO_FREECAD_LIBDIR not specified, using default \
|
||||
-FreeCAD version in {}".format( "${FREECAD_LIBRARY_INSTALL_DIR}"))
|
||||
+FreeCAD version in {}".format("${FREECAD_LIBRARY_INSTALL_DIR}"))
|
||||
|
||||
_sys.path.append(_path_to_freecad_libdir) # this is the default version
|
||||
import FreeCAD as app
|
||||
@@ -0,0 +1,6 @@
|
||||
mesa-libGL
|
||||
mesa-dri-drivers
|
||||
libselinux
|
||||
libXdamage
|
||||
libXxf86vm
|
||||
libXext-devel
|
||||
@@ -127,13 +127,13 @@
|
||||
#define PACKAGE_NAME "FreeCAD"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "${PACKAGE_STRING}"
|
||||
#define PACKAGE_STRING "FreeCAD ${FREECAD_VERSION}"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "FreeCAD"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "${PACKAGE_VERSION}"
|
||||
#define PACKAGE_VERSION "${FREECAD_VERSION}"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#cmakedefine STDC_HEADERS
|
||||
@@ -142,7 +142,7 @@
|
||||
#cmakedefine USE_STD_IOSTREAM
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "${PACKAGE_VERSION}"
|
||||
#define VERSION "${FREECAD_VERSION}"
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
/* #cmakedefine X_DISPLAY_MISSING */
|
||||
@@ -1 +1,9 @@
|
||||
add_subdirectory(examples)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
License.txt
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_DATADIR}
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
The files:
|
||||
|
||||
DrawingExample.FCStd
|
||||
PartDesignExample.FCStd
|
||||
RobotExample.FCStd
|
||||
Schenkel.stp
|
||||
|
||||
are
|
||||
(c) 2011 Juergen Riegel (juergen.riegel@web.de)
|
||||
licensed under:
|
||||
|
||||
Creative Commons Attribution Share Alike
|
||||
|
||||
|
||||
The files:
|
||||
|
||||
EngineBlock.FCStd
|
||||
|
||||
are
|
||||
(c) 2011 Werner Mayer (wmayer@users.sourceforge.net)
|
||||
licensed under:
|
||||
|
||||
Creative Commons Attribution Share Alike
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user