Compare commits

..

678 Commits

Author SHA1 Message Date
Adrian Insaurralde Avalos 256fc7eff3 AddonManager: fix create_pip_call 2025-08-05 17:19:07 -03:00
Adrián Insaurralde Avalos ccc98966e6 WindowsInstaller: use --safe-mode in freecadcmd commands [skip ci] 2025-08-05 10:50:56 -03:00
Adrian Insaurralde Avalos b0127687c2 bump version to 1.0.2 2025-08-03 20:01:51 -03:00
chris 8637434db9 Backport fix for #20656 - fix compilation with occt 7.9 2025-08-03 19:54:58 -03:00
github-actions[bot] 199b4c81d1 [Backport releases/FreeCAD-1-0] Import: DXF, handle non-standard 8859_1 encoding (#22840)
* Import: DXF, handle non-standard 8859_1 encoding (#21905)

* Import: improve DXF importer exception handling

* Import: DXF, pinpoint erroneous header section when reading

* Import: tackle 8859_1 non-standard encoding name

(cherry picked from commit 1e29a3273f)

* Use `Base::RuntimeError` instead of `Base::Exception` since it's constructor is protected in 1.0

---------

Co-authored-by: Furgo <148809153+furgo16@users.noreply.github.com>
Co-authored-by: Adrian Insaurralde Avalos <adrianinsaval@gmail.com>
2025-08-02 11:57:09 -03:00
github-actions[bot] 34b70663d1 Assembly: Fix crash 20614 (#22844)
* Assembly: Fix crash 20614 (#22538)

(cherry picked from commit facfbeb47e)

* adapt to `getMovingPartFromRef` from 1.0 branch

* fix `Console().Warning` has PascalCase name in 1.0

---------

Co-authored-by: PaddleStroke <pierrelouis.boyer@gmail.com>
Co-authored-by: Adrian Insaurralde Avalos <adrianinsaval@gmail.com>
2025-08-01 09:28:01 -03:00
Syres916 1bcf27e1aa [Measure] Fix seg fault in MeasurePosition::execute if subElements is empty (#22016)
* [Measure] take into account if subElements is empty

* [Measure] Remove unnecessary else block

(cherry picked from commit 7e6775d2c0)
2025-07-31 11:18:58 -03:00
Jakub Klinkovský 8c8a418c95 Use vtkUnstructuredGrid::GetLinks instead of vtkUnstructuredGrid::GetCellLinks for VTK >= 9.3
The vtkUnstructuredGrid::GetCellLinks has been deprecated in VTK 9.3 and
silently removed in 9.5:

https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/release/9.3.md
(cherry picked from commit 3d2b7dc9c7)
2025-07-31 11:18:36 -03:00
jffmichi 7317eb3035 CAM: remove redundant move after drilling
(cherry picked from commit 3bce6e3fc9)
2025-07-31 11:17:18 -03:00
Syres916 1dea8f3ca9 [1.0] [Gui] Fix wildcard call disconnects warnings Qt6.9 2025-07-31 10:41:52 -03:00
Syres916 19c54a8a66 [1.0] [GUI] Remove dark fringe around letters 2025-07-31 10:41:34 -03:00
Syres916 e6b82ca9e1 [1.0] [Points] Add e57 to import file extensions 2025-07-31 10:41:18 -03:00
Syres916 7d6bcbc03a [TechDraw] update to align with newer templates 2025-07-31 10:41:03 -03:00
Syres916 8588a85fa1 [1.0] [TechDraw] Fix Qt6 compatability of FillTemplateFields tool 2025-07-31 10:40:46 -03:00
Adrian Insaurralde Avalos faa260f0ce conda ci: use conda cdt packages and run on ubuntu 24.04 2025-07-30 17:53:54 -03:00
Adrian Insaurralde Avalos 42299aefca conda ci: pin compilers on linux and macos 2025-07-30 17:53:54 -03:00
Chris Hennes 3f5f828c25 Tests: Save/restore Materials user prefs
(cherry picked from commit d54ff81870)
2025-07-30 17:53:54 -03:00
Chris Hennes 18dd3f83ed Tests: Ensure tests use a fixture that inits app
(cherry picked from commit 25f1d28468)
2025-07-30 17:53:54 -03:00
Syres916 2255548c52 [CAM] write the post file with UTF-8 encoding
Based on #20421, Fixes #18698
2025-07-28 13:14:44 -03:00
Roy-043 48226c3346 BIM: fix Arch_SectionPlane 'Toggle Cutview' issue 2025-07-11 15:53:40 +02:00
Roy-043 552309b38e Update BimTDPage.py 2025-07-11 15:49:48 +02:00
Roy-043 b78dd00d31 Update ArchSchedule.py 2025-07-11 15:48:52 +02:00
Roy-043 872d98d7df Update ArchAxis.py 2025-07-11 15:47:13 +02:00
Roy-043 8502c09b45 Update BimProjectManager.py 2025-07-11 15:41:04 +02:00
Roy-043 34f8982b81 Update ArchMaterial.py 2025-07-11 15:39:29 +02:00
Roy-043 5921f4cd03 BIM: fix filtering out level issue (#22059)
* Update ifc_status.py

* Update ifc_tools.py
2025-07-11 15:37:08 +02:00
Roy-043 c78d633d07 BIM: fix index error in ifc_viewproviders.py
Fixes #21912
2025-07-11 15:36:21 +02:00
Roy-043 a8bf9a5f41 BIM: Roof add tolerance to parallel check (#21814)
Fixes #21796.
2025-07-11 15:35:29 +02:00
Benjamin Guest e23a81e0c4 TechDraw: Fix dimension alignment issue.
Fixes issue #19121 "dimension numbers placed lower than normal".

Problem:

QGCustomText has a new method `alignmentRect` which can optionally return a
`tightBoundingRect` instead of the regular `boundingRect`. The
`alignmentRect` is used for laying out the `QGIDatumLabel`, however
QGraphicsItemGroup's `childrenBoundingRect` use the childrens'
`boundingRect` and knows nothing of `alignmentRect`. The result is an
improperly sized label and frame and miss alignment. Additionally
`childrenBoundingRect` calculations includes hidden views, so even though
the `m_tolTextOver` and `m_tolTextUnder` are hidden they still affect
the bounding rect size.

Solution:

1. Implement new method `QGIDatumLabel::tightBoundingRect` this
   calculates the bounding rect using the subview's
   `aligmentRect` if there is text in the custom text.
2. Use `tightBoundingRect` in place of `boundingRect` to for the drawing of
   arrows and the exact dim frames.
3. This PR acknowledges that there are some edge case fonts that while not
   clipped may not interface perfectly with arrows and the exact dimension
   frame.
4. Fix vertical alignment of `m_tolTextOver` / `m_tolTextUnder`
5. Incorporate PR Review comments
2025-06-13 20:28:36 -03:00
tritao 010d37deda Standardize on Py::Long type for Python bindings. 2025-05-15 19:59:08 -03:00
Roy-043 5391e21d4e BIM: fix BIM_WPView command (#20741)
* BIM: fix BIM_WPView command

The BIM_WPView command did not work properly. This was mainly due to a faulty import.

* Updated to avoid a linter warning
2025-05-15 11:28:19 +02:00
Roy-043 e94e1d9260 BIM: BIM_Leader would create a wire with fewer than 2 points
If the BIM_Leader was escaped without clicking a point, or after cicking only 1 point, a Draft_Wire object would still be created.
2025-05-15 11:26:29 +02:00
Roy-043 1331b1f4b7 Merge pull request #20529 from Roy-043/Draft-fix-alignment-of-dim-arrows
Draft: fix alignment of dim arrows
2025-05-15 11:25:40 +02:00
Adrian Insaurralde Avalos ba50b8ce79 fedora rpm packaging: fix inverted pcl_enabled conditionals [skip ci] 2025-05-14 09:59:15 -03:00
Adrian Insaurralde Avalos 878f0b8c9c bump version to 1.0.1 2025-05-13 23:58:13 -03:00
Benjamin Nauck eebef0613b Update ondselsolver 2025-05-13 23:58:13 -03:00
Adrian Insaurralde Avalos 2aee1066ef fedora rpm packaging: tweak rpmbuild options
change `bundled_zipios` option to enabled by default, it was wrongly always set to enabled no matter what option was chosen
change `bundled_pycxx` option to enabled by default
add `pcl_enabled` option
2025-05-13 23:58:13 -03:00
Adrian Insaurralde Avalos 5929a5de39 fedora rpm packaging: use standard macro to package sources 2025-05-13 23:54:50 -03:00
ljo 315585ca87 Fix RPM packaging and add support for building with Qt6 and PySide6 for Fedora 40+ (#19565)
(cherry picked from commit afe23a432c)
2025-05-13 19:17:27 -03:00
Leif-Jöran Olsson 54b689fc23 Fixing ambiguiguous python shebang in installed script freecad-thumbnailer. Removed skip ci according to instruction.
(cherry picked from commit fb5ded6e53)
2025-05-13 19:17:27 -03:00
Adrián Insaurralde Avalos 0207f7716a WindowsInstaller: multiple improvements and fixes
update artwork
adapt to conda builds
make msvc redist directory optional
automate version information definition
use relative directories for file locations definitions
improve/update readme
partially update Delete.bat for qt6 libpack
add .gitignore
update signing.bat and add hashing command
2025-05-13 19:17:27 -03:00
Adrian Insaurralde Avalos 7637a991a9 Improvements and fixes on macos sing and notarize script 2025-05-13 19:17:27 -03:00
Syres916 ca9489c740 [App] add MeterDecimal to Unit Scheme Enum (#21275) 2025-05-12 13:14:55 -03:00
Adrian Insaurralde Avalos aa6f2943a9 github ci: use container for ubuntu 20.04 workflow
github deprecated the ubuntu-20.04 runner so it didn't work anymore, some adjustments where necessary
2025-05-11 17:25:18 -03:00
Syres916 deb68996f3 [1.0] [Gui] Fix bottomRight index by correcting last row count 2025-04-28 13:23:22 -03:00
Syres916 32a69b227f Backport of PR19377 and PR19765 to releases/1.0 branch 2025-04-21 11:37:36 -03:00
Roy-043 d9177606f5 Backport of #20436
Draft: Update checked state of grid button when switching the grid
2025-03-26 15:24:34 +01:00
Roy-043 71ba4d58fa Draft: show and hide Tray with delay
Without this delay the Tray may not display if Draft is the start-up workbench.

When the Draft workbench is autoloaded the Tray is shown and then immediately hidden. Because of this, hiding the tray must also happen with a delay.
2025-03-23 11:07:02 +01:00
Roy-043 c4a9c75bcc BIM: HumanFigure.brep: fix typo in create_qrc.py
Fixes #20289

My bad. Because of this typo the brep file was not included in Arch_rc.py.
2025-03-20 18:12:18 +01:00
Roy-043 b9bd1ca9db Draft: fix sweep==0 issue with Draft_Rotate
This is side-issue fixed with #19927. The rest of that PR should not be backported.
2025-03-19 11:26:47 +01:00
Roy-043 a2f3edbbf9 Draft: fix Draft_Edit issue with Gesture navigation
Fixes #19519
2025-03-19 11:19:13 +01:00
Roy-043 912e9a1429 BIM: fix ArchAxis index errors
Fixes #19577

Apparently the ViewObject can be updated before the Shape of the objects has been changed. To catch this the number of edges is checked in the `onChanged` method of the ViewObject.

There was an additional index error if the Limit property was not zero.
2025-03-19 11:10:01 +01:00
GHDE dee64c7c5d fixed openExternalLinks in DlbAbout (FreeCAD#16423) 2025-03-18 23:25:23 -03:00
Furgo 3fffb79426 BIM: include selected objects when creating a level 2025-03-18 23:18:57 -03:00
Adrian Insaurralde 0667e59d01 Fix backport of #19458 on occt 7.3 2025-03-18 17:21:13 -03:00
captain0xff a42141ea13 stop the cursor from flickering while picking a cosmetic vertex in techdraw 2025-03-18 16:13:29 -03:00
Kevin Martin ffec2d3055 Correct Issue 19980 for the 1.0 tree
Make no Change notification if an object's Label, after making it Unique and letting OnBeforeChangeLabel alter it, ends up equal to its current value.
2025-03-18 15:49:44 -03:00
Roy-043 865652822a Draft: make Draft_Edit also detect key up events
The key down events can be claimed by shortcuts from other workbenches. Detecting both the down and up events does not seem to cause problems.
2025-03-18 15:24:36 -03:00
Furgo 7406f274fb BIM: Arch imports ArchSpace methods 2025-03-17 20:11:28 -03:00
PaddleStroke 71a2315a5c Core: Text object: Fix icon of the tab. 2025-03-17 20:09:27 -03:00
PaddleStroke 0fcdecc934 QuickMeasure: Do not measure datums 2025-03-17 20:01:49 -03:00
PaddleStroke edfe5f4958 Fix #20004 2025-03-17 19:51:34 -03:00
j-hap 77269ee53b TechDraw: Fix double free when resetting line formats 2025-03-17 19:36:32 -03:00
Aurélien Pascal 1f42e804d7 TechDraw: Fix hatch drawing (#19458)
* TechDraw: Fix hatch drawing (#16353)

* TechDraw: Fix hatch drawing in Tech View
2025-03-17 19:33:12 -03:00
wmayer 25a3bd1239 Mesh: Workaround to load 3mf files not supported by zipios library
Mesh: Add comment explaining the workaround
2025-03-17 19:31:51 -03:00
Benjamin Bræstrup Sayoc 666600b589 Build: suppress warnings from 3rd party libraries
Warnings from 3rd parties are not relevant and are only polluting the warning output. Marking these libraries as SYSTEM suppresses warning.

https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#index-I
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
2025-03-17 18:17:46 -03:00
Adrian Insaurralde 37b5ac7b1c pixi: use cos7 packages on linux-64 2025-03-17 18:17:46 -03:00
Jacob Oursland 144fa63a8b CI: Enable GitHub Problem Matchers for compiler warnings. 2025-03-17 18:17:46 -03:00
mosfet80 94b30af836 Update pixi (#19625) 2025-03-17 18:17:46 -03:00
mosfet80 f34b73e46d Update sub_buildPixi.yml
Update checkout to version 4 -> default runtime to node20
2025-03-17 18:17:46 -03:00
mosfet80 1c18001290 Update sub_buildPixi.yml 2025-03-17 18:17:46 -03:00
mosfet80 2a9d56ea7e Update pixi.toml
fix version
2025-03-17 18:17:46 -03:00
lorenz fc48d88bca pixi: update to py3.13 (#18832)
* pixi: update to py3.13

* pixi: Update gh-action to use pixi v0.39.4

* Pixi: add dep. xorg-xproto for linux

* update lock-file
2025-03-17 18:17:46 -03:00
Jacob Oursland fe51a4d2de pixi: Add run freecad configuration for Windows.
Windows requires running from an installed FreeCAD, not simply the build environment.  This
commit performs the install and execution from the installation environment.
2025-03-17 18:17:46 -03:00
looooo a1aa127617 CI: add pixi github action
partial backport to keep conda qt5 CI workflows
2025-03-17 18:17:46 -03:00
looooo 23b77b096f pixi: add pixi.toml and pixi.lock 2025-03-17 18:17:46 -03:00
Jacob Oursland a2576785e7 CMake: modernize to use CMAKE_<LANG>_COMPILER_LAUNCHER for ccache. 2025-03-17 18:17:46 -03:00
Jacob Oursland 1c684b2c25 CMake: emit message when ccache is detected. 2025-03-17 18:17:46 -03:00
Jacob Oursland 0eda35d19f Mesh: Add template type to WM4 TRational variables. 2025-03-17 18:17:46 -03:00
Jacob Oursland 55e942ba94 Mesh: move counter declaration to loop-local. 2025-03-17 18:17:46 -03:00
Jacob Oursland 216a30ac57 CMake: Add missing target_link_directories() for OCCT. 2025-03-17 18:17:46 -03:00
Jacob Oursland c2ba10d4e4 App: Reduce BOOST_VERSION workaround to fix boost symbol linker error on Win-Qt5. 2025-03-17 18:17:46 -03:00
Chris Hennes b05242c27a CI: Make black line length match pre-commit 2025-03-17 18:17:46 -03:00
Adrian Insaurralde 299e7d3f0c CI: fix assembly unit tests executable name 2025-03-17 18:17:46 -03:00
Chris Hennes f5415a2511 CI: Add missing C++ tests to CI run
The current structure of the CI system explicitly lists the tests to run, and several recently-added test executables were not included in the list.
2025-03-17 18:17:46 -03:00
Chris Hennes 7670663f4a Spacemouse: Add #include <chrono> 2025-03-17 18:17:46 -03:00
Furgo e8db8a52b4 Add-On Manager: list correct vendor path for snaps (#19816) 2025-02-27 18:20:55 -03:00
Furgo 48004949de Add-On Manager: generalize removal of non-compatible pip options for the snap package (#19814) 2025-02-27 18:19:52 -03:00
xtemp09 9bd72d7bb3 [Spreadsheet] Remove prepended apostrophe if cell content is copied into clipboard (#19781)
* [Spreadsheet] Remove prepended apostrophe if cell content is copied into
clipboard

Closes #10058.
2025-02-27 18:18:57 -03:00
Andrew Shkolik 0ff7f0f5ff Surface - Fill boundary curves not honor SplitCurve edge if it's part of BSpline 2025-02-27 18:18:51 -03:00
Chris Hennes 2462f72ebf Addon Manager: Fix pip on Snap and AppImage
Also fixes various issues with dependency updater
2025-02-27 18:12:26 -03:00
Robert Schiele f1e86b9304 Fix: Linux builds fail at link time referencing missing symbols from 3DConnexions SDK (#19865)
backport of #19406

Co-authored-by: Patryk Skowroński <pskowronski@3dconnexion.com>
2025-02-27 15:13:32 -03:00
Adrian Insaurralde 9faedf7618 CMake: add missing ifs to support building 1.0 with LibPack 3.1.0 2025-02-26 00:04:33 -03:00
Chris Hennes b68dfbaf6d CMake: Support building 1.0 with LibPack 3.1.0 2025-02-24 13:23:26 -03:00
Adrian Insaurralde 7e08681df4 Gui: hide legacy spacemouse support PrefCheckBox if navlib isn't enabled 2025-02-23 15:17:29 -03:00
Adrian Insaurralde ef4d3714b3 Fix spnav not enabled by default on linux after #19226 and #19407 2025-02-23 15:17:29 -03:00
Chris Hennes fabaf130ec Gui: Disable spacemouse init if not legacy 2025-02-23 15:17:29 -03:00
Chris Hennes 317def083a GUI: Disable legacy spnav code when legacy is false
We don't ever want to connect to both libspnav and NavLib
2025-02-23 15:17:29 -03:00
Adrian Insaurralde 59341f7570 Backport: Enabling 3Dconnexion NavLib integration for MacOS (PR #17000) 2025-02-23 15:17:29 -03:00
wmayer 365fca1abb MSVC: Fix linking error when 3Dconnexion support is set to 'Raw input' 2025-02-23 15:14:36 -03:00
wmayer fa88a6e74e CMake: Handle build time checks to choose between modern and/or legacy space mouse devices 2025-02-23 15:14:36 -03:00
wmayer 0ce373c072 Gui: Add runtime check to choose between modern and legacy space mouse devices 2025-02-23 15:14:36 -03:00
Adrian Insaurralde 9afc9bb4d3 [CI][conda] Update qt5 devenv and remove default channel from workflows 2025-02-23 15:14:36 -03:00
Adrián Insaurralde Avalos 7aeb9ebfcf Merge pull request #19724 from LarryWoestman/pr_1_0
CAM:  A set of commits that are ready to be backported to the 1.0 branch from #18103 #19006 and #18685
2025-02-23 12:34:43 -03:00
pre-commit-ci[bot] 6ea40c3e63 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-02-20 01:11:11 +00:00
lorenz 3c6140dc26 cam: remove imghdr import (#18081) 2025-02-19 17:37:05 -03:00
Yorik van Havre c0363e14da BIM: Do not change important pref options without user's consent - fixes #19163 2025-02-19 17:36:26 -03:00
Lawrence Woestman d9561a8574 CAM: Fixed F parameter handling for only rotary axes
with tests
2025-02-18 19:06:51 -08:00
Lawrence Woestman 1c04b7cc96 CAM: converted the refactored* postprocessors to the new API
with corresponding tests
2025-02-18 19:06:51 -08:00
Lawrence Woestman 66d406b06f CAM: fixed A, B, and C axis handling; added relevant tests 2025-02-18 19:06:51 -08:00
Lawrence Woestman 0c9891be4b Added a line to make the build work
Note that this is the same change as Commit 1fdd2ya
	which hasn't been backported yet.
2025-02-18 19:05:41 -08:00
Adrian Insaurralde e960b745f9 Fix missing bracket after bad backport of #18644 2025-02-18 18:18:38 -03:00
Jiří Mácha 3aa55e5e91 Assembly: migrationScript2 and migrationScript4 improved and refactored
Description of Defects in migrationScript2 and migrationScript4:

Several additional issues have been identified in the Assembly
functions migrationScript4 and migrationScript2, beyond those fixed in
patch 71f0104bb2.

One common problem is that the Joint property Reference1 or Reference2
can be set to an invalid format. For example, user can manually cause
this issue by assigning an incorrect reference (e.g., the Z-axis) to
these properties via the FreeCAD GUI.  When this happens, internal
errors (exceptions and their corresponding Python call stack) are
reported in the Report View.  However, such information is not helpful
for the user to fix their 3D model.

Issues with the Current Implementation (Using migrationScript4 as
Reference):

- Lack of Type Validation for Reference1 and Reference2:

  The script does not check whether joint.Reference1[1] or
  joint.Reference2[1] is a sequence. If this condition is not met,
  statements like:

    sub1 = joint.Reference1[1][0]

  will throw an exception, printing the Python call stack.

- Lack of Length Validation for Sequences:

  The script does not ensure that the sequence length is sufficient
  for indexing. For example, joint.Reference1 and joint.Reference2
  must each have at least two elements to allow:

    joint.Reference1[1][1]
    joint.Reference2[1][1]

  Without validation, such calls can result in exceptions, printing the
  Python call stack.

- No Feedback on Problematic Joint:

  The user is not informed about which Assembly joint in the object
  hierarchy has an invalid Reference1 or Reference2. Depending on the
  size of the 3D model, identifying the defect can be time-consuming
  and frustrating without proper feedback.

This patch is focused on:

- Reporting Problematic Joint Path:

  A new function has been added to retrieve the full path to the
  Assembly joint. The return value (a string) is used to report the
  issue.

- Improved Exception Handling:

  Instead of adding more conditional checks (see above), exception
  handling is implemented. AttributeError, IndexError, and TypeError
  exceptions are caught. The exception message (excluding the call
  stack) is displayed at the end of a user-friendly warning.

- User-Friendly Warnings in the Report View:

  A single-line warning is now shown in the Report View, containing
  the following details:

    - Source of Warning:              'Assembly joint'
    - Location in the 3D Model: e.g., 'Assembly_XY.object_XY.joint_XY'
    - Problematic Attribute: e.g.,    'ReferenceXY'
    - Exception Message: e.g.,        'list index out of range'

- Refactoring and Optimization:

  The functions were refactored and optimized at the end of the
  conversion process.

Advantages:

- Cleaner Report View:
  Internal errors (e.g., Python call stacks) are no longer logged in
  the Report View, as they are not useful for end users. Only the
  exception message is displayed.

- Improved User Feedback:
  Users can now identify the problematic Assembly joint in the object
  hierarchy, saving significant time and effort.

- Robust and Concise Code:
  The solution simplifies the code while increasing its robustness.
2025-02-18 17:22:09 -03:00
wmayer c75fe83a4e App: Fix possible crash when postponing the destruction of a removed property
Fixes #18601
2025-02-18 17:17:27 -03:00
PaddleStroke b8b02f5f46 Assembly: Make ExplodedView: a group extension. So that we don't mimick group. Fixing the delete exploded view group issue 2025-02-18 17:15:27 -03:00
wmayer 9040a14d7b Part: Fix getIcon() of several view providers to return full path name of the icon file 2025-02-18 17:13:22 -03:00
Pascal de Bruijn 0dff5334d1 TechDraw: fix editable/autofill scale in Templates 2025-02-18 17:08:50 -03:00
Pascal de Bruijn db1f37a98a TechDraw: Component Drawing as default document type (#18827)
Presumably Component Drawings are more common as opposed to Assembly Drawing's
therefore FreeCAD's default should reflect this.

find src/Mod/TechDraw/Templates -iname "*.svg" -exec sed -i 's#Assembly Drawing#Component Drawing#g' "{}" \;
2025-02-18 17:08:35 -03:00
Roy-043 c4e292bd66 BIM: Improve onChanged Placement code
* Switched Component code to new Comp=True version of code.
* Made the Placement code in both files identical. This also solves that Rotating a BuildingPart was not propagated to children.
2025-02-18 13:26:12 +01:00
Chris Hennes 9dd074ff6d Points: Add missing QMessageBox include to PCH file 2025-02-17 21:40:14 -06:00
Benjamin Nauck 8de5d74502 Backport: Core: Implement SoFCTransform node (#19672)
* Core: Implement SoFCTransform node

In its doAction() method it only sets the model matrix if it's not the identity matrix.
This improves the issue #7606


* Add doc string to SoFCTransform

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
Co-authored-by: wmayer <wmayer@freecad.org>
Co-authored-by: wwmayer <werner.wm.mayer@gmx.de>
2025-02-17 19:38:10 -03:00
Adrian Insaurralde 5c23509370 Add proper PDF creator metadata (backport PR #18824)
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

App: Add utility method to get app name with version included

Gui: Migrate to using App::Application::getNameWithVersion

Spreadsheet: Migrate to using App::Application::getNameWithVersion

TD: Migrate to using App::Application::getNameWithVersion

Drawing: Migrate to using App::Application::getNameWithVersion
2025-02-17 14:21:35 -03:00
Syres916 78d954d086 [Techdraw] Import SVG files with UTF-8 encoding (#18816)
* [Techdraw] Fix importing SVG files with UTF-8 encoding

* [Techdraw] fix Lint feedback
2025-02-17 14:13:22 -03:00
Paul Lee 526ee2c9c4 [ArchWall] Fix Regression Single-edge Wall w/ Multi-Material
Forum Discussion
- https://forum.freecad.org/viewtopic.php?t=93610&start=10#p806296

Github Issues
- https://github.com/FreeCAD/FreeCAD/issues/19147#issuecomment-2607946858
2025-02-17 15:13:30 +01:00
Roy-043 95dfb2ede8 Merge pull request #19089 from Roy-043/Draft-Clone-avoid-B-spline-faces-in-more-cases
Draft: Clone: avoid B-spline faces in more cases
2025-02-17 15:12:53 +01:00
Daniel Wood cfb02b88be CAM: Tool Bit Library Fixes (#18973)
* remove unused else
* Enable reloading / re-selection of libraries
* Reload the libraries when exiting the editor
* Clear the model to prevent duplicate entries
* add missing docstring to reduce linting warnings
* Maintain any previous library selection when editing
2025-02-17 00:56:02 -03:00
MisterMaker a28fb062b9 [stylesheets] Gathering of stylesheet fixes (#18929)
* this is a workaround to remove caps

pelase ignore this hackery

* And now the caps are gone

* a bunch of small tweaks and fixes.

* Update FreeCAD Light.qss

updated menubar color light theme

* updated the buttons a tiny bit

* Fix for to short buttons.

Couldn't test it since my macro window is broken.

Co-Authored-By: Syres916 <46537884+Syres916@users.noreply.github.com>

* qspinbox disabled tweaks.

* Update FreeCAD Dark.qss

Tweaked the buttons a bit so they are more in line with the light theme.

* Update FreeCAD Dark.qss

small tweaks

* reversed the spreadsheet headers gradient for dark

* Update light with undo arrows position

Co-Authored-By: Syres916 <46537884+Syres916@users.noreply.github.com>

* Update undo buttons arrow position dark

Co-Authored-By: Syres916 <46537884+Syres916@users.noreply.github.com>

* added an offset to qcombobox

* removed the fix since it ruined every Qcombobox.

* Tabs update more clean less gradients.

* Update DlgMacroExecuteImp.cpp

fixing conflicts

* Update DlgMacroExecuteImp.cpp

* Delete DlgMacroExecuteImp.cpp

* Create DlgMacroExecuteImp.cpp

* Revert "Create DlgMacroExecuteImp.cpp"

This reverts commit 8de8f7506177d773bb356fd0e22a66466c25b668.

* Revert "Delete DlgMacroExecuteImp.cpp"

This reverts commit 41315f31abdad79afd4b696ee15c603de3e4a6a1.

* Revert "Update DlgMacroExecuteImp.cpp"

This reverts commit aa792291684e2d674f6961c641c8e2f8b9af12c8.

* Revert "Update DlgMacroExecuteImp.cpp"

This reverts commit e8376a8fdf11d7fd014f2c46f189afdca42833ce.

* Delete src/Gui/DlgMacroExecuteImp.cpp

* Update DlgMacroExecuteImp.cpp

finally realized what was going on lol

---------

Co-authored-by: Syres916 <46537884+Syres916@users.noreply.github.com>
2025-02-17 00:50:08 -03:00
PaddleStroke c7a1792309 Stylesheet toolbar background (#18831) 2025-02-17 00:41:23 -03:00
PaddleStroke 0141331dbd TechDraw: Assembly exploded views : revert #17726 2025-02-17 00:39:16 -03:00
Kacper Donat 6c8f9b28a0 App: Fix GeoFeature::getGlobalPlacement when rootObj is Link
This fixes a case when in case of rootObj being Link placement was not
calculated correctly due to not changing of the document. While for
original use it was fine as this was mostly used in case where there was
defined non-link root for general case Links can be root objects of the
document.
2025-02-17 00:31:02 -03:00
marioalexis e18e786f76 Fem: Fix references assignment in centrif example 2025-02-17 00:27:44 -03:00
herbkonik 5613501758 CAM: Fix bug that incorrectly calculates corner radius (#18724)
OCL requires three elements for defining a bullnose cutter: overall diameter, corner radius, and overall length. FreeCAD is providing the correct diameter and length, but the corner radius is calculated incorrectly in SurfaceSupport.py
Props go to Edyork in https://forum.freecad.org/viewtopic.php?p=798895#p798895
2025-02-17 00:22:18 -03:00
wmayer 4505c28cb6 Gui: Fix copying elements in the tree view by holding CTRL key
In older versions it was possible to copy elements with drag and drop by holding the CTRL key. Since v0.20 or v0.21 this wasn't possible any
more so that elements are always moved.

Note: Copying is only allowed for elements that have a parent object.
2025-02-17 00:19:04 -03:00
WandererFan e605d73d3f [TD]Dimension font clipping (fix #11452) (#18771)
* [TD]separate alignment and rendering bounding rectangles

* [TD]use alignment rectangle (fix #11452)
2025-02-17 00:17:45 -03:00
wwmayer aff5cdf016 Fix issues in ellipse creation (#18800)
* Sketcher: Handle exceptions in onViewValueChanged

Because the method onViewValueChanged is used as a Qt slot it must handle all possibly raised exceptions as otherwise
they will slip through GUIApplication::notify() that usually results into a crash on some platforms like macOS

* Sketch: Handle undefined values in calculateThroughPointMinorAxisParameters

* The argument of acos() must be in the range [-1, +1], otherwise it returns nan (not a number)
* The value of sin(0) = 0. So, it cannot be used in the denominator of a fraction
2025-02-17 00:14:53 -03:00
MisterMaker 25f929c572 Stylesheets spreadsheets visual fix. (#18719)
* this fixes the spreadsheet alignment and the corner button

* missed a line
2025-02-17 00:13:21 -03:00
wmayer fafff3a08b smesh: Fix build failure with vtk 9.4
Fixes #18423
2025-02-17 00:09:56 -03:00
WandererFan 149b64e8ef [TD]Fix transparent area in pdf (fix #18443) (#18507)
* [TD]fix transparent areas in pdf (#18443)

* [TD]restore use of PDF/A-1b format

- was not working in older versions of QPdfWriter
2025-02-17 00:07:21 -03:00
Bas Ruigrok 48dca901e6 Gui: Fix Blender and Revit navigation issues with shift key in sketcher 2025-02-17 00:03:50 -03:00
Rotzbua 11136b282f feat(win): add registry for silent uninstall
Entry is recommended to support the silent uninstall process without knowing the arguments.
https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs#Recommended_values
2025-02-17 00:00:02 -03:00
Pieter Hijma 5d4587cfb3 Gui: Fix VarSet dialog 2 digit problem 2025-02-16 23:53:02 -03:00
mwganson 3209329eb4 [Part TopoShapeExpansion] move shape transform from make element copy into ruled surface function since it does not work well when copying vertex objects 2025-02-16 23:38:30 -03:00
Chris Hennes 2718d4589b Ext: Correct user preference specified in comment 2025-02-16 23:37:25 -03:00
Bas Ruigrok b11d4211e4 Gui: Fix camera position shift when starting rotation 2025-02-16 23:36:06 -03:00
Roy-043 0e3d2a208f PrefPacks: Add spreadsheet colors to classic theme
Fixes #17984.
2025-02-16 15:27:33 -03:00
Ian Hunter 5f2ac5479b Fix bug preventing filtering named constraints (#19339)
* Fix bug preventing filtering named constraints

There was a bug (see issue #11843) that displayed a filter for Named
constraints in the Sketcher Workbench whose toggling did not affect the
UI in any way. This enables this feature by checking if a given
constraint has a custom name or not and then appropriately toggling its
visibility.

* Use `std::string::empty()` per reviewer suggestion

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-02-16 14:36:18 -03:00
Tim 12dc5829d7 [AddonManager] Fix construct_git_url return urls with '.git'. (#19242)
* [AddonManager] Fix construct_git_url return urls with '.git'.
2025-02-16 14:34:53 -03:00
Syres916 b638dba12c [Gui] fix the FPS text visibilty issues raised in #19371 (#19385)
* [Gui] fix the FPS text visibilty issues
* [Gui] code efficiency based on suggestions
* [Gui] update color parameter
* [Gui] Fix Lint feedback
* [Gui] check if string is empty
2025-02-16 14:14:44 -03:00
Roy-043 2a26b3d01b Draft: Avoid setRadiusValue error message
Fixes #19386.
2025-02-16 14:02:24 -03:00
Benjamin Nauck 9ad1aee683 CAM: Fix finish passes by avoiding fuzzy in Area.cpp (#19525) 2025-02-16 13:25:12 -03:00
tritao cff1b1921c Gui: Check if document exists in View3DInventorViewer::setOverrideMode. 2025-02-16 13:24:10 -03:00
Roy-043 79655aabf6 Draft: Fix line length input issue
Fixes #19451.
2025-02-16 13:23:29 -03:00
Chris Hennes 67b10dd24e Core: Update copyright date range to include 2025 (#19520)
* Main: Update copyright date range to include 2025
* GUI: Update copyright date range to include 2025
2025-02-16 13:20:42 -03:00
Benjamin Nauck 630f7bcd29 Revert "refactor: taskpanel ui on linux"
This reverts commit 537ad0fd7a.
2025-02-05 08:52:30 -06:00
Alfredo Monclus 537ad0fd7a refactor: taskpanel ui on linux 2025-01-27 14:07:14 -03:00
phaseloop 6d35b82899 CAM: Fix finishing pass (#17960)
* CAM: Fix finishing pass

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add finishing pass unit (by @baehr)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-27 14:04:11 -03:00
Lawrence Woestman 4dca99183d CAM: Fixed script-style postprocessors getting the wrong __name__
Also added a test that the __name__ of the postprocessor is correct
2025-01-27 14:02:56 -03:00
Stan Tomlinson 4ee2c5d9db improved checks in GUI/Jobs.py/claimChildren
eliminate some error messages when a Job is not fully loaded
  (or when not properly constructed via scripting)

TESTED ON V0.21 -- code hasn't changed since then
2025-01-27 13:53:05 -03:00
Shai Seger 245b62b8fa [CAM Simulator] Add ifdef to fix OpenGL compatibility on linux. issue #18707 (#18746)
* Add ifdef to fix compilation on linux. issue #18707

* remove multisample line altogether
2025-01-27 13:42:45 -03:00
Joona Okkonen 7dca20f979 Backport version. Sketcher: Fixed mapping error when attempting to create a sketch inside a group. (#19215)
* Sketcher mapping error fix

Fixed an issue in the Sketcher where attempting to create a sketch while a group is selected caused a mapping error. Now, when a sketch is created with a group selected, the sketch will be placed inside the group.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Joona <jookkone@edu.lapinamk.fi>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-24 08:04:20 -06:00
Roy-043 1e55e402ae Draft and BIM: Layer manager did not accept zero transparency 2025-01-10 23:44:28 +01:00
Roy-043 e557658def Merge pull request #18949 from Roy-043/Draft-and-Pref-Packs-fix-snapcolor
Draft (and Pref Packs): fix snapcolor
2025-01-09 12:04:02 +01:00
Benjamin Nauck 695f0cfe32 Remove octal in expressions when there's a leading zero 2025-01-09 11:55:43 +01:00
Roy-043 7b29489d3d Merge pull request #18959 from Roy-043/Core-fix-sWhatsThis-for-Std_LinkActions
Core: fix sWhatsThis for Std_LinkActions
2025-01-09 11:37:57 +01:00
Roy-043 485f239d6d Merge pull request #18942 from Roy-043/Draft-fix-selection-for-FacebinderTaskPanel
Draft: fix selection for FacebinderTaskPanel
2025-01-09 11:37:18 +01:00
Roy-043 ab3d0c319c Draft: fix axis calculation in make_sketch
Fixes #18713.

The code follows the suggestion by imm/webmite:
https://forum.freecad.org/viewtopic.php?p=799014#p799014

@webmite Thank you.
2025-01-09 09:41:03 +01:00
wmayer 9e4419a19c Gui: Check for exising layout before accessing it
It still must be checked if the crash in #18747 will be fixed.
2025-01-08 11:27:38 +01:00
Yorik van Havre b0c4aeee9e BIM: Fixed nativeIFC license - issue #18622 2025-01-07 16:06:13 +01:00
Roy-043 5a16f625b7 Part: copy_visual_attributes did not handle Draft Link arrays
Fixes #16541.
Fixes #18760.
2025-01-06 18:17:13 +01:00
pre-commit-ci[bot] d9e8fe0d7d [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-12-23 14:12:57 -03:00
Demolux d1707fdf10 BOM generation missing columns and .doCommandEval bugfix
BOM generation bugfix: Columns are persistent and .doCommandEval dependency circumvented #18615 backport to 1.0
2024-12-20 14:26:32 -03:00
Tobias Frost aaf2b6ed10 Fix SPDX Identifier to match license 2024-12-20 14:10:04 -03:00
Alfredo Monclus 4edb2e328c fix(PD): size should be enabled if profile is not none 2024-12-20 14:10:02 -03:00
Roy-043 4f9e833512 BIM: fix Wiki links in BIM Tutorial 2024-12-18 10:39:27 +01:00
Vincenzo Calligaro 82d1210f81 Updated tests affected by the modification
Signed-off-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>
2024-12-16 13:47:54 -03:00
Vincenzo Calligaro 9a4b9c5277 [PartDesign] Hole: restore missing call to FeatureAddSub::refineShapeIfActive()
Signed-off-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>
2024-12-16 13:47:54 -03:00
Syres916 9423cb9250 [Gui] Show Preferences page by name rather than index 2024-12-16 13:47:54 -03:00
Roy-043 cb49d64bbe BIM: Fix ArchReference problem caused by TNP code
Due to TNP code Document.xml can contain (for example)` <Part ElementMap="0.4" file="Box001.Shape.brp"/>` instead of `<Part file="Box001.Shape.brp"/>`.
2024-12-16 15:29:25 +01:00
wmayer 8f9c76a95d Sketch: Fix possible crash in BSpline::splineValue
There is an underflow of an unsigned int in the calling instance that sets the parameter 'p' to 2**32-1.
But the size of the passed vector is 0. To fix the crash first check if p is less then the size of the vector.

See: https://forum.freecad.org/viewtopic.php?t=92815
2024-12-15 19:24:04 -03:00
wmayer 1b1927bed7 Test: Add unit test to read in 3MF file 2024-12-15 19:20:58 -03:00
wmayer b027cfbf2e Mesh: Improve 3MF format to support files from 'Make World' 2024-12-15 19:20:58 -03:00
Yorik van Havre 9ea63ce943 BIM: Fixed image loading of the tutorial - fixes #17863 2024-12-15 19:13:03 -03:00
Adrian Insaurralde Avalos b5ee6ef952 [Points WB] fix issue where points are inaccurately imported when the points are far from the origin. This PR checks if the bounding box contains the origin and offers to move it to the origin if not, addresses issue #5808
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Update src/Mod/Points/Gui/Command.cpp

backport of PR #17282
2024-12-15 18:11:13 -03:00
Florian Foinant-Willig 2ea219412b PartDesign: fix helix with negative angle 2024-12-15 16:55:18 -03:00
Syres916 92bbe88322 [Gui] Tree, set FontSize on start of application 2024-12-15 13:24:28 -03:00
Patryk Skowroński a1929d704a Update for 3Dconnexion NavLib integration (#18433)
* Fixed QuickZoom crash & picking in ortho view

* Fixed QuickZoom for high DPI screens

* Fixed return value for SetHitLookFrom

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

* Removed whitespace from GetPointerPosition

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

---------

Co-authored-by: Patryk Skowroński <pskowronski@3dconnexion.com>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2024-12-15 13:19:52 -03:00
Adrian Insaurralde Avalos 992c234e2c [TD] Backport PR #18083: Fix crash on no mdi (fix #16672)
[TD]add preference for auto workbench switch

[TD]prevent fail on auto switch to hidden tab

[TD]prevent crash on attempt to print hidden page

[TD]prevent use of non-exist/hidden tab in exports
2024-12-15 12:30:33 -03:00
wmayer 8aa75c09d1 PD: Fix possible crash in up to shape 2024-12-15 12:16:34 -03:00
Chris Hennes f7f3119d43 Merge pull request #17799 from Roy-043/Gui-FreeCAD-Light-PreferencePack-should-not-change-PickRadius
Gui: Remove rogue preferences from PreferencePacks (Light theme should not change PickRadius)
2024-12-07 13:04:52 +01:00
Roy-043 f0ef15df98 Merge pull request #18307 from Roy-043/Draft-Fix-make_point-color-regression
Draft: Fix make_point color regression
2024-12-05 12:10:37 +01:00
Roy-043 a7f1699e0d Merge pull request #18212 from Roy-043/Draft-Fix-finish-behavior-of-Draft_Edit-on-doc-close
Draft: Fix finish behavior of commands on doc close
2024-12-05 12:10:06 +01:00
Roy-043 f7f85143bb Draft: minor improvements for gui_edit.py (#17970)
* Draft: minor improvements for gui_edit.py

* Fix error...
2024-12-05 12:09:26 +01:00
Chris Mayo 366fe0b74e BIM: Replace use of ArchWorkbench in ArchSelectionObserver 2024-12-04 11:32:49 +01:00
Roy-043 b10f001c3a Merge pull request #18164 from Roy-043/Draft-Fix-cursor-scaling-for-xcb-platform
Draft: Fix cursor scaling for xcb platform
2024-11-29 18:01:57 +01:00
Roy-043 1372cdb506 Draft: fix color of arrays (#18123)
If `get_diffuse_color` returned a list with a single color, the list was wrongly multiplied. Regression introduced in V0.21, but in that version the error was masked by how Core handled the diffuse color.

Fixes #17052.
2024-11-29 18:01:09 +01:00
bdieterm 88fae786a5 Gui: use utf-8 encoding for saving recorded macros
FCMacros always have the header "# -*- coding: utf-8 -*".
But the QTextStream class in Qt5 does not always use utf-8 for saving the text file.
2024-11-29 13:56:17 -03:00
wmayer 865997597a Gui: Fixes #16637: Can no longer set transparency of Link faces 2024-11-28 17:20:57 +01:00
wmayer dc6d5e1e9f Core: Fix crash in ActiveObjectList
Forum: https://forum.freecad.org/viewtopic.php?t=91823
2024-11-28 17:16:55 +01:00
wmayer d88524b4f7 Core: Fix unicode path names under Windows 2024-11-26 10:22:32 -06:00
Chris Hennes b6ff2a67c6 Start: Show thumbnail if filename contains a dot
Backport of #18139
2024-11-26 08:59:22 -06:00
wmayer a15134d79b Core: Do not detach object from document before the call of breakDependency
This fixes #17900
2024-11-25 11:25:31 -06:00
PaddleStroke 80ec1e00b9 Assembly: Fix joints not being deleted when subassembly is deleted. 2024-11-25 11:21:01 -06:00
Roy-043 f1c740af0e Increase the delay to be on the safe side. 2024-11-25 15:03:42 +01:00
Roy-043 ff9b93de0d Draft: avoid listing status bar widgets in toolbar area context menu
Fixes #16832.

In V1.0 the two Draft status bar widgets appear as checkboxes without label in the toolbar area context menu. They should not be listed in that menu, as was the case in V0.21. Their visibility is controlled via preferences.

Additionally, in case the Draft WB is only preloaded, the widgets would display in another workbench. This is prevented by using a delay.
2024-11-25 15:03:25 +01:00
Roy-043 9c944183d0 BIM: Fix calculation of fence sections (#18042)
* BIM: Fix calculation of fence sections

The length  and placement of fence sections was only correct if they were cut to size.

* Fix required another change.
2024-11-25 14:57:28 +01:00
paul cd92e568d5 [Draft Gui_Stretch] Improve Stretch Rectangle Behaviour (#18063)
* [Draft gui_stretch] Improve Stretch Rectangle Behaviour

Feature Improvement discussed at FreeCAD Forum :
- https://forum.freecad.org/viewtopic.php?t=92124#p792118  (Draft_Stretching the whole rectangle creates a new wire)

Currently, 3 cases in general, proposed PR improve Case 3 below :

1. The original object is a Rectangle, if after stretching it is no longer a rectangle, it makes a copy turning it into a Wire which reflect the result of stretching.
   - Current behanviour is good for user, no change.
2. If after stretching it is still a rectangle, the code just resize the original.
   - Current behanviour is good for user, no change.
3. Now, if the user 'stretch' the whole rectangle, the code creates a copy as DWire in the 'stretched location'.
** - Users find this not intuitive, better just move the whole rectangle.
2024-11-25 14:55:54 +01:00
Roy-043 807d523660 BIM+Draft: Bring back human figure
* For the human figure attached to the Draft grid a hard-coded point list is used (instead deriving the points from human figure.brep). This is more efficient and avoids a dependency on the BIM WB.
* The default for the human figure preference of the grid was changed to false. And the tooltip adjusted.
2024-11-25 13:37:03 +01:00
wmayer 08fef7405c Core: Fix dangling pointer in SoFCUnifiedSelection::setSelection
This fixes #17965: Measurement: Crash when clicking on COM label
2024-11-22 17:04:10 +01:00
Roy-043 c1f45b0c96 Draft: Fix extra_scale error in hatch.py (#17715)
Fixes #17712.
2024-11-22 11:09:37 +01:00
Roy-043 a512314442 Draft: fix tray construction mode button for Light and Dark themes (#17886)
Fixes #17869.
2024-11-22 11:09:00 +01:00
Adrian Insaurralde Avalos 2fcc5317fe cmake: remove rc4 suffix from version info 2024-11-18 13:48:00 -03:00
Jiří Mácha 78a2a9c002 Assembly: fixed defect in the migrationScript4 function
The old CAD model created by the development version of FreeCAD
(in which the Assembly workbench was used) contained joints that,
for some reason, had an empty Joint Connector 1 reference (Reference1).

This was causing an exception and a crash of the Python function
called migrationScript4. The FreeCAD Report view contained:

23:28:29  pyException: Traceback (most recent call last):
  File "/FreeCAD/Mod/Assembly/JointObject.py", line 175, in onDocumentRestored
    self.createProperties(joint)
  File "/FreeCAD/Mod/Assembly/JointObject.py", line 181, in createProperties
    self.migrationScript4(joint)
  File "/FreeCAD/Mod/Assembly/JointObject.py", line 514, in migrationScript4
    if hasattr(joint, "Reference1") and joint.Reference1[0] is not None:
                                        ~~~~~~~~~~~~~~~~^^^
<class 'TypeError'>: 'NoneType' object is not subscriptable

This patch attempts to avoid such exceptions by validating the type of
the property variable before accessing it.
2024-11-18 10:46:53 -06:00
PaddleStroke 076623ef73 Assembly: Store DocumentObject instead of mbdPart for the dragged parts. Fixing the bug where doDragStep was 50% of time failing to find the correct DocumentObject due to bundling. 2024-11-18 10:44:03 -06:00
Jonas Bähr bbd366b5a7 CAM: Fix Helix Defaults in Setup Sheet
With PR #17655 (commit 1027926), the property "Direction" was changed
being an input to an output and the new "Cut Mode" took over (to
implement #14314). Unfortunately, this change was not reflected in the
Setup Sheet (or "Op Defaults" as it's called on the Job panel). This
commit fixes this.
2024-11-18 10:39:24 -06:00
Jonas Bähr 1ef5bd3fc3 CAM: Fix creating Helix on Prototype
For the "Op Defaults" from the setup sheet the operations get created
with a `OpPrototype` instead of a real document object. This prototype
provides only a small subset of FreeCAD's document object API. When a
new Job is created via the GUI, each registered operation is created
with such a dummy to populate the setup sheet panel. And if such an
operation uses document APIs not provided by the prototype, the enire
job creation fails, see #17871.
Unfortunately we don't have tests for the GUI part, where all the
operations are regsitered and thus the integration with all of them
could be verified, this I just created a local test for the helix, where
the actual issue was reported -- this can be verified with headlessly.
2024-11-18 10:39:11 -06:00
Adrián Insaurralde Avalos 83646753e0 Update version to 1.0.0RC4 2024-11-13 22:01:49 -03:00
PaddleStroke bdcf40a17c Assembly: JointObject refactor adaptUi 2024-11-13 12:15:16 -03:00
PaddleStroke 24e5b181b5 Assembly: Improve joint taskbox offset ui. 2024-11-13 12:15:16 -03:00
Adrián Insaurralde Avalos d548f81525 Revert "Assembly: JointObject refactor adaptUi"
This reverts commit 00c992ff34.
2024-11-13 12:15:16 -03:00
Adrian Insaurralde Avalos 3c1047103c Update version to 1.0.0RC3 2024-11-11 18:23:38 -03:00
wwmayer 47d557545e PD: Add test case for #17184 (#17707) 2024-11-11 18:21:43 -03:00
Adrian Insaurralde Avalos 487b206edb Gui: extend version info to specify flatpak and conda builds 2024-11-11 15:30:59 -03:00
Alfredo Monclus 411b6cf4e9 fix(PD): initialization of thread class and fit 2024-11-11 14:19:37 -03:00
Yorik van Havre 70f8141a7d Merge pull request #17655 from jbaehr/cam-fix-rename-cw-ccw-climb-conventional
CAM: Fix CW/CCW to Climb/Conventional rename
2024-11-11 18:03:50 +01:00
marioalexis e4fefd67b0 Fem: Save empty UUID if customizing material from task panel 2024-11-11 13:59:23 -03:00
marioalexis bfe65acf87 Fem: Use quantity spin boxes in material task panel 2024-11-11 13:59:23 -03:00
marioalexis b84e78ac2c Fem: Use new material editor in materials task panels - fixes #16814 2024-11-11 13:59:23 -03:00
marioalexis 6943363280 Material: Propagate changes to MaterialTreeWidget even if UUID does not change 2024-11-11 13:59:23 -03:00
wmayer 9b67ca9c42 Assembly: Handle thrown Base::Exception in ViewProviderAssembly 2024-11-11 13:56:29 -03:00
wmayer 0df319e430 Core: In View3DInventorViewer::getPointOnXYPlaneOfPlacement throw exception
If no intersection point can be found throw a Base::RuntimeError
2024-11-11 13:56:29 -03:00
PaddleStroke 7601857582 Techdraw: Fix assembly exploded view (#17726) 2024-11-11 13:53:52 -03:00
Eric Price 7d28404ad8 Part: bugfix #17468 recursively unpack compounds for boolean fuse (#17469)
* fix #17468  recursively unpack compounds for boolean fuse

* fix and into &&, add ctest case for multifuse with compounds and recursive compounds

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unneeded duplicated code - allow Part::Common to be created with a single object (compound or shape) - will result in Unity and possibly a warning message

* prevent endless loop in case of endless recursive compounds as suggested in chat

* Update src/Mod/Part/App/FeaturePartFuse.cpp

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

* implemented suggestion by wwmayer

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2024-11-11 13:52:19 -03:00
Florian Foinant-Willig 5ea9a672c3 Fix revolution with ShapeBinder profile (#17489)
* Fix revolution with ShapeBinder profile

* Remove log level init

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-11-11 13:48:35 -03:00
Eric Price 6d68d22258 increase tolerance on helical shapes to avoid crash / broken geometry (#17356)
* increase tolerance on helical shapes to avoid crash

fix #17113
fix #9377
fix #11083

* added test cases for additive and subtractive helix

* fixed whitespace issue, reduced turncount for speed

* relaxed large scale testcases for OCCT 7.3 and below, work around windows CI error #17394

* Further reduce max size in test for buggy Ubuntu OCCT
2024-11-11 13:45:49 -03:00
Eric Price 8362c5af8b Fix boolean operations (#17119)
* add BRepAlgoAPI wrapper files to CMakeList

* introduce wrapper for BRepAlgoAPI_BooleanOperation and derivatives, set sensible default Fuzzyness for boolean operations

* allow default fuzzyness to be set in settings - including off

* backwards compatibility with OCCT 7.3.3 - removed newer paramateres from wrapper

* added missing header

* reverted src/Mod/Part/App/OpenCascadeAll.h to original state

* implement some changes suggested by @wwmayer

* removed unneeded destructor definitions

* moved getDefaultFuzzyValue into its own helper class

* removed unneeded references to base class default constructor

* default to SetRunParallel(Standard_True) as suggested by @FlachyJoe

* fixed license header as requested

* Added new method to autocalculate fuzzyness to BooleanOperation base class and use it for those parts that do not call the obsolete constructor but also do not set precision

* implemented static variable solution as suggested by @wwmayer

* added helix for test case

* Refactoring FCRepAlgoAPI to FCBRepAlgoAPI

* Added Test Case (fuse cylinder with helix with different working and non-working Fuzzy values)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* increased default value of FuzzyBoolean and made tests more robust for compatibility with OCCT 7.3

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixes for FREECAD_USE_PCH - allow testing of FREECAD_USE_PCH on linux with cmake switch (default OFF)

* removed surplus line - wasn't needed after all

* included precompiled as instructed

* set anti-corruption flag in boolean operations, ensures source shape is not damaged in OCCT 7.1 and higher

* fix #17085

* disable subtests that were too specific for now

* fixed all CLI tests - see comments in Pull Request https://github.com/FreeCAD/FreeCAD/pull/17119#issuecomment-2420772452

* Update src/Mod/PartDesign/PartDesignTests/TestTopologicalNamingProblem.py

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

suggested updated test by CalligaroV

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* Update tests/src/Mod/Part/App/TopoShapeExpansion.cpp

Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>

* remove surplus tests from github suggestion interface bug

* hide the BooleanFuzzy variable - can now be only set by manually editing the config file
i
in FCParamGroup "Boolean"
<FCFloat Name="BooleanFuzzy" Value="10.000000000000"/>

* Suggestion by @FlachyJoe - add validity checks to the base and tool shape in any direct boolean op

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vincenzo Calligaro <vincenzo.calligaro@gmail.com>
2024-11-11 17:36:30 +01:00
paul 51449826a3 ArchWall : Bug Fix Length Property Accuracy Problem (#17496)
* ArchWall : Bug Fix Length Property Accuracy Problem

See https://github.com/FreeCAD/FreeCAD/issues/15794

* [ArchWall] Fix regression with multi-material and align center

* ArchWall - Regression Typo

---------

Co-authored-by: Yorik van Havre <yorik@uncreated.net>
2024-11-11 17:26:55 +01:00
Roy-043 10ccab5227 Draft: Fix Shape2DView finish bug
The Draft_Shape2DView did not finish properly if no object was selected.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=92031
2024-11-11 17:15:52 +01:00
Yorik van Havre 5b00d7f1f2 Translations 2024-11-11 17:09:27 +01:00
Jonas Bähr 1027926be9 CAM: Configure Helix via CutMode, not Direction (#14314)
To harmonize the various CAM operations, the helical drill shall also be
configured using the cut mode (Climb/Conventional) just like Pocket or
FaceMill.
This means, the path direction (CW/CCW) is now a hidden read-only output
property, calculated from the side (Inside/OutSide) and the here newly
introduced cut mode.
The spindle direction is not yet taken into account and is always assumed
to be "Forward".
The GUI strings are kept compatible with what RP#14364 introduced becasue
of the v1.0 release string freeze. They need revision once back on the
main branch.
2024-11-10 23:23:23 +01:00
PaddleStroke 97aef3b3b1 Sketcher: Dimension: Handle case of vertical/horizontal lines 2024-11-09 10:00:08 -06:00
Roy-043 12e15dc739 Draft: Fix _param_observer_callback_scalemultiplier error
Fixes #17741.
2024-11-09 09:27:25 -06:00
marioalexis 9291671fe1 Fem: Fix spelling in Netgen enumeration property 2024-11-09 09:25:36 -06:00
wmayer df971b1014 Material: Replace YAML::LoadFile() with YAML::Load()
YAML::LoadFile() cannot be used on Windows because it doesn't support UTF-16 to load a file from an arbitrary location

This fixes #17097
2024-11-09 09:23:33 -06:00
PaddleStroke cd138ae5d7 Assembly: Fix problem with App::Link to AssemblyObject : they would not go back to position. 2024-11-09 09:20:54 -06:00
PaddleStroke c15e018bb1 Assembly: Fix regressions of https://github.com/FreeCAD/FreeCAD/pull/16671 2024-11-09 09:20:39 -06:00
PaddleStroke 00c992ff34 Assembly: JointObject refactor adaptUi 2024-11-09 09:13:25 -06:00
PaddleStroke 7ab212dced Update CommandExportASMT.py 2024-11-09 09:10:35 -06:00
Jonas Bähr 509fef6877 Revert "CAM: Rename CW/CCW to Climb/Conventional for consistency (#14364)"
This reverts commit 7e62d07538 and adapts
to the in between commits where necessary.
 - CAM: apply precommit 7274dac185
 - CAM: rename "Tests" to "CAMTests" 2ff4914fd8

Motivations for the revert:
 - Instead of actually implementing #14364 only a search and replace in
   the enums values has been performed. But this does not mean the
   feature is there, becasue "climb"/"conventional" milling depends not
   only on the path's direction, but also on the spindle direction and
   whether the milled feature is "inside" or "outside".
 - In half of the cases of every changed operation or dressup, depending
   on whether we mill "inside" or "outside", we now get the wrong results.
 - In the (rarer) case of a reversed spindle direction, the "other half"
   is wrong.
 - Files created with previous versions of FreeCAD cannot be recomputed
   any longer because there were no precautions on document restore.
 - In files created with previous versions of FreeCAD one cannot change
   the broken operation as the choices are now invalid.
 - The original search/replace was incomplete.
 - Only property values have been changed, the property names are still
   inconsistent ("Direction" vs "Cutting Mode").
 - The original search/replace also changed internal APIs where the
   "climb"/"conventional" wording is not applicable as there is no
   notation of "inside"/"outside" or "forward"/"reverse". If only the
   path's direction is concerned, "CW"/"CCW" fits better.
2024-11-08 23:02:44 +01:00
Jonas Bähr 2df29a80f4 CAM: Fix and enable TestPathHelix again
Since the fixture in use has holes smaller than the default tool dimeter,
executing a helix operation with default parameters (i.e. all holes)
used to fail with an exception. Some tests work around this by actively
chaning the tool diameter, and this fix is now moved into the global
setup where the respective fixture is loaded.

The reason why the tests got disabled in the first place is unclear.
2024-11-07 22:31:32 +01:00
Roy-043 9b3329ff9c Draft: avoid race condition in todo code
The doTasks function is called multiple times when using Draft tools. In some cases the ToDo.commitlist belonging to a previous call was not fuly processed, resulting in the same list being processed twice. To avoid this the list is stored as a local variable and then immediately reset.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=91832
2024-11-07 11:13:58 +01:00
Yorik van Havre ac9b2da210 Merge branch 'releases/FreeCAD-1-0' of github.com:FreeCAD/FreeCAD into releases/FreeCAD-1-0 2024-11-07 09:41:44 +01:00
Benjamin Bræstrup Sayoc 53ef8030ca [Gui] Fix 100% CPU usage due to StartView (#17565)
* [Gui] Fix 100% CPU usage due to StartView

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-06 13:50:21 -06:00
marioalexis 5f8ae401d3 Fem: Prevent race condition between signals in timer update 2024-11-06 13:43:12 -06:00
wmayer 41806782e7 Import: Fix index error with legacy STEP export
Fixes #17677
2024-11-06 12:53:54 -06:00
wmayer af993d1f6b Core: Generate a static random number in Application::applicationPid()
Using Qt's QCoreApplication::applicationPid() doesn't always give a unique ID so that multiple FreeCAD instances cannot be executed at the same time.
This fixes #17678
2024-11-06 12:52:48 -06:00
Benjamin Bræstrup Sayoc 52cf32c910 [Gui] Fix 100% CPU usage due to StartView (#17565)
* [Gui] Fix 100% CPU usage due to StartView

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-06 16:11:59 +01:00
Chris Mayo e495f83667 Mod: Remove Doxygen special commands from Python docstrings
These don't work by default in Doxygen [1] and cause Python syntax
warnings.

[1] https://www.doxygen.nl/manual/docblocks.html#pythonblocks
2024-11-05 16:19:03 -06:00
wmayer ddb42b134e PD: Fix default display mode of ViewProviderBoolean
Make sure that by default display mode is set to 'Flat Lines' instead of 'Group' as otherwise it won't show the result object
2024-11-05 15:24:51 -06:00
Eric Price fd64529bfe FEM: Allow assigning materials to compounds to avoid having to assign the same material by hand to all subsolids (#17562)
* fix #17561

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added missing code to have it also work without MeshRegions

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-05 10:15:38 -06:00
Jarno de Wit 7293718606 Fix excessive selection pruning in dae exporter for PartDesign Objects (#17529) (#17654)
* Fixes excessive export selection pruning for PartDesign objects (#17529)

* Raises selection prune message log-level from Log to Warning (#17529)
2024-11-05 14:44:51 +01:00
mwganson df18d88d96 [Sketcher] Address issue #17629, where Attach sketch command allows sketch to be attached to itself 2024-11-05 14:41:34 +01:00
Yorik van Havre 3b7bae0323 BIM: Fixed imports of IfcOpenShell 0.8 - fixes #17628 2024-11-05 14:28:41 +01:00
Chris Mayo 66a2163104 BIM: Fix imports of Python importers 2024-11-05 13:00:02 +01:00
Jonas Bähr 96fa7efee5 CAM: Add tests loading a helical path created with v0.21
This demonstrates a regression introduced with PR #14364, where documents
containing helix operations cannot be recomputed any more (see #15643).
This is in preparation for a fix and to ensure we don't break it again.
The fixture has been created with the official mac build of FreeCAD-0.21.1
2024-11-04 22:54:09 +01:00
marioalexis 81a28b5402 Fem: Print real-time log messages in mesher task panels - fixes #17594 2024-11-04 12:34:17 -06:00
PaddleStroke f5fa6f80b3 Assembly: Fix reverse button in joint task (#17663) 2024-11-04 11:23:33 -06:00
PaddleStroke 2958940463 Update JointObject.py 2024-11-04 11:18:30 -06:00
wmayer 644f0bf48b PD: If needed open another transaction for sketch creation
When creating a sketch in PartDesign a dialog is opened that gives the user the possibility to perform another action that may close the
active transaction. To make sure the creation of the sketch can be undone a new transaction must be opened.
2024-11-04 11:14:36 -06:00
wmayer f2bf2a4bcc Core: Fixes #17553 2024-11-04 11:14:36 -06:00
wmayer 8e3b8e3172 Tests: Add unit test to demonstrate failure of #17553 2024-11-04 11:14:36 -06:00
wmayer c7f40bc111 Core: Write a log message instead of warning when locking a file fails 2024-11-04 11:09:06 -06:00
wmayer 9daf71417a Core: Add wrapper function Application::applicationPid() 2024-11-04 11:09:06 -06:00
wmayer 94adf177ee Core: Don't freeze application if lock file already exists 2024-11-04 11:09:05 -06:00
PaddleStroke eff8826ca7 Assembly: Joint creation: add expression support to spinboxes 2024-11-04 11:07:25 -06:00
mwganson 6cd80f52f3 [Part Booleans] fix issue with copying visuals when doing Part workbench booleans using App::Part objects, see https://forum.freecad.org/viewtopic.php?t=91813&sid=eea2494d6d02882c3be7df74d7e2b689 2024-11-04 11:02:44 -06:00
WandererFan e1948f79d4 [TD]handle short&wide hatch area (#17630)
* [TD]handle short&wide hatch area

* [TD]sync .h and .cpp parameter names
2024-11-04 11:01:42 -06:00
James e57599c3f0 Safe mode message added as per #17580 (#17640)
* Safe mode message added as per #17580

* Fixed extra whitespace after return

Removed extra whitespace after return spotted by @hyarion

* Incorporated comments by @hyarion
2024-11-04 11:00:38 -06:00
Bas Ruigrok 4b5e09043d Gui: Fix camera behavior when rotation center is far from object
Also fixes a regression in turntable navigation speed
2024-11-04 10:59:31 -06:00
wmayer 7a48443897 DAG: Add method hasRecord() and use it in Model::slotChangeObject
to avoid a possible failing assert().

Fixes #17572
2024-11-04 10:57:09 -06:00
Benjamin Nauck a3f8ec0fd4 macOS+win+qt6.4+: Hide classic and auto choose light or dark mode depending on os setting (#17410)
* mac, win, qt6.4+: Hide classic and auto choose light or dark mode

* Add dark mode qt6.5 check

* Start: Add QStyleHints to PreCompiled.h

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-11-04 10:55:56 -06:00
David Carter 364ae2ca12 Materials: Disable editor right click menu
The right click context menu in the materials editor was implemented
as a place holder but is currently non-functional. It should be
disabled for 1.0. This will be revisited post 1.0 as all editor
functionality is reviewed and improved.

Fixes #17110
2024-11-04 10:51:11 -06:00
wmayer 7082b086a5 Mat: Clean-up code in DlgDisplayPropertiesImp 2024-11-04 10:44:17 -06:00
wmayer 279e39bd2b Mat: Tmp. block signals of material widget
Fixes #17523
2024-11-04 10:44:17 -06:00
Adrian Insaurralde Avalos 4ebf28b6a4 CAM: rename "Tests" to "CAMTests" to avoid python name conflicts 2024-11-04 10:36:32 -06:00
Yorik van Havre 1d11f0b9e7 BIM: Fixed case bug in library tool 2024-11-04 14:48:52 +01:00
Chris Mayo 62ff8820dd BIM: IFC explorer Qt 6 compatibility and other fixes (#17649)
* BIM: IFC - Fixes for Qt 6 due to QtGui.QFont.setWeight()

PySide6 replaced:
  PySide6.QtGui.QFont.setWeight(int)

with:
  PySide6.QtGui.QFont.setWeight(PySide6.QtGui.QFont.Weight)

* BIM: Fix IFC explorer addEntity() and addProperties() on Qt 6

Qt 6 removed QTreeWidget.setFirstItemColumnSpanned()

https://doc.qt.io/qt-5/qtreewidget-obsolete.html#setFirstItemColumnSpanned

Running the Python command 'BIM_IfcExplorer' failed:
Traceback (most recent call last):
  File "/usr/lib64/freecad/Mod/BIM/bimcommands/BimIfcExplorer.py", line 170, in Activated
    self.open()
  File "/usr/lib64/freecad/Mod/BIM/bimcommands/BimIfcExplorer.py", line 223, in open
    self.addEntity(eid, children, self.tree)
  File "/usr/lib64/freecad/Mod/BIM/bimcommands/BimIfcExplorer.py", line 455, in addEntity
    self.tree.setFirstItemColumnSpanned(item, True)

* BIM: Fix IFC explorer exception on toggle mesh

Traceback (most recent call last):
  File "/usr/lib64/freecad/Mod/BIM/bimcommands/BimIfcExplorer.py", line 278, in toggleMesh
    import importIFCHelper
ModuleNotFoundError: No module named 'importIFCHelper'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/freecad/Mod/BIM/bimcommands/BimIfcExplorer.py", line 282, in toggleMesh
    import importIFC
ModuleNotFoundError: No module named 'importIFC'

* BIM: Fix IFC explorer layout warnings

QLayout: Attempting to add QLayout "" to QDialog "IfcExplorer", which already has a layout
QLayout: Attempting to add QLayout "" to QDialog "IfcExplorer", which already has a layout

https://doc.qt.io/qt-6/qtwidgets-tutorials-widgets-nestedlayouts-example.html

* BIM: Output an error if IFC explorer can't explore a file

---------

Co-authored-by: Roy-043 <info@b-k-g.nl>
2024-11-04 14:02:44 +01:00
PaddleStroke 4bee4ca3dd Sketcher: DrawSketchHandlerRotate : Fix unwanted copy of DistanceX/Y constraints 2024-10-31 15:30:28 -05:00
PaddleStroke 17a7ddee2f Formating PythonConverter.cpp 2024-10-31 15:30:18 -05:00
PaddleStroke 52903e281c Sketcher: PythonConverter: use getRange to handle bad arcs. 2024-10-31 15:30:10 -05:00
marioalexis 9cfec546cc Fem: fix Gmsh analysis mesh groups - fixes #17427 2024-10-31 15:29:14 -05:00
wmayer e4a24f0789 Core: Fix compiler warning 2024-10-30 18:14:36 -05:00
wmayer b67d2d0881 Fix compiler warnings 2024-10-30 18:14:36 -05:00
Eric Price 29f2dbdebf fix #17578 - RIP bgbsww , don't worry, we got this. 2024-10-30 18:12:51 -05:00
Ulices 6945472e36 Help: Fix function return to avoid error when clicking URL on built-in browser (#17498)
* Help: Fix function return to avoid error when clicking URL on built-in browser

* fixup! Help: Fix function return to avoid error when clicking URL on built-in browser

Co-authored-by: Yorik van Havre <yorik.vanhavre@gmail.com>

---------

Co-authored-by: Yorik van Havre <yorik.vanhavre@gmail.com>
2024-10-30 12:52:13 +01:00
PaddleStroke ee60379138 Core: Enable TaskDialogs to associate view (#17373)
* Core: Add possibility for task dialogs to associate a view and be able to close when associated view is closed.

* TaskImage: Use task dialog view association.

* Sketcher: Use task dialog view association. Preventing crash (https://github.com/FreeCAD/FreeCAD/issues/16702)

* EditableDatumLabel: Use QPointer to prevent crash
2024-10-29 10:01:41 -05:00
hoshengwei 42832ee6af Fix IFC export elevation with wrong unit 2024-10-29 15:14:39 +01:00
David Carter ec2f666344 Materials: Selectively apply appearances
Change the appearance only if the appearance hasn't been set explicitly.
A cached material appearance is used to see if the current appearance
matches the last material. It is also compared against an empty
material to see if the saved material value has been initialized.

This solves the problem of material changes overwriting appearance
changes
2024-10-28 21:49:55 -05:00
Adrian Insaurralde Avalos 065029b6a0 Gui: show cpu architecture in version info instead of word size
Fix #15833
2024-10-28 21:48:43 -05:00
Benjamin Nauck 6fea3dc5f4 Fix crashes when importing and opening .csv files on macOS (#17084)
* Open recent documents from start same way as in menu

* Make insert spreadsheet create document if not available.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
# Conflicts:
#	src/Mod/Start/Gui/StartView.cpp
2024-10-28 21:46:55 -05:00
Bas Ruigrok 52982c0c67 Gui: Correct spin sensitivity 2024-10-28 12:08:09 -05:00
Bas Ruigrok f313de1ce3 Gui: Set spin projector sphere depending on rotation center 2024-10-28 12:08:08 -05:00
Adrian Insaurralde Avalos 82204a7b06 Gui: use wildcard for some warnings filters. Fix #16687 2024-10-28 11:39:29 -05:00
Adrian Insaurralde Avalos a435a81c8a Fix OpenSCAD test failing when using pipe transfer mechanism 2024-10-28 11:34:36 -05:00
Pieter Hijma edbfbe40f5 Gui: Make VarSet dialog modal
Also tracks its own transactions to prevent interfering with other
transactions.
2024-10-28 11:33:25 -05:00
wmayer 231d734b7c Draft: Fixes #17461 2024-10-28 11:31:41 -05:00
wmayer 216b130761 Core: Extend DocumentObjectPy
* expose isAttachedToDocument to Python
* change DocumentObjectPy::getName() to return None instead of throwing an exception if object is not part of a document
2024-10-28 11:31:41 -05:00
wmayer c6a6e9d4b0 Sketch: Make sure that variable 'ActiveSketch' is defined in macro
Fixes #17502
2024-10-28 11:24:00 -05:00
Yorik van Havre dc230a8ce0 Draft: Warn user if using trimex on unsupported curve type - fixes #17346 2024-10-28 11:12:17 -05:00
marioalexis 57a6c5aed7 Fem: Remove unnecessary system name check 2024-10-28 11:11:18 -05:00
mwganson 69e40ba5c7 [Macros Dialog] Fix broken toolbar walkthrough 2024-10-28 11:10:26 -05:00
PaddleStroke c0db00e5cd Assembly: AssemblyLinks. 2024-10-28 11:07:47 -05:00
PaddleStroke 69df04e6a6 Assembly: Create SoSwitchMarker.py to externalize the coin stuff that draw the joint's markers(JCS) 2024-10-28 11:07:47 -05:00
PaddleStroke eb352fe34f Assembly: Joint creation UI : add advanced offset handling. 2024-10-28 11:07:46 -05:00
Yorik van Havre e3aa8ef9b8 BIM: Fixed export of boolean IFC properties - fixes #17425 2024-10-28 10:58:45 -05:00
Yorik van Havre 6029b79885 Draft: Fixed trimex bug when snapping to itself - fixes #17345 2024-10-28 10:58:07 -05:00
Yorik van Havre 1c6e5b9664 BIM: Fixed online search mode - fixes #17353 2024-10-28 10:51:46 -05:00
Benjamin Bræstrup Sayoc cd99adc094 [Gui] Make styles update on paint (#17376)
* [Gui] Make styles update on paint

Fixes #15756. Similar implementation to that already in FileCardDelegate.cpp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-28 10:48:58 -05:00
Benjamin Nauck 734b327ef0 Reuse Std_Delete shortcut instead of hardcoding Delete (#16682)
* Reuse Std_Delete shortcut in TaskBooleanParameters

* Reuse Std_Delete shortcut in TaskDressUpParameters

* Reuse Std_Delete shortcut in TaskLoftParameters

* Reuse Std_Delete shortcut in TaskPipeParameters

* Reuse Std_Delete shortcut in TaskSapeBinder

* Reuse Std_Delete shortcut in TaskTransformedParameters

* Reuse Std_Delete shortcut in TaskExtrudeParameters

* Reuse Std_Delete shortcut in TaskSections

* Reuse Std_Delete shortcut in MaterialSave

* Reuse Std_Delete shortcut in Array2D

* Reuse Std_Delete shortcut in TaskFemConstraint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-28 09:51:52 -05:00
wandererfan 471fce1f50 [TD]remove spurious mouseReleaseEvent (fix #17519) 2024-10-28 09:47:53 -05:00
wandererfan 5e8e6568e9 [TD]fix line style regression from #17331 2024-10-28 09:47:28 -05:00
wandererfan e0f6298d5d [TD]handle cut profiles with only a single edge 2024-10-28 09:46:54 -05:00
wandererfan 9fcb04c0b3 [TD]do not mark document as changed after print 2024-10-28 09:46:23 -05:00
wmayer 146f5055d7 Core: Refactor Document::setEdit 2024-10-27 13:13:38 -05:00
Benjamin Nauck 2d14dcec7d Repost QFileOpenEvent event to avoid an undefined state 2024-10-25 12:25:31 -05:00
marioalexis fe8f0acbef Fem: Do not try to set EndStep property for legacy Netgen 2024-10-25 12:11:28 -05:00
PaddleStroke c6e0f838ba Fix circle tangent issue 2024-10-25 10:03:59 -05:00
mwganson cd74b7b5ea [Part RuledSurface] fix issue where ruled surface is failing if both edges are from same object and the object is not at the identity placement, addresses issue #17235 2024-10-25 09:59:25 -05:00
wmayer 9854b2a3c8 Core: Handle possible nested calls of TreeWidget::onUpdateStatus()
Fixes #17460
2024-10-24 23:11:53 -05:00
PaddleStroke a76027ce91 Assembly: CommandInsertLink: Hide hidden objects 2024-10-24 23:08:05 -05:00
Pieter Hijma 72316d0f96 Gui: Fix tooltip/documentation in VarSet dialog 2024-10-24 23:01:24 -05:00
PaddleStroke e9b9c788d2 Sketcher: Symmetric: Do not copy names of constraints (#17433)
* Sketcher: Symmetric: Do not copy names of constraints

* Sketcher: Symmetric : Fix https://github.com/FreeCAD/FreeCAD/issues/17442
2024-10-24 22:59:15 -05:00
Jiří Pinkava 2cfa89fb56 Disable Qt bug 129596 workeround for QT >= 6.8.1
The fix is also in 6.5.8+, but honestly I would not bother ...
2024-10-24 22:30:54 -05:00
Kacper Donat d046d4848b PD: Fix TwoLengths and Midplane both enabled
This scenario makes no sense, so it is removed from the code.
2024-10-24 22:29:54 -05:00
wmayer d7bcba730c Test: Add test for MeasureDistance with two circles 2024-10-24 21:56:22 -05:00
wmayer 8c1c24656a Measure: When measuring the distance between circles then use the center points as reference
See forum: https://forum.freecad.org/viewtopic.php?t=91570
2024-10-24 21:56:22 -05:00
PaddleStroke 4432d6dc16 Update Workbench.cpp 2024-10-24 21:54:02 -05:00
PaddleStroke 8780c645b7 Part Design: Remove legacy/modern workflow checks. 2024-10-24 21:54:02 -05:00
Michael Fuchs ff3729614e Remove unused LibraryInfo class 2024-10-24 21:51:37 -05:00
Michael Fuchs be3307d198 Inject version information into 3rd Party libraries html 2024-10-24 21:51:37 -05:00
Michael Fuchs e2956efcb1 Replace About/Libraries with ThirdPartyLibraries.html
Use system browser to open external links
2024-10-24 21:51:37 -05:00
mwganson 515b9b0ef9 [Python Console] prevent crash on autocomplete if python module is invalid, fixes issue #17299 2024-10-24 21:23:47 -05:00
Roy-043 c3565499f2 Updated 2 file paths to make the code work with AppImage
As advised in this forum post:
https://forum.freecad.org/viewtopic.php?p=788556#p788556
2024-10-24 14:09:41 +02:00
Roy-043 41b5df3883 Draft: fix errors in draft_test_objects.py
* Label property TextSize should be FontSize.
* Added missing recomputes.
2024-10-24 14:09:26 +02:00
wmayer e3bf086e49 Start: Use ModuleIO in StartView::fileCardSelected 2024-10-22 22:50:44 -05:00
wmayer 25bfdc92c8 Core: Use ModuleIO in MainWindow::loadUrls 2024-10-22 22:41:38 -05:00
wmayer 6df7231cfb Core: Use ModuleIO in RecentFilesAction & RecentMacrosAction 2024-10-22 22:41:35 -05:00
marioalexis 5b68566b5b Fem: Netgen meshing parameters improvements 2024-10-22 22:41:01 -05:00
pre-commit-ci[bot] 71734d87ac [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-22 22:39:37 -05:00
wmayer 569c2f9538 Measure: Use Base::toDegrees to convert radian to degree 2024-10-22 22:39:28 -05:00
wmayer 969b0dad8d Robot: Use Base::toRadians to convert degree to radian 2024-10-22 22:39:17 -05:00
wmayer 4b9d03772f Part: Use Base::toRadians to convert degree to radian 2024-10-22 22:38:00 -05:00
Yorik van Havre 0101b5dfc7 Revert "Horrible hack to work around bug in OCCT7.7.2"
This reverts commit 60640fa441.
2024-10-22 13:28:17 +02:00
Chris Mayo 3ea129fa0b Tux: Avoid warning on startup when BIM is not installed
os.listdir() raises an exception if modpath does not exist.
2024-10-22 11:02:54 +02:00
Roy-043 c4854b8cba Draft: suppress patharray offset warnings if values are already zero
See forum topic:
https://forum.freecad.org/viewtopic.php?t=91517
2024-10-22 10:52:30 +02:00
Benjamin Nauck e6f97126d3 Remove broken robot example file
fixes #17303
2024-10-21 21:03:11 -05:00
marioalexis 1f27df4e9c Fem: Set startupinfo for gmsh subprocess - fixes #17298 2024-10-21 21:00:29 -05:00
Adrián Insaurralde Avalos 597d417564 Gui: extend warning filters
filter out:
-qt.qpa.wayland
-kf.config.core
-kf.kio.widgets
-kf.service.sycoca
-kf.solid.backends.udisks2
2024-10-21 11:33:35 -05:00
PaddleStroke ab7987a149 Core: Fix Ctrl-deselection issue 2024-10-21 11:31:16 -05:00
David Carter c9f0b81855 Materials: Child ignoring parent material
Inherit the material from the parent object when creating a new object,
such as during a boolean operation, or when extruding a sketch.

fixes #15503
2024-10-21 11:20:30 -05:00
wmayer 109f481a6d Core: Set unit scheme when switching between unsaved documents
Fixes #17297
2024-10-21 11:17:37 -05:00
Chris Mayo ddfdb2ee10 CMake: Add inter-module dependency of ReverseEngineering on Points
Building with -DBUILD_POINTS=no -DBUILD_REVERSEENGINEERING=yes fails with:

src/Mod/ReverseEngineering/App/AppReverseEngineering.cpp
src/Mod/ReverseEngineering/App/AppReverseEngineering.cpp:36:10: fatal error: Mod/Points/App/PointsPy.h: No such file or directory
   36 | #include <Mod/Points/App/PointsPy.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
2024-10-21 11:13:29 -05:00
wmayer d59160b2ce PD: Explicitly switch off AllowCompound for some tests to make them succeed
Fixes #17363
2024-10-21 11:12:50 -05:00
Chris Mayo 4014ae1dc9 CMake: Add inter-module dependency of Part on Material
Building with -DBUILD_PART=ON and -DBUILD_MATERIAL=no fails with:

/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lMaterials: No such file or directory
collect2: error: ld returned 1 exit status
2024-10-21 11:12:07 -05:00
Michael Fuchs bad2d2a37a Switch back to default filename for exports after the active document changes. Fixes #16839 2024-10-21 11:10:51 -05:00
Benjamin Nauck 5f303edf30 Add "Safe mode" which temporarily disables configs and addons (#16858)
* Add safe-mode which starts freecad in a clean environment

* Integrate safe-mode

* Show "(Safe Mode)" in main window title

* Show safe mode info when safe mode is started

* Created Safe Mode Icon

* Use new icon

* Add PreCompiled.h

* Add exports for windows

---------

Co-authored-by: Gabriel <gaz082@gmail.com>
2024-10-21 11:09:03 -05:00
Eric Price 4322c16e0f disable tesselation limit in ViewProviderGUI to prevent large parts from freezing FreeCAD 2024-10-21 10:59:03 -05:00
wandererfan 718c2746ae [TD]Fix leader line style (fix #17307) 2024-10-21 10:58:03 -05:00
PaddleStroke 16277b2f8d Fix datum not being cancelled 2024-10-21 10:56:58 -05:00
Yorik van Havre a338d8f544 BIM: Better objects filtering when IFC locking/unlocking - fixes #17193 (#17285) 2024-10-21 10:55:24 -05:00
wmayer c3e3d2ec99 Part/PD: Fix cone creation if both radii are equal
The cone features in Part and PartDesign automatically create a cylinder if top and bottom radius are identical. However, the algorithm
ignores the angle and always creates a full cylinder.
2024-10-21 10:53:36 -05:00
marioalexis 96e65ac0f6 Fem: Set converted property value after property type change 2024-10-21 10:43:27 -05:00
Jiří Pinkava 7a342d11fb Sketch: refactor GeoHistory 2024-10-21 10:42:03 -05:00
wmayer 4c71f47f9b Core: Add convenience class ModuleIO to open files 2024-10-21 10:40:18 -05:00
mwganson c3ecbcef21 [PartDesign DuplicateSelected] do not put duplicated feature into active body if it is already in another body -- addresses issue #6278 2024-10-21 10:37:26 -05:00
Adrian Insaurralde Avalos 7094af67f5 Gui: try calling graphviz binaries from PATH by default [fix #15224] 2024-10-21 10:33:04 -05:00
Florian Foinant-Willig 24bbd0769e Fix uptoshape crash when selecting a face without assigned shape 2024-10-17 20:26:27 -05:00
PaddleStroke 48beaa066e Assembly: Fix limits disappearing on edit (#17289) 2024-10-17 20:23:42 -05:00
Yorik van Havre b4cee0cd18 GUI: Added dedication to @bgbsww in about dialog/credits 2024-10-17 20:17:57 -05:00
Pieter Hijma d7a3517296 Core: Fix VarSet add property dialog Esc segfault (#17215)
* Core: Fix VarSet add property dialog Esc segfault

* Core: Improve the way disconnect is handled

* Core: Add a check for a non-existing property
2024-10-17 20:15:04 -05:00
PaddleStroke 8dd04d5fb3 Fix regressions of #16726 2024-10-17 20:13:47 -05:00
Roy-043 79e0e72aca Draft: Improve layer drag-drop fix.
The fix in #16212 only checks the LayerContainer for layers. Since we do not stop users from moving layers out of that container, we should search the whole document instead.

Fixes: #16201.
2024-10-17 12:30:42 +02:00
Roy-043 acb18c2745 BIM: Fix BIM_Leader callback bug
Probably due to changes in gui_lines `self.call` was no longer ended.

Fixes: #17283.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=91413
2024-10-17 12:14:20 +02:00
Kris Wilk 64d8ab5e55 Use Qt built-in to determine the system's preferred fixed-width font 2024-10-16 08:50:15 -05:00
marioalexis 42d0dfa121 Fem: Do not use main window widget from another thread - fixes #17255 2024-10-16 08:32:06 -05:00
wmayer af4a7800ce Sketch: Fix creating the shape of a sketch
SketchObject::buildShape() used the geometries as they were created by the user. However, they are not accurate enough in order
to create a closed wire. Instead the geometries after running the solver must be used because they are guaranteed to be accurate.
2024-10-15 23:22:43 -05:00
ronak a50ee5ee6a final returned at line 461 2024-10-15 08:48:08 -05:00
Syres916 b093191da5 [TechDraw] Fix error for some compilers 2024-10-15 08:45:18 -05:00
wmayer 7a58bbf6b4 Start: Fix build failure with enabled PCH 2024-10-15 08:44:19 -05:00
Adrián Insaurralde Avalos 868a0f174b Bim remove py2 compatibility code (#17229)
* BIM: remove py2 compatibility code

* remove unused six from conda environments
2024-10-14 11:25:23 -05:00
Yorik van Havre ef667e8409 BIM: Fixed adding missing windows when converting to IFC - Fixes issue #16631 2024-10-14 11:23:14 -05:00
Benjamin Bræstrup Sayoc b16bd50f73 [Gui] Fix isBad asserts, by removing old monkey patch
Multiple places in code, asserts for bad types would trigger SIGABRT. This is not just limited to #16316 with SoZoomTranslation, but multiple more places, not described in issue, but I experienced myself. Fixes #16316
2024-10-14 11:16:33 -05:00
wmayer 227588350d Core: Directly store text changes made in text object
Store changes made in TextDocumentEditorView immediately to TextDocument. This fixes the issue reported in
https://forum.freecad.org/viewtopic.php?p=786175#p786175
2024-10-14 11:04:57 -05:00
pre-commit-ci[bot] 9a377c6e98 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-10-14 17:55:51 +02:00
Yorik van Havre 4bf0553ea7 crowdin translations 2024-10-14 17:55:51 +02:00
wmayer bcab31e047 PD: Disable PartDesign_CompDatums & PartDesign_CompSketches if dialog is open
A group command is not disabled if its default command is disabled. This allows it to invoke the command when it should be impossible.
To fix the problem override the isActive() method in the sub-classes CmdPartDesignCompDatums & CmdPartDesignCompSketches

This fixes #16294
2024-10-14 10:55:21 -05:00
hlorus 2018b7b5ed MeasureGui: Revert temporary measure object creation (#17109)
* MeasureGui: Revert temporary measure object creation

Reverts the temporary creation of measurement objects that was added in #15122

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* MeasureGui: Adress review comments

- Remove _mDocument and _mGuiDocument
- Replace c-style casts with dynamic_cast
- Add file guard
- Remove leftover canAnnotate method

* MeasureGui: Fix crash when selecting elements from different documents

* MeasureGui: Add additional type check in ensureGroup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-14 10:54:23 -05:00
H. Tsubota 69ae9b2c46 Change to enclose field values ​​with quotation character in exported CSV file if they contain delimiters in Spreadsheet workbench (#17140)
* Change to enclose field values ​​with quotation character in exported CSV file if they contain delimiters

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-14 10:52:48 -05:00
Furgo c8b53bdba6 Properly scale link overlays 2024-10-14 10:50:48 -05:00
WandererFan 010c3c9f4b [TD]Fix bad circles (fix #16980) (#17182)
* [TD]fix spurious messages in GeometryMatcher

* [TD]fix closed circle test (fix #16980)
2024-10-14 10:47:13 -05:00
wandererfan 3042d8d951 [TD]throttle over aggressive dimension autocorrect 2024-10-14 10:46:02 -05:00
Jiří Pinkava c9450422d6 Gui: add Qt Platform name to splashscreen information dump
There is several bugs in FreeCAD which are related to platform (mostly wayland),
the hope is this will make it easier to identify the dependence of bug on the platform
2024-10-14 10:45:02 -05:00
Furgo 9516391ed3 Assembly: make "Solve failed" error more verbose (#17117)
* Add FC_ERR macro for the 'Solve failed' Assembly error

* Handle standard exceptions during assembly solve

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-14 10:43:27 -05:00
Yorik van Havre d82c2d6d61 BIM: Fixed missing object creation in IFC document conversion (#17093)
* BIM: Fixed missing object creation in IFC document conversion - fixes #17031

* BIM: fixed deleting of non-existing objects - fixes #17032
2024-10-14 10:37:43 -05:00
Florian Foinant-Willig ebe2777d68 Disable closed Loft for less than 3 profiles 2024-10-14 10:36:08 -05:00
Jiří Pinkava 1d7b05c607 Gui: Workaround for crash on close of MDI window
The Qt6 (up to Qt 6.7.3 now) contains bug, which can lead, under
specific circumstances, to crash of the application, when the
MDI window is closed. The circumstances are:

* at least 2 MDI windows needs to be open
* stylesheet muset set different size (border, margin) for activated and un-activated tabBar tab
* the closed window must be inactive, but created before the window now active and open
* race condition must occur betwee the closing and resize event handlers for the tabBar
  (see qt bug for details)

So this bug only occures with Qt6 with the Dark or Light styles selected (no classic) and only if
specific sequence of steps is followed during opening and closing the MDI windows.

The bug is in Qt code path executed when QMdiArea::ActivationHistoryOrder is set.

The other possible workaround might be to change all the affected stylesheets, but this seems to me
impractical and also fragile, because the affected code path will be still active.

https://bugreports.qt.io/browse/QTBUG-129596
2024-10-14 10:33:21 -05:00
Shai Seger 9365e358dd Fix shader compilation error on linux. (#17236) 2024-10-14 09:58:48 -05:00
wmayer 9dba811236 Part: Fix XML output of PropertyGeometryList::Save
Write all XML attributes of the Geometry element into a single line.

Currently the XML output looks:
                        <Geometry type="Part::GeomLineSegment"
 id="-1" migrated="1">

With the fix it will be:
                        <Geometry type="Part::GeomLineSegment" id="-1" migrated="1">
2024-10-14 09:08:07 -05:00
marioalexis 131ce95ee6 Fem: Use default height for mesh task panel quantity spin boxes 2024-10-14 09:02:03 -05:00
PaddleStroke 3d665fab34 AssemblyObject.cpp : add failsafe checks 2024-10-14 08:58:59 -05:00
marioalexis a31cde78d9 Fem: Fix examples affected by Part workbench preference parameter 2024-10-14 08:52:08 -05:00
marioalexis84 84c3457a28 Fem: Remove highlighted nodes if ccx finish without error - fixes #14855 (#17203) 2024-10-14 08:51:03 -05:00
Benjamin Bræstrup Sayoc c4e71656db [Gui] TextEdit, zoom on Ctrl + wheel
Fixes #13861
2024-10-14 08:31:45 -05:00
PaddleStroke de1b1dca21 Assembly: Fix context menu 'Activate object' not working and causing crash (#17092)
* Assembly: Add setupContextMenu to ViewProviderAssembly.h

* Assembly: Fix right click 'activate object' menu not setting edit

* add QMenu header

* Add NOLINT

* Add one more space before //NOLINT or clang cries...

* Fix isInEditMode

* add isInEditMode to ViewProviderAssemblyPy.xml

* add isInEditMode to ViewProviderAssemblyPyImp.cpp

* update activeAssembly() in Utils to make sure isInEditMode
2024-10-14 08:30:09 -05:00
PaddleStroke 3fe73e5ba4 Assembly: Remove JointObject camera callbacks. And fix lock highlight. 2024-10-14 08:27:52 -05:00
Roy-043 1dbeb9d143 Draft: Fix upgrade function: delete argument was ignored in case of draftify
Forum topic:
https://forum.freecad.org/viewtopic.php?t=91357
2024-10-14 08:19:22 -05:00
MisterMakerNL 1b50abbafe fixing the checked toolbutton issue in Qsint
https://github.com/FreeCAD/FreeCAD/issues/17230
2024-10-14 08:14:40 -05:00
wmayer 7c842eea13 PD: Fix crash when clicking on invalid edge in task panel
Fixes #10843
2024-10-13 13:34:31 -05:00
Pieter Hijma f5c138884b Gui: Fix showing multiple dialogs VarSet add prop 2024-10-11 08:55:50 -05:00
PaddleStroke bc5b0bb610 Assembly: Joint: add support to non ascii characters. 2024-10-10 20:37:09 -05:00
wmayer dcd048e00a Core: Check returned pointer of convertSWIGPointerObj 2024-10-10 20:36:22 -05:00
marioalexis 5f3e4ceb4d Fem: Remove reduntant info from geometry selector widget title 2024-10-10 20:34:29 -05:00
PaddleStroke fdca32a577 Assembly: Fix gear/belt switch on checkbox toggle 2024-10-10 20:26:35 -05:00
Syres916 dab0cb1ba9 [Gui] Disable the ability to change themes and preference packs... 2024-10-10 20:25:46 -05:00
marioalexis 5cd2862aab Fem: Fix gap in constraint fixed symbol 2024-10-10 20:23:24 -05:00
Adrian Insaurralde Avalos 6c64197cdb CI: update lint action for ubuntu 24.04 2024-10-10 12:26:11 -03:00
Roy-043 0e1bc2b716 BIM: Remove calls to end_all_events to avoid Linux crash
Fixes #15723.
2024-10-10 13:47:32 +02:00
Paul Lee c30d087385 [Arch] Bug: ArchRemove Creates Cyclic Dependency and TNP
FreeCAD Discussion Forum -
https://forum.freecad.org/viewtopic.php?t=91180&start=30#p786308
2024-10-10 10:06:46 +02:00
PaddleStroke c02ad52bfd Sketcher: Fix double click of wire and remove selection that was not working 2024-10-08 10:53:27 -05:00
PaddleStroke 259d21c565 Core: Fix #7580 (#17013)
Fixes several undo/redo issues with the attachment dialog
2024-10-08 09:05:49 -05:00
PaddleStroke bf804beb21 Assembly: Fix migrationScript2 error with bad joints (#17010)
* Fix migrationScript2 to handle bad joints
2024-10-07 18:49:01 -05:00
Bas Ruigrok e3af254dd6 Gui: Fix Touchpad navigation style panning in edit mode 2024-10-07 12:41:02 -05:00
marioalexis ac8d084924 Fem: Add option to use old Netgen mesher implementation 2024-10-07 11:11:25 -05:00
mwganson 3ad9565f56 [Part Workbench] Fix issue with Sketcher_NewSketch icon moving on changing back to workbench 2024-10-07 10:53:03 -05:00
Furgo 0e1e7dcf03 Create the assembly object inside the list of commands 2024-10-07 10:50:20 -05:00
mwganson 6e5375002f [Step Import] fix issue with non-latin characters in import path 2024-10-07 10:43:26 -05:00
marcuspollio 4d9685ae0d Start: little layout tweak to First Start Region 2024-10-07 10:41:58 -05:00
wmayer 3d97955f7d TD: Fix compiler warnings
This fixes the compiler warning: unused parameter 'mode' [-Wunused-parameter]

It's a regression of #16889 to not initialize the class member m_createMode any more that causes UB,
i.e. whenever m_createMode is accessed it may return an unexpected value.
2024-10-07 10:40:47 -05:00
Florian Foinant-Willig 69823f7abc [PD] Fix subtractive primitive placement 2024-10-07 10:39:48 -05:00
Florian Foinant-Willig 22a8ffdbe4 [PD] fix change primitive AttachmentOffset move the body 2024-10-07 10:39:48 -05:00
Unl0gic ad9e6231f9 Update SurfaceSupport.py
- Fixed mapping v_bit to ConeCutter
2024-10-07 10:35:14 -05:00
wandererfan 32c664bdaa [TD]fix parallel edge test (fix #16851)
- missing normalization before test
2024-10-07 10:34:28 -05:00
Benjamin Bræstrup Sayoc 664805fa4d [Sketcher] If origin selected: don't do distance to origin
In auto constrainer. Fixes #12684
2024-10-07 09:02:56 -05:00
mwganson fd8ef079d0 [PartDesign AllowCompound] recompute all features when AllowCompound property is changed either from true to false or from false to true 2024-10-07 08:56:25 -05:00
shai 3d400211da Fix issue #17035 2024-10-07 08:35:56 -05:00
Eric Price 0909816af6 Changed QuickMeasurement to be conservative (#17060)
* Changed QuickMeasurement to be conservative

QuickMeasurement should not measure while tool dialogs are open
this includes but is not limited to editing sketches
also changed several other sanity checks to be opt-in vs opt-out, as discussed.

* move the test if it is safe to measure to when the measurement actually happens - avoids any potential race conditions
2024-10-07 08:33:46 -05:00
Roy-043 344ff7b946 BIM: BimWall add missing imports
Fixes #16996.
2024-10-07 15:21:41 +02:00
Roy-043 00610a62c5 Draft: avoid confusing SVG warning for nested circles and ellipses
Forum topic:
https://forum.freecad.org/viewtopic.php?t=90942
2024-10-07 15:08:31 +02:00
bgbsww bd4afe9f6e Disallow end_all_events in Gesture Nav Style 2024-10-07 15:03:47 +02:00
Roy-043 1119303d36 More logical implementation of the fix. 2024-10-07 15:00:44 +02:00
Max Wilfinger ea0b0bacac Update images on XDGData and README 2024-10-07 14:55:11 +02:00
Furgo ab49392da3 Prepend a single quote to BOM index to be interpreted as a string in generated spreadsheets 2024-10-04 08:53:27 -05:00
Roy-043 8932d52107 BIM: Compatibility fix for walls based on wire or face with -Z normal
In V1.0 the handling of wall normals has changed. As a result existing walls with their Normal set to [0, 0, 0], based on wires or faces with a shape normal pointing towards -Z, would be extruded in that direction instead of towards +Z as before. To avoid this their Normal property is changed to [0, 0, 1].
2024-10-04 13:55:01 +02:00
Ajinkya Dahale 7acf6274a4 [Sketcher] Apply tangent autoconstraint only when Dir given
This relates to `seekAutoConstraint` and `seekAndRenderAutoConstraint`.

Fixes #16321.
2024-10-03 23:18:07 -05:00
Florian Foinant-Willig f14917e8d4 [PD Helix] allow refinement to fail 2024-10-03 21:54:29 -05:00
bgbsww c587d6b8f9 Refine further 2024-10-03 13:47:37 -05:00
bgbsww 40239810cc Return to python; simplify to work with only classic names, provide migration 2024-10-03 13:47:37 -05:00
bgbsww 9aba82d5d6 Correctly build reference from selection subname 2024-10-03 13:47:37 -05:00
Jiří Pinkava cdec2159f1 Gui: fix warning with duplicate name in DlgSettingsLightSources 2024-10-03 13:23:04 -05:00
Kris Wilk e76ebea729 Placement Dialog: Use default tab order (Fix #16944) 2024-10-03 11:44:07 -05:00
wmayer baa57f5ee4 Fix compiler warning 2024-10-03 11:31:45 -05:00
Kris Wilk c43e19820d Prevent using reserved names for properties or aliases (Fix #16846) (#16902)
* Prevent naming properties with reserved words (Fix #16846)

* Prevent using reserved constant names for properties or aliases

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* App: Add unit test for isTokenAConstant

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-10-03 10:03:21 -05:00
PaddleStroke 3325ae99a9 Chennes fix
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-10-03 10:01:31 -05:00
PaddleStroke c6f5def7d7 Assembly: Use cpp getGlobalPlacement python binding rather than reimplementing it. 2024-10-03 10:01:31 -05:00
PaddleStroke 3475cf42d2 Core: GeoFeature: Add python binding to the new getGlobalPlacement() 2024-10-03 10:01:31 -05:00
Frank Martinez efb79d1c96 [AddonManager] Set default filter to ANY package type 2024-10-03 09:55:17 -05:00
PaddleStroke 3931953bc7 QuickMeasure: Prevent crash by limiting selection to Part::Features (#16921)
* QuickMeasure: Prevent crash by limiting selection to Part::Features

* chennes' fix

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-10-03 09:49:31 -05:00
Roy-043 72441c3a27 BIM: check if Width and Height of window are not zero 2024-10-02 22:49:44 -05:00
André Althaus a953eb20e3 Only omit edges for group children in the dependecy graph
All edges for GeoFeatureGroupExtension where omited even if the
dependency was not a child of the object.
2024-10-02 22:45:05 -05:00
wmayer 5feb628feb Core: Fix macro recording when using module_io 2024-10-02 22:13:40 -05:00
Benjamin Nauck 11bc6c6b69 Fix macos crashes when unhandled exceptions reaches qt 2024-10-02 22:12:03 -05:00
wmayer 484a262c31 Core: Do not save changes of a text object if the GUI document is about to be closed
This fixes #16873: Text document breaks some Analysis container objects
2024-10-02 21:42:16 -05:00
David Carter 1b33aedb56 Materials: Correct DiffuseColor custom attribute
Custom attributes were modified to maintain the behaviour of setting
transparencies using the DiffuseColor alpha channels
2024-10-02 21:35:28 -05:00
Pieter Hijma c70093d22f Gui: Fix segfault in Expression Editor/VarSet 2024-10-02 21:31:33 -05:00
André Althaus 5410d92eb1 Remove the explicit dependency on Version.h from the fc_version target
This caused problems witht the Makefile generator because it doesn't
support the BYPRODUCTS option.
2024-10-02 21:31:00 -05:00
David Carter dbf849a592 FEM: Translation error causing a crash
An error in the Italian translation added an extra '{}' to the
translation string resulting in a dump when formatting.

This has also been updated in CrowdIn but as it's causing a crash is
also beiung changed via this PR. It should updated correctly when
doing the next translation pull.

Fixes #16704
2024-10-02 21:29:50 -05:00
hlorus 2b5dca48a5 MeasureGui: Also hide delta measurements 2024-09-30 11:24:31 -05:00
hlorus 9830160821 MeasureGui: Remove leftover reset of _mMeasureObject
This was introduced in af9097ce87 due to a faulty resolve of a merge conflict
2024-09-30 11:23:11 -05:00
WandererFan 5ac53527df [TD]Fix auto correct msg missing16892 (#16909)
* [TD]fix bad return code on auto-correct fail

* [TD]prevent changing references in property editor

- this is a "shoot yourself in the foot" practice
2024-09-30 11:21:02 -05:00
mwganson 70befd69d5 [Part CheckGeometry] prevent crash when attempting to check origin axis 2024-09-30 11:19:22 -05:00
Benjamin Nauck 20c552693d Include a warning to devs for unhandled exceptions
The same situation will cause a crash on at least macOS.
2024-09-30 11:15:26 -05:00
wandererfan 0117d6994a [TD]fix no dim repair on area (fix #16894) 2024-09-30 11:13:40 -05:00
André Althaus 49ee02277b Regenerate Version.h if the git hash changes
Prevous Version.h was not regenerated after it was initially created.
This prevented an accurate commit hash in the About dialog when
incrementally building from source.

Now the file is always rewritten when it's content is changed.
2024-09-30 11:12:54 -05:00
Shai Seger 41d8ed4c78 [CAM Simulator][1.0] Change usage of sample shader code to one with compatible license. (#16899)
* Change usage of sample shader code to one with compatible license.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-30 11:08:52 -05:00
Frank Martinez e00765506c Revert 9b409da due to a regression in some platforms 2024-09-30 11:07:04 -05:00
wmayer 66ec2642a4 Core: Do not set to XY plane by default if the rotation of the image doesn't match 2024-09-30 11:04:16 -05:00
wmayer cec0213799 Core: Fix resetting placement of transformed image
The restored Euler angles of a rotation may significantly differ from the input Euler angles so that determining the plane isn't very reliable.
To get the plane reliably multiply (0,0,1) with the rotation and use this as reference normal of the plane.
2024-09-30 11:04:01 -05:00
wandererfan 5b4fac652d [TD]fix solid line detail highlight not shown 2024-09-30 11:01:53 -05:00
wandererfan c4bf46e97a [TD]fix handling of projection convention (fix #16788 #16785) 2024-09-30 11:00:56 -05:00
wandererfan b885af57b2 [TD]add preference methods for Projection Group 2024-09-30 11:00:56 -05:00
Eric Price 4d54b458a7 Do not allow loft where the segment shapes are too close ( fix #5855 )
A loft or pocket only makes sense if the segments used for it have some minimum separation. Having the shapes identical causes segfaults in OCCT

Checking for CoG is a hack. Identical shapes have identical CoG - but an identical CoG does not necessarily mean identical shapes - however it can be argued that a shape that is not offset at least somewhat in the direction of the loft doesnt make a valid shape for a loft (it will typically freeze OCCT instead of crashing it) and a sufficiently suitable shape will have a different CoG

throwing the exception will make it easy to identify if there ever is a case where this is a bad thing - and exceptions are better than segfaults.
2024-09-30 10:58:25 -05:00
bgbsww 13f719f285 Tiny doc format changes to make pybin11_stubgen happy 2024-09-30 10:54:04 -05:00
marioalexis 1c53cde453 Fem: Add offset between faces and wireframe in FemPostObject view provider 2024-09-30 10:50:24 -05:00
Eric Price d2c9078fd3 PadDesign: Work around issue 16690
This is a stopgap measure, I don't know if the underlying issue is fully understood - but this prevents it from happening in the given test case.

By overriding the base for the pocket prism, which is a trick also applied by
TopoShape::makeElementPrismUntil() if the prism creation fails on first try, the bug where said prism goes to the wrong shape is avoided - this on its own would however break a pad in the inverse case, so we only do that when pocketing
2024-09-30 10:48:01 -05:00
Benjamin Nauck 5575ad7085 Fixes name 'PyExc_FC_AbortIOException' is not defined 2024-09-30 10:46:21 -05:00
wandererfan 587e0b2bf9 [TD]fix bad default value (fix #16783) 2024-09-30 10:45:20 -05:00
bgbsww 469379de61 Make python Regex Strings raw to avoid py3.12 SyntaxError 2024-09-30 10:43:10 -05:00
wandererfan 3bccd5bd6a [TD]allow override of Balloon drag modifier (fix #15388) 2024-09-30 10:40:54 -05:00
wandererfan 668d72dfe2 [TD]add preferences for Balloon drag modifiers 2024-09-30 10:40:45 -05:00
PaddleStroke b327870fd4 Assembly: Fix lag during dragging of large assemblies. Bundle fix joints together. Show only the movingJoint during dragging. Do not recompute joints during dragging. 2024-09-30 10:39:06 -05:00
Syres916 57a94ff4f3 [Gui] Qt6 OpenGLWidget - move black rectangle off screen (#16863) 2024-09-27 22:52:07 -04:00
Jacob Oursland 734ea2e8bc CI: Fix conda builds. 2024-09-27 09:39:27 -04:00
Eric Price d4db6e1432 Measurement: Avoid null shapes to be returned in all code branches (Fix #16820)
Returning a null shape would have triggered an exception in the bottom branch but not in the top one - which later leads to a segfault - solution - raise an exception. OOC doesn't like null shapes.
2024-09-25 12:30:06 -05:00
David Carter 1d4d524932 Materials: Fix QT6 error
The MaterialTreeWidget was not working in QT6 due to a type check for a
QT5 widget
2024-09-25 11:49:16 -05:00
Roy-043 aca050d47c Fix linter warning 2024-09-25 16:01:06 +02:00
Yorik van Havre f34c43d56e Merge branch 'releases/FreeCAD-1-0' of github.com:FreeCAD/FreeCAD into releases/FreeCAD-1-0 2024-09-25 16:00:14 +02:00
Eric Price 843b724b6d Measurement: Correctly handle unknown selections to avoid segfaults (Fix 16794)
The measurement code did not handle mixed selections of known and unknown types correctly. Although a unknown selected object would leave the type at Invalid, selecting both known and unknown objects would have the type determined by the known object type and treat the unknown as the same. This causes exceptions and - worst case a segmentation fault.

This fix introduces a new category "other" which - if present in a selection always forces type to Invalid. This should be forward compatible in case new types are introduced in the future.
2024-09-25 07:49:10 -05:00
chris 118cc02c74 issue #15329 add missing include to resolve build error 2024-09-24 19:10:01 -05:00
Eric Price 6bab0c2787 PartDesign: Loft Intelligence - Select the whole sketch if the selected shape is … (#16791)
* Loft Intelligence - Select the whole sketch if the selected shape is a component of a sketch that is not a vertex (Fix #16630)

In fa8f29aed4 FeatureLoft.cpp was refactured, dropping some functionality, mainly the ability to create lofts to entire sketches or other 2d shapes if a single component that was not a single vertex was selected as either the base shape or a section

the old code was:

1     auto getSectionShape =
2          [](App::DocumentObject* feature, const std::vector<std::string> &subs) -> TopoDS_Shape {
3              if (!feature ||
4                  !feature->isDerivedFrom(Part::Feature::getClassTypeId()))
5                  throw Base::TypeError("Loft: Invalid profile/section");
6
7              auto subName = subs.empty() ? "" : subs.front();
8
9              // only take the entire shape when we have a sketch selected, but
10             // not a point of the sketch
11             if (feature->isDerivedFrom(Part::Part2DObject::getClassTypeId()) &&
12                 subName.compare(0, 6, "Vertex") != 0)
13                 return static_cast<Part::Part2DObject*>(feature)->Shape.getValue();
14             else {
15                 if(subName.empty())
16                     throw Base::ValueError("No valid subelement linked in Part::Feature");
17                 return static_cast<Part::Feature*>(feature)->Shape.getShape().getSubShape(subName.c_str());
18             }
19         };

this commit forward-ports the missing functionality provided by line 7-12 in above snippet

* Code cleanup as suggested by (#16791)
2024-09-24 15:01:49 -05:00
Florian Foinant-Willig 55e912b060 [PD] Fix Pad uptoface with custom direction (#16539)
* [PD] Fix Pad uptoface with custom direction

* Add unit test
2024-09-24 11:30:17 -05:00
wandererfan d272722d9d [TD]fix crash on bad selection (fix #16727) 2024-09-24 10:08:05 -05:00
Benjamin Nauck 690f06e618 Swaps out the hard coded icon to the standard svg icon 2024-09-24 10:04:32 -05:00
Syres916 ea9d1c4fd2 [BIM] Fix error starting BIM Wb for certain new users 2024-09-24 14:22:58 +02:00
Eric Price cf9e2e9c9a CLI: Enforce LC_NUMERIC=C on Posix systems (#16724) (#16763)
* Enforce LC_NUMERIC=C on Posix systems (#16724)

Initialising Qt with native LC_NUMERIC affects XML import on CLI (freecad -c)

This causes sketch constraints and potentially other components relying on numeric constants to break or have incorrect values.

Forcing LC_NUMERIC to C avoids this issue and enforces reproducible behaviour on all locales.
This does not affect the number format displayed in the GUI, as set in preferences.
2024-09-23 19:10:28 -05:00
Chris Hennes 3d63fc6c2f cMake: Update version to 1.0.0RC2 2024-09-23 16:14:10 -05:00
Frank Martinez 99097c61f6 Splash Screen minimal show time. Issue #16264 2024-09-23 16:07:31 -05:00
Yorik van Havre b0d847ca15 Translations (#16754)
* Updated ts files

* merged crowdin translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 14:12:15 -04:00
bgbsww 95e93a3ab1 Match LS3 opcodes for sketch shape 2024-09-23 10:45:48 -05:00
3x380V e061f81beb TechDraw: Buggy Wayland custom cursors workaround (#16740)
* Gui: Minor polishing of cursor regression fix

* TD: Buggy Wayland custom cursors workaround

Until Qt v6.6 displaying custom cursors on Wayland is broken,
so add a workaround. See also QTBUG-95434.

Fix is the same as d3bb2068 ("Gui: Buggy Wayland custom cursors workaround")
plus subsequent fixes.
2024-09-23 10:43:28 -05:00
Christoph Moench-Tegeder 94d1a67d88 replace exec_program() with execute_process()
Recent CMake (>= 3.28) do not allow exec_program() any more by default,
but prefer execute_process(), which takes slightly different flags.
According to the documentation, exec_program() has been deprecated
since CMake 3.0 (which was released in 2014, so it should be common
enough that I don't feel like making allowances for any really old CMake).

References: https://cmake.org/cmake/help/latest/policy/CMP0153.html
2024-09-23 10:41:34 -05:00
WandererFan 8fe89409a5 [TD] Fix win file spec backslash (fix #16646) (#16689)
* [TD]add method to clean win filespecs

- '\' in strings passed to Python as filespecs is interpreted as
  an escape of the following character.
- replace '\' with '/'

* [TD]remove '\' from filespecs before use
2024-09-23 10:40:22 -05:00
Shai Seger 29d4c9f13a [Cam Simulator][1.0] Fix minor Ambient Occlusion bug. (#16665)
* Fix minor Ambient Occlusion bug.

* fix text cutting in CAM Simulator task panel. Issue #16707
2024-09-23 10:39:09 -05:00
wandererfan 98cb3ae80e [TD]fix BrokenView selection (fix #16567) 2024-09-23 10:37:11 -05:00
Kevin Martin 288b6e6943 DXF: Fix Import related behavior reported in issues #13597 and #16068 (#16511)
* Fix double-import on exception in ImportGUI.readDXF
The python code has a try/catch block intended to detect if the ImportGUI module is present and if so use its readDXF method, otherwise use Import.readDXF.
The block was incorrectly structured so that Import.readDXF would also be called if ImportGUI.readDXF raised an exception, causing the DXF file contents to be loaded twice into the drawing (at least, up to the point where the exception occurred)

* Make ImpExpDxfRead::MakeLayer use centralized accessor for Draft module
The importer class already had a method to find the python Draft module, but MakeLayer was doing the work itself. Now it uses the centralized accessor, which has also been improved to generate a message if the module can't be loaded.

* Give compounded objects names related to the containing layer name
If "Use Layers" is set and also "Group layers into blocks" the names of the generated compound objects will be based on the name of the containing layer.
If "Use Layers" is not set this will not occur because in general objects from several layers would be compounded together.
Fixes (partially) #16068, the remaining fix is likely just an explanation of the interaction of the options.
closes #13597

* Use correct (new) property name OverrideShapeAppearanceChildren
This corrects a bug created by commit 495a96a which renamed the layer property "OverrideShapeColorChildren" to "OverrideShapeAppearanceChildren" but missed this particular reference to the property by its old name.

The code here called PyObject_SetAttrString which, due to the wrong attribute name, set an expection state in the Python engine, ultimately causing the next attempt at importing a module to fail, with various consequences depending on why the module is being imported.

* Wrap PyObject_SetAttrString and PyObject_GetAttrString with error-checkers
In DEBUG compiles these methods are wrapped to report errors which can occur if the property cannot be referenced.

* Make some error-printers static instead of const
They don't need the CDxfRead object to work

* Display exceptions raised by ReadEntity
Although the DXF reader has an ignore-errors flag, it should still report any errors it encounters. The flag is deemed to mean that, after an error, the reader should continue to try to read the file rather than quitting on the first error.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 17:28:32 +02:00
hasecilu 49aee8e57c Help: Don't open 404 documentation pages
Unfortunately, not all documentation is translated.

Instead of presenting to the user 404 code error pages is preferable to
show the documentation on English.

Status codes 200 and 404 are assumed as requests response.
2024-09-23 17:17:51 +02:00
David Carter 555299ddea Materials: Update install locations
Ensure icons and images are put in the correct location.
2024-09-23 10:04:52 -05:00
wandererfan a49e5c0c01 [TD]respect camera direction preference (fix #16593) 2024-09-23 09:23:59 -05:00
wandererfan 6eb92e6647 [TD]fix torus render (fix #16646) 2024-09-23 09:21:33 -05:00
wandererfan b99e34bd86 [TD]fix double pdf file on win (fix #16538) 2024-09-23 09:19:05 -05:00
marioalexis a48fd0f422 Fem: Use shape global placement in Mesh Netgen new implementation 2024-09-23 08:17:21 -05:00
marioalexis b164b49b81 Fem: Add offset between faces and wireframe in FemMesh view provider 2024-09-23 08:16:45 -05:00
marioalexis 162eeeb5de Fem: Use reference subshape transformation on the underlying geometry 2024-09-23 08:12:01 -05:00
Jiří Pinkava 7a1282a6da BIM: Fix tabstop order for Project Manager dialog
Until now not defined explicitly, using tab juped throught boxes in
order in which they were created, which is really jumpy user experience.
2024-09-23 12:15:19 +02:00
Kevin Martin 238c68d8eb DXF: Place objects in layer all at once rather than one at a time to improve DXF import speed dramatically. (#16596)
* Place objects in layer all at once rather than one at a time.
This reduces (by a factor of the number of objects in the layer) the number of times that the layer contents are traversed to set the properties of the contained objects.
This means the layer insertion of O(n) rather then O(n^2) on the number of objects.
Also remove a loop invariant in view_layer so the chidren are not traversed if colours or appearnces are not inherited from the layer.
Fixes #15732

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-23 11:41:41 +02:00
Kevin Martin 7cc34c9072 DXF: Remove O(n^2) time on DXF import with the legacy importer (#16611)
* Remove O(n^2) time on DXF import
Accumulates the contents of each layer in a local Python list, then at the end assignes all the objects at once into the layer. This avoids a very slow process of traversing the objects so far and (re-)updating their properties each time a new object is added.
Fixes #16604

* Correct last change to not damage existing layer contents.
The layer could already have contents if the DXF file is being Imported rather than Opened.
The original change would lose the previous layer contents.
2024-09-23 11:38:16 +02:00
hlorus b2b0af95d8 MeasureGui: Move _mMeasureType member to local variable
Fixes #16565
2024-09-22 20:35:25 -05:00
Florian Foinant-Willig 6afb4a0220 [PD] Fix Pad uptoshape and add unit test 2024-09-22 17:22:56 -05:00
Roy-043 50962ae9fe Correct tree icon for TechDraw_AreaDimension 2024-09-22 16:59:11 -05:00
Bas Ruigrok 87e2d01ccb Tux: Fix default orbit style shown in status bar 2024-09-22 16:57:48 -05:00
bgbsww 6625b675af Update method names and clean 2024-09-22 16:55:45 -05:00
Zheng, Lei 7c16b82e70 Transfer FeatureHole code 2024-09-22 16:55:45 -05:00
Benjamin Nauck 72ae812aa4 Use backspace as default to delete on mac
Only full size mac keyboards has a specific delete key, most doesn't.
2024-09-21 10:37:44 -05:00
bgbsww 4c3ffa617a Correct error in resolveElement 2024-09-21 10:36:39 -05:00
David Carter a5c4416bd0 Materials: Set transparency from DiffuseColor
Migrate the transparency from the DiffuseColor alpha channel to the
transparency color attribute. This allows the alpha channel to be
used as designed

fixes #14938
2024-09-21 10:35:54 -05:00
Chris Hennes 24f67f2d87 GUI: Fix mistake in cherry-picking
The cherry-pick lost the deletion of a line of code.
2024-09-20 09:17:12 -05:00
Jiří Pinkava 580e7879d4 Gui: Fix path to QRC file in PreferencePages UI file
QtCreator, when the file is opened, reports reference to .qrc filewhich
does not exists. It looks like a missing piece from ccb9d7faeb.
2024-09-20 08:43:27 -05:00
CalligaroV 3cf5f0e086 Sketcher/Gui: check if there's a 3D view while executing ViewProviderSketch::unsetEdit()
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-20 08:30:08 -05:00
supermixed 18de22a8a7 Core: Import STEP: Cancel button does not cancel (#16499)
* Fix importing .step file when user cancelled import settings dialog
* Refactor object loading python code, fix not using settings when STEP options dialog not shown
* Use custom exception type for user cancelling import instead of `RuntimeError`
* Pull python code out to external file
2024-09-20 08:25:44 -05:00
xtemp09 28bcea6613 [GUI] Move the Push In and Pull Out buttons to the left side
Closes #16587.
2024-09-20 08:20:02 -05:00
theosib 5755e70636 Filter out infinite shapes from Sweep available surfaces 2024-09-20 08:18:27 -05:00
theosib f65a9ffec5 Filter out infinite shapes from Loft available shapes 2024-09-20 08:18:27 -05:00
Frank Martinez 6d5c7ea855 Change fixed selection colors to style based palette. Issue #16454
GUI: Merged cherry-picked 6afc6c7757 to 1.0 branch
2024-09-20 08:11:53 -05:00
bgbsww ae7fe1bc2e Match Ruled Surface behavior to prior versions 2024-09-20 08:09:26 -05:00
Bas Ruigrok acbce24dd9 Gui: Fix segfault in align to selection tool 2024-09-20 08:06:45 -05:00
David Carter d0e0cf112f Materials: ShapeMaterial not properly restored
The ShapeMaterial variable was not being properly restored. It's UUID
was restored but the material was not being loaded and set
2024-09-20 08:05:01 -05:00
Florian Foinant-Willig 6310430e38 [PD] fix pad uptoface and uptoshape (#16030)
* [PD] fix Pad UpToFace and UpToShape
* specify struct pointers for Win
* Rename variables for MSVC compatibility - windows.h defines 'near' and 'far' as macros
* Add unit test

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-09-19 08:51:37 -05:00
bgbsww 064abb30ee Move the recompute dialog to after Gui opens instead of per document signal. 2024-09-19 08:49:27 -05:00
PaddleStroke 3c1b54200d Measure: Fix quickmeasure globalplacement. 2024-09-19 08:48:12 -05:00
Chris Hennes 25a0847e60 Addon Manager: Don't crash on bad XML
Wrap all metadata reads in try/except blocks and gracefully bail out if the data is bad.
2024-09-19 08:46:04 -05:00
Roy-043 5f7eb6c16f BIM: show AutoUpdate of existing ArchSchedule
Fixes #16655.
2024-09-19 14:18:21 +02:00
Yorik van Havre 915c05a289 Translations (#16582)
* updated ts files

* merged crowdin translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-19 09:37:33 +02:00
Syres916 a82eb29af1 [Draft] Improve the color activation and ability to change… (#16603)
* [Draft] Improve the color activation and ability to change size of the snap text

* [Draft] Correct dimension text size calculation
2024-09-19 09:04:06 +02:00
bgbsww e19f583e77 Sketcher: Do not consider missing external geometry to be an error (#16590)
* Do not consider missing external geometry to be an error; highlight in conflict color.
2024-09-18 15:18:29 -05:00
hlorus dd31321038 MeasureGui: Auto close task on document deletion 2024-09-18 13:04:15 -05:00
Zheng, Lei 4fd8b40f65 Base: fix XMLReader non-closing character stream 2024-09-18 12:59:23 -05:00
Benjamin Bræstrup Sayoc 89b118e125 Revert "[Measure] Fix redundant variable assignment"
Fixes #16564. This reverts commit a7831eee4b.

Co-authored-by: Murmele <Murmele@users.noreply.github.com>
2024-09-18 08:36:39 -05:00
bgbsww b215a96f5d If we are creating a Sketch inside a Body that is in a link, use link position 2024-09-18 08:35:37 -05:00
bgbsww eca9a105af Gui: fix python syntax in C++ code that broke some compilers (#16614) 2024-09-18 08:33:53 -05:00
marioalexis 814945f728 Fem: Replace old FemMesh Netgen object implementation 2024-09-16 19:16:42 -05:00
marioalexis 58d27094fa Fem: New implementation of FemMesh Netgen object 2024-09-16 19:16:42 -05:00
marioalexis 61cc23bda2 Fem: Add set of mesh elements from a list 2024-09-16 19:16:42 -05:00
Bas Ruigrok d4006c4937 App: Return root object placement if target and root object are the same in getGlobalPlacement
(cherry picked from commit 8db7191084)
2024-09-16 13:01:12 -06:00
Ladislav Michl fad1c30559 Main: simplify banner
FreeCAD advertizes itself too noisy way which brings no usefull
infomation. Unify banner for commandline and GUI application and
drop unicode '(C)' character.
2024-09-16 11:15:06 -05:00
Jiří Pinkava 57c23537d0 Gui: fix size of ComboBox in Preferences/Navigation
Fixes visual artifact in the Preferences/Navigation dialog. The
default value for this field is 0 (at least for some Qt versions),
which does not make sense, because the element would be invisible.

Also the element is actually invisible when editing the UI file in
QtCreator.

Using the default "max" value set for other fields.
2024-09-16 11:07:27 -05:00
hlorus 255bdadf88 Measure: Use getGlobalPlacement method (#16251)
* Initial commit to apply delta also for interactive measurement

* Not required special logic to check if possible, it can be easily checked if the property exists

* remember setting so it is not required to turn it always on

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Measure: Use getGlobalPlacement method

Fixes #16058

---------

Co-authored-by: Martin Marmsoler <martin.marmsoler@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-16 11:05:37 -05:00
CalligaroV 0312824742 Do the same for the elements selected in the Task Panel
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-16 11:01:40 -05:00
Zheng, Lei a323e03030 Sketcher/Toponaming: call SketchObject::convertSubName() in ViewProviderSketch::addSelection2() 2024-09-16 11:01:40 -05:00
marioalexis c0941f9e22 Fem: Enable cancel meshing for Gmsh - fixes #5914 2024-09-16 10:53:50 -05:00
marioalexis 7d13b17b1e Fem: Add base class for FemMesh task panels 2024-09-16 10:53:50 -05:00
Yorik van Havre b1e611d7e3 BIM: Support for IfcOpenShell 0.8 2024-09-16 10:51:49 -05:00
bgbsww 4a57077f73 Add override flag for recomputes; set it in relevant tests with old files. 2024-09-16 10:50:48 -05:00
bgbsww d1903eabc7 Move code for recompute dialog and disable warning 2024-09-16 10:50:48 -05:00
Zheng, Lei c093a79151 Transfer in LS3 code 2024-09-16 10:50:48 -05:00
qewer33 779e1b2bb5 Update about dialog thumbnail image 2024-09-16 10:46:45 -05:00
Shai Seger a86b0ad3fd [Cam Simulator][1.0] Limit anti alias samples for better compatibility. (#16416)
* Limit anti alias samples for better compatibility. might solve Wayland problem, issue #15665

* Antialias samples are taken from display prefs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-16 10:42:19 -05:00
Jiří Pinkava b55d54a417 Sketcher: initialize geometry history limit variable (#16337)
* Sketcher: initialize geometry history limit variable

The variable seems to be uninitialized, valgrind complais about it.

The `git grep geoHistoryLevel` and the code ispection suggest it is never set.
If initialized to zero, most of the related code is never used, which
can point to the fact there is either another bug or the code is unused.

The variable was introduced in 42bf92ad12.

* Sketcher: Default geoHistoryLevel to 1

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-09-16 10:41:29 -05:00
wandererfan c5fef051f0 [TD]allow SaveCopy from MDIViewPage (fix #16447) 2024-09-16 10:36:09 -05:00
Roy-043 5e32fe2547 BIM: exportIFC.py fix UnboundLocalError
As shown in the image here:
https://github.com/FreeCAD/FreeCAD/issues/16485#issue-2523042111
2024-09-16 13:38:28 +02:00
Jiří Pinkava 192314b070 BIM: refactor wellcome window, drop most obvious comment 2024-09-16 13:29:27 +02:00
Jiří Pinkava aba9c8d74d BIM: drop unnecessary setPixmap from wellcome window
The image is already set in the UI file, it is not necessary to set it again
2024-09-16 13:29:18 +02:00
Jiří Pinkava 29ef93cbf3 BIM: adjust size of wellcome window to fit content
The actual optimal size of the window depends on many details, like UI style, system fonts,
OS etc ... so lets auto-resize the window to fit the content before display.
2024-09-16 13:29:10 +02:00
Roy-043 c6a273b789 Draft: Fix regression with layer print color
Problem with the same cause as #16212.
2024-09-16 10:08:25 +02:00
hoshengwei fa9d92a819 fix Material TaskPanel Load Preset not working bug 2024-09-16 10:04:00 +02:00
Kacper Donat 756d1a0a80 Gui: Use FreeCAD Theme only for FreeCAD stuff 2024-09-13 13:26:58 -06:00
Yorik van Havre 14ff4cb869 Draft: Fixed restrained movement - Fixes #16386 2024-09-13 13:20:59 -06:00
Bas Ruigrok 37b8fd1e40 Move isLink and isLinkGroup from AssemblyObject to DocumentObject 2024-09-13 13:10:59 -06:00
Bas Ruigrok 53b878869e Gui: Fix alignment direction for transformed objects 2024-09-13 13:10:59 -06:00
Bas Ruigrok d515ba9428 Move getGlobalPlacement from AssemblyObject to GeoFeature 2024-09-13 13:10:59 -06:00
Bas Ruigrok 131618941c Move splitSubName from AssemblyObject to Base::Tools 2024-09-13 13:10:59 -06:00
Jacob Oursland 196312941c Windows: Make FreeCAD.exe debuggable on PDB builds. 2024-09-13 12:30:47 -06:00
Jacob Oursland d8ea9a6bca CMake: conda-macos-* do not search Homebrew for dependencies. 2024-09-13 12:28:43 -06:00
Jacob Oursland 21af2176a6 Base: switch header include type for consistency with codebase. 2024-09-13 12:27:37 -06:00
Jiří Pinkava 358451359c GUI: Fix tree visibility click when a tree item gets collapsed
The tree can change shape during handling the mousePressEvent() event,
because some part of the tree can be (un)folded. This might lead to
shift of the three (up or down). The position of items in tree change
relatively to the position of mouse (which stays in place).
If the visibility click is handled after mousePressEvent, the shift in
position can lead to cursor beeing over visibility icon and the click
is handled like if the visibility icon vas clicked, which is unexpected.

Handling the visibility click first fixes this. The setAccepted(true),
was removed, it is left to the subroutine to set it.
2024-09-13 12:25:03 -06:00
Benjamin Bræstrup Sayoc d00aae972c [Measure] Redirect enter key press to apply button
Fixes #16401. Now call of the save function is dependent on whether the apply button is enabled. The button is only enabled if valid objects to save.
2024-09-13 08:43:07 -05:00
Benjamin Bræstrup Sayoc 4e5e193c76 [Measure] Fix redundant variable assignment 2024-09-13 08:43:07 -05:00
wmayer 1c9432539a Port: Include changes of FreeBSD port 2024-09-13 08:32:16 -05:00
Yorik van Havre add3a14b6e Draft: Fixed function case 2024-09-13 15:01:50 +02:00
Yorik van Havre 04ee5f8583 Draft: Fixes error in Draft trackers when not on a 3D view 2024-09-13 15:01:38 +02:00
hoshengwei 84ae76764e fix ArchMaterialTaskPanel wrong import BimClassification Path
1. fix ArchMaterialTaskPanel wrong import BimClassification Path and icon after BIM merge into Arch

2. change taskpanel name to BIM material 

3. fix Qt slot and signal (more up to date style)
2024-09-13 12:12:24 +02:00
Yorik van Havre 6f6205ff41 Merge branch 'releases/FreeCAD-1-0' of github.com:FreeCAD/FreeCAD into releases/FreeCAD-1-0 2024-09-13 12:09:14 +02:00
Roy-043 f655c2545b Use max instead of if-else for numerical checks (as per linter warning) 2024-09-13 12:09:08 +02:00
Roy-043 5b38fc606c Draft: fix division by zero and count is zero for path arrays
Fixes #16468.
2024-09-13 12:08:56 +02:00
Adrián Insaurralde Avalos 92663a8773 GUI: Fix splashscreen for single image (#16428)
* fix splashscreen for single image
* improve clarity of splashscreen load order logic
* fix splashscreen with no _2x variant
2024-09-12 21:50:19 -05:00
mosfet80 701dc43675 fix CXX standard selection
only   CXX 23, 20 and 17 standards are allowed
2024-09-12 21:36:34 -05:00
pre-commit-ci[bot] 1bf69792ad [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-09-12 21:23:43 -05:00
wmayer 6878ed9ffa Qt6: QLocale::countryToString and QLocale::country() are deprecated since Qt 6.6 2024-09-12 21:23:43 -05:00
wmayer c478d2e22e Qt6: Several methods of QMouseEvent are deprecated since Qt 6.0 2024-09-12 21:23:43 -05:00
wmayer 769d46729a Qt6: QColor::setNamedColor is deprecated since Qt 6.6 2024-09-12 21:23:43 -05:00
Benjamin Bræstrup Sayoc 022fb23068 [Gui] Handle unset style preferences in clipboard about info
FIxes #16391
2024-09-12 21:20:50 -05:00
CalligaroV 0a5ceb636c Sketcher/Toponaming: import code for SketchObject::checkSubName() from LS3
* applied review hints

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-12 21:12:17 -05:00
Zheng, Lei 8e7fe5c5f2 Sketcher/Toponaming: import code for SketchObject::checkSubName() from LS3
* import code
 * add modified_item assignment in TaskSketcherElements::onSelectionChanged() like for non ExternalEdge
2024-09-12 21:12:07 -05:00
luzpaz 15d79e8a7b TechDraw: fix typo ballon->balloon 2024-09-12 12:11:58 -05:00
Kacper Donat d5ab4bda33 Gui: Force OpenGL rendering for main window
This is big hack for Qt6 to force rendering using OpenGL from the
beginning. Since Qt6 OpenGL context is initialized only after creating
first QOpenGLWidget which results in window hiding and showing again
after some delay. This causes various timing issus as the window is not
supposed to do that.
2024-09-12 12:11:27 -05:00
wmayer e790200395 StartPage: Make sure to pass a container widget to the QScrollArea
Fixes #16047: FreeBSD: Segfault in StartView::firstStartWidgetDismissed
2024-09-12 12:11:14 -05:00
wmayer 1720ac8ac1 MSVC: Fix several compiler warnings 2024-09-12 12:11:00 -05:00
Yorik van Havre 072d21135a BIM: Fixed bug in BimViews - fixes #16452 2024-09-12 14:31:15 +02:00
Furgo 8a19e37bec Check location and call corresponding addObject, add missing import. Fixes #16435 2024-09-12 14:29:47 +02:00
Yorik van Havre a1c8874705 Merge branch 'releases/FreeCAD-1-0' of github.com:FreeCAD/FreeCAD into releases/FreeCAD-1-0 2024-09-12 11:01:25 +02:00
Roy-043 3a7448afac BIM: fix BIM_Setup license issue
FreeCAD currently has 19 standard licenses. BIM_Setup could only handle the first 10.

Forum post:
https://forum.freecad.org/viewtopic.php?p=781578#p781535
2024-09-12 11:01:13 +02:00
Benjamin Bræstrup Sayoc 983fdfc671 [TechDraw] Fix uncentered balloon label 2024-09-11 19:50:01 -05:00
xtemp09 c2834e873d [GUI] Make some strings untranslatable in Light Sources dialog 2024-09-11 08:41:34 -05:00
Adrián Insaurralde Avalos dafc018b68 CI: add version to cache key for libpack/ccache download actions for win 2024-09-10 17:42:26 -04:00
Adrián Insaurralde Avalos bc815fd244 Fix compiler cache for conda linux builds 2024-09-10 17:42:19 -04:00
spanner888 e3ac0e4d09 save after del, new, add (#16230)
Co-authored-by: spanner888 <spanner888@users.noreply.github.com>
2024-09-10 11:21:04 -05:00
sliptonic 6eefc8e649 set default directory for sanity (#15934)
Respond correctly if user cancels  Fixes #14796

Co-authored-by: Brad Collette <bradcollette@pop-os.localdomain>
2024-09-10 10:24:59 -05:00
Furgo 20065e644b BIM: Fixes profile tool positioning (#16305)
* [BIM] Get working plane when picking a point

Fixes: #16284

* Use the new way of getting the Draft Working Plane
2024-09-10 11:49:23 +02:00
Pieter Hijma 589027ebec Core: Fix duplicated extensions (see #16299) 2024-09-09 22:12:12 -05:00
Murmele 6e203e7083 Measure: Show delta option also in interactive mode (#16379)
* Initial commit to apply delta also for interactive measurement
* Not required special logic to check if possible, it can be easily checked if the property exists
* remember setting so it is not required to turn it always on
2024-09-09 21:39:57 -05:00
marioalexis f7108ddd92 Fem: Set Elmer result output format to Ascii 2024-09-09 11:35:43 -05:00
marioalexis af3ea3bab3 Fem: Allow only one shape type per mesh group - Partially revert #16076 2024-09-09 11:33:06 -05:00
Morimiue 4c473a17eb Sketcher: transfer constraints on conic's mid point to the newly created conic arc (e.g. ellipse arc)" -m "Fixes #15860" -m "When spliting a sketch curve, constraints on the original curve are transferred to the newly created curve. The original code did not consider the constraints on the center point of an ellipse arc. 2024-09-09 11:31:30 -05:00
xtemp09 0e9fa777b3 [GUI] Enable sort of zoom in Light Sources dialog 2024-09-09 11:28:10 -05:00
Yorik van Havre 0b9b4d5347 Translations (#16389)
* Translations: Updated ts files

* Translations: Merged crowdin translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-09 11:26:13 -05:00
wmayer 9f14e6e87b Core: Placement dialog
+ replace separate buttons with QDialogButtonBox
+ add convenience method setPlacementAndBindObject
+ use const DocumentObject
2024-09-09 11:25:31 -05:00
wmayer 8828587084 Core: Add option to ignore transactions in placement dialog 2024-09-09 11:25:31 -05:00
wmayer 687f01c84a Core: Expose Placement dialog to Python 2024-09-09 11:25:31 -05:00
wmayer d07ae89f72 Core: Change placement dialog to operate on passed selection objects 2024-09-09 11:25:30 -05:00
wmayer bb3c7afe95 Core: Refactor placement dialog 2024-09-09 11:25:30 -05:00
PaddleStroke 71c6a4f3d7 Assembly: Replace Offset and Rotation properties by Offset1 and Offset2, giving full control over JCS positions. 2024-09-09 11:22:22 -05:00
PaddleStroke bcd08a01ba Sketcher: Rectangle DSH: refactor the createShape function. 2024-09-09 11:15:15 -05:00
PaddleStroke 8108b93058 Sketcher: Fix round corner + thickness issue if radius + thickness = 0. 2024-09-09 11:15:15 -05:00
Florian Foinant-Willig e7acb60253 [PD] Fix helix placement 2024-09-09 11:11:50 -05:00
Kacper Donat 985089a26d Sketcher: AutoColor should update only colors
Previously AutoColor property forced reinitialization of all subscribed
parameters. It was mostly fine as most of them should stay in sync with
user settings but it also affected grids.
2024-09-09 18:08:29 +02:00
CalligaroV 2dd4526531 Call ComplexGeoData::ensureElementMap() in ComplexGeoData::readElements()
Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-09-09 11:06:18 -05:00
Syres916 20b996ab12 [Spreadsheet] Fix CSV import by insert 2024-09-09 11:04:23 -05:00
wmayer d4feb51402 Port: Include some important changes of the OpenBSD port
Forum thread: https://forum.freecad.org/viewtopic.php?t=80792
2024-09-09 11:01:52 -05:00
Bas Ruigrok ec61f5e3fb Gui: Fix orthographic camera standard views in an empty scene 2024-09-09 11:00:05 -05:00
Bas Ruigrok 12b06306a3 Gui: Use Coin 4.0.3 fix for orthographic camera clipping 2024-09-09 10:58:54 -05:00
Benjamin Nauck e94e12723f Spreadsheet XLSX import: Fix bug causing xls import failing for some operators (#16336)
* Fix bug causing xls import failing for some comparisons

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Benjamin Nauck <benjamin.nauck@adlede.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-09-09 10:56:12 -05:00
Roy-043 d45016ee8a BIM: ArchFence: Fix some color issues
* ShapeAppearance property was misspelled.
* The post and section objects could not be Std_Parts (because they do not have a DIffuseColor).
* Minor improvements to the handling of Bodies.
* Removed the `if __name__ == '__main__':` section. This code is no longer relevant.
2024-09-09 17:52:08 +02:00
Furgo b7514bf848 [BIM] Separate profile name from label number (#16304)
* [BIM] Separate profile name from label number

Fixes: #16286

* Make internal name generic
2024-09-09 10:49:27 -05:00
MisterMakerNL 7a297f76bf changed selection colors 2024-09-09 10:49:27 -05:00
wandererfan 54eb7b3d9f [TD]fix initial balloon placement on rotated view (fix #16234) 2024-09-09 10:49:27 -05:00
Roy-043 280548fb50 BIM: BimWindow.py add missing imports 2024-09-09 17:49:01 +02:00
PaddleStroke 1a270ca088 Update Ondsel Solver 2024-09-09 09:40:33 -05:00
Roy-043 455cad24eb BIM: Fix window transparency
V1.0 fix for the transparency of glass panels in windows and doors.
2024-09-09 11:43:13 +02:00
huguesdpdn-aerospace 7a6a82e2ca PD: Xerces-C++ - Prepare for the latest version (backward compatible) 2024-09-08 20:32:08 -05:00
Jiří Pinkava 5fba69e328 OverlayManager: fix unititialized hideTab variable
The hideTab is of type bool, which is primitive type and is thus unitialized if new
instance of the class is created. The exception would be to for static
instance of the class, but that is not the case (only the pointer to the instance is static).

It was originaly initialized, but the initialization was removed in
9d5390ed83.
2024-09-08 20:14:03 -05:00
PaddleStroke 708e07e594 App::Link: fix crash with Draft Array (#16240)
* App::Link: fix crash with Draft Array
2024-09-08 17:13:38 -05:00
Benjamin Bræstrup Sayoc 9c95a7aa3a Add myself to contributors 2024-09-08 17:08:48 -05:00
Benjamin Bræstrup Sayoc 8cdcbe361f [Gui] Add style, theme and QtStyle to clipboard about info
Fixes #16272
2024-09-08 17:08:48 -05:00
Benjamin Bræstrup Sayoc 61bb5abfa2 [Gui] QtStyle preference consistency
Previously, the some of the code searched for the QtStyle in the wrong location
2024-09-08 17:08:48 -05:00
Syres916 422c7370a7 [Measure] Disable QuickMeasure for TechDraw, Spreadsheet, Part Container and Origin objects (#16225)
* [Measure] Disable QuickMeasure for TechDraw objects
* [Measure] Add spreadsheet, Part containers and origins to the exemptions
2024-09-08 16:51:24 -05:00
FEA-eng 0165db7e79 FEM: Update Material.ui 2024-09-08 16:29:08 -05:00
FEA-eng 3b192c533b FEM: Update write_femelement_material.py 2024-09-08 16:29:07 -05:00
FEA-eng 2b609b64ec FEM: Update task_material_common.py
Fix from benj5378
2024-09-08 16:29:07 -05:00
David Carter b05dc2da73 Materials: UI updates for transparency
Add missing UI elements to support per face transparencies:
- Setting per face transparencies
- show transparency information in the appearance inspector
- expose alpha channel in material properties dialog
2024-09-06 12:30:08 -05:00
Roy-043 aa1ec60f65 Draft: fix snapping to endpoints of dimension lines (V0.19 regression)
This fixes a regression introduced in V0.19 (!) when the type of linear dimensions was changed from "Dimension" to "LinearDimension".

Forum topic:
https://forum.freecad.org/viewtopic.php?t=90292
2024-09-05 13:18:40 +02:00
Chris Hennes 60a251354e Core: Update version number to 1.0.0RC1 2024-09-05 08:32:33 +02:00
10194 changed files with 2504078 additions and 2442154 deletions
+48 -75
View File
@@ -1,22 +1,22 @@
# --- Based on Qt Coding Style ---
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
# --- Bracket and Indentation Behavior ---
IndentWidth: 4
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
ColumnLimit: 100
UseTab: Never
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: DontAlign
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackParameters: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
BreakTemplateDeclarations: Yes
BreakBeforeBinaryOperators: All
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
@@ -31,68 +31,41 @@ BraceWrapping:
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
# --- Special: Lambdas and Short Things ---
AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Inline
AllowAllArgumentsOnNextLine: false
# --- Spaces ---
SpaceBeforeParens: ControlStatements
SpaceAfterCStyleCast: false
Cpp11BracedListStyle: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeRangeBasedForLoopColon: true
SpacesBeforeTrailingComments: 2
SpaceAfterTemplateKeyword: false
SpaceBeforeInheritanceColon: false
# --- Alignment & Formatting Tweaks ---
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignOperands: DontAlign
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
PointerAlignment: Left
ReferenceAlignment: Left
# --- Comment Style ---
CommentPragmas: '^ IWYU pragma:'
# --- Namespace handling ---
NamespaceIndentation: None
# --- Others ---
SortIncludes: Never
IncludeBlocks: Preserve
MaxEmptyLinesToKeep: 2
BreakInheritanceList: BeforeColon
ColumnLimit: 100
CompactNamespaces: false
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
InsertBraces: true
AlignEscapedNewlines: DontAlign
PPIndentWidth: 1
IndentPPDirectives: AfterHash
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: Never
PointerAlignment: Left
ReflowComments: true
# --- Penalties (Fine-tuning when to break lines) ---
PenaltyBreakAssignment: 80
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 60
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakOpenParenthesis: 5
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 600
SortIncludes: Never
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
+8 -3
View File
@@ -1,13 +1,14 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,boost-*,bugprone-*,
performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*,google-explicit-constructor,
concurrency-*,-modernize-use-trailing-return-type, -modernize-use-nodiscard,-readability-identifier-length,
-readability-redundant-access-specifiers,-readability-qualified-auto,-readability-implicit-bool-conversion,
-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-cppcoreguidelines-avoid-do-while,
concurrency-*,-modernize-use-trailing-return-type, -modernize-use-nodiscard,
-readability-redundant-access-specifiers,-readability-qualified-auto,
-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,
-readability-convert-member-functions-to-static,-bugprone-easily-swappable-parameters,
-cppcoreguidelines-pro-type-static-cast-downcast'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: file
User: florians
CheckOptions:
@@ -149,6 +150,8 @@ CheckOptions:
value: '0'
- key: concurrency-mt-unsafe.FunctionSet
value: any
- key: readability-identifier-length.IgnoredExceptionVariableNames
value: '^[e]$'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: bugprone-reserved-identifier.AllowedIdentifiers
@@ -203,6 +206,8 @@ CheckOptions:
value: '4294967295'
- key: bugprone-suspicious-missing-comma.RatioThreshold
value: '0.200000'
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: 'false'
- key: readability-identifier-length.IgnoredParameterNames
value: '^[n]$'
- key: readability-function-size.StatementThreshold
-4
View File
@@ -102,7 +102,3 @@ c5c2ea3498f402c0c89916c46ddb071e22756622 # Assembly: Final application of pre-co
d472927bba7b2d8d151c99fb29cf1d8dd099ea7d # Correct PartDesign Helix feature negative angles (#11399)
b93c02e07da4990482b9d927506901e6f5d624e1 # Black updated to 24.3.0
cbea6b60942f8327e6105b12e8c1d5db4647984c # FEM: Apply pre-commit to FEM files
f9d66096878c7d89c273522b9ca57bdb14fee3bc # Rearranged CommandCreateGeo.cpp
b23d5809414d63ea90bcc744212c126645051438 # BIM: add to pre-commit and apply Black formatting
50e4864efb06faf3e2126e8cb9ff9058a08a54b2 # Draft: add to pre-commit and apply Black formatting
25c3ba733889264bcb3b3c8d2287b79053c0c8ec # All: Reformat according to new standard
+1
View File
@@ -1,6 +1,7 @@
# These are supported funding model platforms
github: FreeCAD
liberapay: FreeCAD
open_collective: freecad
patreon: # Replace with a single Patreon username
ko_fi: # Replace with a single Ko-fi username
@@ -1,92 +0,0 @@
name: Report a Problem
description: Have you found something that does not work well, is too hard to do or is missing altogether? Please create a Problem Report.
labels: ["Status: Needs triage","Status: Needs confirmation"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this problem report! Please [search](https://github.com/FreeCAD/FreeCAD/issues) if a similar issue already exists and check out [how to report issues](https://github.com/FreeCAD/FreeCAD?tab=readme-ov-file#reporting-issues). By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/FreeCAD/FreeCAD/blob/main/CODE_OF_CONDUCT.md).
- type: textarea
id: description
attributes:
label: Problem description
description: Describe the problem and how it impacts user experience, workflow, maintainability or performance. 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.
placeholder: Describe your problem briefly.
validations:
required: true
- type: dropdown
id: wb
attributes:
label: Workbench affected?
options:
- Assembly
- BIM
- CAM
- Core (App, Gui,...)
- Draft
- FEM
- Material
- Measurement
- Mesh
- Part
- Part Design
- Sketcher
- Spreadsheet
- TechDraw
- Other (specify in description)
- type: textarea
id: steps_to_reproduce
attributes:
label: Steps to reproduce
description: If the problem appears to be a bug with the current functionality, provide a test case or recipe that reliably reproduces the issue. Ideally [record a macro](https://wiki.freecad.org/Std_DlgMacroRecord) and attach it. Please also add an example file as ZIP.
placeholder: |
Drag an example file as ZIP into this textbox to attach it.
Steps to reproduce the behavior:
1. Open my example file
2. Go to '...'
3. Click on '...'
validations:
required: true
- type: textarea
id: expected_behavior
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen when following the provided steps above.
placeholder: What is the expected behavior?
validations:
required: true
- type: textarea
id: actual_behavior
attributes:
label: Actual behavior
description: A clear and concise description of what actually happens. If applicable, add screenshots to help explain the problem.
placeholder: What is actually happening? You can add screenshorts or videos by dragging them into this textbox.
validations:
required: true
- type: textarea
id: dev_version
attributes:
label: Development version About Info (in Safe Mode)
description: Download the latest weekly [development release](https://github.com/FreeCAD/FreeCAD/releases) and try reproducing the issue in safe mode (Help → Restart in Safe Mode). Use the [About FreeCAD](https://wiki.freecad.org/About) dialog to copy your full version information and paste it here.
placeholder: |
1. Download the latest weekly development version (link above).
2. Make sure to run in Safe Mode (Help -> Restart in Safe Mode) to exclude interference from 3rd party addons.
3. If the issue is still reproducible, open the About FreeCAD dialog and copy the full version info here.
render: shell
validations:
required: true
- type: textarea
id: good_version
attributes:
label: Last known good version (optional)
description: If this is a regression, paste the [About FreeCAD](https://wiki.freecad.org/About) info from the last known working version.
placeholder: If the problem did not exist in a previous version, paste the About FreeCAD info from that version here.
render: shell
@@ -1,103 +0,0 @@
name: Report a Code Quality Issue
description: Report problems related to code structure, maintainability, performance, correctness, or technical debt that do not directly affect end-user behavior.
labels: ["Status: Needs triage", "Status: Needs confirmation", "Type: Code Quality"]
type: "Code Quality"
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to help improve FreeCAD's code quality!
> [!NOTE]
> This form is intended **only for code quality issues**, such as:
> - Architectural or design problems
> - Maintainability or readability issues
> - Performance or scalability concerns
> - Incorrect abstractions, layering violations, or technical debt
>
> If the issue affects user-visible behavior, workflows, or UI, please use the regular **Report Problem** form instead.
Please [search existing issues](https://github.com/FreeCAD/FreeCAD/issues) before submitting.
By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/FreeCAD/FreeCAD/blob/main/CODE_OF_CONDUCT.md).
- type: dropdown
id: wb
attributes:
label: Area / Workbench affected
description: Select the primary area affected by the code quality issue.
options:
- Assembly
- BIM
- CAM
- Core (App, Gui, Base, ...)
- Draft
- FEM
- Material
- Measurement
- Mesh
- Part
- Part Design
- Sketcher
- Spreadsheet
- TechDraw
- Build system / CI
- Documentation
- Other (specify below)
- type: textarea
id: description
attributes:
label: Problem description
description: |
Describe the code quality issue clearly.
Focus on *why* the current implementation is problematic (e.g. maintainability, performance, correctness, extensibility).
Reference files, classes, functions, or modules where applicable.
placeholder: |
Example:
- Class X violates dependency rules by including Y
- Function Z mixes responsibilities and is hard to reason about
- Algorithm has unnecessary complexity or poor performance characteristics
validations:
required: true
- type: textarea
id: impact
attributes:
label: Impact
description: |
Explain the practical impact of this issue.
For example: increased maintenance cost, higher bug risk, performance degradation, difficulty extending functionality, or CI/build issues.
placeholder: Describe how this affects the codebase long-term.
validations:
required: true
- type: textarea
id: proposed_solution
attributes:
label: Suggested improvement (optional)
description: |
If you have ideas on how to address the issue, outline them here.
This can include refactoring suggestions, alternative designs, or references to best practices.
placeholder: Optional — leave empty if unsure.
- type: textarea
id: references
attributes:
label: References / evidence
description: |
Add relevant references such as:
- File paths or code snippets
- Related issues or pull requests
- Benchmarks, logs, or static analysis results
placeholder: Links, snippets, or related issues.
- type: textarea
id: dev_version
attributes:
label: Development version (if relevant)
description: |
If the issue is version-specific or recently introduced, paste the output from the
**About FreeCAD** dialog of a development build.
Otherwise, this can be left empty.
placeholder: Paste About FreeCAD information here.
render: shell
+71
View File
@@ -0,0 +1,71 @@
name: Report a Problem
description: Have you found something that does not work well, is too hard to do or is missing altogether? Please create a Problem Report.
labels: ["Status: Needs triage"]
body:
- type: checkboxes
id: existing_issue
attributes:
label: Is there an existing issue for this?
description: Please [search](https://github.com/FreeCAD/FreeCAD/issues) to see if a similar issue already exists for the problem you encountered.
options:
- label: I have searched the existing issues
required: true
- 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. Ideally record a macro and attach it.
placeholder: Description of the problem
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
- Assembly
- BIM
- CAM
- Core
- Draft
- Expressions
- FEM
- File formats
- Mesh
- OpenSCAD
- Part
- PartDesign
- Project Tools & Websites
- Sketcher
- Spreadsheet
- TechDraw
- Other (specify in description)
- 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.
You can upload or copy your macro here to speed up the diagnosis and debugging.
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/main/CODE_OF_CONDUCT.md)
options:
- label: I agree to follow this project's Code of Conduct
required: true
+1 -26
View File
@@ -1,6 +1,4 @@
aci
addmin
afile
ake
aline
alle
@@ -8,23 +6,19 @@ alledges
alocation
anid
anormal
anull
apoints
aply
appy
ascript
ba
beginn
bloaded
bottome
brushin
childrens
childs
connexion
currenty
curvelinear
detet
documentin
doubleclick
dum
eiter
@@ -34,28 +28,18 @@ finde
findn
fle
fo
fpt
freez
froms
graphin
hist
incrementin
indexin
indicies
indx
inout
invertin
isnt
ist
itsel
leadin
linez
localy
lod
mantatory
mata
methode
mke
modell
nd
nin
@@ -65,30 +49,21 @@ numer
oce
ontop
ot
pard
parm
parms
pointin
programm
propt
rady
recurrance
rin
rougly
sectionin
seh
ser
sergent
serie
shs
siz
som
strack
strin
substraction
sur
te
textin
thist
tread
ue
@@ -99,4 +74,4 @@ vas
vertexes
vew
wallthickness
zuser
zuser
-11
View File
@@ -1,11 +0,0 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: pip
directory: /
schedule:
interval: daily
+1 -9
View File
@@ -80,13 +80,9 @@
- changed-files:
- any-glob-to-any-file: ['src/Mod/Spreadsheet/**/*']
"Mod: Start":
- changed-files:
- any-glob-to-any-file: ['src/Mod/Start/**/*']
"Mod: Surface":
- changed-files:
- any-glob-to-any-file: ['src/Mod/Surface/**/*']
- any-glob-to-any-file: ['src/Mod/Surface/**/*/']
"Mod: TechDraw":
- changed-files:
@@ -102,10 +98,6 @@
- changed-files:
- any-glob-to-any-file: ['cMake/**/*']
"3rd party component":
- changed-files:
- any-glob-to-any-file: ['src/3rdParty/**/*']
# 'Topic' related labels
"Topic: Stylesheets":
+11 -11
View File
@@ -1,15 +1,15 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "black-warning",
"severity": "warning",
"pattern": [
{
"owner": "black-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(would reformat (.*))$",
"file": 2,
"message": 1
}
]
"regexp": "^(would reformat (.*))$",
"file": 2,
"message": 1
}
]
]
}
]
}
+13 -13
View File
@@ -1,17 +1,17 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "clang",
"pattern": [
{
"owner": "clang",
"pattern": [
{
"regexp": "^(.+):([0-9]+):([0-9]+): (error|warning|note): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
"regexp": "^(.+):([0-9]+):([0-9]+): (error|warning|note): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
]
}
]
}
+12 -12
View File
@@ -1,16 +1,16 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "codespell-matcher",
"severity": "warning",
"pattern": [
{
"owner": "codespell-matcher",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s+(.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
"regexp": "^(.+):(\\d+):\\s+(.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
]
}
]
}
+12 -12
View File
@@ -1,16 +1,16 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "cpplint",
"severity": "warning",
"pattern": [
{
"owner": "cpplint",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):([0-9]+): (.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
"regexp": "^(.+):([0-9]+): (.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
]
}
]
}
+12 -12
View File
@@ -1,16 +1,16 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "grepMatcher-warning",
"severity": "warning",
"pattern": [
{
"owner": "grepMatcher-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+):([0-9]+):(.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
"regexp": "^(.+):([0-9]+):(.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
]
}
]
}
+1 -2
View File
@@ -1,6 +1,5 @@
{
"__comment":
"Taken from vscode's vs/workbench/contrib/tasks/common/problemMatcher.ts msCompile rule",
"__comment": "Taken from vscode's vs/workbench/contrib/tasks/common/problemMatcher.ts msCompile rule",
"problemMatcher": [
{
"owner": "msvc-problem-matcher",
+14 -14
View File
@@ -1,18 +1,18 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "pylint-error",
"severity": "error",
"pattern": [
{
"owner": "pylint-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.+?):([0-9]+):([0-9]+): ([([E|F][0-9]+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
"regexp": "^(.+?):([0-9]+):([0-9]+): ([([E|F][0-9]+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
]
}
]
}
+14 -14
View File
@@ -1,18 +1,18 @@
{
"problemMatcher": [
"problemMatcher": [
{
"owner": "pylint-warning",
"severity": "warning",
"pattern": [
{
"owner": "pylint-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.+?):([0-9]+):([0-9]+): ([^E|F][0-9]+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
"regexp": "^(.+?):([0-9]+):([0-9]+): ([^E|F][0-9]+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
]
}
]
}
-46
View File
@@ -1,46 +0,0 @@
<!-- Include a brief summary of the changes. -->
<!--
The FreeCAD community thanks you for your contribution!
By creating a Pull Request you agree to the contributing policy. The complete policy can be found in the root of the source tree (CONTRIBUTING.md) or at https://github.com/FreeCAD/FreeCAD/blob/main/CONTRIBUTING.md
This template provides guidance on creating a PR that can be reviewed and approved as quickly as possible. Comments may be safely deleted.
Unless you know exactly what you're doing, please leave the checkbox 'Allow edits by maintainers' enabled. This will allow maintainers to help you.
-->
## Issues
<!-- link to individual issues this PR closes by referencing the issue number (e.g., fixes #1234, closes #4321). -->
## Before and After Images
<!-- If your proposed changes affect the FreeCAD GUI, add before and after screenshots -->
<!-- Notes on the PR Review Process
The following section describes what the maintainers consider when reviewing your Pull Request. These items may not require you to take any action. This information is provided for context. Understanding what we consider will help you prepare your request for speedy approval.
You can find additional documentation about these guidelines in the [Developers handbook](https://freecad.github.io/DevelopersHandbook).
Alignment (Does the PR align with the goals and interests of the project?)
- Does the PR have at least one issue linked, which this PR closes?
- Has the conversation on the PR and related issue(s) reached consensus?
- If the PR affects the GUI, is the Design Working Group (DWG) aware and have they had time to review and comment?
- If the PR affects the GUI, did the contributor include before/after images?
- If the PR affects standards and workflow, is the CAD Working Group (CWG) aware and have they had time to review/comment?
Impact (Does the change affect other parts of the project?)
- Has the impact on documentation been considered and appropriate action taken?
- Has the impact on translation been considered appropriate action taken?
- Will the PR affect existing user documents?
Code Quality (Is code well-written and maintainable?)
- Does the PR warrant a review by the Code Quality Working Group (CQWG)?
- Does the change include tests?
- Is the PR rebased on the current main branch with unnecessary commits squashed?
Release (Are there considerations related to release timing?)
- Has the PR been considered for backporting to the latest release branch?
- Have the release notes been considered/updated?
-->
-168
View File
@@ -1,168 +0,0 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
"""
run_gui_tests.py
List registered tests via `FreeCAD -t`, filter for GUI tests (names containing 'Gui'), and run each
GUI test module using the specified FreeCAD executable.
Usage:
run_gui_tests.py [FREECAD_EXEC]
If FREECAD_EXEC is omitted the script falls back to 'FreeCAD' on PATH.
If FREECAD_EXEC is a directory containing bin/FreeCAD, that binary is used.
If FREECAD_EXEC is an executable path, it is used directly.
This script returns 0 if all GUI modules run successfully. Otherwise it returns the last non-zero
exit code.
"""
from __future__ import annotations
import sys
import subprocess
import os
from pathlib import Path
def find_executable(arg: str | None) -> str:
"""Return the FreeCAD executable path to use.
If `arg` is None or empty, returns the plain name 'FreeCAD' which will be looked up on PATH. If
`arg` is a directory and contains `bin/FreeCAD` that binary will be returned. If `arg` is a file
path it is returned as-is. Otherwise the original argument is returned.
Common use cases: use the FreeCAD binary from a build directory or an installed FreeCAD prefix.
"""
if not arg:
return "FreeCAD"
p = Path(arg)
if p.is_dir():
candidate = p / "bin" / "FreeCAD"
if candidate.exists():
return str(candidate)
if p.is_file():
return str(p)
# fallback: return as-is (may be on PATH)
return arg
def validate_executable(path: str) -> tuple[bool, str]:
"""Return (ok, message). Checks if the executable exists or is likely on PATH.
This is best effort: if a bare name is given (e.g. 'FreeCAD') we can't stat it here, so we
accept it but warn. If the path points to a file, we check executability. Also warn if the name
looks like the CLI-only 'FreeCADCmd'.
"""
p = Path(path)
if p.is_file():
if not os.access(str(p), os.X_OK):
return False, f"File exists but is not executable: {path}"
if p.name.endswith("FreeCADCmd"):
return (
True,
(
"Warning: executable looks like 'FreeCADCmd' (CLI); GUI tests require the GUI "
"binary 'FreeCAD'."
),
)
return True, ""
# Bare name or non-existent path: accept but warn
if p.name.endswith("FreeCADCmd"):
return (
True,
(
"Warning: executable name looks like 'FreeCADCmd' (CLI); GUI tests require the GUI "
"binary 'FreeCAD'."
),
)
return True, ""
def run_and_capture(cmd: list[str]) -> tuple[int, str]:
"""Run `cmd` and return (returncode, combined stdout+stderr string).
If the executable is not found a return code of 127 is returned and a small error string is
provided as output to aid diagnosis.
"""
try:
proc = subprocess.run(
cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, check=False
)
return proc.returncode, proc.stdout
except FileNotFoundError:
return 127, f"Executable not found: {cmd[0]}\n"
def parse_registered_tests(output: str) -> list[str]:
"""Parse output from `FreeCAD -t` and return a list of registered test unit names.
The function looks for the section starting with the literal 'Registered test units:' and
then collects non-empty, stripped lines from that point onwards as test names.
"""
lines = output.splitlines()
tests: list[str] = []
started = False
for ln in lines:
if not started:
if "Registered test units:" in ln:
started = True
continue
s = ln.strip()
if not s:
# allow blank lines but keep going
continue
tests.append(s)
return tests
def main(argv: list[str]) -> int:
"""Entry point: run GUI test modules registered in the FreeCAD executable.
Returns the last non-zero exit code from any GUI test module, or 0 on success.
"""
exec_arg = argv[1] if len(argv) > 1 else None
freecad_exec = find_executable(exec_arg)
print(f"Using FreeCAD executable: {freecad_exec}")
ok, msg = validate_executable(freecad_exec)
if msg:
print(msg, file=sys.stderr)
if not ok:
print(f"Aborting: invalid FreeCAD executable: {freecad_exec}", file=sys.stderr)
return 3
code, out = run_and_capture([freecad_exec, "-t"])
if code != 0:
print(
f"Warning: listing tests returned exit code {code}; attempting to parse output anyway",
file=sys.stderr,
)
tests = parse_registered_tests(out)
if not tests:
print("No registered tests found; exiting with success.")
return 0
gui_tests = [t for t in tests if "Gui" in t]
if not gui_tests:
print("No GUI tests found in registered tests; nothing to run.")
return 0
print("Found GUI test modules:")
for t in gui_tests:
print(" ", t)
last_rc = 0
for mod in gui_tests:
print(f"\nRunning GUI tests for module: {mod}")
rc, out = run_and_capture([freecad_exec, "-t", mod])
print(out)
if rc != 0:
print(f"Module {mod} exited with code {rc}", file=sys.stderr)
last_rc = rc
return last_rc
if __name__ == "__main__":
sys.exit(main(sys.argv))
+1 -6
View File
@@ -57,11 +57,6 @@ jobs:
env:
logdir: /tmp/log/
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Make needed directories
run: |
mkdir -p ${{ env.logdir }}
@@ -108,7 +103,7 @@ jobs:
done
- name: Upload logs
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}-Logs
path: |
+20 -19
View File
@@ -26,21 +26,14 @@
name: FreeCAD master CI
on:
workflow_dispatch: ~
push:
branches:
- main
- releases/**
pull_request: ~
merge_group: ~
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:
@@ -52,38 +45,46 @@ jobs:
with:
artifactBasename: Pixi-${{ github.run_id }}
Ubuntu:
MacOS_13_Conda_Apple:
needs: [Prepare]
if: "!startsWith(github.head_ref, 'refs/heads/backport-')"
uses: ./.github/workflows/sub_buildUbuntu.yml
uses: ./.github/workflows/sub_buildMacOSCondaApple.yml
with:
artifactBasename: Ubuntu-${{ github.run_id }}
artifactBasename: MacOS_13_Conda_Apple-${{ github.run_id }}
Ubuntu_20-04:
needs: [Prepare]
uses: ./.github/workflows/sub_buildUbuntu2004.yml
with:
artifactBasename: Ubuntu_20-04-${{ github.run_id }}
Ubuntu_24-04_Conda:
needs: [Prepare]
uses: ./.github/workflows/sub_buildUbuntu2404Conda.yml
with:
artifactBasename: Ubuntu_24-04_Conda-${{ github.run_id }}
Windows:
needs: [Prepare]
if: "!startsWith(github.head_ref, 'refs/heads/backport-')"
uses: ./.github/workflows/sub_buildWindows.yml
with:
artifactBasename: Windows-${{ github.run_id }}
Lint:
needs: [Prepare]
if: "!startsWith(github.head_ref, 'refs/heads/backport-')"
uses: ./.github/workflows/sub_lint.yml
with:
artifactBasename: Lint-${{ github.run_id }}
changedFiles: ${{ needs.Prepare.outputs.changedFiles }}
changedLines: ${{ needs.Prepare.outputs.changedLines }}
changedCppFiles: ${{ needs.Prepare.outputs.changedCppFiles }}
changedCppLines: ${{ needs.Prepare.outputs.changedCppLines }}
changedPythonFiles: ${{ needs.Prepare.outputs.changedPythonFiles }}
changedPythonLines: ${{ needs.Prepare.outputs.changedPythonLines }}
WrapUp:
needs: [
Prepare,
Pixi,
Ubuntu,
MacOS_13_Conda_Apple,
Ubuntu_20-04,
Ubuntu_24-04_Conda,
Windows,
Lint
]
@@ -47,33 +47,13 @@ runs:
testCommand: ${{ inputs.builddir }}/tests/Assembly_tests_run --gtest_output=json:${{ inputs.reportdir }}assembly_gtest_results.json
testLogFile: ${{ inputs.reportdir }}assembly_gtest_test_log.txt
testName: Assembly
- name: C++ app tests
id: app
- name: C++ core tests
id: core
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
with:
testCommand: ${{ inputs.builddir }}/tests/App_tests_run --gtest_output=json:${{ inputs.reportdir }}app_gtest_results.json
testLogFile: ${{ inputs.reportdir }}app_gtest_test_log.txt
testName: App
- name: C++ base tests
id: base
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
with:
testCommand: ${{ inputs.builddir }}/tests/Base_tests_run --gtest_output=json:${{ inputs.reportdir }}base_gtest_results.json
testLogFile: ${{ inputs.reportdir }}base_gtest_test_log.txt
testName: Base
- name: C++ Gui tests
id: gui
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
with:
testCommand: ${{ inputs.builddir }}/tests/Gui_tests_run --gtest_output=json:${{ inputs.reportdir }}gui_gtest_results.json
testLogFile: ${{ inputs.reportdir }}gui_gtest_test_log.txt
testName: Gui
- name: C++ Qt tests
id: qttests
uses: ./.github/workflows/actions/runCPPTests/runQtTests
with:
builddir: ${{ inputs.builddir }}
testLogFile: ${{ inputs.reportdir }}qt_ctest_log.txt
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++ Material tests
id: material
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
@@ -102,13 +82,6 @@ runs:
testCommand: ${{ inputs.builddir }}/tests/Mesh_tests_run --gtest_output=json:${{ inputs.reportdir }}meshpart_gtest_results.json
testLogFile: ${{ inputs.reportdir }}meshpart_gtest_test_log.txt
testName: MeshPart
- name: C++ Misc tests
id: misc
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
with:
testCommand: ${{ inputs.builddir }}/tests/Misc_tests_run --gtest_output=json:${{ inputs.reportdir }}misc_gtest_results.json
testLogFile: ${{ inputs.reportdir }}misc_gtest_test_log.txt
testName: Misc
- name: C++ Part tests
id: part
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
@@ -144,13 +117,6 @@ runs:
testCommand: ${{ inputs.builddir }}/tests/Sketcher_tests_run --gtest_output=json:${{ inputs.reportdir }}spreadsheet_gtest_results.json
testLogFile: ${{ inputs.reportdir }}spreadsheet_gtest_test_log.txt
testName: Spreadsheet
- name: C++ Start tests
id: start
uses: ./.github/workflows/actions/runCPPTests/runSingleTest
with:
testCommand: ${{ inputs.builddir }}/tests/Start_tests_run --gtest_output=json:${{ inputs.reportdir }}start_gtest_results.json
testLogFile: ${{ inputs.reportdir }}start_gtest_test_log.txt
testName: Start
- name: Compose summary report based on test results
if: always()
shell: bash -l {0}
@@ -1,55 +0,0 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileNotice: Part of the FreeCAD project.
name: runQtTests
description: "Run all QtTest-based C++ tests (those labelled 'Qt' in CTest), generate log and report"
inputs:
builddir:
description: "Build directory containing CTestTestfile.cmake"
required: true
testLogFile:
description: "Path for the command-line output of the tests"
required: true
outputs:
reportText:
description: "Report text"
value: ${{ steps.report.outputs.reportText }}
runs:
using: "composite"
steps:
- name: Run Qt tests via CTest
shell: bash -l {0}
env:
BUILD_DIR: ${{ inputs.builddir }}
TEST_LOG_FILE: ${{ inputs.testLogFile }}
run: |
set -o pipefail
ctest --test-dir "$BUILD_DIR" -L Qt --output-on-failure | tee -a "$TEST_LOG_FILE"
- name: Parse test results
if: always()
id: report
shell: bash -l {0}
env:
TEST_LOG_FILE: ${{ inputs.testLogFile }}
run: |
result=$(grep -E "(Test #|tests passed|tests failed|Total Test time)" "$TEST_LOG_FILE" || true)
if grep -qE "[1-9][0-9]* tests failed" "$TEST_LOG_FILE"
then
reportText="<details><summary>:fire: QtTest C++ tests failed</summary>\n"
else
reportText="<details><summary>:heavy_check_mark: QtTest C++ tests 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,62 +0,0 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileNotice: Part of the FreeCAD project.
name: runSingleQtTest
description: "Run a single QtTest-based C++ test executable, generate log and report"
inputs:
testCommand:
description: "Test executable path"
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 QtTest tests
shell: bash -l {0}
env:
QT_QPA_PLATFORM: offscreen
TEST_COMMAND: ${{ inputs.testCommand }}
TEST_LOG_FILE: ${{ inputs.testLogFile }}
run: |
set -o pipefail
$TEST_COMMAND | tee -a "$TEST_LOG_FILE"
- name: Parse test results
if: always()
id: report
shell: bash -l {0}
env:
TEST_LOG_FILE: ${{ inputs.testLogFile }}
TEST_NAME: ${{ inputs.testName }}
run: |
# This bonkers sed regex is to try to find the start and end of the QtTest output block, which is not really
# designed to be machine-readable. Why did they have to choose asterisks?!?!
result=$(sed -n '/^\*\*\*\*\*\*\*\*\* Start/,/^\*\*\*\*\*\*\*\*\* Finished/p' "$TEST_LOG_FILE" || true)
if grep -qE "^FAIL!" "$TEST_LOG_FILE"
then
reportText="<details><summary>:fire: QtTest C++ test suite '${TEST_NAME}' failed</summary>\n"
else
reportText="<details><summary>:heavy_check_mark: QtTest C++ test suite '${TEST_NAME}' 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"
@@ -41,11 +41,11 @@ inputs:
libpackdownloadurl:
description: "URL where to download libpack"
required: false
default: https://github.com/FreeCAD/FreeCAD-LibPack/releases/download/3.1.1.3/LibPack-1.1.0-v3.1.1.3-Release.7z
default: https://github.com/FreeCAD/FreeCAD-LibPack/releases/download/3.0.0RC4/LibPack-1.0.0-v3.0.0RC4-Release.7z
libpackname:
description: "Libpack name (once downloaded)"
required: false
default: LibPack-1.1.0-v3.1.1.3-Release
default: LibPack-1.0.0-v3.0.0RC4-Release
runs:
using: "composite"
@@ -1,133 +0,0 @@
# This workflow warns and then closes issues that have had no activity for a
# specified amount of time. You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/marketplace/actions/close-stale-issues
# https://github.com/actions/stale/blob/master/action.yml
# https://github.com/actions/stale
---
name: 'Stale Issues'
on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 0 * * *' # Run at 00:00 UTC every day
workflow_dispatch:
permissions:
contents: read
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale pull requests
jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: '🧹 Tag & close stale unconfirmed bugs'
id: stale_issues
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 90
days-before-issue-close: 14
days-before-pr-stale: -1
days-before-pr-close: -1
operations-per-run: 200 # max num of ops per run
stale-issue-label: 'Status: Stale'
close-issue-label: 'Status: Auto-closing'
exempt-issue-labels: 'Status: Confirmed,Priority: High,Priority: Critical,Blocker,Type: Feature,no-auto-close,3rd party: OCC'
remove-stale-when-updated: true
ascending: true
stale-issue-message: |
Hi! This issue hasnt seen activity in a while. If its still relevant, please update to the latest FreeCAD weekly build [download here](https://github.com/FreeCAD/FreeCAD/releases/) to see if the problem is resolved.
If the issue persists, let us know by adding a comment with any updates or details. Otherwise, well close this issue automatically in 14 days to keep our backlog tidy. Feel free to comment anytime to keep it open. Closed issues can always be reopened.
Thanks for helping improve FreeCAD!
Access additional [FreeCAD](https://freecad.org) resources:
- **Forum**: https://forum.freecad.org
- **Blog**: https://blog.freecad.org
- **Wiki**: https://wiki.freecad.org
- name: '🧹 Close stale requested feedback issues'
id: awaiting_issues
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 20
days-before-issue-close: 14
days-before-pr-stale: -1
days-before-pr-close: -1
operations-per-run: 100 # max num of ops per run
stale-issue-label: 'Status: Stale'
close-issue-label: 'Status: Auto-closing'
only-labels: 'Status: Needs feedback,Status: Needs test on dev version,Status: Needs steps to reproduce'
remove-stale-when-updated: true
ascending: true
stale-issue-message: |
Hi! This issue hasnt seen activity in a while despite the need for further feedback.
If its still relevant, please update to the latest FreeCAD weekly build [download here](https://github.com/FreeCAD/FreeCAD/releases/) to see if the problem is resolved.
If the issue persists, let us know by adding a comment with any updates or details. Otherwise, well close this issue automatically in 14 days to keep our backlog tidy. Feel free to comment anytime to keep it open. Closed issues can always be reopened.
Thanks for helping improve FreeCAD!
Access additional [FreeCAD](https://freecad.org) resources:
- **Forum**: https://forum.freecad.org
- **Blog**: https://blog.freecad.org
- **Wiki**: https://wiki.freecad.org
- name: '🧹 Tag & close inactive issues'
id: inactive_issues
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 190
days-before-issue-close: 60
days-before-pr-stale: -1
days-before-pr-close: -1
operations-per-run: 100 # max num of ops per run
stale-issue-label: 'Status: Stale'
close-issue-label: 'Status: Auto-closing'
exempt-issue-labels: 'Priority: High,Priority: Critical,Blocker,Type: Feature,no-auto-close,3rd party: OCC'
remove-stale-when-updated: true
ascending: true
stale-issue-message: |
Hi! This issue hasnt seen activity in a while. We automatically check each issue after 190 days without activity to keep the backlog tidy.
If its still relevant, please update to the latest FreeCAD weekly build [download here](https://github.com/FreeCAD/FreeCAD/releases/) to see if the issue is already resolved.
If the issue is still relevant, let us know by adding a comment.
Otherwise, well close this issue automatically in 60 days.
Feel free to comment anytime to keep it open. Closed issues can always be reopened.
Thanks for helping improve FreeCAD!
Access additional [FreeCAD](https://freecad.org) resources:
- **Forum**: https://forum.freecad.org
- **Blog**: https://blog.freecad.org
- **Wiki**: https://wiki.freecad.org
- name: '🧹 Tag & close inactive PRs'
id: inactive_pr
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: -1
days-before-issue-close: -1
days-before-pr-stale: 120
days-before-pr-close: 60
operations-per-run: 30 # max num of ops per run
stale-pr-label: 'Status: Stale'
close-pr-label: 'Status: Auto-closing'
exempt-pr-labels: 'Needs backport,Priority: High,Priority: Critical,no-auto-close'
remove-stale-when-updated: true
ascending: true
stale-pr-message: |
Thanks for helping improve FreeCAD!
This pull request hasnt seen activity in a while. We automatically check each PR after 120 days without activity to keep the repository tidy.
If the PR is still relevant, let us know by adding a comment.
Otherwise, well close this PR automatically in 60 days.
If you would like to keep working on this pull request, we advice to rebase it on current main branch, ask feedback from users or maintainers and engage with the community to get it forward.
-52
View File
@@ -1,52 +0,0 @@
name: Backport merged pull request
on:
pull_request_target:
types: [closed, labeled]
branches: [main, releases/*]
permissions:
contents: write
pull-requests: write
jobs:
backport:
name: Create backport pull request
runs-on: ubuntu-latest
# Run the action if a PR is merged with backport labels
# OR
# when already merged PR is labeled with backport labels
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& startsWith(github.event.label.name, 'backport ')
)
)
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.GH_TOKEN_FOR_CI_RUNNERS }}
- name: Create backport pull requests
uses: korthout/backport-action@01619ebc9a6e3f6820274221b9956b3e7365000a # v4.1.0
with:
# Inputs documented here: https://github.com/korthout/backport-action?tab=readme-ov-file#inputs
github_token: ${{ secrets.GH_TOKEN_FOR_CI_RUNNERS }}
github_workspace: ${{ github.workspace }}
# permit PRs with merge commits to be backported
merge_commits: 'skip'
# copy labels to backport to identify affected systems and priorities
copy_labels_pattern: '.*'
# Regex pattern to match github labels
# The capture group catches the target branch
# i.e. label "backport releases/FreeCAD-1-0" will create backport
# PR for branch releases/FreeCAD-1-0
label_pattern: ^backport ([^ ]+)$
-277
View File
@@ -1,277 +0,0 @@
name: Build Release
on:
release:
types: [created]
schedule:
- cron: "0 0 * * 3"
workflow_dispatch:
permissions:
contents: write
actions: write
concurrency:
group: build-release-${{ github.event_name }}
cancel-in-progress: true
jobs:
upload_src:
runs-on: ubuntu-latest
outputs:
build_tag: ${{ steps.get_tag.outputs.build_tag }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.sha }}
fetch-depth: 2
fetch-tags: true
submodules: 'recursive'
- name: Get tag and create release if weekly
id: get_tag
shell: bash -l {0}
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ github.event_name }}" = "release" ]; then
export BUILD_TAG="${{ github.event.release.tag_name }}"
else
export BUILD_TAG=weekly-$(date "+%Y.%m.%d")
gh release create ${BUILD_TAG} --title "Development Build ${BUILD_TAG}" \
-F .github/workflows/weekly-build-notes.md \
--prerelease || \
gh release view ${BUILD_TAG} > /dev/null # fail if it doesn't exist
fi
echo "BUILD_TAG=${BUILD_TAG}" >> "$GITHUB_ENV"
echo "build_tag=${BUILD_TAG}" >> "$GITHUB_OUTPUT"
- name: Trigger notes updater workflow (only for weekly)
if: startsWith(steps.get_tag.outputs.build_tag, 'weekly-')
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
WEEKLY_TAG: ${{ steps.get_tag.outputs.build_tag }}
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
// Reusable/dispatchable updater workflow file in .github/workflows/
const workflow_id = 'weekly-compare-link.yml';
// Use the default branch so the workflow file is available
const ref = (context.payload?.repository?.default_branch) || 'main';
const current_tag = process.env.WEEKLY_TAG || '';
await github.rest.actions.createWorkflowDispatch({
owner, repo, workflow_id, ref,
inputs: { current_tag }
});
core.info(`Dispatched ${workflow_id} on ${ref} with current_tag='${current_tag}'.`)
- name: Upload Source
id: upload_source
shell: bash -l {0}
env:
GH_TOKEN: ${{ github.token }}
run: |
python3 package/scripts/write_version_info.py ../freecad_version.txt
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config user.name 'github-actions[bot]'
git apply package/disable_git_info.patch
git commit -a -m "Disable git info write to Version.h"
git archive HEAD -o freecad_source_${BUILD_TAG}.tar
git submodule foreach --recursive \
"git archive HEAD --prefix=\$path/ -o \$sha1.tar && \
tar -A -f \$toplevel/freecad_source_${BUILD_TAG}.tar \$sha1.tar && \
rm \$sha1.tar"
gzip freecad_source_${BUILD_TAG}.tar
sha256sum freecad_source_${BUILD_TAG}.tar.gz > freecad_source_${BUILD_TAG}.tar.gz-SHA256.txt
gh release upload --clobber ${BUILD_TAG} "freecad_source_${BUILD_TAG}.tar.gz" "freecad_source_${BUILD_TAG}.tar.gz-SHA256.txt"
build:
needs: upload_src
strategy:
matrix:
include:
- { target: linux-64, os: ubuntu-22.04 }
- { target: linux-arm64, os: ubuntu-22.04-arm }
- { target: osx-64, os: macos-15-intel, deploy_target: "10.13" }
- { target: osx-arm64, os: macos-latest, deploy_target: "11.0" }
- { target: osx-arm64, os: macos-latest, deploy_target: "15.0" }
- { target: win-64, os: windows-latest }
fail-fast: false
runs-on: ${{ matrix.os }}
environment: weekly-build
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
# prevent running out of disk space on Ubuntu runners.
- name: Maximize build space
if: runner.os == 'Linux'
uses: AdityaGarg8/remove-unwanted-software@90e01b21170618765a73370fcc3abbd1684a7793 # v5
with:
verbose: 'true'
remove-android: 'true' # (frees ~9 GB)
remove-cached-tools: 'true' # (frees ~8.3 GB)
- name: Set platform environment variables
shell: bash -l {0}
env:
OPERATING_SYSTEM: ${{ runner.os }}
run: |
if [[ $OPERATING_SYSTEM == 'Windows' ]]; then
echo 'PIXI_CACHE_DIR=D:\rattler' >> "$GITHUB_ENV"
echo 'RATTLER_CACHE_DIR=D:\rattler' >> "$GITHUB_ENV"
fi
- name: Checkout source
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.sha }}
fetch-depth: 2
fetch-tags: true
submodules: 'recursive'
- uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
pixi-version: v0.59.0
cache: false
- name: Install the Apple certificate and provisioning profile
id: macos_get_cert
if: runner.os == 'macOS'
env:
APP_SPECIFIC_PASSWORD: ${{ secrets.APP_SPECIFIC_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
DEVELOPER_TEAM_ID: ${{ secrets.DEVELOPER_TEAM_ID }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
run: |
if [ -z "$BUILD_CERTIFICATE_BASE64" ]; then
echo "has_cert=false" >> $GITHUB_OUTPUT
echo "No certificate avalable... skipping" && exit 0
else
echo "has_cert=true" >> $GITHUB_OUTPUT
fi
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/FreeCAD_bundle.provisionprofile
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
export KEYCHAIN_PASSWORD=$(openssl rand -base64 8)
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/Provisioning\ Profiles
cp $PP_PATH ~/Library/Provisioning\ Profiles
xcrun notarytool store-credentials "FreeCAD" --keychain "$KEYCHAIN_PATH" --apple-id "${APPLE_ID}" --password "${APP_SPECIFIC_PASSWORD}" --team-id "${DEVELOPER_TEAM_ID}"
- name: Setup .NET 10 SDK
if: runner.os == 'Windows'
uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
dotnet-version: '10.0.103'
- name: Install sign tool
if: runner.os == 'Windows'
run: |
# NOTE: The sign tool is ONLY available as a prerelease package, they never issue real releases.
dotnet tool install --global --prerelease sign
echo "$env:USERPROFILE\.dotnet\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
dotnet --info
sign --version
- name: Build packages
shell: bash
env:
GH_TOKEN: ${{ github.token }}
TARGET_PLATFORM: ${{ matrix.target }}
BUILD_TAG: ${{ needs.upload_src.outputs.build_tag }}
run: |
set -euo pipefail
if [[ "${{ runner.os }}" == "macOS" ]]; then
export MACOS_DEPLOYMENT_TARGET="${{ matrix.deploy_target }}"
fi
python3 package/scripts/write_version_info.py ../freecad_version.txt
cd package/rattler-build
pixi install
- name: Azure login for Windows build code signing
id: azure_login
if: runner.os == 'Windows'
continue-on-error: true
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
- name: Release packages with optional code-signing on Windows and macOS
shell: bash
env:
GH_TOKEN: ${{ github.token }}
TARGET_PLATFORM: ${{ matrix.target }}
MAKE_INSTALLER: "true"
UPLOAD_RELEASE: "true"
BUILD_TAG: ${{ needs.upload_src.outputs.build_tag }}
run: |
set -euo pipefail
export MACOS_SIGN_RELEASE=0
export WINDOWS_SIGN_RELEASE=0
case "${RUNNER_OS}" in
Windows)
export WINDOWS_SIGN_RELEASE="${{ steps.azure_login.outcome }}"
export WINDOWS_AZURE_ENDPOINT="${{ vars.AZURE_TRUSTED_SIGNING_ENDPOINT }}"
export WINDOWS_AZURE_CERTIFICATE_PROFILE="${{ vars.AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE }}"
export WINDOWS_AZURE_SIGNING_ACCOUNT="${{ vars.AZURE_TRUSTED_SIGNING_ACCOUNT }}"
# For good measure, normalize the azure_login result to 1 or 0
if [[ "${WINDOWS_SIGN_RELEASE:-}" == "success" ]]; then
export WINDOWS_SIGN_RELEASE=1
else
export WINDOWS_SIGN_RELEASE=0
fi
;;
macOS)
export MACOS_SIGN_RELEASE="${{ steps.macos_get_cert.outputs.has_cert }}"
export MACOS_SIGNING_KEY_ID="${{ secrets.SIGNING_KEY_ID }}"
export MACOS_DEPLOYMENT_TARGET="${{ matrix.deploy_target }}"
;;
esac
cd package/rattler-build
pixi run -e package create_bundle
## Needed if running on a self-hosted runner:
# - name: Clean up keychain and provisioning profile
# if: ${{ always() }}
# run: |
# security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
# rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision
-127
View File
@@ -1,127 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '28 12 * * 6'
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
# - language: c-cpp
# build-mode: autobuild
# - language: javascript-typescript
# build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 2
submodules: recursive
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended
queries: security-and-quality
# Change the CodeQL Bundle version
# tools: https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.20.7/codeql-bundle-linux64.tar.gz
# Add exclusions
config: |
paths-ignore:
- src/Mod/Import/App/SCL_output/**
query-filters:
- exclude:
id: py/file-not-closed
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
category: "/language:${{matrix.language}}"
-163
View File
@@ -1,163 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced (c-cpp)"
on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
schedule:
- cron: '28 12 * * 6'
workflow_dispatch: # Allow manual triggers
env:
CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: false
permissions:
contents: read
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
# - language: actions
# build-mode: none
- language: c-cpp
build-mode: autobuild
# - language: javascript-typescript
# build-mode: none
# - language: python
# build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
# prevent running out of disk space on Ubuntu runners.
- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@90e01b21170618765a73370fcc3abbd1684a7793 # v5
with:
verbose: 'true'
remove-android: 'true' # (frees ~9 GB)
remove-cached-tools: 'true' # (frees ~8.3 GB)
remove-haskell: 'true' # (frees ~5.2 GB)
remove-swapfile: 'true' # (frees ~4 GB)
remove-docker-images: 'true' # (frees ~3.2 GB)
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 2
submodules: recursive
# Install FreeCAD dependencies (cpp)
- name: Setup build environment
run: ./package/ubuntu/install-apt-packages.sh
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended
queries: security-and-quality
# Change the CodeQL Bundle version
# tools: https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.20.7/codeql-bundle-linux64.tar.gz
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
category: "/language:${{matrix.language}}"
output: sarif-results
upload: failure-only
- name: filter-sarif
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-tests/**/*
-src/3rdParty/**/*
-**/ui_*.h
-**/moc_*.cpp
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/cpp.sarif
- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v7.0.0
with:
name: sarif-results
path: sarif-results
retention-days: 1
-27
View File
@@ -1,27 +0,0 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: 'Checkout Repository'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@05fe4576374b728f0c523d6a13d64c25081e0803 # v4
-39
View File
@@ -1,39 +0,0 @@
name: Fedora Daily Build
permissions:
contents: read
on:
schedule:
- cron: "00 00 * * *"
workflow_dispatch:
jobs:
trigger-copr-build:
environment: fedora-daily
env:
copr_login: ${{ secrets.COPR_LOGIN }}
copr_username: ${{ secrets.COPR_USERNAME }}
copr_token: ${{ secrets.COPR_TOKEN }}
runs-on: ubuntu-latest
container: quay.io/packit/packit
steps:
- name: setup copr token
run: |
mkdir -p ~/.config
echo \
"[copr-cli]
login = $copr_login
username = $copr_username
token = $copr_token
copr_url = https://copr.fedorainfracloud.org
" > ~/.config/copr
- name: checkout sources
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 500
fetch-tags: true
- name: Setup safe Git directory
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: trigger copr build
run: |
packit build in-copr --project freecad
@@ -1,68 +0,0 @@
name: Fetch Crowdin Translations
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
jobs:
update-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_FOR_CROWDIN_SYNC }}
- name: Install Qt ≥ 6.8
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
with:
aqtversion: "==3.1.*"
version: "6.8.3"
host: "linux"
target: "desktop"
arch: "linux_gcc_64"
- name: Setup Python & dependencies
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: "3.13"
- name: Install Python packages
run: |
python3 -m pip install --upgrade pip
pip install pyside6
- name: Gather translations from crowdin
run: |
./updatecrowdin.py build
while ./updatecrowdin.py build-status | grep -q "status: inProgress"; do sleep 10; done
./updatecrowdin.py download
./updatecrowdin.py install
working-directory: ./src/Tools
env:
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
CROWDIN_PROJECT_ID: freecad
- name: Commit changes
run: |
git config --global user.name "freecad-gh-actions-translation-bot"
git config --global user.email "freecad-gh-actions-translation-bot@github.com"
git add src
git commit -m "Update translations from Crowdin" || echo "No changes to commit"
- name: Push changes to a new branch
run: |
git branch update-crowdin-translations
git push origin update-crowdin-translations --force
- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0
with:
branch: update-crowdin-translations
title: "Update translations from Crowdin"
body: "Automatic Crowdin update."
token: ${{ secrets.GH_TOKEN_FOR_CROWDIN_SYNC }}
delete-branch: true
add-paths: |
src
+2 -7
View File
@@ -16,11 +16,6 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Get dates for last month
shell: bash
run: |
@@ -35,13 +30,13 @@ jobs:
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
- name: Run issue-metrics tool
uses: github/issue-metrics@6a35322ff89cee3e1a594d282c27eb34bffa9174 # v4.1.1
uses: github/issue-metrics@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:FreeCAD/FreeCAD is:issue created:${{ env.last_month }}'
- name: Create issue
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
uses: peter-evans/create-issue-from-file@v4
with:
title: Monthly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
+1 -9
View File
@@ -9,9 +9,6 @@ on:
pull_request_target:
types: [opened, reopened]
permissions:
contents: read
jobs:
label:
runs-on: ubuntu-latest
@@ -20,12 +17,7 @@ jobs:
pull-requests: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: ".github/labels.yml"
@@ -1,43 +0,0 @@
name: Push Crowdin Translations
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
jobs:
update-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
ref: releases/FreeCAD-1-1
- name: Install Qt ≥ 6.8
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
with:
aqtversion: "==3.1.*"
version: "6.8.3"
host: "linux"
target: "desktop"
arch: "linux_gcc_64"
- name: Setup Python & dependencies
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: "3.13"
- name: Install Python packages
run: |
python3 -m pip install --upgrade pip
pip install pyside6
- name: Push translations to Crowdin
run: |
./updatecrowdin.py gather
./updatecrowdin.py upload
working-directory: ./src/Tools
env:
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
CROWDIN_PROJECT_ID: freecad
-81
View File
@@ -1,81 +0,0 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '20 7 * * 2'
push:
branches: ["main"]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
contents: read
actions: read
# To allow GraphQL ListCommits to work
issues: read
pull-requests: read
# To detect SAST tools
checks: read
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecards on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
sarif_file: results.sarif
@@ -0,0 +1,172 @@
# 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 a Conda environment on macOS.
name: Build macOS 13 (Apple Silicon)
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: macos-14
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: arm64-apple-darwin20.0.0-clang
CXX: arm64-apple-darwin20.0.0-clang++
builddir: ${{ github.workspace }}/build/release/
logdir: /tmp/logs/
reportdir: /tmp/report/
reportfilename: ${{ inputs.artifactBasename }}-report.md
defaults:
run:
shell: bash -l {0}
outputs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Checking out source code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Miniconda
env:
CONDA_VERBOSITY: 2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: .conda/freecad
environment-file: conda/conda-env.yaml
channels: conda-forge
channel-priority: true
miniforge-version: latest
conda-remove-defaults: "true"
- name: Install FreeCAD dependencies
env:
CONDA_VERBOSITY: 2
run: |
./conda/setup-environment.sh
- name: Set Environment Variables
run: |
echo "CC=$CC" >> "$GITHUB_ENV"
echo "CXX=$CXX" >> "$GITHUB_ENV"
- 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/macos/generateCacheKey
with:
compiler: ${{ env.CXX }}
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
save-always: true
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
run: |
mamba run --live-stream -p .conda/freecad cmake --preset conda-macos-release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.conda/freecad/opt/freecad
- name: CMake Build
run: |
mamba run --live-stream -p .conda/freecad cmake --build build/release
- 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: 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
run: |
mamba run --live-stream -p .conda/freecad cmake --install build/release
- name: FreeCAD CLI tests on install
timeout-minutes: 10
uses: ./.github/workflows/actions/runPythonTests
with:
testDescription: "CLI tests on install"
testCommand: ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCADCmd -t 0
logFile: ${{ env.logdir }}TestCLIInstall.log
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
/var/crash/*FreeCAD*
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
${{env.reportdir}}${{ env.reportfilename }}
+14 -28
View File
@@ -49,18 +49,13 @@ jobs:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ inputs.allowedToFail }}
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config
CCACHE_MAXSIZE: 1G
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 5
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 1G
CCACHE_NODIRECT: true
CCACHE_NOHASHDIR: true
CCACHE_NOINODECACHE: true
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros"
builddir: ${{ github.workspace }}/build/release/
builddir: ${{ github.workspace }}/build/
cacheKey: pixi-${{ matrix.os }}
config: release
logdir: ${{ github.workspace }}/logs/
reportdir: ${{ github.workspace }}/report/
reportfilename: ${{ inputs.artifactBasename }}-${{ matrix.os }}-report.md
@@ -74,11 +69,6 @@ jobs:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Set Platform Environment Variables
shell: bash -l {0}
env:
@@ -91,7 +81,7 @@ jobs:
fi
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4
- name: Add GCC Problem Matcher
if: runner.os == 'Linux'
@@ -116,15 +106,13 @@ jobs:
mkdir -p ${{ env.reportdir }}
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
- uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
pixi-version: v0.59.0
pixi-version: v0.41.3
cache: false
- name: Restore Compiler Cache
id: cache-restore
if: always()
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
@@ -140,14 +128,13 @@ jobs:
- name: CMake Configure
run: |
pixi run configure-${{ env.config }}
pixi run configure-release
- name: CMake Build
run: |
pixi run build-${{ env.config }}
pixi run build
- name: Print ccache statistics after Build
if: always()
run: |
pixi run ccache -s
@@ -182,7 +169,7 @@ jobs:
- name: CMake Install
run: |
pixi run install-${{ env.config }}
pixi run install
- name: FreeCAD CLI tests on install
if: runner.os != 'Windows'
@@ -207,16 +194,15 @@ jobs:
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
- name: Save Compiler Cache
id: cache-save
if: always()
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
uses: actions/cache/save@v4
with:
path: ${{ env.CCACHE_DIR }}
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
- name: Upload logs
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-${{ matrix.os }}-Logs
path: |
@@ -225,7 +211,7 @@ jobs:
- name: Upload report
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
-239
View File
@@ -1,239 +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 24.04 using GCC.
name: Build Ubuntu 24.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-24.04
continue-on-error: ${{ inputs.allowedToFail }}
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 5
CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config
CCACHE_DIR: ${{ github.workspace }}/ccache
CCACHE_MAXSIZE: 1G
CCACHE_NODIRECT: true
CCACHE_NOHASHDIR: true
CCACHE_NOINODECACHE: true
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros"
CC: /usr/bin/gcc
CXX: /usr/bin/g++
#CC: /usr/bin/clang
#CXX: /usr/bin/clang++
builddir: ${{ github.workspace }}/build/release/
config: release
logdir: /tmp/logs/
reportdir: /tmp/report/
reportfilename: ${{ inputs.artifactBasename }}-report.md
defaults:
run:
shell: bash
outputs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checking out source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: Install FreeCAD dependencies
run: ./package/ubuntu/install-apt-packages.sh
- name: Install FreeCAD Python test dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install ifcopenshell==0.8.2 --break-system-packages
- 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 }}
qt_major_version: 5
- name: Restore Compiler Cache
id: cache-restore
if: always()
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
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: Install cmake
uses: jwlawson/actions-setup-cmake@3a6cbe35ba64df7ca70c51365c4aff65db9a9037 # v2.1.1
with:
cmake-version: '3.31.6'
- name: CMake Configure
uses: ./.github/workflows/actions/linux/configure
with:
extraParameters: -G Ninja --preset ${{ env.config }}
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
if: always()
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"
# Use Python wrapper to run only GUI-registered tests with the built FreeCAD executable
testCommand: xvfb-run python3 ./.github/scripts/run_gui_tests.py "${{ env.builddir }}"
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"
# Use Python wrapper to run only GUI-registered tests using the installed FreeCAD
testCommand: xvfb-run python3 ./.github/scripts/run_gui_tests.py "FreeCAD"
logFile: ${{ env.logdir }}TestGUIInstall.log
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
- name: Save Compiler Cache
id: cache-save
if: always()
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ env.CCACHE_DIR }}
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
- name: Upload logs
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
/var/crash/*FreeCAD*
- name: Upload report
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ env.reportfilename }}
path: |
${{env.reportdir}}${{ env.reportfilename }}
+266
View File
@@ -0,0 +1,266 @@
# 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-latest
container:
image: ubuntu:20.04
continue-on-error: ${{ inputs.allowedToFail }}
env:
LC_ALL: en_US.utf8
DEBIAN_FRONTEND: noninteractive
# set in a step to workaround https://github.com/actions/runner/issues/2058
#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++
# set in a step to workaround https://github.com/actions/runner/issues/2058
#builddir: ${{ github.workspace }}/build/release/
logdir: /tmp/logs/
reportdir: /tmp/report/
reportfilename: ${{ inputs.artifactBasename }}-report.md
defaults:
run:
shell: bash
outputs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Install basic packages
run: |
apt-get update -qq
apt-get install -y --no-install-recommends --reinstall language-pack-en sudo git ca-certificates build-essential cmake
- name: set env variables
run: |
echo "CCACHE_DIR=$GITHUB_WORKSPACE/ccache" >> "$GITHUB_ENV"
echo "CCACHE_CONFIGPATH=$GITHUB_WORKSPACE/ccache/config" >> "$GITHUB_ENV"
echo "builddir=$GITHUB_WORKSPACE/build/release/" >> "$GITHUB_ENV"
- name: Checking out source code
uses: actions/checkout@v4
with:
submodules: true
- name: Install FreeCAD dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
ccache \
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 \
libshiboken2-dev \
libspnav-dev \
libvtk7-dev \
libx11-dev \
libxerces-c-dev \
libyaml-cpp-dev \
libzipios++-dev \
netgen \
netgen-headers \
ninja-build \
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.qtwidgets \
python3-yaml \
qtbase5-dev \
qttools5-dev \
shiboken2 \
swig \
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 }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
save-always: true
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:
extraParameters: -G Ninja -D CMAKE_BUILD_TYPE=Release
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@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
/var/crash/*FreeCAD*
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
${{env.reportdir}}${{ env.reportfilename }}
@@ -0,0 +1,201 @@
# 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 a Conda environment on Linux.
name: Build Ubuntu 24.04 (Conda)
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-24.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
builddir: ${{ github.workspace }}/build/release/
logdir: /tmp/logs/
reportdir: /tmp/report/
reportfilename: ${{ inputs.artifactBasename }}-report.md
defaults:
run:
shell: bash -l {0}
outputs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Checking out source code
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Miniconda
env:
CONDA_VERBOSITY: 2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: .conda/freecad
environment-file: conda/conda-env.yaml
channels: conda-forge
channel-priority: true
miniforge-version: latest
conda-remove-defaults: "true"
- name: Install FreeCAD dependencies
env:
CONDA_VERBOSITY: 2
run: |
./conda/setup-environment.sh
- name: Set Environment Variables
run: |
echo "CC=$CC" >> "$GITHUB_ENV"
echo "CXX=$CXX" >> "$GITHUB_ENV"
- 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 }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@v4
with:
save-always: true
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:
extraParameters: --preset conda-linux-release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.conda/freecad/opt/freecad
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: ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/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 ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCAD -t 0
logFile: ${{ env.logdir }}TestGUIInstall.log
reportFile: ${{env.reportdir}}${{ env.reportfilename }}
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
/var/crash/*FreeCAD*
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
${{env.reportdir}}${{ env.reportfilename }}
+18 -65
View File
@@ -24,27 +24,15 @@
name: Build Windows
on:
workflow_dispatch:
inputs:
artifactBasename:
description: "Base name for artifact"
required: false
type: string
default: "FreeCAD"
allowedToFail:
description: "whether a failed build is allowed"
required: false
type: boolean
default: false
workflow_call:
inputs:
artifactBasename:
required: true
type: string
required: true
allowedToFail:
required: false
default: false
type: boolean
required: false
outputs:
reportFile:
value: ${{ jobs.Build.outputs.reportFile }}
@@ -54,22 +42,19 @@ jobs:
runs-on: windows-latest
continue-on-error: ${{ inputs.allowedToFail }}
env:
CCACHE_COMPILERCHECK: "%compiler%" # default:mtime
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 5
CCACHE_DIR: C:/FC/cache/
CCACHE_LOGFILE: C:/logs/ccache.log
CCACHE_COMPILERCHECK: "%compiler%" # default:mtime
CCACHE_MAXSIZE: 1G
CCACHE_NODIRECT: true
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 1
CCACHE_NOHASHDIR: true
CCACHE_NOINODECACHE: true
CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros" # Can't get PCH to work on Windows
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/release/
cacheKey: Windows
ccachebindir: C:/FC/ccache/
config: release
libpackdir: C:/FC/libpack/
ccachebindir: C:/FC/ccache/
logdir: C:/logs/
reportdir: C:/report/
reportfilename: ${{ inputs.artifactBasename }}-report.md
@@ -77,16 +62,10 @@ jobs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checking out source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4
with:
submodules: true
- name: Make needed directories, files and initializations
id: Init
run: |
@@ -97,43 +76,32 @@ jobs:
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
id: cache-restore
if: always()
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.CCACHE_DIR }}
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
key: FC-Windows-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
FC-${{ env.cacheKey }}-${{ github.ref }}-
FC-${{ env.cacheKey }}-
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: Install cmake
uses: jwlawson/actions-setup-cmake@3a6cbe35ba64df7ca70c51365c4aff65db9a9037 # v2.1.1
with:
cmake-version: '3.31.6'
- name: Configuring CMake
run: >
cmake -B"${{ env.builddir }}" .
--preset ${{ env.config }}
--preset release
-DCMAKE_VS_NO_COMPILE_BATCHING=ON
-DCMAKE_BUILD_TYPE=Release
-DFREECAD_USE_PCH=OFF
@@ -142,41 +110,26 @@ jobs:
-DFREECAD_COPY_DEPEND_DIRS_TO_BUILD=ON
-DFREECAD_COPY_LIBPACK_BIN_TO_BUILD=ON
-DFREECAD_COPY_PLUGINS_BIN_TO_BUILD=ON
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
uses: microsoft/setup-msbuild@v2
- 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
if: always()
run: |
. $env:ccachebindir\ccache -s
- name: C++ unit tests
if: false # Disabled because seems to not function on Windows build
timeout-minutes: 1
run: |
. ${{ env.builddir }}\tests\Release\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: Save Compiler Cache
id: cache-save
if: always()
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ env.CCACHE_DIR }}
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
- name: Upload logs
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
+509 -111
View File
@@ -34,21 +34,12 @@ on:
changedFiles:
type: string
required: true
changedLines:
type: string
required: false
changedCppFiles:
type: string
required: true
changedCppLines:
type: string
required: false
changedPythonFiles:
type: string
required: true
changedPythonLines:
type: string
required: false
checkLineendings:
default: false
type: boolean
@@ -85,6 +76,14 @@ on:
default: true
type: boolean
required: false
cpplintFilters:
default: -whitespace-*
type: string
required: false
cpplintLineLength:
default: 120
type: string
required: false
cpplintFailSilent:
default: true
type: boolean
@@ -130,7 +129,7 @@ on:
type: string
required: false
spellingIgnore:
default: ./.git*,*.po,*.ts,*.svg,./src/3rdParty,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL*,./src/Doc/FreeCAD.uml,./build/
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:
@@ -141,12 +140,16 @@ on:
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: false
default: true
type: boolean
required: false
clazyChecks:
@@ -158,7 +161,7 @@ on:
type: boolean
required: false
checkClazyQT6:
default: false
default: true
type: boolean
required: false
clazyQT6Checks:
@@ -177,9 +180,6 @@ on:
reportFile:
value: ${{ jobs.Lint.outputs.reportFile }}
permissions:
contents: read
jobs:
Lint:
@@ -197,16 +197,10 @@ jobs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4
with:
submodules: true
- name: Make needed directories, files and initializations
id: Init
run: |
@@ -214,157 +208,561 @@ jobs:
mkdir -p ${{ env.fixesdir }}
mkdir -p ${{ env.reportdir }}
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
# Generic lints steps
- name: Check File Case Sensitivity
uses: credfeto/action-case-checker@cb652aeab29ed363bbdb7d9ee1bfcc010c46cac5 # v1.3.0
# Run generic lints
- name: Check for non Unix line ending
if: inputs.checkLineendings && always()
continue-on-error: ${{ inputs.lineendingsFailSilent }}
run: |
python3 tools/lint/generic_checks.py \
--lineendings-check \
--files "${{ inputs.changedFiles }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}" \
--log-dir "${{ env.logdir }}"
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: |
python3 tools/lint/generic_checks.py \
--whitespace-check \
--files "${{ inputs.changedFiles }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}" \
--log-dir "${{ env.logdir }}"
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: |
python3 tools/lint/generic_checks.py \
--tabs-check \
--files "${{ inputs.changedFiles }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}" \
--log-dir "${{ env.logdir }}"
# Python linting steps
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: |
python3 tools/lint/pylint.py \
--files "${{ inputs.changedPythonFiles }}" \
--disable "${{ inputs.pylintDisable }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
- name: Black
pylintErrors=0
pylintWarnings=0
pylintRefactorings=0
pylintConventions=0
pip install --break-system-packages 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: |
python3 tools/lint/black.py \
--files "${{ inputs.changedPythonFiles }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
# C++ linting steps
blackReformats=0
blackFails=0
pip install --break-system-packages black
set +e
black --line-length 100 --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: ./package/ubuntu/install-apt-packages.sh
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 \
libshiboken2-dev \
libspnav-dev \
libvtk9-dev \
libx11-dev \
libxerces-c-dev \
libyaml-cpp-dev \
libzipios++-dev \
netgen \
netgen-headers \
occt-draw \
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.qtwidgets \
qtbase5-dev \
qttools5-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: |
python3 tools/lint/qt_connections.py \
--files "${{ inputs.changedFiles }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
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: |
python3 tools/lint/cpplint.py \
--files "${{ inputs.changedCppFiles }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
cpplintErrors=0
pip install --break-system-packages 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: |
python3 tools/lint/clang_format.py \
--files "${{ inputs.changedCppFiles }}" \
--clang-style "${{ inputs.clangStyle }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
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: |
python3 tools/lint/codespell.py \
--files ${{ inputs.changedFiles }} \
--ignore-words "${{ inputs.listIgnoredMisspelling }}" \
--skip "${{ inputs.spellingIgnore }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
pip install --break-system-packages 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: |
python3 tools/lint/clang_tidy.py \
--files "${{ inputs.changedCppFiles }}" \
--line-filter '${{ inputs.changedCppLines }}' \
--clang-style "${{ inputs.clangStyle }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
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: |
python3 tools/lint/clazy.py \
--files "${{ inputs.changedCppFiles }}" \
--clazy-checks "${{ inputs.clazyChecks }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
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: |
python3 tools/lint/clazy_qt6.py \
--files "${{ inputs.changedCppFiles }}" \
--clazy-qt6-checks "${{ inputs.clazyQT6Checks }}" \
--log-dir "${{ env.logdir }}" \
--report-file "${{ env.reportdir }}${{ env.reportfilename }}"
# Upload steps
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@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
${{ env.fixesdir }}
- name: Upload report
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
+6 -38
View File
@@ -46,16 +46,10 @@ on:
value: ${{ jobs.Prepare.outputs.reportFile }}
changedFiles:
value: ${{ jobs.Prepare.outputs.changedFiles }}
changedLines:
value: ${{ jobs.Prepare.outputs.changedLines }}
changedPythonFiles:
value: ${{ jobs.Prepare.outputs.changedPythonFiles }}
changedPythonLines:
value: ${{ jobs.Prepare.outputs.changedPythonLines }}
changedCppFiles:
value: ${{ jobs.Prepare.outputs.changedCppFiles }}
changedCppLines:
value: ${{ jobs.Prepare.outputs.changedCppLines }}
jobs:
@@ -73,18 +67,10 @@ jobs:
outputs:
reportFile: ${{ steps.Init.outputs.reportFile }}
changedFiles: ${{ steps.Output.outputs.changedFiles }}
changedLines: ${{ steps.Output.outputs.changedLines }}
changedPythonFiles: ${{ steps.Output.outputs.changedPythonFiles }}
changedPythonLines: ${{ steps.Output.outputs.changedPythonLines }}
changedCppFiles: ${{ steps.Output.outputs.changedCppFiles }}
changedCppLines: ${{ steps.Output.outputs.changedCppLines }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Make needed directories, files and initializations
id: Init
run: |
@@ -93,10 +79,6 @@ jobs:
commitCnt=0
touch ${{ env.logdir }}changedFiles.lst ${{ env.logdir }}changedCppFiles.lst ${{ env.logdir }}changedPythonFiles.lst
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
- name: Determine base and head SHA in case of PR
if: env.isPR == 'true'
run: |
@@ -146,22 +128,11 @@ jobs:
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:
API_URL: ${{ github.api_url }}
TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
REF: ${{ github.ref_name }}
PR: ${{ github.event.number }}
if: env.isPR == 'true' || env.isPush == 'true'
run: |
# could reduce this to a single
python3 tools/lint/changed_lines.py --api-url ${API_URL} --token ${TOKEN} --repo ${REPO} --ref=${REF} --pr=${PR} > ${{ env.logdir }}changedLines.lst
cat ${{ env.logdir }}changedLines.lst | jq '.[].name' > ${{ env.logdir }}changedFiles.lst
python3 tools/lint/changed_lines.py --api-url ${API_URL} --token ${TOKEN} --repo ${REPO} --ref=${REF} --pr=${PR} --file-filter '.py, .pyi' > ${{ env.logdir }}changedPythonLines.lst
cat ${{ env.logdir }}changedPythonLines.lst | jq '.[].name' > ${{ env.logdir }}changedPythonFiles.lst
python3 tools/lint/changed_lines.py --api-url ${API_URL} --token ${TOKEN} --repo ${REPO} --ref=${REF} --pr=${PR} --file-filter '.c, .cc, .cu, .cuh, .c++, .cpp, .cxx, .h, .hh, .h++, .hpp, .hxx' > ${{ env.logdir }}changedCppLines.lst
cat ${{ env.logdir }}changedCppLines.lst | jq '.[].name' > ${{ env.logdir }}changedCppFiles.lst
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 }}
@@ -172,22 +143,19 @@ jobs:
id: Output
run: |
echo "changedFiles=$(cat ${{ env.logdir }}changedFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "changedLines=$(cat ${{ env.logdir }}changedLines.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "changedPythonFiles=$(cat ${{ env.logdir }}changedPythonFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "changedPythonLines=$(cat ${{ env.logdir }}changedPythonLines.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "changedCppFiles=$(cat ${{ env.logdir }}changedCppFiles.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "changedCppLines=$(cat ${{ env.logdir }}changedCppLines.lst | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
- name: Upload logs
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
- name: Upload report
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
+2 -10
View File
@@ -39,9 +39,6 @@ on:
type: string
required: true
permissions:
contents: read
jobs:
WrapUp:
@@ -53,16 +50,11 @@ jobs:
shell: bash
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Make needed directories, files and initializations
run: |
mkdir -p ${{ env.artifactsDownloadDir }}
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
uses: actions/download-artifact@v4
with:
path: ${{ env.artifactsDownloadDir }}
- name: Save input data to file
@@ -119,7 +111,7 @@ jobs:
cat report.md >> $GITHUB_STEP_SUMMARY
- name: Delete used artifacts
continue-on-error: true
uses: geekyeggo/delete-artifact@176a747ab7e287e3ff4787bf8a148716375ca118 # v6.0.0
uses: geekyeggo/delete-artifact@v5
with:
name: |
${{ env.usedArtifacts }}
-16
View File
@@ -1,16 +0,0 @@
> [!IMPORTANT]
> Bleeding edge FreeCAD development builds for testing bugfixes, regressions, and recently implemented features. Do not use in a production environment.
**Changes since last weekly:** <!--DIFF_LINK-->
### How-to use
1. Download the appropriate asset for your OS below
2. Unpack the bundle to any folder on your system
3. Launch the application
- **Windows**
Run `\FreeCAD.exe` in the extracted directory
- **macOS**
Launch `/FreeCAD.app` in the extracted directory
- **Linux**
Open the `*.AppImage`
-140
View File
@@ -1,140 +0,0 @@
name: Weekly compare link to release notes
on:
release:
types: [published] # run automatically when a (pre-)release is published
workflow_dispatch: # allow manual runs too
inputs:
current_tag:
description: "Weekly tag (e.g., weekly-2026.01.07). Leave empty to auto-detect latest weekly pre-release."
required: false
dry_run:
description: "Only compute; do not update the release body."
required: false
type: boolean
default: false
permissions:
contents: write # required to PATCH the release body
jobs:
update-notes:
runs-on: ubuntu-latest
steps:
- name: Inject compare link into weekly release notes
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
# Pass manual inputs via env for convenience
CURRENT_TAG: ${{ github.event.inputs.current_tag }}
DRY_RUN: ${{ github.event.inputs.dry_run }}
PLACEHOLDER: "<!--DIFF_LINK-->"
with:
script: |
// Updates the current weekly release notes with a compare link to the previous weekly.
// Works for both release-published events and manual (workflow_dispatch) runs.
const owner = context.repo.owner;
const repo = context.repo.repo;
const rx = /^weekly-(\d{4})\.(\d{2})\.(\d{2})$/;
// Determine currentTag:
// 1) Manual input via workflow_dispatch (env.CURRENT_TAG)
// 2) Tag from release event payload
// 3) Fallback: newest weekly pre-release
let currentTag = process.env.CURRENT_TAG || (context.payload?.release?.tag_name) || null;
async function detectLatestWeeklyTag() {
const releases = await github.paginate(github.rest.repos.listReleases, { owner, repo, per_page: 100 });
const cand = releases.find(r => r.prerelease && typeof r.tag_name === 'string' && rx.test(r.tag_name));
return cand?.tag_name || null;
}
if (!currentTag) {
currentTag = await detectLatestWeeklyTag();
}
if (!currentTag || !rx.test(currentTag)) {
core.info(`No weekly tag detected or tag format mismatch ('${currentTag}'). Skipping.`);
return;
}
// Resolve the current release object
let curRel;
try {
const { data } = await github.rest.repos.getReleaseByTag({ owner, repo, tag: currentTag });
curRel = data;
} catch (e) {
core.setFailed(`No release for tag ${currentTag}: ${e.message}`);
return;
}
// If event is a normal release (not pre-release), skip automatically-run case;
// but allow manual override (manual runs can patch any weekly tag).
const isManual = context.eventName === 'workflow_dispatch';
if (!isManual && !curRel.prerelease) {
core.info('Current release is not a pre-release; skipping (auto run).');
return;
}
// Helpers
const toPrevWeeklyTag = (tag) => {
const [, y, m, d] = tag.match(rx);
const dt = new Date(Date.UTC(+y, +m - 1, +d));
const prev = new Date(dt.getTime() - 7 * 24 * 3600 * 1000); // minus 7 days
const iso = prev.toISOString().slice(0, 10); // YYYY-MM-DD
return `weekly-${iso.replace(/-/g, '.')}`; // weekly-YYYY.MM.DD
};
const ymdKey = (t) => t.replace(rx, '$1$2$3'); // YYYYMMDD
async function tagExists(tag) {
try {
await github.rest.git.getRef({ owner, repo, ref: `tags/${tag}` });
return true;
} catch {
return false;
}
}
// Compute previous weekly deterministically, then fall back if needed
let prevTag = toPrevWeeklyTag(currentTag);
if (!(await tagExists(prevTag))) {
core.info(`Computed previous tag ${prevTag} not found; scanning older weeklies...`);
const releases = await github.paginate(github.rest.repos.listReleases, { owner, repo, per_page: 100 });
const curKey = ymdKey(currentTag);
const older = releases
.filter(r => r.prerelease && typeof r.tag_name === 'string' && rx.test(r.tag_name))
.map(r => ({ tag: r.tag_name, key: ymdKey(r.tag_name) }))
.filter(x => x.key < curKey)
.sort((a, b) => b.key.localeCompare(a.key)); // newest older first
if (!older.length) {
core.info('No older weekly found; nothing to do.');
return;
}
prevTag = older[0].tag;
}
const compareUrl = `https://github.com/${owner}/${repo}/compare/${prevTag}...${currentTag}`;
const head = `**Changes since last weekly (${prevTag} → ${currentTag}):**\n${compareUrl}\n`;
if (process.env.DRY_RUN === 'true') {
core.info(`[DRY RUN] Would update release ${currentTag} with: ${compareUrl}`);
return;
}
// Idempotent body update
let body = curRel.body || '';
if (body.includes(compareUrl)) {
core.info('Compare URL already present; done.');
return;
}
const placeholder = process.env.PLACEHOLDER || '<!--DIFF_LINK-->';
if (body.includes(placeholder)) {
body = body.replace(placeholder, compareUrl);
} else if (/\*\*Changes since last weekly:/i.test(body)) {
body = body.replace(/\*\*Changes since last weekly:[^\n]*\n?/i, head + '\n');
} else {
body += (body.endsWith('\n') ? '\n' : '\n\n') + head;
}
await github.rest.repos.updateRelease({ owner, repo, release_id: curRel.id, body });
core.info(`Release notes updated with compare link: ${compareUrl}`);
+29 -36
View File
@@ -1,73 +1,66 @@
# file types to ignore
.*
!*.gitattributes
!*.gitignore
!/.clang-format
!/.clang-tidy
!/.git-blame-ignore-revs
!/.gitattributes
!/.github/
!/.gitignore
!/.gitmodules
!/.packit.yaml
!/.pre-commit-config.yaml
!/.pylintrc
!/.github/
!/contrib/.vscode/
*.clangd
!*.gitattributes
!*.gitignore
*.DS_Store
*.dep
*.exp
*.kdev4
*.pyc
*.obj
*.lib
*.pch
*.vcproj
*.kdev4
*.exp
*.dep
*.manifest
*.o
*.obj
*.orig
*.output
*.pch
*.pyc
*.vcproj
# Ignore .db files created by Qt Designer when editing .ui files
*.db
*qrc.depends
*~
qrc_*.cpp
BuildLog.htm
CMakeCache.txt
CMakeFiles/
CMakeLists.txt.user
Makefile
cmake_install.cmake
*~
CMakeFiles/
*qrc.depends
ui_*.h
moc_*.cpp
Makefile
CMakeCache.txt
CMakeLists.txt.user
config.h
install_manifest.txt
moc_*.cpp
qrc_*.cpp
ui_*.h
/.vscode/
/ALL_BUILD.dir/
/Mod/
/ZERO_CHECK.dir/
/bin/
/build-*/
/build/
/cmake-build*/
/conda/environment.yml
/ALL_BUILD.dir/
/doc/
/lib/
/src/Tools/offlinedoc/*.txt
/Mod/
/ZERO_CHECK.dir/
/build/
/cmake-build*/
/src/Tools/offlinedoc/localwiki/
/src/Tools/offlinedoc/*.txt
/conda/environment.yml
/.vscode/
OpenSCAD_rc.py
tags
/CMakeUserPresets.json
Testing
compile_commands.json
*.sublime-project
*.sublime-workspace
# crowdin file
files_to_translate.txt
src/Tools/freecad.zip
tsupdate_stderr.log
tsupdate_stdout.log
files_to_translate.txt
# pixi environments
*.egg-info
.pixi
*.egg-info
+1 -4
View File
@@ -1,12 +1,9 @@
[submodule "src/3rdParty/OndselSolver"]
path = src/3rdParty/OndselSolver
url = https://github.com/FreeCAD/OndselSolver.git
url = https://github.com/Ondsel-Development/OndselSolver.git
[submodule "tests/lib"]
path = tests/lib
url = https://github.com/google/googletest
[submodule "src/3rdParty/GSL"]
path = src/3rdParty/GSL
url = https://github.com/microsoft/GSL
[submodule "src/Mod/AddonManager"]
path = src/Mod/AddonManager
url = https://github.com/FreeCAD/AddonManager.git
-68
View File
@@ -1,68 +0,0 @@
specfile_path: package/fedora/freecad.spec
files_to_sync:
- .packit.yaml
actions:
post-upstream-clone:
- bash -c '/usr/bin/python3 package/scripts/write_version_info.py freecad_version.txt'
- rm -f freecad-sources.tar.gz
changelog-entry:
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 )..HEAD -- |sed 's/%/%%/g''
create-archive:
- git submodule update --init
- bash -c 'git ls-files --recurse-submodules | tar -caf freecad-sources.tar.gz -T-'
- echo -n 'freecad-sources.tar.gz'
downstream_package_name: freecad
additional_packages:
- python3
jobs:
- job: copr_build
identifier: pull_request
trigger: pull_request
notifications:
pull_request:
successful_build: True
branch: main
additional_repos:
- copr://bpostle/IfcOpenShell
manual_trigger: true
targets:
fedora-stable:
without_opts:
- debug_info
fedora-development:
without_opts:
- debug_info
- job: tests
identifier: pull_request
trigger: pull_request
branch: main
manual_trigger: true
targets:
fedora-latest-stable:
without_opts:
- debug_info
fmf_path: package/fedora/tests
- job: copr_build
identifier: main
trigger: commit
manual_trigger: true
branch: main
additional_repos:
- copr://bpostle/IfcOpenShell
owner: freecad
project: nightly
- job: copr_build
identifier: release
trigger: release
owner: freecad
project: freecad
additional_repos:
- copr://bpostle/IfcOpenShell
targets:
fedora-all:
without_opts:
- tests
+10 -21
View File
@@ -4,26 +4,23 @@
# See https://pre-commit.com/hooks.html for more hooks
files: |
(?x)^(
.github|
src/Base|
src/Gui|
src/Main|
src/Tools|
tests/src|
src/Mod/AddonManager|
src/Mod/Assembly|
src/Mod/BIM|
src/Mod/CAM|
src/Mod/Cloud|
src/Mod/Draft|
src/Mod/Drawing|
src/Mod/Fem|
src/Mod/Help|
src/Mod/Import|
src/Mod/Inspection|
src/Mod/JtReader|
src/Mod/Measure|
src/Mod/MeshPart|
src/Mod/Mesh|
src/Mod/PartDesign|
src/Mod/Part|
src/Mod/MeshPart|
src/Mod/Plot|
src/Mod/Points|
src/Mod/ReverseEngineering|
@@ -35,8 +32,7 @@ files: |
src/Mod/Surface|
src/Mod/Test|
src/Mod/Tux|
src/Mod/Web|
tests/src
src/Mod/Web
)
exclude: |
(?x)^(
@@ -46,35 +42,28 @@ exclude: |
src/App/ExpressionParser.tab.h|
src/App/ExpressionParser.y|
src/App/lex.ExpressionParser.c|
src/Doc/ThirdPartyLibraries.html.cmake|
src/Gui/3Dconnexion/navlib|
src/Gui/QSint|
src/Gui/Quarter|
src/Mod/Fem/femexamples|
src/Mod/Import/App/SCL|
src/Mod/Import/App/SCL_output|
src/Mod/Mesh/App/TestData|
src/Mod/Mesh/App/WildMagic4|
src/Mod/Robot/App/kdl_cp|
src/Mod/Robot/Lib|
.*\.ts$|
.*\.brep$
src/Mod/Robot/Lib
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.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-pre-commit-mirror
rev: 2892f1f81088477370d4fbc56545c05d33d2493f # frozen: 25.11.0
- repo: https://github.com/psf/black
rev: b965c2a5026f8ba399283ba3e01898b012853c79 # frozen: 24.8.0
hooks:
- id: black
args: ['--line-length', '100']
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 317810f3c6a0ad3572367dc86cb6e41863e16e08 # frozen: v21.1.5
rev: 7d85583be209cb547946c82fbe51f4bc5dd1d017 # frozen: v18.1.8
hooks:
- id: clang-format
+6 -2
View File
@@ -82,11 +82,15 @@ persistent=yes
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.10
py-version=3.8
# Discover python modules and packages in the file system subtree.
recursive=no
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
@@ -398,7 +402,7 @@ indent-after-paren=4
indent-string=' '
# Maximum number of characters on a single line.
max-line-length=120
max-line-length=100
# Maximum number of lines in a module.
max-module-lines=1000
+19 -53
View File
@@ -1,42 +1,21 @@
# As of February 2025 we require CMake 3.22.0
cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR)
# 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)
# policy CMP0072 was introduced with CMake 3.11
# relates to FindOpenGL module
# and cache variables OPENGL_gl_LIBRARY, OPENGL_glu_LIBRARY
if (POLICY CMP0072)
set(OpenGL_GL_PREFERENCE LEGACY)
endif(POLICY CMP0072)
# As of cMake 3.27, find_package() will look for both case-sensitive and all-uppercase versions
# of the package. This seems to affect FLANN as included by Pixi
if(POLICY CMP0144)
cmake_policy(SET CMP0144 NEW)
endif()
# FindPythonInterp and FindPythonLibs modules are deprecated, but are still in use by
# all versions of Shiboken2. This policy must be kept at OLD until Shiboken2 is no longer
# supported
if(POLICY CMP0148)
# FindPythonInterp and FindPythonLibs modules are deprecated.
# Currently, they are still used by shiboken's CMake files
if (POLICY CMP0148)
cmake_policy(SET CMP0148 OLD)
endif()
# The exec_program command was deprecated in cMake 3.0, and policy CMP0153 was added in cMake
# 3.28 to control whether this gives a warning (the OLD behavior) or a fatal error (NEW)
if(POLICY CMP0153)
cmake_policy(SET CMP0153 NEW)
endif()
# Suppress 'FindBoost module is removed' warning. Will use BoostConfig.cmake instead
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
# As of cMake 3.31 add_custom_command() rejects invalid arguments
if(POLICY CMP0175)
cmake_policy(SET CMP0175 NEW)
endif()
# Added in cMake 3.31, enforce normalization of all DESTINATION paths given to install()
if(POLICY CMP0177)
cmake_policy(SET CMP0177 NEW)
endif()
option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON)
if(FREECAD_USE_CCACHE)
@@ -51,11 +30,10 @@ endif()
project(FreeCAD)
set(PACKAGE_VERSION_MAJOR "1")
set(PACKAGE_VERSION_MINOR "2")
set(PACKAGE_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
set(PACKAGE_VERSION_MINOR "0")
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)
string(TIMESTAMP PACKAGE_COPYRIGHT_YEAR "%Y")
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
set(PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
@@ -77,8 +55,6 @@ FreeCADLibpackChecks()
SetupDoxygen()
SetupLibFmt()
SetupYamlCpp()
SetupZipIos()
find_package(ICU REQUIRED COMPONENTS uc i18n)
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER OR FREECAD_LIBPACK_CHECKFILE_VERSION)
SetupPython()
SetupPCL()
@@ -93,13 +69,11 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER OR FREECAD_LIB
# OPENGL_gl_LIBRARY empty that results into linker errors
SetupOpenGL()
endif(BUILD_GUI)
SetupBoost()
SetupSalomeSMESH()
if (BUILD_FEM_NETGEN)
set(NETGEN_DEFINITIONS -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
if (NOT FREECAD_USE_EXTERNAL_SMESH)
find_package(NETGEN REQUIRED)
endif()
endif()
find_package(NETGEN)
endif(BUILD_FEM_NETGEN)
# not needed at the moment
#find_package(OpenCV REQUIRED)
SetupSwig()
@@ -111,18 +85,10 @@ if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER OR FREECAD_LIB
if(BUILD_GUI)
SetupCoin3D()
SetupPivy()
SetupSpaceball()
SetupShibokenAndPyside()
SetupMatplotlib()
endif(BUILD_GUI)
# SetupCoin3D can overwrite find_package(Boost) output so keep this after.
SetupBoost()
if(BUILD_BIM)
SetupLark()
endif()
endif()
if(BUILD_VR)
+38 -185
View File
@@ -13,18 +13,6 @@
"CMAKE_EXPORT_COMPILE_COMMANDS": {
"type": "BOOL",
"value": "ON"
},
"CMAKE_JOB_POOL_COMPILE": {
"type": "STRING",
"value": "compile_jobs"
},
"CMAKE_JOB_POOL_LINK": {
"type": "STRING",
"value": "link_jobs"
},
"CMAKE_POLICY_VERSION_MINIMUM": {
"type": "STRING",
"value": "3.5"
}
}
},
@@ -117,38 +105,31 @@
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"cmakeExecutable": "${sourceDir}/conda/cmake.sh",
"cacheVariables": {
"CMAKE_C_COMPILER": {
"type": "STRING",
"value": "clang"
"CMAKE_INCLUDE_PATH": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/include"
},
"CMAKE_CXX_COMPILER": {
"type": "STRING",
"value": "clang++"
},
"CMAKE_EXE_LINKER_FLAGS": {
"type": "STRING",
"value": "-fuse-ld=mold"
"CMAKE_INSTALL_LIBDIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/lib"
},
"CMAKE_INSTALL_PREFIX": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}"
},
"CMAKE_LIBRARY_PATH":{
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/lib"
},
"CMAKE_PREFIX_PATH": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}"
},
"CMAKE_SHARED_LINKER_FLAGS": {
"type": "STRING",
"value": "-fuse-ld=mold"
},
"OCC_INCLUDE_DIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/include/opencascade"
},
"OCC_LIBRARY_DIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/lib"
}
}
},
@@ -160,30 +141,35 @@
"lhs": "${hostSystemName}",
"rhs": "Darwin"
},
"cmakeExecutable": "${sourceDir}/conda/cmake.sh",
"cacheVariables": {
"CMAKE_IGNORE_PREFIX_PATH": {
"type": "STRING",
"value": "/opt/homebrew;/usr/local/homebrew"
},
"CMAKE_INCLUDE_PATH": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/include"
},
"CMAKE_INSTALL_LIBDIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/lib"
},
"CMAKE_INSTALL_PREFIX": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}"
},
"CMAKE_LIBRARY_PATH":{
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/lib"
},
"CMAKE_PREFIX_PATH": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}"
},
"FREECAD_3DCONNEXION_SUPPORT": {
"type": "STRING",
"value": "Both"
},
"OCC_INCLUDE_DIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/include/opencascade"
},
"OCC_LIBRARY_DIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/lib"
}
}
},
@@ -195,26 +181,31 @@
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"cmakeExecutable": "${sourceDir}/conda/cmake.cmd",
"cacheVariables": {
"CMAKE_INCLUDE_PATH": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/Library/include"
},
"CMAKE_INSTALL_LIBDIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/Library/lib"
},
"CMAKE_INSTALL_PREFIX": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/Library"
},
"CMAKE_LIBRARY_PATH":{
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/Library/lib"
},
"CMAKE_PREFIX_PATH": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/Library"
},
"FREECAD_3DCONNEXION_SUPPORT": {
"type": "STRING",
"value": "Both"
},
"OCC_INCLUDE_DIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/Library/include/opencascade"
},
"OCC_LIBRARY_DIR": {
"type": "FILEPATH",
"value": "$env{CONDA_PREFIX}/Library/lib"
}
}
},
@@ -303,144 +294,6 @@
"value": "OFF"
}
}
},
{
"name": "rpm",
"description": "Settings like rpm build",
"displayName": "rpm",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/rpm",
"cacheVariables": {
"CMAKE_INSTALL_DATAROOTDIR": {
"type": "PATH",
"value": "/usr/share"
},
"CMAKE_C_FLAGS_RELEASE": {
"type": "STRING",
"value": "-DNDEBUG"
},
"CMAKE_CXX_FLAGS_RELEASE": {
"type": "STRING",
"value": "-DNDEBUG"
},
"CMAKE_Fortran_FLAGS_RELEASE": {
"type": "STRING",
"value": "-DNDEBUG"
},
"CMAKE_VERBOSE_MAKEFILE": {
"type": "BOOL",
"value": "ON"
},
"CMAKE_INSTALL_DO_STRIP": {
"type": "BOOL",
"value": "OFF"
},
"CMAKE_INSTALL_PREFIX": {
"type": "PATH",
"value": "/usr/lib64/freecad"
},
"CMAKE_INSTALL_FULL_SBINDIR": {
"type": "PATH",
"value": "/usr/bin"
},
"CMAKE_INSTALL_SBINDIR": {
"type": "PATH",
"value": "bin"
},
"INCLUDE_INSTALL_DIR": {
"type": "PATH",
"value": "/usr/include"
},
"LIB_INSTALL_DIR": {
"type": "PATH",
"value": "/usr/lib64"
},
"SYSCONF_INSTALL_DIR": {
"type": "PATH",
"value": "/etc"
},
"SHARE_INSTALL_PREFIX": {
"type": "PATH",
"value": "/usr/share"
},
"LIB_SUFFIX": {
"type": "STRING",
"value": "64"
},
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": "ON"
},
"CMAKE_INSTALL_DOCDIR": {
"type": "PATH",
"value": "/usr/share/doc/freecad"
},
"CMAKE_INSTALL_INCLUDEDIR": {
"type": "PATH",
"value": "/usr/include"
},
"RESOURCEDIR": {
"type": "PATH",
"value": "/usr/share/freecad"
},
"FREECAD_USE_EXTERNAL_PIVY": {
"type": "BOOL",
"value": "TRUE"
},
"FREECAD_USE_EXTERNAL_FMT": {
"type": "BOOL",
"value": "TRUE"
},
"FREECAD_USE_PCL": {
"type": "BOOL",
"value": "OFF"
},
"FREECAD_QT_VERSION": {
"type": "STRING",
"value": "6"
},
"OpenGL_GL_PREFERENCE": {
"type": "STRING",
"value": "GLVND"
},
"USE_OCC": {
"type": "BOOL",
"value": "TRUE"
},
"PYCXX_INCLUDE_DIR": {
"type": "PATH",
"value": "/usr/include"
},
"PYCXX_SOURCE_DIR": {
"type": "PATH",
"value": "/usr/src/CXX"
},
"ENABLE_DEVELOPER_TESTS": {
"type": "BOOL",
"value": "TRUE"
},
"FREECAD_USE_EXTERNAL_GTEST": {
"type": "BOOL",
"value": "TRUE"
},
"ONDSELSOLVER_BUILD_EXE": {
"type": "BOOL",
"value": "TRUE"
},
"BUILD_GUI": {
"type": "BOOL",
"value": "TRUE"
}
},
"environment": {
"CC": "gcc",
"CXX": "g++",
"LT_SYS_LIBRARY_PATH": "/usr/lib64:",
"CCACHE_PROGRAM": "/usr/bin/ccache",
"CFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
"CXXFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
"LDFLAGS": "-Wl,--as-needed -Wl,--no-undefined"
}
}
}
]
}
+8 -17
View File
@@ -26,7 +26,7 @@ The FreeCAD Contribution Process is expressed here with the following specific g
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.
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.
@@ -47,7 +47,7 @@ The FreeCAD Contribution Process is expressed here with the following specific g
## 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.
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.
@@ -55,16 +55,9 @@ The FreeCAD Contribution Process is expressed here with the following specific g
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. Changes that break python API used by extensions SHALL be avoided. If it is not possible to avoid breaking changes, the amount of them MUST be minimized and PR MUST clearly describe all breaking changes with clear description on how to replace no longer working solution with newer one. Contributor SHOULD search for addons that will be broken and list them in the PR.
11. 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.
12. The PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
13. If a PR contains the work of another author (for example, if it is cherry-picked from a fork by someone other than the PR-submitter):
1. the PR description MUST contain proper attribution as the first line, for example: "This is work of XYZ cherry-picked from <link>";
2. all commits MUST have proper authorship, i.e. be authored by the original author and committed by the author of the PR;
3. if changes to cherry-picked commits are necessary they SHOULD be done as follow-up commits. If it is not possible to do so, then the modified commits MUST contain a `Co-Authored-By` trailer in their commit message.
14. Contributions must meet existing quality standards. Raw AI output is not accepted under any circumstances. AI may be used only as an assistive tool; in all cases, the resulting content must be reviewed, validated, and justifiable by the contributor. The contributor should be able to explain design and code decisions, answer reviewers questions, and ensure that AI use does not waste reviewers time during review. That being said, the use of AI is not recommended under any circumstances or in any manner.
15. The contributor provides reasonable assurance that the contribution does not infringe third-party copyrights or license terms.
16. A “Valid PR” is one which satisfies the above requirements.
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. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
12. A “Valid PR” is one which satisfies the above requirements.
## 6. Process
@@ -88,11 +81,9 @@ The FreeCAD Contribution Process is expressed here with the following specific g
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. If a PR requires significant further work before merging, the PR SHOULD be moved to draft status.
16. If a PR is complete, but should not be merged yet (for example, because it depends on another in-process PR), the "On hold" label SHOULD be applied.
17. Any Contributor who has value judgments on a PR SHOULD express these via their own PR.
18. The User who created an issue SHOULD close the issue after checking the PR is successful.
19. Maintainers SHOULD close issues that are left open without action or update for an unreasonable period.
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
+98 -121
View File
@@ -1,125 +1,113 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin Street - Fifth Floor
Boston, MA 02110-1301, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
former contains code derived from the library, while the latter only
works together with the library.
GNU LESSER GENERAL PUBLIC LICENSE
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
@@ -146,7 +134,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
@@ -158,7 +146,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@@ -216,7 +204,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@@ -267,8 +255,8 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
@@ -295,31 +283,23 @@ of these things:
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
@@ -329,7 +309,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@@ -368,9 +348,9 @@ Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@@ -411,7 +391,7 @@ excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
@@ -422,7 +402,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@@ -432,7 +412,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -455,9 +435,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
@@ -476,7 +455,7 @@ convey the exclusion of warranty; and each file should have at least the
This library 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.
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -485,8 +464,7 @@ convey the exclusion of warranty; and each file should have at least the
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
@@ -495,8 +473,7 @@ school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random
Hacker.
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
+8 -4
View File
@@ -4,7 +4,10 @@ The FreeCAD application does not collect, transmit, share or use any Personal Da
FreeCAD is community-developed Free Software. The community does not condone the unauthorized usage of private data, so our software does not gather or send personal data.
The FreeCAD website is mostly static, it does not contain any trackers, neither ours nor third-party. The website uses cookies to remember logged in status, timezone and other data related to navigating the site. The website does not contain advertisements.
The FreeCAD website is mostly static, it does not contain any trackers, neither ours nor third-party. The website uses cookies to remember logged in status, timezone and other
data related to navigating the site.
The website does not contain advertisements.
The software does not contain advertisements or trackers either.
@@ -12,9 +15,9 @@ The software does not contain advertisements or trackers either.
FreeCAD is able to load or save files to/from remote servers (for some protocols and platforms). If you choose to load or save a remote file, your IP or other private data might be shared as part of the normal connection flow for the given protocol. This is out of our control and it is up to you to decide whether you trust a remote host.
The FreeCAD eco system includes user developed workbenches. These workbenches can be installed/updated using the Add-on Manager. The Add-on Manager retrieves workbenches from remote servers across the internet. Add-on workbenches are not checked for malicious content. It is your responsibility to decide whether you trust an add-on workbench.
The FreeCAD eco system includes user developed workbenches. These workbenches can be installed/updated using the Add-on Manager. The Add-on Manager retrieves workbenches from remote servers across the internet. Add-on workbenches are not checked for malicious content. It is your responsibility to decide whether you trust an add-on workbench.
FreeCAD is meant to manipulate CAD files which may contain metadata. It is your responsibility to verify the metadata contained in your files before you share them with others. These files may contain local directory paths which could reveal user names if the user name forms part of the path - as in “C:\MrsCAD\Documents\myFreeCADFile.FCstd”.
FreeCAD is meant to manipulate CAD files which may contain metadata. It is your responsibility to verify the metadata contained in your files before you share them with others. These files may contain local directory paths which could reveal user names if the user name forms part of the path - as in “C:\MrsCAD\Documents\myFreeCADFile.FCstd”.
FreeCAD can also be used to create and run macros. These are Python scripts that can perform any action that the user can perform on a system. When running a macro from an outside source, it is your responsibility to ensure you trust the author.
@@ -25,4 +28,5 @@ When reading the online version of the User Manual within FreeCAD, manual conten
FreeCAD is Free Software and therefore may be packaged by other people, who may include additional software or modify the source code. We do not vouch for these third-party packages and cannot tell you what they contain and what they do regarding your privacy. The official packages are explicitly listed in our download page.
*The above privacy policy is based on the [GIMP privacy policy](https://www.gimp.org/about/privacy.html).*
- [based on the GIMP privacy policy](https://www.gimp.org/about/privacy.html)
+34 -22
View File
@@ -1,6 +1,6 @@
<a href="https://freecad.org"><img src="/src/Gui/Icons/freecad.svg" height="100px" width="100px"></a>
### Your own 3D Parametric Modeler
### Your own 3D parametric modeler
[Website](https://www.freecad.org) •
[Documentation](https://wiki.freecad.org) •
@@ -10,7 +10,7 @@
[Blog](https://blog.freecad.org)
[![Release](https://img.shields.io/github/release/freecad/freecad.svg)](https://github.com/freecad/freecad/releases/latest) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/freecad/localized.svg)](https://crowdin.com/project/freecad)
[![Release](https://img.shields.io/github/release/freecad/freecad.svg)](https://github.com/freecad/freecad/releases/latest) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/freecad/localized.svg)](https://crowdin.com/project/freecad) [![Liberapay](https://img.shields.io/liberapay/receives/FreeCAD.svg?logo=liberapay)](https://liberapay.com/FreeCAD)
<img src="/.github/images/partdesign.png" width="800"/>
@@ -22,8 +22,8 @@ modeler made primarily to design real-life objects of any size.
Parametric modeling allows you to easily modify your design by going back into
your model history to change its parameters.
* **Create 3D from 2D and back** FreeCAD lets you sketch geometry-constrained
2D shapes and use them as a base to build other objects.
* **Create 3D from 2D and back** FreeCAD lets you to sketch geometry constrained
2D shapes and use them as a base to build other objects.
It contains many components to adjust dimensions or extract design details from
3D models to create high quality production-ready drawings.
@@ -44,20 +44,33 @@ Installing
----------
Precompiled packages for stable releases are available for Windows, macOS and Linux on the
[latest releases page](https://github.com/FreeCAD/FreeCAD/releases/latest).
[Releases page](https://github.com/FreeCAD/FreeCAD/releases).
On most Linux distributions, FreeCAD is also directly installable from the
software center application.
For weekly development releases visit the [releases page](https://github.com/FreeCAD/FreeCAD/releases/).
For development releases check the [weekly-builds page](https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds).
Other options are described on the [wiki Download page](https://wiki.freecad.org/Download).
Other options are described at the [wiki Download page](https://wiki.freecad.org/Download).
Compiling
---------
See the [Developers Handbook Getting Started](https://freecad.github.io/DevelopersHandbook/gettingstarted/)
for build instructions.
Compiling FreeCAD requires installation of several libraries and their
development files such as OCCT (Open Cascade), Coin and Qt, listed in the
pages below. Once this is done, FreeCAD can be compiled with
CMake. On Windows, these libraries are bundled and offered by the
FreeCAD team in a convenient package. On Linux, they are usually found
in your distribution's repositories, and on macOS and other platforms,
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)
Reporting Issues
@@ -65,46 +78,45 @@ Reporting Issues
To report an issue please:
- Consider posting to the [Forum](https://forum.freecad.org), [Discord](https://discord.com/invite/w2cTKGzccC) channel, or [Reddit](https://www.reddit.com/r/FreeCAD) to verify the issue;
- Consider posting to the [Forum](https://forum.freecad.org), [Discord](https://discord.com/invite/F4hdxzYZfc) channel, or [Reddit](https://www.reddit.com/r/FreeCAD) to verify the issue;
- Search the existing [issues](https://github.com/FreeCAD/FreeCAD/issues) for potential duplicates;
- Use the most updated stable or [development versions](https://github.com/FreeCAD/FreeCAD/releases/) of FreeCAD;
- Post version info from `Help > About FreeCAD > Copy to clipboard`;
- Restart FreeCAD in safe mode `Help > Restart in safe mode` and try to reproduce the issue again. If the issue is resolved it can be fixed by deleting the FreeCAD config files.
- Use the most updated stable or [development versions](https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds) of FreeCAD;
- Post version info from e.g. `Help > About FreeCAD > Copy to clipboard`;
- Start recording a macro `Macro > Macro recording...` and repeat all steps. Stop recording after the issue occurs and upload the saved macro or copy the macro code in the issue;
- Post a Step-By-Step explanation on how to recreate the issue;
- Upload an example file (FCStd as ZIP file) to demonstrate the problem;
For more details see:
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/main/CONTRIBUTING.md)
- [Help Forum](https://forum.freecad.org/viewforum.php?f=3)
- [Developers Handbook](https://freecad.github.io/DevelopersHandbook/)
> [!NOTE]
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.
Usage & Getting Help
Usage & Getting help
--------------------
The FreeCAD wiki contains documentation on
general FreeCAD usage, Python scripting, and development.
View these pages for more information:
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)
- [Developers Handbook](https://freecad.github.io/DevelopersHandbook/)
- [Development](https://wiki.freecad.org/Developer_hub)
The [FreeCAD forum](https://forum.freecad.org) is a great place
to find help and solve specific problems when learning to use FreeCAD.
The [FreeCAD forum](https://forum.freecad.org) is also a great place
to find help and solve specific problems you might encounter when
learning to use FreeCAD.
---
<p>This project receives generous infrastructure support from
<a href="https://www.digitalocean.com/">
+9 -9
View File
@@ -1,29 +1,29 @@
# Security Policy
The FreeCAD project is a FOSS (Free and Open-Source Software) project that has a community of thousands of users and
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
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
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 main branch.
FreeCAD implements security fixes to the current release series, and to the current development on the master branch.
| Version | Supported |
|---------| ------------------ |
| 1.1dev | :white_check_mark: |
| 1.0 | :white_check_mark: |
| < 1.0 | :x: |
| 0.22dev | :white_check_mark: |
| 0.21 | :white_check_mark: |
| < 0.21 | :x: |
## Reporting a Vulnerability
+12 -23
View File
@@ -1,8 +1,8 @@
# - Try to find Eigen3 lib
#
# This module supports requiring a minimum version, e.g. you can do
# find_package(Eigen3 3.4.0)
# to require version 3.4.0 or newer of Eigen3.
# find_package(Eigen3 3.1.2)
# to require version 3.1.2 or newer of Eigen3.
#
# Once done this will define
#
@@ -17,33 +17,22 @@
if(NOT Eigen3_FIND_VERSION)
set(Eigen3_FIND_VERSION_MAJOR 3)
set(Eigen3_FIND_VERSION_MINOR 4)
set(Eigen3_FIND_VERSION_MINOR 0)
set(Eigen3_FIND_VERSION_PATCH 0)
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
endif(NOT Eigen3_FIND_VERSION)
macro(_eigen3_check_version)
# file Version exists from Eigen3 5.0.0
if (EXISTS "${EIGEN3_INCLUDE_DIR}/Eigen/Version")
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/Version" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_PATCH_VERSION[ \t]+([0-9]+)" _eigen3_patch_version_match "${_eigen3_version_header}")
set(EIGEN3_PATCH_VERSION "${CMAKE_MATCH_1}")
set(EIGEN3_VERSION ${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}.${EIGEN3_PATCH_VERSION})
else()
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
endif()
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
set(EIGEN3_VERSION_OK FALSE)
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
+7 -4
View File
@@ -9,10 +9,10 @@
IF ( CMAKE_PKGCONFIG_EXECUTABLE )
MESSAGE( STATUS "Detecting KDL" )
SET(ENV{PKG_CONFIG_PATH} "${KDL_INSTALL}/lib/pkgconfig/")
MESSAGE( "Looking for KDL in: ${KDL_INSTALL}")
PKGCONFIG( "orocos-kdl >= 1.4.0" KDL_FOUND KDL_INCLUDE_DIRS KDL_DEFINES KDL_LINK_DIRS KDL_LIBS )
PKGCONFIG( "orocos-kdl >= 0.99" KDL_FOUND KDL_INCLUDE_DIRS KDL_DEFINES KDL_LINK_DIRS KDL_LIBS )
IF( KDL_FOUND )
MESSAGE(" Includes in: ${KDL_INCLUDE_DIRS}")
@@ -22,10 +22,13 @@ IF ( CMAKE_PKGCONFIG_EXECUTABLE )
INCLUDE_DIRECTORIES( ${KDL_INCLUDE_DIRS} )
LINK_DIRECTORIES( ${KDL_LINK_DIRS})
#OROCOS_PKGCONFIG_INCPATH("${KDLTK_INCLUDE_DIRS}")
#OROCOS_PKGCONFIG_LIBS("${KDL_LIBS}")
#OROCOS_PKGCONFIG_LIBPATH("${KDL_LINK_DIRS}")
SET(ENV{PKG_CONFIG_PATH} "${KDL_INSTALL}/lib/pkgconfig/:${OROCOS_INSTALL}/lib/pkgconfig")
MESSAGE( "Looking for KDL Toolkit in: ${PKG_CONFIG_PATH}")
PKGCONFIG( "orocos-kdltk-${OROCOS_TARGET} >= 1.4.0" KDLTK_FOUND KDLTK_INCLUDE_DIRS KDLTK_DEFINES KDLTK_LINK_DIRS KDLTK_LIBS )
PKGCONFIG( "orocos-kdltk-${OROCOS_TARGET} >= 0.99" KDLTK_FOUND KDLTK_INCLUDE_DIRS KDLTK_DEFINES KDLTK_LINK_DIRS KDLTK_LIBS )
IF(KDLTK_FOUND)
INCLUDE_DIRECTORIES( ${KDLTK_INCLUDE_DIRS} )
LINK_DIRECTORIES( ${KDLTK_LINK_DIRS})
@@ -35,7 +38,7 @@ IF ( CMAKE_PKGCONFIG_EXECUTABLE )
IF(CORBA_ENABLED)
SET(ENV{PKG_CONFIG_PATH} "${KDL_INSTALL}/lib/pkgconfig/:${OROCOS_INSTALL}/lib/pkgconfig")
MESSAGE("Looking for KDL Toolkit CORBA extension in ${PKG_CONFIG_PATH}")
PKGCONFIG( "orocos-kdltk-corba-${OROCOS_TARGET} >= 1.4.0" KDLTKCORBA_FOUND KDLTKCORBA_INCLUDE_DIRS KDLTKCORBA_DEFINES KDLTKCORBA_LINK_DIRS KDLTKCORBA_LIBS )
PKGCONFIG( "orocos-kdltk-corba-${OROCOS_TARGET} >= 0.99" KDLTKCORBA_FOUND KDLTKCORBA_INCLUDE_DIRS KDLTKCORBA_DEFINES KDLTKCORBA_LINK_DIRS KDLTKCORBA_LIBS )
IF(KDLTKCORBA_FOUND)
INCLUDE_DIRECTORIES( ${KDLTKCORBA_INCLUDE_DIRS} )
LINK_DIRECTORIES( ${KDLTKCORBA_LINK_DIRS})
-53
View File
@@ -1,53 +0,0 @@
# - Find the lark library
# This module finds if lark is installed, and sets the following variables
# indicating where it is.
#
# LARK_FOUND - was lark found
# LARK_VERSION - the version of lark found as a string
# LARK_VERSION_MAJOR - the major version number of lark
# LARK_VERSION_MINOR - the minor version number of lark
# LARK_VERSION_PATCH - the patch version number of lark
include(FindPackageHandleStandardArgs)
if(Python3_EXECUTABLE)
message(STATUS "FindLark: Using Python3_EXECUTABLE = ${Python3_EXECUTABLE}")
# try to import lark into Python interpreter
execute_process(
COMMAND "${Python3_EXECUTABLE}" "-c"
"import lark; print(lark.__version__)"
RESULT_VARIABLE _LARK_SEARCH_SUCCESS
OUTPUT_VARIABLE LARK_VERSION
ERROR_VARIABLE _LARK_ERROR_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(DEBUG "FindLark: Result = ${_LARK_SEARCH_SUCCESS}")
message(DEBUG "FindLark: Version = ${LARK_VERSION}")
message(DEBUG "FindLark: Error = ${_LARK_ERROR_VALUE}")
if(_LARK_SEARCH_SUCCESS MATCHES 0)
# extract version components
string(REGEX REPLACE "\\." ";" _LARK_VERSION_LIST ${LARK_VERSION})
list(LENGTH _LARK_VERSION_LIST _LARK_VERSION_LIST_LEN)
if(_LARK_VERSION_LIST_LEN GREATER_EQUAL 1)
list(GET _LARK_VERSION_LIST 0 LARK_VERSION_MAJOR)
endif()
if(_LARK_VERSION_LIST_LEN GREATER_EQUAL 2)
list(GET _LARK_VERSION_LIST 1 LARK_VERSION_MINOR)
endif()
if(_LARK_VERSION_LIST_LEN GREATER_EQUAL 3)
list(GET _LARK_VERSION_LIST 2 LARK_VERSION_PATCH)
endif()
else()
message(STATUS "The BIM workbench requires the lark python package / module to be installed")
endif()
else()
message(STATUS "FindLark: Python3_EXECUTABLE not set")
endif()
find_package_handle_standard_args(LARK
REQUIRED_VARS LARK_VERSION
VERSION_VAR LARK_VERSION
)
+1 -1
View File
@@ -13,7 +13,7 @@ IF(Python3_Interpreter_FOUND)
# Try to import matplotlib into Python interpreter. Python
# interpreter was found previously as required package, so
# don't take care about this.
execute_process(COMMAND "${Python3_EXECUTABLE}" "-c"
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
"import matplotlib as m; print(m.__version__); print(m.__path__[0]);"
RESULT_VARIABLE _MATPLOTLIB_SEARCH_SUCCESS
OUTPUT_VARIABLE _MATPLOTLIB_VALUES
+5 -6
View File
@@ -13,15 +13,19 @@
# See also: http://git.salome-platform.org/gitweb/?p=NETGENPLUGIN_SRC.git;a=summary
find_package(Netgen CONFIG QUIET)
find_package(Netgen CONFIG)
IF (Netgen_FOUND)
set(NGLIB_INCLUDE_DIR ${NETGEN_INCLUDE_DIRS})
set(NGLIB_LIBRARIES nglib)
set(NETGEN_DEFINITIONS -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
# for external smesh only the following two variables are needed:
set(NETGEN_FOUND True)
set(NETGEN_INCLUDE_DIRS ${NETGEN_INCLUDE_DIRS})
ELSE ()
SET(NETGEN_DEFINITIONS -DNO_PARALLEL_THREADS -DOCCGEOMETRY)
IF (WIN32)
FIND_PATH(NGLIB_INCLUDE_DIR NAMES nglib.h PATHS ${NETGEN_INCLUDEDIR})
SET(NETGEN_LIBS nglib mesh occ interface)
@@ -143,8 +147,3 @@ IF (Netgen_FOUND)
MESSAGE(STATUS "Found NETGEN version ${NETGEN_VERSION_MAJOR}.${NETGEN_VERSION_MINOR}, calculated: ${NETGEN_VERSION_C}")
LIST(APPEND NETGEN_DEFINITIONS -DNETGEN_VERSION=${NETGEN_VERSION_C})
ENDIF ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NETGEN
REQUIRED_VARS NGLIB_INCLUDE_DIR NGLIB_LIBRARIES NETGEN_INCLUDE_DIRS
VERSION_VAR NETGEN_VERSION)
+149 -116
View File
@@ -1,4 +1,4 @@
# Try to find OCC
# Try to find OCE / OCC
# Once done this will define
#
# OCC_FOUND - system has OCC - OpenCASCADE
@@ -7,134 +7,167 @@
# OCC_LIBRARIES - Link this to use OCC
# OCC_OCAF_LIBRARIES - Link this to use OCC OCAF framework
# we first try to find opencascade directly:
if (NOT OCCT_CMAKE_FALLBACK)
# First try to find OpenCASCADE Community Edition
if(NOT DEFINED OCE_DIR)
# Check for OSX needs to come first because UNIX evaluates to true on OSX
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(DEFINED MACPORTS_PREFIX)
find_package(OCE QUIET HINTS ${MACPORTS_PREFIX}/Library/Frameworks)
elseif(DEFINED HOMEBREW_PREFIX)
find_package(OCE QUIET HINTS ${HOMEBREW_PREFIX}/Cellar/oce/*)
endif()
elseif(UNIX)
set(OCE_DIR "/usr/local/share/cmake/")
elseif(WIN32)
set(OCE_DIR "c:/OCE-0.4.0/share/cmake")
endif()
endif()
if(${FREECAD_USE_OCC_VARIANT} MATCHES "Community Edition")
find_package(OCE QUIET)
endif()
if(OCE_FOUND)
message(STATUS "-- OpenCASCADE Community Edition has been found.")
# Disable this define. For more details see bug #0001872
#add_definitions (-DHAVE_CONFIG_H)
set(OCC_INCLUDE_DIR ${OCE_INCLUDE_DIRS})
#set(OCC_LIBRARY_DIR ${OCE_LIBRARY_DIR})
else(OCE_FOUND) #look for OpenCASCADE
# we first try to find opencascade directly:
if(NOT OCCT_CMAKE_FALLBACK)
find_package(OpenCASCADE CONFIG QUIET)
get_property(flags DIRECTORY PROPERTY COMPILE_DEFINITIONS)
# OCCT 7.5 adds this define that causes hundreds of compiler warnings with Qt5.x, so remove it again
list(FILTER flags EXCLUDE REGEX [[GL_GLEXT_LEGACY]])
set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${flags})
endif ()
if (OpenCASCADE_FOUND)
if(NOT (CMAKE_VERSION VERSION_LESS 3.6.0))
get_property(flags DIRECTORY PROPERTY COMPILE_DEFINITIONS)
# OCCT 7.5 adds this define that causes hundreds of compiler warnings with Qt5.x, so remove it again
list(FILTER flags EXCLUDE REGEX [[GL_GLEXT_LEGACY]])
set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${flags})
endif()
endif(NOT OCCT_CMAKE_FALLBACK)
if(OpenCASCADE_FOUND)
set(OCC_FOUND ${OpenCASCADE_FOUND})
set(OCC_INCLUDE_DIR ${OpenCASCADE_INCLUDE_DIR})
set(OCC_LIBRARY_DIR ${OpenCASCADE_LIBRARY_DIR})
set(OCC_LIBRARIES ${OpenCASCADE_LIBRARIES})
set(OCC_OCAF_LIBRARIES TKCAF TKXCAF)
else ()
if (WIN32)
if (CYGWIN OR MINGW)
find_path(OCC_INCLUDE_DIR Standard_Version.hxx
/usr/include/opencascade
/usr/local/include/opencascade
/opt/opencascade/include
/opt/opencascade/inc
)
find_path(OCC_LIBRARY TKernel
/usr/lib
/usr/local/lib
/opt/opencascade/lib
)
else ()
find_path(OCC_INCLUDE_DIR Standard_Version.hxx
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\OCC\\2;Installation Path]/include"
)
find_library(OCC_LIBRARY TKernel
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\OCC\\2;Installation Path]/lib"
)
endif ()
else ()
find_path(OCC_INCLUDE_DIR Standard_Version.hxx
/usr/include/occt
/usr/include/opencascade
/usr/local/include/opencascade
/opt/opencascade/include
/opt/opencascade/inc
else(OpenCASCADE_FOUND)
if(WIN32)
if(CYGWIN OR MINGW)
FIND_PATH(OCC_INCLUDE_DIR Standard_Version.hxx
/usr/include/opencascade
/usr/local/include/opencascade
/opt/opencascade/include
/opt/opencascade/inc
)
find_library(OCC_LIBRARY TKernel
/usr/lib
/usr/local/lib
/opt/opencascade/lib
FIND_LIBRARY(OCC_LIBRARY TKernel
/usr/lib
/usr/local/lib
/opt/opencascade/lib
)
endif ()
if (OCC_LIBRARY)
get_filename_component(OCC_LIBRARY_DIR ${OCC_LIBRARY} PATH)
if (NOT OCC_INCLUDE_DIR)
find_path(OCC_INCLUDE_DIR Standard_Version.hxx
${OCC_LIBRARY_DIR}/../inc
)
endif ()
endif ()
endif ()
else(CYGWIN OR MINGW)
FIND_PATH(OCC_INCLUDE_DIR Standard_Version.hxx
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\OCC\\2;Installation Path]/include"
)
FIND_LIBRARY(OCC_LIBRARY TKernel
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SIM\\OCC\\2;Installation Path]/lib"
)
endif(CYGWIN OR MINGW)
else(WIN32)
FIND_PATH(OCC_INCLUDE_DIR Standard_Version.hxx
/usr/include/occt
/usr/include/opencascade
/usr/local/include/opencascade
/opt/opencascade/include
/opt/opencascade/inc
)
FIND_LIBRARY(OCC_LIBRARY TKernel
/usr/lib
/usr/local/lib
/opt/opencascade/lib
)
endif(WIN32)
if(OCC_LIBRARY)
GET_FILENAME_COMPONENT(OCC_LIBRARY_DIR ${OCC_LIBRARY} PATH)
IF(NOT OCC_INCLUDE_DIR)
FIND_PATH(OCC_INCLUDE_DIR Standard_Version.hxx
${OCC_LIBRARY_DIR}/../inc
)
ENDIF()
endif(OCC_LIBRARY)
endif(OpenCASCADE_FOUND)
endif(OCE_FOUND)
if (OCC_INCLUDE_DIR)
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAJOR
REGEX "#define OCC_VERSION_MAJOR.*"
)
string(REGEX MATCH "[0-9]+" OCC_MAJOR ${OCC_MAJOR})
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MINOR
REGEX "#define OCC_VERSION_MINOR.*"
)
string(REGEX MATCH "[0-9]+" OCC_MINOR ${OCC_MINOR})
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAINT
REGEX "#define OCC_VERSION_MAINTENANCE.*"
)
string(REGEX MATCH "[0-9]+" OCC_MAINT ${OCC_MAINT})
if(OCC_INCLUDE_DIR)
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAJOR
REGEX "#define OCC_VERSION_MAJOR.*"
)
string(REGEX MATCH "[0-9]+" OCC_MAJOR ${OCC_MAJOR})
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MINOR
REGEX "#define OCC_VERSION_MINOR.*"
)
string(REGEX MATCH "[0-9]+" OCC_MINOR ${OCC_MINOR})
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAINT
REGEX "#define OCC_VERSION_MAINTENANCE.*"
)
string(REGEX MATCH "[0-9]+" OCC_MAINT ${OCC_MAINT})
set(OCC_VERSION_STRING "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
endif ()
set(OCC_VERSION_STRING "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
endif(OCC_INCLUDE_DIR)
# handle the QUIETLY and REQUIRED arguments and set OCC_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OCC REQUIRED_VARS OCC_INCLUDE_DIR VERSION_VAR OCC_VERSION_STRING)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OCC REQUIRED_VARS OCC_INCLUDE_DIR VERSION_VAR OCC_VERSION_STRING)
if (OCC_FOUND)
set(OCC_LIBRARIES
TKFillet
TKMesh
TKernel
TKG2d
TKG3d
TKMath
TKShHealing
TKXSBase
TKBool
TKBO
TKBRep
TKTopAlgo
TKGeomAlgo
TKGeomBase
TKOffset
TKPrim
TKHLR
TKFeat
)
if (OCC_VERSION_STRING VERSION_GREATER_EQUAL 7.9.0)
list(APPEND OCC_LIBRARIES TKExpress)
endif ()
if(OCC_FOUND)
set(OCC_LIBRARIES
TKFillet
TKMesh
TKernel
TKG2d
TKG3d
TKMath
TKShHealing
TKXSBase
TKBool
TKBO
TKBRep
TKTopAlgo
TKGeomAlgo
TKGeomBase
TKOffset
TKPrim
TKHLR
TKFeat
)
if (OCC_VERSION_STRING VERSION_GREATER_EQUAL 7.9.0)
list(APPEND OCC_LIBRARIES TKExpress)
endif ()
set(OCC_OCAF_LIBRARIES
TKBin
TKBinL
TKCAF
TKXCAF
TKLCAF
TKVCAF
TKCDF
TKMeshVS
TKService
TKV3d
)
set(OCC_OCAF_LIBRARIES
TKBin
TKBinL
TKCAF
TKXCAF
TKLCAF
TKVCAF
TKCDF
TKMeshVS
TKService
TKV3d
TKRWMesh
)
if (OCC_VERSION_STRING VERSION_LESS 7.8.0)
list(APPEND OCC_LIBRARIES TKIGES TKSTL TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP)
list(APPEND OCC_OCAF_LIBRARIES TKXDESTEP TKXDEIGES)
else ()
list(APPEND OCC_LIBRARIES TKDESTEP TKDEIGES TKDEGLTF TKDESTL)
endif ()
message(STATUS "Found OpenCASCADE version: ${OCC_VERSION_STRING}")
message(STATUS " OpenCASCADE include directory: ${OCC_INCLUDE_DIR}")
message(STATUS " OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}")
endif ()
if(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0)
list(APPEND OCC_OCAF_LIBRARIES TKRWMesh)
endif(NOT OCC_VERSION_STRING VERSION_LESS 7.5.0)
if(OCC_VERSION_STRING VERSION_LESS 7.8.0)
list(APPEND OCC_LIBRARIES TKIGES TKSTL TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP)
list(APPEND OCC_OCAF_LIBRARIES TKXDESTEP TKXDEIGES)
else(OCC_VERSION_STRING VERSION_LESS 7.8.0)
list(APPEND OCC_LIBRARIES TKDESTEP TKDEIGES TKDEGLTF TKDESTL)
endif(OCC_VERSION_STRING VERSION_LESS 7.8.0)
message(STATUS "-- Found OCE/OpenCASCADE version: ${OCC_VERSION_STRING}")
message(STATUS "-- OCE/OpenCASCADE include directory: ${OCC_INCLUDE_DIR}")
message(STATUS "-- OCE/OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}")
else(OCC_FOUND)
#message(SEND_ERROR "Neither OpenCASCADE Community Edition nor OpenCasCade were found: will not build CAD modules!")
endif(OCC_FOUND)
+1 -1
View File
@@ -118,7 +118,7 @@ if(PYCXX_FOUND)
${PYCXX_SOURCE_DIR}/IndirectPythonInterface.cxx
)
#set old 6.2 pycxx compatibility
#set old 6.2 pycxx compatibility
list(APPEND PYCXX_SOURCES ${PYCXX_SOURCE_DIR}/cxx_exceptions.cxx)
add_definitions(-DPYCXX_6_2_COMPATIBILITY)
#end old compatibility
+3 -3
View File
@@ -5,7 +5,7 @@
if(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
#pyside2 tools are often in same location as python interpreter
get_filename_component(PYTHON_BIN_DIR ${Python3_EXECUTABLE} PATH)
get_filename_component(PYTHON_BIN_DIR ${PYTHON_EXECUTABLE} PATH)
set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR})
endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -16,8 +16,8 @@ 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-${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} pyuic5 HINTS ${PYSIDE_BIN_DIR})
FIND_PROGRAM(PYSIDE2_RCC_EXECUTABLE NAMES pyside2-rcc pyside2-rcc-${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} pyrcc5 HINTS ${PYSIDE_BIN_DIR})
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})
set(UICOPTIONS "")
set(RCCOPTIONS "")
ELSE()
+14 -46
View File
@@ -1,54 +1,22 @@
# The Qt for Python project officially recommends using pip to install PySide,
# so we expect to find PySide in the site-packages directory.
# The library will be called "PySide6.abi3.*", and there will
# be an "include" directory inside the site-packages/PySide6.
# Over time some distros may provide custom versions, so we also support
# using a more normal cMake find_package() call
include(FindPackageHandleStandardArgs)
# The Qt for Python project officially recommends using pip to install PySide, so we expect to find PySide in the
# site-packages directory. The library will be called "PySide6.abi3.*", and there will be an "include" directory inside
# the site-packages/PySide6. Over time some distros may provide custom versions, so we also support using a more normal
# cMake find_package() call
find_package(PySide6 CONFIG QUIET)
if(NOT PySide6_FOUND)
find_pip_package(PySide6)
endif()
if(NOT PySide6_INCLUDE_DIR AND TARGET PySide6::pyside6)
get_property(PySide6_INCLUDE_DIR TARGET PySide6::pyside6 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
endif()
if(PySide6_FOUND)
# verify PySide6 version matches Qt6 version (major.minor)
if(PySide6_VERSION AND Qt6_VERSION)
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" _qt6_major_minor "${Qt6_VERSION}")
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)" _pyside6_major_minor "${PySide6_VERSION}")
message(STATUS "Qt version: ${Qt6_VERSION}")
message(STATUS "PySide version: ${PySide6_VERSION}")
if(NOT _qt6_major_minor STREQUAL _pyside6_major_minor)
message(FATAL_ERROR
" --------------------------------------------------------
Qt/PySide version mismatch!
cmake found Qt: ${Qt6_VERSION}
cmake found PySide: ${PySide6_VERSION}
major.minor versions of Qt and PySide must match to avoid errors.
Ensure CMAKE_PREFIX_PATH points to matching Qt and PySide6 installations.
--------------------------------------------------------"
)
if(NOT PySide6_INCLUDE_DIR)
find_pip_package(PySide6)
if (PySide6_FOUND)
set(PYSIDE_INCLUDE_DIR ${PySide6_INCLUDE_DIRS} CACHE INTERNAL "")
set(PYSIDE_LIBRARY ${PySide6_LIBRARIES} CACHE INTERNAL "")
set(PYSIDE_FOUND TRUE CACHE BOOL OFF)
set(PYSIDE_MAJOR_VERSION 6 CACHE INTERNAL 6)
endif()
message(STATUS "PySide/Qt version check passed (${_pyside6_major_minor})")
endif()
if(NOT PySide6_INCLUDE_DIRS AND TARGET PySide6::pyside6)
get_property(PySide6_INCLUDE_DIRS TARGET PySide6::pyside6 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
endif()
find_package_handle_standard_args(PySide6
REQUIRED_VARS PySide6_INCLUDE_DIRS
VERSION_VAR PySide6_VERSION
)
# Also provide the old-style variables so we don't have to update everything yet
set(PYSIDE_INCLUDE_DIR ${PySide6_INCLUDE_DIRS})
set(PYSIDE_LIBRARY ${PySide6_LIBRARIES})
set(PYSIDE_FOUND TRUE)
set(PYSIDE_MAJOR_VERSION 6)
endif()
+6 -6
View File
@@ -3,11 +3,11 @@
# PYSIDE_RCC_EXECUTABLE - Location of PYSIDE6RCC executable
# PYSIDE_TOOLS_FOUND - PYSIDE6 utilities found.
if(TARGET Qt6::uic)
if (TARGET Qt6::uic)
get_target_property(PYSIDE6_UIC_EXECUTABLE Qt6::uic LOCATION)
set(UICOPTIONS "--generator=python")
endif()
if(TARGET Qt6::rcc)
if (TARGET Qt6::rcc)
get_target_property(PYSIDE6_RCC_EXECUTABLE Qt6::rcc LOCATION)
set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
endif()
@@ -18,15 +18,15 @@ set(PySideTools_VERSION 6)
if(PYSIDE_RCC_EXECUTABLE AND PYSIDE_UIC_EXECUTABLE)
set(PYSIDE_TOOLS_FOUND TRUE)
if(NOT PYSIDE6Tools_FIND_QUIETLY)
if (NOT PYSIDE6Tools_FIND_QUIETLY)
message(STATUS "Found PYSIDE6 tools: ${PYSIDE_UIC_EXECUTABLE}, ${PYSIDE_RCC_EXECUTABLE}")
endif()
endif ()
else()
if(PYSIDE6Tools_FIND_REQUIRED)
message(FATAL_ERROR "PYSIDE6 tools could not be found, but are required.")
else()
if(NOT PYSIDE6Tools_FIND_QUIETLY)
if (NOT PYSIDE6Tools_FIND_QUIETLY)
message(STATUS "PYSIDE6 tools: not found.")
endif()
endif ()
endif()
endif()
+9 -9
View File
@@ -10,19 +10,19 @@ if(NOT Shiboken6_FOUND)
endif()
if(NOT Shiboken6_INCLUDE_DIR)
find_pip_package(Shiboken6)
if(Shiboken6_FOUND)
set(SHIBOKEN_LIBRARY ${Shiboken6_LIBRARIES})
set(SHIBOKEN_MAJOR_VERSION 6)
set(SHIBOKEN_FOUND ON)
if (Shiboken6_FOUND)
set(SHIBOKEN_LIBRARY ${Shiboken6_LIBRARIES} CACHE INTERNAL "")
set(SHIBOKEN_MAJOR_VERSION 6 CACHE INTERNAL 6)
set(SHIBOKEN_FOUND ON CACHE BOOL OFF)
endif()
# The include directory we actually want is part of shiboken6-generator
find_pip_package(shiboken6_generator)
if(shiboken6_generator_FOUND)
set(SHIBOKEN_INCLUDE_DIR ${shiboken6_generator_INCLUDE_DIRS})
if (shiboken6_generator_FOUND)
set(SHIBOKEN_INCLUDE_DIR ${shiboken6_generator_INCLUDE_DIRS} CACHE PATH "")
endif()
endif()
else()
set(SHIBOKEN_INCLUDE_DIR ${Shiboken6_INCLUDE_DIRS})
set(SHIBOKEN_LIBRARY ${Shiboken6_LIBRARIES})
set(SHIBOKEN_FOUND ON)
set(SHIBOKEN_INCLUDE_DIR ${Shiboken6_INCLUDE_DIRS} CACHE PATH "")
set(SHIBOKEN_LIBRARY ${Shiboken6_LIBRARIES} CACHE INTERNAL "")
set(SHIBOKEN_FOUND ON CACHE BOOL OFF)
endif()
@@ -8,8 +8,8 @@ macro(CheckInterModuleDependencies)
if(${dependent})
foreach(prerequisite IN LISTS ARGN)
if(NOT ${prerequisite})
message(SEND_ERROR "${dependent} requires ${prerequisite} to be ON, but it"
" is \"${${prerequisite}}\"")
message(STATUS "${dependent} requires ${prerequisite} to be ON, but it"
" is \"${${prerequisite}}\"")
set(${dependent} OFF PARENT_SCOPE)
break()
endif(NOT ${prerequisite})
@@ -17,19 +17,17 @@ macro(CheckInterModuleDependencies)
endif(${dependent})
endfunction(REQUIRES_MODS)
REQUIRES_MODS(BUILD_ASSEMBLY BUILD_PART BUILD_PART_DESIGN BUILD_SPREADSHEET)
REQUIRES_MODS(BUILD_BIM BUILD_PART BUILD_MESH BUILD_MESH_PART BUILD_DRAFT)
REQUIRES_MODS(BUILD_DRAFT BUILD_SKETCHER BUILD_TECHDRAW)
REQUIRES_MODS(BUILD_BIM BUILD_PART BUILD_MESH BUILD_DRAFT)
REQUIRES_MODS(BUILD_DRAFT BUILD_SKETCHER)
REQUIRES_MODS(BUILD_DRAWING BUILD_PART BUILD_SPREADSHEET)
REQUIRES_MODS(BUILD_FEM BUILD_PART)
REQUIRES_MODS(BUILD_IMPORT BUILD_PART BUILD_PART_DESIGN)
REQUIRES_MODS(BUILD_IDF BUILD_PART)
REQUIRES_MODS(BUILD_IMPORT BUILD_PART)
REQUIRES_MODS(BUILD_INSPECTION BUILD_MESH BUILD_POINTS BUILD_PART)
REQUIRES_MODS(BUILD_JTREADER BUILD_MESH)
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH)
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH BUILD_SMESH)
REQUIRES_MODS(BUILD_FLAT_MESH BUILD_MESH_PART)
REQUIRES_MODS(BUILD_OPENSCAD BUILD_MESH_PART BUILD_DRAFT)
REQUIRES_MODS(BUILD_MATERIAL_EXTERNAL BUILD_MATERIAL)
REQUIRES_MODS(BUILD_MEASURE BUILD_PART)
REQUIRES_MODS(BUILD_PART BUILD_MATERIAL)
REQUIRES_MODS(BUILD_PART_DESIGN BUILD_SKETCHER)
# REQUIRES_MODS(BUILD_CAM BUILD_PART BUILD_MESH BUILD_ROBOT)
@@ -39,6 +37,5 @@ macro(CheckInterModuleDependencies)
REQUIRES_MODS(BUILD_SANDBOX BUILD_PART BUILD_MESH)
REQUIRES_MODS(BUILD_SKETCHER BUILD_PART)
REQUIRES_MODS(BUILD_SPREADSHEET BUILD_DRAFT)
REQUIRES_MODS(BUILD_SURFACE BUILD_PART)
REQUIRES_MODS(BUILD_TECHDRAW BUILD_PART BUILD_PART_DESIGN BUILD_SPREADSHEET BUILD_MEASURE BUILD_IMPORT)
REQUIRES_MODS(BUILD_TECHDRAW BUILD_PART BUILD_SPREADSHEET)
endmacro(CheckInterModuleDependencies)
+6 -6
View File
@@ -84,15 +84,15 @@ macro(ChooseQtVersion)
endif ()
set(_FREECAD_QT_VERSION "${FREECAD_QT_VERSION}")
else ()
find_package(Qt6 QUIET COMPONENTS Core)
set(_FREECAD_QT_VERSION 6)
if (NOT Qt6_FOUND)
find_package(Qt5 QUIET COMPONENTS Core)
if (NOT Qt5_FOUND)
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 5)
set(_FREECAD_QT_VERSION 6)
endif ()
endif ()
set(FREECAD_QT_MAJOR_VERSION "${_FREECAD_QT_VERSION}" CACHE INTERNAL
@@ -9,16 +9,17 @@ macro(CompilerChecksAndSetups)
# ================================================================================
# Use a heuristic of 1 GiB of RAM needed per compiler job and limit to
# a single link job. Modern linkers are multithreaded and running them concurrently
# can exhaust resources.
cmake_host_system_information(RESULT avail_mem_MiB QUERY TOTAL_PHYSICAL_MEMORY)
math(EXPR max_compile_procs "${avail_mem_MiB} / 1024")
set_property(GLOBAL PROPERTY JOB_POOLS compile_jobs=${max_compile_procs} link_jobs=1)
# Needed for boost1.69
# Avoid that Python (pyerrors.h) defines snprintf and vsnprintf
if (MSVC AND NOT MSVC_VERSION VERSION_LESS 1900)
add_definitions(-DHAVE_SNPRINTF)
elseif (MINGW)
add_definitions(-DHAVE_SNPRINTF)
endif()
# Allow developers to use Boost < 1.74
# Allow developers to use Boost < 1.65
if (NOT BOOST_MIN_VERSION)
set(BOOST_MIN_VERSION 1.74)
set(BOOST_MIN_VERSION 1.65)
endif()
# For older cmake versions the variable 'CMAKE_CXX_COMPILER_VERSION' is missing
@@ -27,27 +28,27 @@ macro(CompilerChecksAndSetups)
OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION)
# Enabled C++20 for Freecad 1.1 and later
set(BUILD_ENABLE_CXX_STD "C++20" CACHE STRING "Enable C++ standard")
set_property(CACHE BUILD_ENABLE_CXX_STD PROPERTY STRINGS
"C++20"
"C++23"
)
# Enabled C++17 for Freecad 0.20 and later
set(BUILD_ENABLE_CXX_STD "C++17" CACHE STRING "Enable C++ standard")
set_property(CACHE BUILD_ENABLE_CXX_STD PROPERTY STRINGS
"C++17"
"C++20"
)
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.2)
message(FATAL_ERROR "FreeCAD 1.1 and later requires C++20. G++ must be 11.2 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}")
elseif(CMAKE_COMPILER_IS_CLANGXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0)
message(FATAL_ERROR "FreeCAD 1.1 and later requires C++20. Clang must be 14.0 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}")
endif()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
message(FATAL_ERROR "FreeCAD 0.20 and later requires C++17. G++ must be 7.3 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}")
elseif(CMAKE_COMPILER_IS_CLANGXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
message(FATAL_ERROR "FreeCAD 0.20 and later requires C++17. Clang must be 6.0 or later, the used version is ${CMAKE_CXX_COMPILER_VERSION}")
endif()
# Escape the two plus chars as otherwise cmake complains about invalid regex
if(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+23")
set(CMAKE_CXX_STANDARD 23)
else()
elseif(${BUILD_ENABLE_CXX_STD} MATCHES "C\\+\\+20")
set(CMAKE_CXX_STANDARD 20)
else()#Enabled C++17
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Log the compiler and version
message(STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID}, version: ${CMAKE_CXX_COMPILER_VERSION}")
@@ -57,8 +58,6 @@ macro(CompilerChecksAndSetups)
configure_file(${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_definitions(-DHAVE_CONFIG_H)
set(CMAKE_CXX_FLAGS "-fdiagnostics-color ${CMAKE_CXX_FLAGS}")
# For now only set pedantic option for clang
if(CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wno-write-strings ${CMAKE_CXX_FLAGS}")
@@ -83,15 +82,6 @@ macro(CompilerChecksAndSetups)
endif()
endif()
endif(BUILD_DYNAMIC_LINK_PYTHON)
if(BUILD_USE_LIBCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
if(BUILD_ENABLE_TIME_TRACE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftime-trace")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftime-trace")
endif()
endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
if(CMAKE_COMPILER_IS_CLANGXX)
@@ -100,15 +90,15 @@ macro(CompilerChecksAndSetups)
#
# https://en.wikipedia.org/wiki/Xcode#Latest_versions
if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template")
endif()
add_definitions(-DGL_SILENCE_DEPRECATION)
elseif (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-undefined-var-template")
endif()
# boost.preprocessor 1.74 and earlier turns off variadics for clang regardless of version, even though they
# work in all versions of clang that we support. Manually force variadic macro support until our oldest
# supported version of boost is 1.75 or higher.
# older boost.preprocessor turn off variadics for clang
add_definitions(-DBOOST_PP_VARIADICS=1)
message(STATUS "Force BOOST_PP_VARIADICS=1 for clang")
endif()
@@ -16,10 +16,10 @@ macro(ConfigureCMakeVariables)
endif()
set(PYCXX_INCLUDE_DIR
"${CMAKE_SOURCE_DIR}/src/3rdParty/PyCXX" CACHE PATH
"${CMAKE_SOURCE_DIR}/src" CACHE PATH
"Path to the directory containing PyCXX's CXX/Config.hxx include file")
set(PYCXX_SOURCE_DIR
"${CMAKE_SOURCE_DIR}/src/3rdParty/PyCXX/CXX" CACHE PATH
"${CMAKE_SOURCE_DIR}/src/CXX" CACHE PATH
"Path to the directory containing PyCXX's cxxextensions.c source file")
# used as compiler defines
@@ -3,12 +3,12 @@ macro(CopyLibpackDirectories)
if(FREECAD_COPY_DEPEND_DIRS_TO_BUILD)
message(STATUS "Copying libpack dependency directories to build directory...")
file(COPY ${FREECAD_LIBPACK_DIR}/bin/assistant.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(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf "[Paths]\nPrefix=..\n")
if(NOT FREECAD_LIBPACK_VERSION VERSION_GREATER_EQUAL "3.0.0")
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_BINARY_DIR}/bin)
endif()
@@ -45,6 +45,7 @@ macro(CopyLibpackDirectories)
if(FREECAD_LIBPACK_VERSION VERSION_LESS "3.1.0")
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
endif()
file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf "[Paths]\nPrefix=..\n")
endif()
endif()
@@ -4,14 +4,14 @@ macro(CreatePackagingTargets)
#
#add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
add_custom_target(dist-git
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
--bindir=${CMAKE_BINARY_DIR}
--major=${PACKAGE_VERSION_MAJOR}
--minor=${PACKAGE_VERSION_MINOR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(distdfsg-git
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
--bindir=${CMAKE_BINARY_DIR}
--major=${PACKAGE_VERSION_MAJOR}
--minor=${PACKAGE_VERSION_MINOR}
@@ -20,7 +20,7 @@ macro(CreatePackagingTargets)
)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX OR MINGW)
add_custom_target(distcheck-git
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
--bindir=${CMAKE_BINARY_DIR}
--major=${PACKAGE_VERSION_MAJOR}
--minor=${PACKAGE_VERSION_MINOR}
@@ -28,7 +28,7 @@ macro(CreatePackagingTargets)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(distcheckdfsg-git
COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/Tools/makedist.py
--bindir=${CMAKE_BINARY_DIR}
--major=${PACKAGE_VERSION_MAJOR}
--minor=${PACKAGE_VERSION_MINOR}
@@ -10,21 +10,17 @@ macro(InitializeFreeCADBuildOptions)
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_EXTERNAL_ONDSELSOLVER "Use system installed OndselSolver instead of git submodule." OFF)
option(FREECAD_USE_EXTERNAL_E57FORMAT "Use system installed libE57Format instead of the bundled." OFF)
option(FREECAD_USE_EXTERNAL_GTEST "Use system installed Google Test and Google Mock" OFF)
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_CHECK_PIVY "Check for pivy version using Python at build time" ON)
option(FREECAD_PARALLEL_COMPILE_JOBS "Compilation jobs pool size to fit memory limitations.")
option(FREECAD_PARALLEL_LINK_JOBS "Linkage jobs pool size to fit memory limitations.")
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(BUILD_TRACY_FRAME_PROFILER "If ON then enables support for the Tracy frame profiler" OFF)
option(INSTALL_TO_SITEPACKAGES "If ON the freecad root namespace (python) is installed into python's site-packages" ON)
option(INSTALL_PREFER_SYMLINKS "If ON then fc_copy_sources macro will create symlinks instead of copying files" OFF)
option(OCCT_CMAKE_FALLBACK "disable usage of occt-config files" OFF)
option(FREECAD_USE_QT_DIALOGS "Use Qt's dialogs instead of the native one." OFF)
if (WIN32 OR APPLE)
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF)
else()
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON)
endif()
# == Win32 is default behaviour use the LibPack copied in Source tree ==========
if(MSVC)
@@ -72,6 +68,15 @@ macro(InitializeFreeCADBuildOptions)
ChooseQtVersion()
# 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")
set_property(CACHE FREECAD_USE_OCC_VARIANT PROPERTY STRINGS
"Official Version"
"Community Edition"
)
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)
if(APPLE)
@@ -111,7 +116,6 @@ macro(InitializeFreeCADBuildOptions)
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_MATERIAL_EXTERNAL "Build the FreeCAD material external interface module" OFF)
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)
@@ -166,7 +170,7 @@ macro(InitializeFreeCADBuildOptions)
if(MSVC)
option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" ON)
option(FREECAD_USE_PCL "Build the features that use PCL libs" OFF)
option(FREECAD_USE_PCL "Build the features that use PCL libs" OFF) # 3/5/2021 current LibPack uses non-C++17 FLANN
endif(MSVC)
if(NOT MSVC)
option(BUILD_FEM_NETGEN "Build the FreeCAD FEM module with the NETGEN mesher" OFF)
@@ -175,28 +179,19 @@ macro(InitializeFreeCADBuildOptions)
# if this is set override some options
if (FREECAD_BUILD_DEBIAN)
# Disable it until the upstream package has been fixed. See
# https://github.com/FreeCAD/FreeCAD/issues/13676#issuecomment-2539978468
# https://github.com/FreeCAD/FreeCAD/issues/13676#issuecomment-2541513308
set(FREECAD_USE_EXTERNAL_ZIPIOS OFF )
set(FREECAD_USE_EXTERNAL_ZIPIOS ON )
# A Debian package for SMESH doesn't exist
#set(FREECAD_USE_EXTERNAL_SMESH ON )
endif (FREECAD_BUILD_DEBIAN)
if(BUILD_FEM OR BUILD_MESH_PART)
set(FREECAD_USE_SMESH ON)
if(FREECAD_USE_EXTERNAL_SMESH)
set(BUILD_SMESH OFF)
else()
set(BUILD_SMESH ON)
endif()
else()
set(FREECAD_USE_SMESH OFF)
set(BUILD_SMESH OFF)
if(BUILD_FEM)
set(BUILD_SMESH ON )
endif()
if (BUILD_CAM OR BUILD_FLAT_MESH)
set(FREECAD_USE_PYBIND11 ON)
# for Windows the minimum required cmake version is 3.4.3 to build the CAM module
if(WIN32 AND CMAKE_VERSION VERSION_LESS 3.4.3)
message(WARNING "Disable CAM, requires cmake >= 3.4.3 in order to build this module")
set(BUILD_CAM OFF )
endif()
# force build directory to be different to source directory
@@ -206,22 +201,4 @@ macro(InitializeFreeCADBuildOptions)
"Please choose another build directory! Or disable the option BUILD_FORCE_DIRECTORY.")
endif()
endif()
if(FREECAD_PARALLEL_COMPILE_JOBS)
if(CMAKE_GENERATOR MATCHES "Ninja")
set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${FREECAD_PARALLEL_COMPILE_JOBS})
set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
else()
message(WARNING "Job pooling is only available with Ninja generators.")
endif()
endif()
if(FREECAD_PARALLEL_LINK_JOBS)
if(CMAKE_GENERATOR MATCHES "Ninja")
set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${FREECAD_PARALLEL_LINK_JOBS})
set(CMAKE_JOB_POOL_LINK link_job_pool)
else()
message(WARNING "Job pooling is only available with Ninja generators.")
endif()
endif()
endmacro(InitializeFreeCADBuildOptions)
+7 -15
View File
@@ -14,7 +14,7 @@ macro(PrintFinalReport)
# just a value
macro(value)
unset(val)
unset(val)
set(name ${ARGV0})
if(${name})
set(val ${${name}}) # name has a value
@@ -58,14 +58,13 @@ macro(PrintFinalReport)
simple(Compiler "${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_VERSION})")
value(CMAKE_VERSION)
conditional(ccache CCACHE_PROGRAM "not enabled" ${CCACHE_PROGRAM})
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} [${Python3_EXECUTABLE}] Suffix: [${PYTHON_CONFIG_SUFFIX}]")
simple(Python "${Python3_VERSION} [${PYTHON_EXECUTABLE}] Suffix: [${PYTHON_CONFIG_SUFFIX}]")
value(BLAS)
section_end()
@@ -84,12 +83,11 @@ macro(PrintFinalReport)
value(BUILD_VR)
value(CMAKE_PREFIX_PATH)
value(FREECAD_QT_VERSION)
value(Python3_EXECUTABLE)
value(PYTHON_EXECUTABLE)
value(PYTHON_LIBRARY)
value(FREECAD_CREATE_MAC_APP)
value(FREECAD_USE_PYBIND11)
value(FREECAD_USE_EXTERNAL_KDL)
value(FREECAD_USE_PYSIDE)
value(FREECAD_USE_SHIBOKEN)
value(BUILD_ADDONMGR)
value(BUILD_BIM)
value(BUILD_ASSEMBLY)
@@ -104,7 +102,6 @@ macro(PrintFinalReport)
value(BUILD_INSPECTION)
value(BUILD_JTREADER)
value(BUILD_MATERIAL)
value(BUILD_MATERIAL_EXTERNAL)
value(BUILD_MESH)
value(BUILD_MESH_PART)
value(BUILD_OPENSCAD)
@@ -141,20 +138,20 @@ macro(PrintFinalReport)
conditional(pybind11 pybind11_FOUND "not enabled" ${pybind11_VERSION})
simple(Boost ${Boost_VERSION})
simple(XercesC "${XercesC_VERSION} [${XercesC_LIBRARIES}] [${XercesC_INCLUDE_DIRS}]")
simple(ICU "${ICU_VERSION}")
simple(ZLIB "${ZLIB_VERSION_STRING}")
simple(OCC "${OCC_VERSION_STRING} [${OCC_LIBRARY_DIR}] [${OCC_INCLUDE_DIR}]")
simple(OCC_Libs "[${OCC_LIBRARIES}]")
if(FREECAD_USE_SMESH)
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 "not enabled")
simple(SMESH "do not build")
endif()
conditional(NETGEN NETGEN_FOUND
"not enabled"
@@ -167,7 +164,6 @@ macro(PrintFinalReport)
simple(QtCore ${QtCore_VERSION})
simple(QtNetwork ${QtNetwork_VERSION})
conditional(QtOpenGL BUILD_GUI "not needed" ${QtOpenGL_VERSION})
conditional(QtOpenGLWidgets BUILD_GUI "not needed" ${QtOpenGLWidgets_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})
@@ -220,10 +216,6 @@ macro(PrintFinalReport)
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}")
conditional(yaml-cpp yaml-cpp_FOUND "not found" "${yaml-cpp_VERSION}")
conditional(Vtk VTK_FOUND "not found" ${VTK_VERSION})
if(BUILD_BIM)
conditional(Lark LARK_FOUND "not found" "${LARK_VERSION}")
endif()
section_end()
@@ -19,29 +19,18 @@ macro(SetGlobalCompilerAndLinkerSettings)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mxgot")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
# Only add -O0 if no -O* optimization flag exists
if (NOT "${CMAKE_C_FLAGS_DEBUG}" MATCHES "-O[a-z0-9]+")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
endif()
if (NOT "${CMAKE_CXX_FLAGS_DEBUG}" MATCHES "-O[a-z0-9]+")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
endif()
endif()
if(MSVC)
# set default compiler settings
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR -DNOMINMAX)
add_compile_options(/Zm150 /bigobj)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFC_DEBUG")
if (MSVC_VERSION LESS 1930) # Anything before VS 2022
# set default libs
set (CMAKE_C_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib SHFolder.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib comsupp.lib Ws2_32.lib dbghelp.lib ")
set (CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}")
# set linker flag /nodefaultlib
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
endif()
# set default libs
set (CMAKE_C_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib SHFolder.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib winmm.lib comsupp.lib Ws2_32.lib dbghelp.lib ")
set (CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}")
# set linker flag /nodefaultlib
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
if(FREECAD_RELEASE_PDB)
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
+1 -1
View File
@@ -3,7 +3,7 @@ macro(SetupBoost)
set(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS})
set (BOOST_COMPONENTS program_options regex thread date_time)
set (BOOST_COMPONENTS filesystem program_options regex system thread date_time)
find_package(Boost ${BOOST_MIN_VERSION}
COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
+17 -55
View File
@@ -6,22 +6,16 @@ macro(SetupCoin3D)
find_library(COIN3D_LIBRARIES Coin)
endif ()
# Try CONFIG mode -- Coin supports very old CMake files, which emits noisy warnings. Silence them.
set(CMAKE_WARN_DEPRECATED_OLD_STATE ${CMAKE_WARN_DEPRECATED})
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
find_package(Coin CONFIG)
set(CMAKE_WARN_DEPRECATED ${CMAKE_WARN_DEPRECATED_OLD_STATE} CACHE BOOL "" FORCE)
if (Coin_FOUND)
set(COIN3D_INCLUDE_DIRS ${Coin_INCLUDE_DIR})
set(COIN3D_LIBRARIES ${Coin_LIBRARIES})
set(COIN3D_LIB_DIRS ${Coin_LIB_DIR})
else ()
# Try MODULE mode (FindCoin3D.cmake, included by CMake)
find_package(Coin3D)
if (NOT COIN3D_FOUND)
message(FATAL_ERROR "Could not find Coin3D")
# Try MODULE mode
find_package(Coin3D)
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})
endif ()
endif ()
ENDIF ()
IF (NOT COIN3D_VERSION)
file(READ "${COIN3D_INCLUDE_DIRS}/Inventor/C/basic.h" _coin3d_basic_h)
@@ -33,50 +27,18 @@ macro(SetupCoin3D)
set(COIN3D_MICRO_VERSION "${CMAKE_MATCH_1}")
set(COIN3D_VERSION "${COIN3D_MAJOR_VERSION}.${COIN3D_MINOR_VERSION}.${COIN3D_MICRO_VERSION}")
ENDIF ()
endmacro(SetupCoin3D)
macro(SetupPivy)
# -------------------------------- Pivy --------------------------------
IF (FREECAD_CHECK_PIVY) # do not make pivy a host dependency for cross compiling
IF (NOT PIVY_VERSION)
message(STATUS "Checking Pivy version by importing it in a Python program...")
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import pivy as p; print(p.__version__,end='')"
OUTPUT_VARIABLE PIVY_VERSION
RESULT_VARIABLE RETURN_CODE)
if (RETURN_CODE EQUAL 0)
message(STATUS "Found Pivy ${PIVY_VERSION}")
else ()
message(ERROR "Failed to import Pivy using ${Python3_EXECUTABLE}")
endif ()
ENDIF ()
message(STATUS "Checking Pivy Coin3D version by importing it in a Python program...")
IF (NOT PIVY_VERSION)
message(STATUS "Checking Pivy version by importing it in a Python program...")
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import pivy as p; print(p.SoDB.getVersion(),end='')"
OUTPUT_VARIABLE PIVY_COIN_VERSION
COMMAND ${Python3_EXECUTABLE} -c "import pivy as p; print(p.__version__,end='')"
OUTPUT_VARIABLE PIVY_VERSION
RESULT_VARIABLE RETURN_CODE)
if (RETURN_CODE EQUAL 0)
message(STATUS "Found Pivy Coin3D ${PIVY_COIN_VERSION}")
message(STATUS "Found Pivy ${PIVY_VERSION}")
else ()
message(ERROR "Failed to get Pivy Coin3D version using ${Python3_EXECUTABLE}")
message(ERROR "Failed to import Pivy using ${Python3_EXECUTABLE}")
endif ()
ENDIF ()
if (${PIVY_COIN_VERSION} MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
set(PIVY_COIN_MAJOR_VERSION ${CMAKE_MATCH_1})
set(PIVY_COIN_MINOR_VERSION ${CMAKE_MATCH_2})
set(PIVY_COIN_MICRO_VERSION ${CMAKE_MATCH_3})
set(PIVY_COIN_VERSION "${PIVY_COIN_MAJOR_VERSION}.${PIVY_COIN_MINOR_VERSION}.${PIVY_COIN_MICRO_VERSION}")
else ()
message(FATAL_ERROR "Failed to match Pivy Coin3D version string output")
endif ()
if (NOT (
(${COIN3D_MAJOR_VERSION} EQUAL ${PIVY_COIN_MAJOR_VERSION}) AND
(${COIN3D_MINOR_VERSION} EQUAL ${PIVY_COIN_MINOR_VERSION}) AND
(${COIN3D_MICRO_VERSION} EQUAL ${PIVY_COIN_MICRO_VERSION})))
message(FATAL_ERROR "Coin3D version ${COIN3D_VERSION} mismatches Pivy Coin3D ${PIVY_COIN_VERSION}.")
endif ()
endif(FREECAD_CHECK_PIVY)
endmacro(SetupPivy)
endmacro(SetupCoin3D)
+11 -2
View File
@@ -11,10 +11,19 @@ macro(SetupEigen)
"=================\n")
endif(NOT EIGEN3_FOUND)
if (EIGEN3_FOUND AND ${EIGEN3_VERSION} VERSION_LESS "3.4.0")
if (EIGEN3_FOUND AND ${EIGEN3_VERSION} VERSION_LESS "3.3.1")
message(WARNING "Disable module flatmesh because it requires "
"minimum Eigen3 version 3.4.0 but version ${EIGEN3_VERSION} was found")
"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")
unset(_flag_found CACHE)
check_cxx_compiler_flag("-Wno-deprecated-copy" _flag_found)
if (_flag_found)
set (EIGEN3_NO_DEPRECATED_COPY "-Wno-deprecated-copy")
endif ()
endif()
endmacro(SetupEigen)
-16
View File
@@ -7,22 +7,6 @@ macro(SetupFreetype)
message("===============================================================\n"
"FreeType2 not found. Part module will lack of makeWireString().\n"
"===============================================================\n")
else()
# find_package(harfbuzz CONFIG) fails on windows
# lets do it the complicated way instead.
find_path(HARFBUZZ_INCLUDE_DIR hb.h PATH_SUFFIXES harfbuzz)
find_library(HARFBUZZ_LIBRARY NAMES harfbuzz)
if(HARFBUZZ_INCLUDE_DIR AND HARFBUZZ_LIBRARY)
if(NOT TARGET harfbuzz::harfbuzz)
add_library(harfbuzz::harfbuzz UNKNOWN IMPORTED)
set_target_properties(harfbuzz::harfbuzz PROPERTIES
IMPORTED_LOCATION "${HARFBUZZ_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIR}"
)
endif()
else()
message(FATAL_ERROR "HarfBuzz not found")
endif()
endif(NOT FREETYPE_FOUND)
endif(FREECAD_USE_FREETYPE)
-7
View File
@@ -1,7 +0,0 @@
macro(SetupLark)
# ------------------------------ Lark ------------------------------
find_package(LARK MODULE REQUIRED)
message(STATUS "Found Lark: version ${LARK_VERSION}")
endmacro()
+2 -2
View File
@@ -34,8 +34,8 @@ macro(SetupLibFmt)
cmake_policy(SET CMP0135 NEW)
endif()
FetchContent_Declare(fmt
URL https://github.com/fmtlib/fmt/archive/refs/tags/11.1.4.zip
URL_MD5 90667b07f34d91554cf8285ae234ff66
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)
+6 -3
View File
@@ -1,8 +1,11 @@
macro(SetupOpenCasCade)
# -------------------------------- OpenCasCade --------------------------------
find_package(OCC)
if(NOT OCC_FOUND)
message(FATAL_ERROR "================================================================\n"
"OpenCASCADE not found!\n"
"Neither OpenCASCADE Community Edition nor OpenCASCADE was found!\n"
"================================================================\n")
endif()
endmacro()
endif(NOT OCC_FOUND)
endmacro(SetupOpenCasCade)
-5
View File
@@ -1,11 +1,6 @@
macro(SetupOpenGL)
# -------------------------------- OpenGL --------------------------------
# If on a system with both a legacy GL library and GLVND, prefer the legacy library.
# This is probably needed until we no longer have any gl.*ARB calls in the codebase
# See, e.g. SoBrepFaceSet.cpp
set(OpenGL_GL_PREFERENCE LEGACY)
find_package(OpenGL)
include(FindPackageMessage)
if(OPENGL_GLU_FOUND)
@@ -2,6 +2,7 @@ macro(SetupPybind11)
# -------------------------------- PyBind11 -----------------------------
# necessary for flat-mesh feature
option(FREECAD_USE_PYBIND11 "Use pybind11" OFF)
if (FREECAD_USE_PYBIND11)
find_package(pybind11 REQUIRED)
endif()
+4 -5
View File
@@ -3,12 +3,7 @@ macro(SetupPython)
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
if (${Python3_VERSION} VERSION_LESS "3.10")
message(FATAL_ERROR "To build FreeCAD you need at least Python 3.10\n")
endif()
# For backwards compatibility with old CMake scripts
# See: https://github.com/FreeCAD/FreeCAD/pull/19635#issuecomment-2725612407
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
@@ -19,4 +14,8 @@ macro(SetupPython)
set(PYTHON_VERSION_PATCH ${Python3_VERSION_PATCH})
set(PYTHONINTERP_FOUND ${Python3_Interpreter_FOUND})
if (${PYTHON_VERSION_STRING} VERSION_LESS "3.8")
message(FATAL_ERROR "To build FreeCAD you need at least Python 3.8\n")
endif()
endmacro(SetupPython)
-2
View File
@@ -13,7 +13,6 @@ if(BUILD_GUI)
elseif (FREECAD_QT_MAJOR_VERSION EQUAL 6)
list (APPEND FREECAD_QT_COMPONENTS GuiTools)
list (APPEND FREECAD_QT_COMPONENTS SvgWidgets)
list (APPEND FREECAD_QT_COMPONENTS OpenGLWidgets)
endif()
list (APPEND FREECAD_QT_COMPONENTS OpenGL PrintSupport Svg UiTools Widgets LinguistTools)
@@ -79,7 +78,6 @@ else()
endif()
configure_file(${CMAKE_SOURCE_DIR}/src/QtCore.h.cmake ${CMAKE_BINARY_DIR}/src/QtCore.h)
configure_file(${CMAKE_SOURCE_DIR}/src/QtWidgets.h.cmake ${CMAKE_BINARY_DIR}/src/QtWidgets.h)
function(qt_find_and_add_translation _qm_files _tr_dir _qm_dir)
file(GLOB _ts_files ${_tr_dir})
+17 -37
View File
@@ -1,8 +1,8 @@
macro(SetupSalomeSMESH)
# -------------------------------- Salome SMESH --------------------------
# Salome SMESH sources are under src/3rdParty now
if(FREECAD_USE_SMESH)
# 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
set(SMESH_VERSION_MAJOR 7)
@@ -42,7 +42,7 @@ macro(SetupSalomeSMESH)
endif()
endforeach()
else()
set(VTK_COMPONENTS "CommonCore;CommonDataModel;FiltersVerdict;IOXML;FiltersCore;FiltersGeneral;IOLegacy;FiltersExtraction;FiltersSources;FiltersGeometry;WrappingPythonCore")
set(VTK_COMPONENTS "CommonCore;CommonDataModel;FiltersVerdict;IOXML;FiltersCore;FiltersGeneral;IOLegacy;FiltersExtraction;FiltersSources;FiltersGeometry")
list(APPEND VTK_COMPONENTS "IOMPIParallel;ParallelMPI;hdf5;FiltersParallelDIY2;RenderingCore;InteractionStyle;RenderingFreeType;RenderingOpenGL2")
foreach(_module ${VTK_COMPONENTS})
list (FIND VTK_AVAILABLE_COMPONENTS ${_module} _index)
@@ -63,17 +63,6 @@ macro(SetupSalomeSMESH)
endif()
set(BUILD_FEM_VTK ON)
# Check if PythonWrapperCore was found
# Note: VTK 9 only, as the implementations use the VTK modules introduced in 8.1
# VTK_WrappingPythonCore_FOUND is named differently for versions <9.0
if (${VTK_WrappingPythonCore_FOUND})
set(BUILD_FEM_VTK_PYTHON 1)
message(STATUS "VTK python wrapper: available")
else()
message(STATUS "VTK python wrapper: NOT available")
endif()
if(${VTK_MAJOR_VERSION} LESS 6)
message( FATAL_ERROR "Found VTK version is <6, this is not compatible" )
endif()
@@ -103,34 +92,25 @@ macro(SetupSalomeSMESH)
set(HDF5_VARIANT "hdf5-serial")
else()
message(STATUS "We guess that libmed was built using hdf5-openmpi version")
set(HDF5_VARIANT "hdf5-openmpi;hdf5_openmpi")
set(HDF5_VARIANT "hdf5-openmpi")
set(HDF5_PREFER_PARALLEL TRUE) # if pkg-config fails, find_package(HDF5) needs this
endif()
pkg_search_module(PCHDF5 ${HDF5_VARIANT})
if(NOT PCHDF5_FOUND)
pkg_search_module(HDF5 ${HDF5_VARIANT})
if(NOT HDF5_FOUND)
find_package(HDF5 REQUIRED)
else()
add_compile_options(${PCHDF5_CFLAGS})
link_directories(${PCHDF5_LIBRARY_DIRS})
link_libraries(${PCHDF5_LIBRARIES})
# workaround to define include dir from PCHDF5_CFLAGS (pkg-config PCHDF5_INCLUDEDIR is only filled since hdf5 1.14.6)
set(hdf5_include_path "")
foreach(flag IN LISTS PCHDF5_CFLAGS)
if(flag MATCHES "^-I")
string(REGEX REPLACE "^-I[ ]*" "" flag "${flag}")
list(APPEND hdf5_include_path "${flag}")
endif()
endforeach()
set(_save_INC CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_INCLUDES ${hdf5_include_path})
check_include_file_cxx(hdf5.h HDF5_HEAD_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${_save_INC})
if(NOT HDF5_HEAD_FOUND)
message( FATAL_ERROR "hdf5.h was not found (tested pkg-config ${HDF5_VARIANT}, suggested header location was '${hdf5_include_path}').")
add_compile_options(${HDF5_CFLAGS})
link_directories(${HDF5_LIBRARY_DIRS})
link_libraries(${HDF5_LIBRARIES})
find_file(Hdf5dotH hdf5.h PATHS ${HDF5_INCLUDE_DIRS} NO_DEFAULT_PATH)
if(NOT Hdf5dotH)
message( FATAL_ERROR "${HDF5_VARIANT} development header not found.")
endif()
endif()
check_include_file_cxx(hdf5.h HDF5_FOUND)
if(NOT HDF5_FOUND)
message( FATAL_ERROR "hdf5.h was not found.")
endif()
# Med Fichier can require MPI
pkg_search_module(OPENMPI ompi-cxx)
@@ -165,6 +145,6 @@ macro(SetupSalomeSMESH)
set(SMESH_FOUND TRUE)
configure_file(${CMAKE_SOURCE_DIR}/src/SMESH_Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SMESH_Version.h)
endif(FREECAD_USE_SMESH)
endif(BUILD_SMESH)
endmacro(SetupSalomeSMESH)
@@ -7,7 +7,7 @@ macro(SetupShibokenAndPyside)
if(DEFINED MACPORTS_PREFIX)
find_package(Shiboken REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
find_package(PySide REQUIRED HINTS "${PYTHON_LIBRARY_DIR}/cmake")
endif()
endif(DEFINED MACPORTS_PREFIX)
if(FREECAD_QT_MAJOR_VERSION EQUAL 5)
set(SHIBOKEN_MAJOR_VERSION 2)
@@ -21,16 +21,16 @@ macro(SetupShibokenAndPyside)
# 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})
set (SAVE_BUILD_TYPE ${CMAKE_BUILD_TYPE})
find_package(Shiboken${SHIBOKEN_MAJOR_VERSION} QUIET)
set(CMAKE_BUILD_TYPE ${SAVE_BUILD_TYPE})
if(Shiboken${SHIBOKEN_MAJOR_VERSION}_FOUND)
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
# 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")
if(SHIBOKEN_CONFIG)
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})
@@ -47,11 +47,11 @@ macro(SetupShibokenAndPyside)
# 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()
endif(NOT SHIBOKEN_INCLUDE_DIR AND TARGET Shiboken${SHIBOKEN_MAJOR_VERSION}::libshiboken)
if(NOT SHIBOKEN_INCLUDE_DIR)
find_pip_package(Shiboken${SHIBOKEN_MAJOR_VERSION})
if(Shiboken${SHIBOKEN_MAJOR_VERSION}_FOUND)
if (Shiboken${SHIBOKEN_MAJOR_VERSION}_FOUND)
set(SHIBOKEN_INCLUDE_DIR ${Shiboken${SHIBOKEN_MAJOR_VERSION}_INCLUDE_DIRS})
set(SHIBOKEN_LIBRARY ${Shiboken${SHIBOKEN_MAJOR_VERSION}_LIBRARIES})
endif()
@@ -59,18 +59,15 @@ macro(SetupShibokenAndPyside)
find_package(PySide${PYSIDE_MAJOR_VERSION} QUIET)
if(${PYSIDE_MAJOR_VERSION} EQUAL 2)
# Our internal FindPySide6.cmake file already provides these for PySide6
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()
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)
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})
endif()
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})
endif()
endif()
@@ -131,7 +128,7 @@ macro(SetupShibokenAndPyside)
# Now try to import the shiboken Python module and print a warning if it can't be loaded
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import shiboken${SHIBOKEN_MAJOR_VERSION}"
COMMAND ${PYTHON_EXECUTABLE} -c "import shiboken${SHIBOKEN_MAJOR_VERSION}"
RESULT_VARIABLE FAILURE
OUTPUT_VARIABLE PRINT_OUTPUT
)
@@ -143,7 +140,7 @@ macro(SetupShibokenAndPyside)
"==================================\n")
else()
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import shiboken${SHIBOKEN_MAJOR_VERSION};print(shiboken${SHIBOKEN_MAJOR_VERSION}.__version__, end='')"
COMMAND ${PYTHON_EXECUTABLE} -c "import shiboken${SHIBOKEN_MAJOR_VERSION};print(shiboken${SHIBOKEN_MAJOR_VERSION}.__version__, end='')"
RESULT_VARIABLE FAILURE
OUTPUT_VARIABLE Shiboken_VERSION
)
@@ -157,7 +154,7 @@ macro(SetupShibokenAndPyside)
# Independent of the build option PySide modules must be loaded at runtime. Print a warning if it fails.
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import PySide${PYSIDE_MAJOR_VERSION};import os;print(os.path.dirname(PySide${PYSIDE_MAJOR_VERSION}.__file__), end='')"
COMMAND ${PYTHON_EXECUTABLE} -c "import PySide${PYSIDE_MAJOR_VERSION};import os;print(os.path.dirname(PySide${PYSIDE_MAJOR_VERSION}.__file__), end='')"
RESULT_VARIABLE FAILURE
OUTPUT_VARIABLE PRINT_OUTPUT
)
@@ -168,29 +165,61 @@ macro(SetupShibokenAndPyside)
"================================\n")
else()
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "import PySide${PYSIDE_MAJOR_VERSION};print(PySide${PYSIDE_MAJOR_VERSION}.__version__, end='')"
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")
endif()
endmacro()
endmacro(SetupShibokenAndPyside)
macro(PYSIDE_WRAP_RC outfiles)
if(NOT PYSIDE_RCC_EXECUTABLE)
# 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")
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}
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYSIDE_RCC_EXECUTABLE} ${RCCOPTIONS} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
@@ -198,7 +227,7 @@ macro(PYSIDE_WRAP_RC outfiles)
# 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}"
ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
COMMAND "${PYSIDE_RCC_EXECUTABLE}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
# The line below sometimes catches unwanted lines too - but there is no date in the file
# anymore with Qt5 RCC, so commenting it out for now...
@@ -207,5 +236,5 @@ macro(PYSIDE_WRAP_RC outfiles)
)
endif()
list(APPEND ${outfiles} ${outfile})
endforeach()
endmacro()
ENDFOREACH(it)
ENDMACRO (PYSIDE_WRAP_RC)
+8 -156
View File
@@ -1,160 +1,12 @@
macro(SetupSwig)
# -------------------------------- Swig ----------------------------------
#-------------------------------- Swig ----------------------------------
find_package(SWIG)
# force cmake to re-search for SWIG when CMAKE_PREFIX_PATH changes
unset(SWIG_EXECUTABLE CACHE)
unset(SWIG_DIR CACHE)
unset(SWIG_VERSION CACHE)
unset(SWIG_FOUND CACHE)
if (NOT SWIG_FOUND)
message("=====================================================\n"
"SWIG not found, will not build SWIG binding for pivy.\n"
"=====================================================\n")
endif(NOT SWIG_FOUND)
if(BUILD_SKETCHER)
# SWIG is required for sketcher WB (use QUIET to provide custom error message)
find_package(SWIG QUIET)
if(NOT SWIG_FOUND)
message(FATAL_ERROR
"-----------------------------------------------------\n"
"SWIG not found, swig & pivy required for sketcher WB.\n"
"-----------------------------------------------------\n")
# do not continue with check if swig not found
return()
endif()
# check swig/pivy runtime compatibility
message(STATUS "checking SWIG/Pivy runtime compatibility...")
# get SWIG's runtime version using -external-runtime flag
execute_process(
COMMAND ${SWIG_EXECUTABLE} -python -external-runtime "${CMAKE_BINARY_DIR}/swig_runtime_check.h"
RESULT_VARIABLE SWIG_EXTERNAL_RUNTIME_RESULT
ERROR_VARIABLE SWIG_EXTERNAL_RUNTIME_ERROR
ERROR_QUIET
)
# NOTE: only print the below output if using `cmake --log-level=DEBUG`
message(DEBUG "SWIG external-runtime result: ${SWIG_EXTERNAL_RUNTIME_RESULT}")
message(DEBUG "SWIG external-runtime error: ${SWIG_EXTERNAL_RUNTIME_ERROR}")
message(STATUS "Looking for: ${CMAKE_BINARY_DIR}/swig_runtime_check.h")
if(EXISTS "${CMAKE_BINARY_DIR}/swig_runtime_check.h")
message(STATUS "File exists: YES")
else()
message(STATUS "File exists: NO")
endif()
if(EXISTS "${CMAKE_BINARY_DIR}/swig_runtime_check.h")
file(STRINGS "${CMAKE_BINARY_DIR}/swig_runtime_check.h"
SWIG_RUNTIME_VERSION_LINE
REGEX "^#define SWIG_RUNTIME_VERSION")
message(STATUS "SWIG_RUNTIME_VERSION_LINE: ${SWIG_RUNTIME_VERSION_LINE}")
if(SWIG_RUNTIME_VERSION_LINE)
# extract the version number (it's in quotes: "5")
string(REGEX MATCH "\"([0-9]+)\"" _ "${SWIG_RUNTIME_VERSION_LINE}")
set(SWIG_RUNTIME_VERSION "${CMAKE_MATCH_1}")
message(STATUS "Extracted SWIG_RUNTIME_VERSION: ${SWIG_RUNTIME_VERSION}")
endif()
file(REMOVE "${CMAKE_BINARY_DIR}/swig_runtime_check.h")
else()
message(STATUS "swig_runtime_check.h not found!")
endif()
# extract pivy's SWIG runtime version from the compiled module
# NOTE: python code can not be indented
set(PYTHON_CHECK_PIVY_RUNTIME [=[
import sys
import os
import re
try:
import pivy
pivy_dir = os.path.dirname(pivy.__file__)
print(f'DEBUG:pivy_dir={pivy_dir}', file=sys.stderr)
print(f'DEBUG:files={os.listdir(pivy_dir)}', file=sys.stderr)
pivy_path = None
# Look for _coin module with any extension (.so on Unix, .pyd on Windows)
for f in os.listdir(pivy_dir):
print(f'DEBUG:checking={f}', file=sys.stderr)
if f.startswith('_coin') and (f.endswith('.so') or f.endswith('.pyd')):
pivy_path = os.path.join(pivy_dir, f)
break
print(f'DEBUG:pivy_path={pivy_path}', file=sys.stderr)
if pivy_path and os.path.exists(pivy_path):
with open(pivy_path, 'rb') as f:
content = f.read().decode('latin-1', errors='ignore')
print(f'DEBUG:content_len={len(content)}', file=sys.stderr)
# Use regex to find swig_runtime_data followed by a number
match = re.search(r'swig_runtime_data(\d+)', content)
print(f'DEBUG:match={match}', file=sys.stderr)
if match:
print(match.group(1))
except ImportError as e:
print(f'DEBUG:import_error={e}', file=sys.stderr)
print('ERROR_IMPORT')
except Exception as e:
print(f'DEBUG:exception={e}', file=sys.stderr)
]=])
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "${PYTHON_CHECK_PIVY_RUNTIME}"
OUTPUT_VARIABLE PIVY_RUNTIME_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE PIVY_DEBUG_OUTPUT
TIMEOUT 10
)
message(DEBUG "Pivy debug output: ${PIVY_DEBUG_OUTPUT}")
# Handle errors and compare versions
if(PIVY_RUNTIME_VERSION STREQUAL "ERROR_IMPORT")
message(WARNING
"Could not import pivy to check SWIG compatibility.\n"
"Proceeding without SWIG version check."
)
elseif(SWIG_RUNTIME_VERSION AND PIVY_RUNTIME_VERSION)
if(NOT SWIG_RUNTIME_VERSION STREQUAL PIVY_RUNTIME_VERSION)
message(FATAL_ERROR
" --------------------------------------------------------
SWIG / PIVY RUNTIME VERSION MISMATCH DETECTED!
SWIG runtime API version: ${SWIG_RUNTIME_VERSION}
Pivy runtime API version: ${PIVY_RUNTIME_VERSION}
These must match for compatibility.
This will cause runtime errors: 'No SWIG wrapped library loaded'
swig v4.4.x is not compatible with pivy built with swig <=4.3.x
FIX: Install a SWIG version that uses runtime ${PIVY_RUNTIME_VERSION}
or rebuild Pivy with your current SWIG ${SWIG_VERSION}.
--------------------------------------------------------"
)
else()
message(STATUS "SWIG/Pivy runtime compatibility: PASSED")
message(STATUS "swig runtime API version: ${SWIG_RUNTIME_VERSION}")
message(STATUS "pivy runtime API version: ${PIVY_RUNTIME_VERSION}")
message(STATUS "swig binary version building freecad: ${SWIG_VERSION}")
endif()
else()
if(NOT SWIG_RUNTIME_VERSION)
message(WARNING "Could not determine SWIG runtime version")
endif()
if(NOT PIVY_RUNTIME_VERSION)
message(WARNING "Could not determine Pivy runtime version")
endif()
message(WARNING "Proceeding without SWIG/Pivy compatibility check.")
endif()
endif()
endmacro()
endmacro(SetupSwig)
-67
View File
@@ -1,67 +0,0 @@
macro(SetupZipIos)
# -------------------------------- ZipIos --------------------------------
# Use external zipios++ if specified.
if(FREECAD_USE_EXTERNAL_ZIPIOS)
find_library(ZIPIOS_LIBRARY zipios)
find_path(ZIPIOS_INCLUDES zipios++/zipios-config.h)
if(ZIPIOS_LIBRARY)
message(STATUS "Found zipios++: ${ZIPIOS}")
endif()
if(ZIPIOS_INCLUDES)
message(STATUS "Found zipios++ headers.")
endif()
if(NOT ZIPIOS_LIBRARY OR NOT ZIPIOS_INCLUDES)
message(FATAL_ERROR "Using external zipios++ was specified but was not found.")
endif()
else(FREECAD_USE_EXTERNAL_ZIPIOS)
set(ZIPIOS_INCLUDES ${CMAKE_SOURCE_DIR}/src/3rdParty)
SET(zipios_SRCS
${ZIPIOS_INCLUDES}/zipios++/backbuffer.h
${ZIPIOS_INCLUDES}/zipios++/collcoll.cpp
${ZIPIOS_INCLUDES}/zipios++/collcoll.h
${ZIPIOS_INCLUDES}/zipios++/deflateoutputstreambuf.cpp
${ZIPIOS_INCLUDES}/zipios++/deflateoutputstreambuf.h
${ZIPIOS_INCLUDES}/zipios++/fcoll.cpp
${ZIPIOS_INCLUDES}/zipios++/fcoll.h
${ZIPIOS_INCLUDES}/zipios++/fcollexceptions.cpp
${ZIPIOS_INCLUDES}/zipios++/fcollexceptions.h
${ZIPIOS_INCLUDES}/zipios++/fileentry.cpp
${ZIPIOS_INCLUDES}/zipios++/fileentry.h
${ZIPIOS_INCLUDES}/zipios++/filepath.cpp
${ZIPIOS_INCLUDES}/zipios++/filepath.h
${ZIPIOS_INCLUDES}/zipios++/filterinputstreambuf.cpp
${ZIPIOS_INCLUDES}/zipios++/filterinputstreambuf.h
${ZIPIOS_INCLUDES}/zipios++/filteroutputstreambuf.cpp
${ZIPIOS_INCLUDES}/zipios++/filteroutputstreambuf.h
${ZIPIOS_INCLUDES}/zipios++/gzipoutputstream.cpp
${ZIPIOS_INCLUDES}/zipios++/gzipoutputstream.h
${ZIPIOS_INCLUDES}/zipios++/gzipoutputstreambuf.cpp
${ZIPIOS_INCLUDES}/zipios++/gzipoutputstreambuf.h
${ZIPIOS_INCLUDES}/zipios++/inflateinputstreambuf.cpp
${ZIPIOS_INCLUDES}/zipios++/inflateinputstreambuf.h
${ZIPIOS_INCLUDES}/zipios++/meta-iostreams.h
${ZIPIOS_INCLUDES}/zipios++/outputstringstream.h
${ZIPIOS_INCLUDES}/zipios++/simplesmartptr.h
${ZIPIOS_INCLUDES}/zipios++/virtualseeker.h
${ZIPIOS_INCLUDES}/zipios++/zipfile.cpp
${ZIPIOS_INCLUDES}/zipios++/zipfile.h
${ZIPIOS_INCLUDES}/zipios++/ziphead.cpp
${ZIPIOS_INCLUDES}/zipios++/ziphead.h
${ZIPIOS_INCLUDES}/zipios++/zipheadio.cpp
${ZIPIOS_INCLUDES}/zipios++/zipheadio.h
${ZIPIOS_INCLUDES}/zipios++/zipinputstream.cpp
${ZIPIOS_INCLUDES}/zipios++/zipinputstream.h
${ZIPIOS_INCLUDES}/zipios++/zipinputstreambuf.cpp
${ZIPIOS_INCLUDES}/zipios++/zipinputstreambuf.h
${ZIPIOS_INCLUDES}/zipios++/zipios_common.h
${ZIPIOS_INCLUDES}/zipios++/zipios-config.h
${ZIPIOS_INCLUDES}/zipios++/zipios_defs.h
${ZIPIOS_INCLUDES}/zipios++/zipoutputstreambuf.cpp
${ZIPIOS_INCLUDES}/zipios++/zipoutputstreambuf.h
${ZIPIOS_INCLUDES}/zipios++/zipoutputstream.cpp
${ZIPIOS_INCLUDES}/zipios++/zipoutputstream.h
)
endif(FREECAD_USE_EXTERNAL_ZIPIOS)
endmacro(SetupZipIos)
+69 -74
View File
@@ -9,27 +9,21 @@ MACRO (fc_copy_sources target_name outpath)
else()
set(fc_details "")
endif()
if(INSTALL_PREFER_SYMLINKS)
set(copy_command create_symlink)
else()
set(copy_command copy)
endif()
foreach(it ${ARGN})
get_filename_component(infile ${it} ABSOLUTE)
get_filename_component(outfile "${outpath}/${it}" ABSOLUTE)
# Ensure parent directory exists when copying or creating symlinks
get_filename_component(outfile_dir "${outfile}" PATH)
add_file_dependencies("${infile}" "${outfile}")
ADD_CUSTOM_COMMAND(
# Make sure destination directory exists before copy/symlink
COMMAND "${CMAKE_COMMAND}" -E make_directory "${outfile_dir}"
COMMAND "${CMAKE_COMMAND}" -E ${copy_command} "${infile}" "${outfile}"
COMMAND "${CMAKE_COMMAND}" -E copy "${infile}" "${outfile}"
OUTPUT "${outfile}"
COMMENT "Copying ${infile} to ${outfile}${fc_details}"
MAIN_DEPENDENCY "${infile}"
)
endforeach(it)
ADD_CUSTOM_COMMAND(
TARGET ${target_name}
DEPENDS ${ARGN}
)
ENDMACRO(fc_copy_sources)
MACRO (fc_copy_file_if_different inputfile outputfile)
@@ -82,6 +76,10 @@ MACRO (fc_target_copy_resource target_name inpath outpath)
MAIN_DEPENDENCY "${infile}"
)
endforeach(it)
ADD_CUSTOM_COMMAND(
TARGET ${target_name}
DEPENDS ${ARGN}
)
ENDMACRO(fc_target_copy_resource)
MACRO (fc_target_copy_resource_flat target_name inpath outpath)
@@ -113,13 +111,16 @@ MACRO (fc_target_copy_resource_flat target_name inpath outpath)
MAIN_DEPENDENCY "${infile}"
)
endforeach(it)
ADD_CUSTOM_COMMAND(
TARGET ${target_name}
DEPENDS ${ARGN}
)
ENDMACRO(fc_target_copy_resource_flat)
# It would be a bit cleaner to generate these files in ${CMAKE_CURRENT_BINARY_DIR}
# To be removed once all instances are migrated to generate_from_py
macro(generate_from_xml BASE_NAME)
set(TOOL_PATH "${CMAKE_SOURCE_DIR}/src/Tools/bindings/generate.py")
set(TOOL_PATH "${CMAKE_SOURCE_DIR}/src/Tools/generate.py")
file(TO_NATIVE_PATH "${TOOL_PATH}" TOOL_NATIVE_PATH)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${BASE_NAME}.xml" SOURCE_NATIVE_PATH)
@@ -131,75 +132,34 @@ macro(generate_from_xml BASE_NAME)
if(NOT EXISTS "${SOURCE_CPP_PATH}")
# assures the source files are generated at least once
message(STATUS "${SOURCE_CPP_PATH}")
execute_process(COMMAND "${Python3_EXECUTABLE}" "${TOOL_NATIVE_PATH}" --outputPath "${OUTPUT_NATIVE_PATH}" "${SOURCE_NATIVE_PATH}"
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${TOOL_NATIVE_PATH}" --outputPath "${OUTPUT_NATIVE_PATH}" "${SOURCE_NATIVE_PATH}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
endif()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME}.h" "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME}.cpp"
COMMAND ${Python3_EXECUTABLE} "${TOOL_NATIVE_PATH}" --outputPath "${OUTPUT_NATIVE_PATH}" ${BASE_NAME}.xml
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${BASE_NAME}.xml"
COMMAND ${PYTHON_EXECUTABLE} "${TOOL_NATIVE_PATH}" --outputPath "${OUTPUT_NATIVE_PATH}" ${BASE_NAME}.xml
MAIN_DEPENDENCY "${BASE_NAME}.xml"
DEPENDS
"${CMAKE_SOURCE_DIR}/src/Tools/bindings/templates/templateClassPyExport.py"
"${CMAKE_SOURCE_DIR}/src/Tools/generateTemplates/templateClassPyExport.py"
"${TOOL_PATH}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Building ${BASE_NAME}.h/.cpp out of ${BASE_NAME}.xml"
)
endmacro(generate_from_xml)
macro(generate_from_py_impl BASE_NAME SUFFIX)
set(TOOL_PATH "${CMAKE_SOURCE_DIR}/src/Tools/bindings/generate.py")
file(TO_NATIVE_PATH "${TOOL_PATH}" TOOL_NATIVE_PATH)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${BASE_NAME}.pyi" SOURCE_NATIVE_PATH)
set(SOURCE_CPP_PATH "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME}Py${SUFFIX}.cpp")
set(SOURCE_H_PATH "${CMAKE_CURRENT_BINARY_DIR}/${BASE_NAME}Py${SUFFIX}.h")
# BASE_NAME may include also a path name
GET_FILENAME_COMPONENT(OUTPUT_PATH "${SOURCE_CPP_PATH}" PATH)
file(TO_NATIVE_PATH "${OUTPUT_PATH}" OUTPUT_NATIVE_PATH)
if(NOT EXISTS "${SOURCE_CPP_PATH}")
# Ensure the source files are generated at least once.
message(STATUS "${SOURCE_CPP_PATH}")
execute_process(
COMMAND "${Python3_EXECUTABLE}" "${TOOL_NATIVE_PATH}" --outputPath "${OUTPUT_NATIVE_PATH}" "${SOURCE_NATIVE_PATH}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND_ERROR_IS_FATAL ANY
)
endif()
add_custom_command(
OUTPUT "${SOURCE_H_PATH}" "${SOURCE_CPP_PATH}"
COMMAND ${Python3_EXECUTABLE} "${TOOL_NATIVE_PATH}" --outputPath "${OUTPUT_NATIVE_PATH}" ${BASE_NAME}.pyi
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${BASE_NAME}.pyi"
DEPENDS
"${CMAKE_SOURCE_DIR}/src/Tools/bindings/templates/templateClassPyExport.py"
"${TOOL_PATH}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Building ${BASE_NAME}Py${SUFFIX}.h/.cpp out of ${BASE_NAME}.pyi"
)
endmacro(generate_from_py_impl)
macro(generate_from_py BASE_NAME)
generate_from_py_impl(${BASE_NAME} "")
endmacro(generate_from_py)
macro(generate_from_py_ BASE_NAME)
generate_from_py_impl(${BASE_NAME} "_")
endmacro(generate_from_py_)
macro(generate_embed_from_py BASE_NAME OUTPUT_FILE)
macro(generate_from_py BASE_NAME OUTPUT_FILE)
set(TOOL_PATH "${CMAKE_SOURCE_DIR}/src/Tools/PythonToCPP.py")
file(TO_NATIVE_PATH "${TOOL_PATH}" TOOL_NATIVE_PATH)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${BASE_NAME}.py" SOURCE_NATIVE_PATH)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE}"
COMMAND "${Python3_EXECUTABLE}" "${TOOL_NATIVE_PATH}" "${SOURCE_NATIVE_PATH}" "${OUTPUT_FILE}"
COMMAND "${PYTHON_EXECUTABLE}" "${TOOL_NATIVE_PATH}" "${SOURCE_NATIVE_PATH}" "${OUTPUT_FILE}"
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${BASE_NAME}.py"
DEPENDS "${TOOL_PATH}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Building files out of ${BASE_NAME}.py")
endmacro(generate_embed_from_py)
endmacro(generate_from_py)
macro(generate_from_any INPUT_FILE OUTPUT_FILE VARIABLE)
set(TOOL_PATH "${CMAKE_SOURCE_DIR}/src/Tools/PythonToCPP.py")
@@ -207,7 +167,7 @@ macro(generate_from_any INPUT_FILE OUTPUT_FILE VARIABLE)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_FILE}" SOURCE_NATIVE_PATH)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE}"
COMMAND "${Python3_EXECUTABLE}" "${TOOL_NATIVE_PATH}" "${SOURCE_NATIVE_PATH}" "${OUTPUT_FILE}" "${VARIABLE}"
COMMAND "${PYTHON_EXECUTABLE}" "${TOOL_NATIVE_PATH}" "${SOURCE_NATIVE_PATH}" "${OUTPUT_FILE}" "${VARIABLE}"
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT_FILE}"
DEPENDS "${TOOL_PATH}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
@@ -215,6 +175,47 @@ macro(generate_from_any INPUT_FILE OUTPUT_FILE VARIABLE)
endmacro(generate_from_any)
MACRO(ADD_MSVC_PRECOMPILED_HEADER TargetName PrecompiledHeader PrecompiledSource SourcesVar)
IF(MSVC)
GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE)
IF(MSVC_IDE)
SET(PrecompiledBinary "$(IntDir)\\$(TargetName).pch")
ELSE(MSVC_IDE)
SET(PrecompiledBinary ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}.pch)
ENDIF(MSVC_IDE)
SET(Sources ${${SourcesVar}})
SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource}
PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
OBJECT_OUTPUTS "${PrecompiledBinary}")
SET_SOURCE_FILES_PROPERTIES(${Sources}
PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeader}\" /FI\"${PrecompiledBinary}\" /Fp\"${PrecompiledBinary}\""
OBJECT_DEPENDS "${PrecompiledBinary}")
# Add precompiled header to SourcesVar
LIST(APPEND ${SourcesVar} ${PrecompiledSource})
ENDIF(MSVC)
ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER)
MACRO(GET_MSVC_PRECOMPILED_SOURCE PrecompiledSource SourcesVar)
IF(MSVC)
FOREACH (it ${ARGN})
GET_FILENAME_COMPONENT(file_ext ${it} EXT)
GET_FILENAME_COMPONENT(file_name ${it} NAME)
STRING(COMPARE EQUAL ${it} ${PrecompiledSource} pch)
IF (NOT pch)
# get c++ source files
STRING(REGEX MATCH "^(.cpp|.cc|.cxx)$" cpp_file ${file_ext})
# ignore any generated source files from Qt
STRING(REGEX MATCH "^(moc_|qrc_|ui_)" gen_file ${file_name})
IF(cpp_file AND NOT gen_file)
LIST(APPEND ${SourcesVar} ${it})
ENDIF(cpp_file AND NOT gen_file)
ENDIF(NOT pch)
ENDFOREACH (it)
ENDIF(MSVC)
ENDMACRO(GET_MSVC_PRECOMPILED_SOURCE)
# Macro to replace all the binary output locations. Takes 2 optional parameters.
# ${ARGVN} is zero based so the 3rd element is ${ARGV2}. When the 3rd element is missing,
# Runtime and Lib directories default to /bin and /lib. When present, the 3rd element
@@ -271,10 +272,8 @@ ENDMACRO(SET_PYTHON_PREFIX_SUFFIX)
# 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)
unset(${PACKAGE}_FOUND) # Remove from local scope
unset(${PACKAGE}_FOUND CACHE) # Remove from CMake cache (if it exists)
execute_process(
COMMAND ${Python3_EXECUTABLE} -m pip show ${PACKAGE}
COMMAND ${PYTHON_EXECUTABLE} -m pip show ${PACKAGE}
RESULT_VARIABLE FAILURE
OUTPUT_VARIABLE PRINT_OUTPUT
)
@@ -307,18 +306,15 @@ macro(find_pip_package PACKAGE)
file(GLOB OPT_LIBRARIES "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/*${PIP_LIB_NAME}*.so.*")
endif()
if (OPT_LIBRARIES AND DEBUG_LIBRARIES)
set(${PACKAGE}_LIBRARIES optimized ${OPT_LIBRARIES} debug ${DEBUG_LIBRARIES} CACHE PATH "Location of the ${PACKAGE} libraries")
set(${PACKAGE}_LIBRARIES optimized ${OPT_LIBRARIES} debug ${DEBUG_LIBRARIES} CACHE PATH "")
elseif(OPT_LIBRARIES)
set(${PACKAGE}_LIBRARIES ${OPT_LIBRARIES} CACHE PATH "Location of the ${PACKAGE} optimized libraries")
set(${PACKAGE}_LIBRARIES ${OPT_LIBRARIES} CACHE PATH "")
elseif(DEBUG_LIBRARIES)
set(${PACKAGE}_LIBRARIES ${DEBUG_LIBRARIES} CACHE PATH "Location of the ${PACKAGE} debug libraries")
set(${PACKAGE}_LIBRARIES ${DEBUG_LIBRARIES} CACHE PATH "")
endif()
set(${PACKAGE}_INCLUDE_DIRS ${INCLUDE_DIR} CACHE PATH "Location of the ${PACKAGE} includes")
set(${PACKAGE}_FOUND ON)
set(${PACKAGE}_INCLUDE_DIRS ${INCLUDE_DIR} CACHE PATH "")
set(${PACKAGE}_FOUND ON CACHE BOOL OFF)
message(STATUS "Found pip-installed ${PACKAGE} in ${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}")
if(${PACKAGE}_INCLUDE_DIRS)
message(STATUS " --> with includes in ${${PACKAGE}_INCLUDE_DIRS}")
endif()
endif()
endmacro()
@@ -327,4 +323,3 @@ function(target_compile_warn_error ProjectName)
target_compile_options(${ProjectName} PRIVATE -Werror)
endif()
endfunction()
+1 -11
View File
@@ -19,25 +19,15 @@ if(FREECAD_LIBPACK_VERSION VERSION_GREATER_EQUAL "3.1.0")
find_package(pybind11 REQUIRED PATHS ${FREECAD_LIBPACK_DIR}/share/cmake/pybind11 NO_DEFAULT_PATH)
message(STATUS "Found LibPack 3 pybind11 ${pybind11_VERSION}")
set(FREECAD_USE_PYBIND11 ON)
else()
# We have completely removed support for boost-python and require pybind11, which requires LibPack 3.1 or later
message(FATAL_ERROR "FreeCAD now requires LibPack 3.1.0 or newer (you are using ${FREECAD_LIBPACK_VERSION}): please upgrade your LibPack")
endif()
find_package(XercesC REQUIRED PATHS ${FREECAD_LIBPACK_DIR}/cmake NO_DEFAULT_PATH)
message(STATUS "Found LibPack 3 XercesC ${XercesC_VERSION}")
if(FREECAD_LIBPACK_VERSION VERSION_GREATER_EQUAL "3.1.1")
set(FREECAD_USE_EXTERNAL_E57FORMAT ON)
find_package(E57Format REQUIRED PATHS ${FREECAD_LIBPACK_DIR}/lib/cmake/e57format NO_DEFAULT_PATH)
message(STATUS "Found LibPack 3 e57format ${e57format_VERSION}")
endif()
find_package(yaml-cpp REQUIRED PATHS ${FREECAD_LIBPACK_DIR}/lib/cmake NO_DEFAULT_PATH)
message(STATUS "Found LibPack 3 yaml-cpp ${yaml-cpp_VERSION}")
message(STATUS "Found LibPack 3 yaml-cpp ${XercesC_VERSION}")
find_package(Coin REQUIRED PATHS ${FREECAD_LIBPACK_DIR}/lib/cmake NO_DEFAULT_PATH)
message(STATUS "Found LibPack 3 Coin ${Coin_VERSION}")
# For compatibility with the rest of the cMake scripts:
set (COIN3D_FOUND TRUE)
+1
View File
@@ -0,0 +1 @@
mamba run --live-stream -n freecad cmake %*

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