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
5241 changed files with 701563 additions and 494965 deletions
+4 -1
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,
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
-1
View File
@@ -102,4 +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
+2 -4
View File
@@ -1,6 +1,6 @@
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"]
labels: ["Status: Needs triage"]
body:
- type: checkboxes
id: existing_issue
@@ -22,7 +22,7 @@ body:
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. Try reproducing the issue by restarting FreeCAD in safe mode too.
description: Please use the About FreeCAD dialog to copy your full version information and paste it here.
render: shell
validations:
required: true
@@ -40,8 +40,6 @@ body:
- Expressions
- FEM
- File formats
- Material
- Measurement
- Mesh
- OpenSCAD
- Part
+1 -1
View File
@@ -74,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
-4
View File
@@ -80,10 +80,6 @@
- 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/**/*/']
+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
}
]
]
}
]
}
+2 -4
View File
@@ -1,13 +1,11 @@
{
"__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",
"pattern": [
{
"regexp":
"^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
+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?
-->
+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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}-Logs
path: |
+19 -5
View File
@@ -26,7 +26,7 @@
name: FreeCAD master CI
on: [workflow_dispatch, push, pull_request, merge_group]
on: [workflow_dispatch, push, pull_request]
concurrency:
group: FC-CI-${{ github.head_ref || github.run_id }}
@@ -45,11 +45,23 @@ jobs:
with:
artifactBasename: Pixi-${{ github.run_id }}
Ubuntu:
MacOS_13_Conda_Apple:
needs: [Prepare]
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]
@@ -70,7 +82,9 @@ jobs:
needs: [
Prepare,
Pixi,
Ubuntu,
MacOS_13_Conda_Apple,
Ubuntu_20-04,
Ubuntu_24-04_Conda,
Windows,
Lint
]
@@ -117,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}
@@ -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,137 +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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: '🧹 Tag & close stale unconfirmed bugs'
id: stale_issues
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: -1
days-before-issue-stale: 90
days-before-issue-close: 20
days-before-pr-stale: -1
day-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: 'Status: Confirmed,Priority: High,Priority: Critical,Blocker,Type: Feature,no-auto-close'
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-Bundle/releases/tag/weekly-builds) 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 20 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@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: -1
days-before-issue-stale: 20
days-before-issue-close: 20
days-before-pr-stale: -1
day-before-pr-close: -1
operations-per-run: 30 # 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-Bundle/releases/tag/weekly-builds) 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 20 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@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: -1
days-before-issue-stale: 190
days-before-issue-close: 60
days-before-pr-stale: -1
day-before-pr-close: -1
operations-per-run: 30 # 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'
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-Bundle/releases/tag/weekly-builds) 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@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: -1
days-before-issue-stale: -1
days-before-issue-close: -1
days-before-pr-stale: 150
days-before-pr-close: 90
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 160 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 90 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.
-242
View File
@@ -1,242 +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'
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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
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: |
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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
category: "/language:${{matrix.language}}"
analyze-cpp:
name: Analyze (${{ matrix.language }})
if: github.event_name == 'schedule'
# 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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
submodules: recursive
# 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)
# 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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
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: |
# 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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
category: "/language:${{matrix.language}}"
-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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4
+2 -7
View File
@@ -16,11 +16,6 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.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@6a0f49b4e14363b63e65ec698b43715b69d21f6d # v3.20.0
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@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5.0.1
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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: ".github/labels.yml"
-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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
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@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
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 }}
+7 -12
View File
@@ -69,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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Set Platform Environment Variables
shell: bash -l {0}
env:
@@ -86,7 +81,7 @@ jobs:
fi
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@v4
- name: Add GCC Problem Matcher
if: runner.os == 'Linux'
@@ -111,13 +106,13 @@ jobs:
mkdir -p ${{ env.reportdir }}
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
- uses: prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
- uses: prefix-dev/setup-pixi@v0.8.2
with:
pixi-version: v0.45.0
pixi-version: v0.41.3
cache: false
- name: Restore Compiler Cache
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
@@ -200,14 +195,14 @@ jobs:
- name: Save Compiler Cache
if: always()
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-${{ matrix.os }}-Logs
path: |
@@ -216,7 +211,7 @@ jobs:
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
+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 }}
@@ -22,10 +22,9 @@
# ***************************************************************************
# This is a build and test workflow for CI of FreeCAD.
# This workflow aims at building and testing FreeCAD on Ubuntu 22.04 using GCC.
name: Build Ubuntu 22.04
# This workflow aims at building and testing FreeCAD on a Conda environment on Linux.
name: Build Ubuntu 24.04 (Conda)
on:
workflow_call:
inputs:
@@ -45,9 +44,8 @@ on:
value: ${{ jobs.Build.outputs.reportFile }}
jobs:
Build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: ${{ inputs.allowedToFail }}
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
@@ -56,33 +54,41 @@ jobs:
CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 1
CC: /usr/bin/gcc
CXX: /usr/bin/g++
#CC: /usr/bin/clang
#CXX: /usr/bin/clang++
builddir: ${{ github.workspace }}/build/release/
logdir: /tmp/logs/
reportdir: /tmp/report/
reportfilename: ${{ inputs.artifactBasename }}-report.md
defaults:
run:
shell: bash
shell: bash -l {0}
outputs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checking out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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
run: ./package/ubuntu/install-apt-packages.sh
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: |
@@ -99,7 +105,7 @@ jobs:
compiler: ${{ env.CXX }}
qt_major_version: 5
- name: Restore Compiler Cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.CCACHE_DIR }}
@@ -112,14 +118,10 @@ jobs:
ccache -s
ccache -z
ccache -p
- name: Install cmake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
with:
cmake-version: '3.31.6'
- name: CMake Configure
uses: ./.github/workflows/actions/linux/configure
with:
extraParameters: -G Ninja --preset release
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
@@ -171,7 +173,7 @@ jobs:
uses: ./.github/workflows/actions/runPythonTests
with:
testDescription: "CLI tests on install"
testCommand: FreeCADCmd -t 0
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
@@ -179,12 +181,12 @@ jobs:
uses: ./.github/workflows/actions/runPythonTests
with:
testDescription: "GUI tests on install"
testCommand: xvfb-run FreeCAD -t 0
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
@@ -192,7 +194,7 @@ jobs:
/var/crash/*FreeCAD*
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
+4 -13
View File
@@ -62,13 +62,8 @@ jobs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checking out source code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@v4
with:
submodules: true
- name: Make needed directories, files and initializations
@@ -90,7 +85,7 @@ jobs:
with:
libpackdir: ${{ env.libpackdir }}
- name: Restore compiler cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
uses: actions/cache@v4
with:
save-always: true
path: ${{ env.CCACHE_DIR }}
@@ -103,10 +98,6 @@ jobs:
. $env:ccachebindir\ccache -s
. $env:ccachebindir\ccache -z
. $env:ccachebindir\ccache -p
- name: Install cmake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be # v2.0.2
with:
cmake-version: '3.31.6'
- name: Configuring CMake
run: >
cmake -B"${{ env.builddir }}" .
@@ -120,7 +111,7 @@ jobs:
-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
@@ -138,7 +129,7 @@ jobs:
. ${{ env.builddir }}\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}\integrationTests.log
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
+509 -101
View File
@@ -76,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
@@ -121,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:
@@ -132,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:
@@ -149,7 +161,7 @@ on:
type: boolean
required: false
checkClazyQT6:
default: false
default: true
type: boolean
required: false
clazyQT6Checks:
@@ -168,9 +180,6 @@ on:
reportFile:
value: ${{ jobs.Lint.outputs.reportFile }}
permissions:
contents: read
jobs:
Lint:
@@ -188,16 +197,10 @@ jobs:
reportFile: ${{ steps.Init.outputs.reportFile }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@v4
with:
submodules: true
- name: Make needed directories, files and initializations
id: Init
run: |
@@ -205,156 +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 }}" \
--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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
${{ env.fixesdir }}
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
+2 -7
View File
@@ -71,11 +71,6 @@ jobs:
changedCppFiles: ${{ steps.Output.outputs.changedCppFiles }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Make needed directories, files and initializations
id: Init
run: |
@@ -153,14 +148,14 @@ jobs:
echo "" >> $GITHUB_OUTPUT
- name: Upload logs
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifactBasename }}-Logs
path: |
${{ env.logdir }}
- name: Upload report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@v4
with:
name: ${{ env.reportfilename }}
path: |
-170
View File
@@ -1,170 +0,0 @@
name: Weekly Build
on:
schedule:
- cron: "42 18 * * 1"
workflow_dispatch:
permissions:
contents: write
jobs:
tag_build:
runs-on: ubuntu-latest
outputs:
build_tag: ${{ steps.tag_build.outputs.build_tag }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout Source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
fetch-tags: true
submodules: 'recursive'
- name: Tag Build
id: tag_build
shell: bash -l {0}
env:
GH_TOKEN: ${{ github.token }}
run: |
export BUILD_TAG=weekly-$(date "+%Y.%m.%d")
echo "BUILD_TAG=${BUILD_TAG}" >> "$GITHUB_ENV"
echo "build_tag=${BUILD_TAG}" >> "$GITHUB_OUTPUT"
gh release create ${BUILD_TAG} --title "Development Build ${BUILD_TAG}" -F .github/workflows/weekly-build-notes.md --prerelease || true
- name: Upload Source
id: upload_source
shell: bash -l {0}
env:
GH_TOKEN: ${{ github.token }}
run: |
python3 package/rattler-build/scripts/make_version_file.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/rattler-build/scripts/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: tag_build
strategy:
matrix:
include:
- { target: linux-64, os: ubuntu-22.04 }
- { target: linux-arm64, os: ubuntu-22.04-arm }
- { target: osx-64, os: macos-13 }
- { target: osx-arm64, os: macos-latest }
- { 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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.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:
BUILD_TAG: ${{ needs.tag_build.outputs.build_tag }}
OPERATING_SYSTEM: ${{ runner.os }}
run: |
echo "BUILD_TAG=${BUILD_TAG}" >> "$GITHUB_ENV"
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
fetch-tags: true
submodules: 'recursive'
- uses: prefix-dev/setup-pixi@19eac09b398e3d0c747adc7921926a6d802df4da # v0.8.8
with:
pixi-version: v0.46.0
cache: false
- name: Install the Apple certificate and provisioning profile
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 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/FreeCAD_Weekly.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: Build and Release Packages
shell: bash
env:
GH_TOKEN: ${{ github.token }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGN_RELEASE: "true"
TARGET_PLATFORM: ${{ matrix.target }}
UPLOAD_RELEASE: "true"
run: |
python3 package/rattler-build/scripts/make_version_file.py ../freecad_version.txt
git apply package/rattler-build/scripts/disable_git_info.patch
cd package/rattler-build
pixi install
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
+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@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Make needed directories, files and initializations
run: |
mkdir -p ${{ env.artifactsDownloadDir }}
- name: Download artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
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@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
uses: geekyeggo/delete-artifact@v5
with:
name: |
${{ env.usedArtifacts }}
-15
View File
@@ -1,15 +0,0 @@
> [!IMPORTANT]
> Bleeding edge FreeCAD development builds for testing bugfixes, regressions, and recently implemented features. Do not use in a production environment.
### 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 `\bin\FreeCAD.exe` in the extracted directory
- **macOS**
Launch `/FreeCAD.app` in the extracted directory
- **Linux**
Open the `*.AppImage`
-3
View File
@@ -45,7 +45,6 @@ install_manifest.txt
/Mod/
/ZERO_CHECK.dir/
/build/
/build-*/
/cmake-build*/
/src/Tools/offlinedoc/localwiki/
/src/Tools/offlinedoc/*.txt
@@ -56,8 +55,6 @@ tags
/CMakeUserPresets.json
Testing
compile_commands.json
*.sublime-project
*.sublime-workspace
# crowdin file
src/Tools/freecad.zip
+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
+5 -7
View File
@@ -4,14 +4,15 @@
# See https://pre-commit.com/hooks.html for more hooks
files: |
(?x)^(
.github|
src/Base|
src/Main|
src/Tools|
tests/src|
src/Mod/AddonManager|
src/Mod/Assembly|
src/Mod/CAM|
src/Mod/Cloud|
src/Mod/Drawing|
src/Mod/Fem|
src/Mod/Help|
src/Mod/Import|
@@ -41,9 +42,6 @@ exclude: |
src/App/ExpressionParser.tab.h|
src/App/ExpressionParser.y|
src/App/lex.ExpressionParser.c|
src/Gui/3Dconnexion/navlib|
src/Gui/QSint|
src/Gui/Quarter|
src/Mod/Import/App/SCL|
src/Mod/Import/App/SCL_output|
src/Mod/Mesh/App/TestData|
@@ -53,7 +51,7 @@ exclude: |
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # frozen: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -61,11 +59,11 @@ repos:
- id: check-added-large-files
- id: mixed-line-ending
- repo: https://github.com/psf/black
rev: 8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # frozen: 25.1.0
rev: b965c2a5026f8ba399283ba3e01898b012853c79 # frozen: 24.8.0
hooks:
- id: black
args: ['--line-length', '100']
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 300fa4c170bf0887bb5585d17ec50901ad2625fb # frozen: v20.1.4
rev: 7d85583be209cb547946c82fbe51f4bc5dd1d017 # frozen: v18.1.8
hooks:
- id: clang-format
+17 -42
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,9 +30,9 @@ endif()
project(FreeCAD)
set(PACKAGE_VERSION_MAJOR "1")
set(PACKAGE_VERSION_MINOR "1")
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)
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
@@ -76,7 +55,6 @@ FreeCADLibpackChecks()
SetupDoxygen()
SetupLibFmt()
SetupYamlCpp()
SetupZipIos()
if(NOT FREECAD_LIBPACK_USE OR FREECAD_LIBPACK_CHECKFILE_CLBUNDLER OR FREECAD_LIBPACK_CHECKFILE_VERSION)
SetupPython()
SetupPCL()
@@ -91,6 +69,7 @@ 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)
find_package(NETGEN)
@@ -106,14 +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()
endif()
if(BUILD_VR)
+34 -34
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"
}
}
},
@@ -71,10 +59,6 @@
"type": "BOOL",
"value": "ON"
},
"BUILD_REVERSEENGINEERING": {
"type": "BOOL",
"value": "OFF"
},
"ENABLE_DEVELOPER_TESTS": {
"type": "BOOL",
"value": "ON"
@@ -103,10 +87,6 @@
"type": "BOOL",
"value": "ON"
},
"FREECAD_QT_VERSION": {
"type": "STRING",
"value": "6"
},
"OCCT_CMAKE_FALLBACK": {
"type": "BOOL",
"value": "ON"
@@ -127,30 +107,26 @@
},
"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"
@@ -171,10 +147,22 @@
"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}"
@@ -195,10 +183,22 @@
},
"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"
+5 -6
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,10 +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 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.
13. 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
+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)
+21 -16
View File
@@ -49,20 +49,27 @@ Precompiled packages for stable releases are available for Windows, macOS and Li
On most Linux distributions, FreeCAD is also directly installable from the
software center application.
For development releases visit the [weekly-builds page](https://github.com/FreeCAD/FreeCAD-Bundle/releases/tag/weekly-builds).
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
---------
FreeCAD requires several dependencies to correctly compile for development and
production builds. The following pages contain updated build instructions for
their respective platforms:
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)
@@ -71,16 +78,15 @@ 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-Bundle/releases/tag/weekly-builds) 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.
- 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)
@@ -88,18 +94,17 @@ For more details see:
- [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)
@@ -108,10 +113,10 @@ View these pages for more information:
- [Scripting](https://wiki.freecad.org/Power_users_hub)
- [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
+3 -3
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,7 +17,7 @@
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)
+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})
+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
+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()
+12 -12
View File
@@ -4,19 +4,19 @@
# 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(NOT PySide6_INCLUDE_DIRS AND TARGET PySide6::pyside6)
get_property(PySide6_INCLUDE_DIRS TARGET PySide6::pyside6 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
endif()
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()
endif()
# Also provide the old-style variables so we don't have to update everything yet
if (PySide6_FOUND)
set(PYSIDE_INCLUDE_DIR ${PySide6_INCLUDE_DIRS})
set(PYSIDE_LIBRARY ${PySide6_LIBRARIES})
set(PYSIDE_FOUND TRUE)
set(PYSIDE_MAJOR_VERSION 6)
endif()
+7 -7
View File
@@ -11,18 +11,18 @@ if(NOT Shiboken6_FOUND)
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)
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})
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_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)
@@ -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,24 +28,26 @@ 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()
# Log the compiler and version
@@ -55,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}")
@@ -81,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)
@@ -98,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
@@ -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,19 +10,11 @@ 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)
if (WIN32 OR APPLE)
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF)
@@ -83,6 +75,8 @@ macro(InitializeFreeCADBuildOptions)
"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)
@@ -122,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)
@@ -177,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)
@@ -186,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
@@ -217,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 -10
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)
@@ -144,16 +141,17 @@ macro(PrintFinalReport)
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"
@@ -218,7 +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})
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 system 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)
+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)
+8 -15
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()
@@ -113,6 +102,10 @@ macro(SetupSalomeSMESH)
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)
@@ -152,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)
@@ -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(NOT PYSIDE_INCLUDE_DIR AND TARGET PySide${PYSIDE_MAJOR_VERSION}::pyside${PYSIDE_MAJOR_VERSION})
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,7 +165,7 @@ 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
)
-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)
+28 -69
View File
@@ -9,23 +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)
add_file_dependencies("${infile}" "${outfile}")
ADD_CUSTOM_COMMAND(
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)
@@ -78,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)
@@ -109,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)
@@ -127,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")
@@ -203,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}"
@@ -308,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
)
@@ -344,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()
+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 -1
View File
@@ -2,7 +2,7 @@ name: freecad
channels:
- conda-forge
dependencies:
- conda-forge/noarch::conda-libmamba-solver==24.11.1
- conda-forge/noarch::conda-libmamba-solver==24.7.0
- conda-devenv
- mamba
- python==3.12.*
+1 -1
View File
@@ -2,7 +2,7 @@ name: freecad
channels:
- conda-forge
dependencies:
- conda-forge/noarch::conda-libmamba-solver==24.11.1
- conda-forge/noarch::conda-libmamba-solver==24.7.0
- conda-devenv
- mamba
- python==3.11.*
+1 -2
View File
@@ -3,7 +3,7 @@ channels:
- conda-forge
- conda-forge/label/pivy_rc
dependencies:
- conda-forge/noarch::conda-libmamba-solver==24.11.1
- conda-forge/noarch::conda-libmamba-solver==24.7.0
- libspnav # [linux]
- kernel-headers_linux-64 # [linux and x86_64]
- libdrm-cos7-x86_64 # [linux and x86_64]
@@ -58,7 +58,6 @@ dependencies:
- xorg-x11-server-xvfb-cos7-aarch64 # [linux and aarch64]
- sed # [unix]
- ccache
- clang-format
- cmake
- coin3d
- compilers
+59 -57
View File
@@ -2,66 +2,68 @@ name: freecad
channels:
- conda-forge
dependencies:
- conda-forge/noarch::conda-libmamba-solver==24.11.1
- libspnav # [linux]
- kernel-headers_linux-64 # [linux and x86_64]
- libdrm-cos6-x86_64 # [linux and x86_64]
- libselinux-cos6-x86_64 # [linux and x86_64]
- libsepol-cos6-x86_64 # [linux and x86_64]
- libx11-common-cos6-x86_64 # [linux and x86_64]
- libx11-cos6-x86_64 # [linux and x86_64]
- libxau-cos6-x86_64 # [linux and x86_64]
- libxcb-cos6-x86_64 # [linux and x86_64]
- libxdamage-cos6-x86_64 # [linux and x86_64]
- libxext-cos6-x86_64 # [linux and x86_64]
- libxfixes-cos6-x86_64 # [linux and x86_64]
- libxi-cos6-x86_64 # [linux and x86_64]
- libxi-devel-cos6-x86_64 # [linux and x86_64]
- libxxf86vm-cos6-x86_64 # [linux and x86_64]
- mesa-dri-drivers-cos6-x86_64 # [linux and x86_64]
- mesa-dri1-drivers-cos6-x86_64 # [linux and x86_64]
- mesa-libegl-cos6-x86_64 # [linux and x86_64]
- mesa-libegl-devel-cos6-x86_64 # [linux and x86_64]
- mesa-libgl-cos6-x86_64 # [linux and x86_64]
- mesa-libgl-devel-cos6-x86_64 # [linux and x86_64]
- pixman-cos6-x86_64 # [linux and x86_64]
- sysroot_linux-64 # [linux and x86_64]
- xorg-x11-server-common-cos6-x86_64 # [linux and x86_64]
- xorg-x11-server-xvfb-cos6-x86_64 # [linux and x86_64]
- kernel-headers_linux-aarch64 # [linux and aarch64]
- libdrm-cos7-aarch64 # [linux and aarch64]
- libglvnd-cos7-aarch64 # [linux and aarch64]
- libglvnd-glx-cos7-aarch64 # [linux and aarch64]
- libselinux-cos7-aarch64 # [linux and aarch64]
- libsepol-cos7-aarch64 # [linux and aarch64]
- libx11-common-cos7-aarch64 # [linux and aarch64]
- libx11-cos7-aarch64 # [linux and aarch64]
- libxau-cos7-aarch64 # [linux and aarch64]
- libxcb-cos7-aarch64 # [linux and aarch64]
- libxdamage-cos7-aarch64 # [linux and aarch64]
- libxext-cos7-aarch64 # [linux and aarch64]
- libxfixes-cos7-aarch64 # [linux and aarch64]
- libxi-cos7-aarch64 # [linux and aarch64]
- libxi-devel-cos7-aarch64 # [linux and aarch64]
- libxxf86vm-cos7-aarch64 # [linux and aarch64]
- mesa-dri-drivers-cos7-aarch64 # [linux and aarch64]
- mesa-khr-devel-cos7-aarch64 # [linux and aarch64]
- mesa-libegl-cos7-aarch64 # [linux and aarch64]
- mesa-libegl-devel-cos7-aarch64 # [linux and aarch64]
- mesa-libgbm-cos7-aarch64 # [linux and aarch64]
- mesa-libgl-cos7-aarch64 # [linux and aarch64]
- mesa-libgl-devel-cos7-aarch64 # [linux and aarch64]
- mesa-libglapi-cos7-aarch64 # [linux and aarch64]
- pixman-cos7-aarch64 # [linux and aarch64]
- sysroot_linux-aarch64 # [linux and aarch64]
- xorg-x11-server-common-cos7-aarch64 # [linux and aarch64]
- xorg-x11-server-xvfb-cos7-aarch64 # [linux and aarch64]
- sed # [unix]
- conda-forge/noarch::conda-libmamba-solver==24.7.0
- libspnav # [linux]
- kernel-headers_linux-64 # [linux and x86_64]
- libdrm-conda-x86_64 # [linux and x86_64]
- libselinux-conda-x86_64 # [linux and x86_64]
- libsepol-conda-x86_64 # [linux and x86_64]
- libx11-common-conda-x86_64 # [linux and x86_64]
- libx11-conda-x86_64 # [linux and x86_64]
- libxau-conda-x86_64 # [linux and x86_64]
- libxcb-conda-x86_64 # [linux and x86_64]
- libxdamage-conda-x86_64 # [linux and x86_64]
- libxext-conda-x86_64 # [linux and x86_64]
- libxfixes-conda-x86_64 # [linux and x86_64]
- libxi-conda-x86_64 # [linux and x86_64]
- libxi-devel-conda-x86_64 # [linux and x86_64]
- libxxf86vm-conda-x86_64 # [linux and x86_64]
- mesa-dri-drivers-conda-x86_64 # [linux and x86_64]
- mesa-libegl-conda-x86_64 # [linux and x86_64]
- mesa-libegl-devel-conda-x86_64 # [linux and x86_64]
- mesa-libgl-conda-x86_64 # [linux and x86_64]
- mesa-libgl-devel-conda-x86_64 # [linux and x86_64]
- pixman-conda-x86_64 # [linux and x86_64]
- sysroot_linux-64 # [linux and x86_64]
- xorg-x11-server-common-conda-x86_64 # [linux and x86_64]
- xorg-x11-server-xvfb-conda-x86_64 # [linux and x86_64]
- kernel-headers_linux-aarch64 # [linux and aarch64]
- libdrm-conda-aarch64 # [linux and aarch64]
- libglvnd-conda-aarch64 # [linux and aarch64]
- libglvnd-glx-conda-aarch64 # [linux and aarch64]
- libselinux-conda-aarch64 # [linux and aarch64]
- libsepol-conda-aarch64 # [linux and aarch64]
- libx11-common-conda-aarch64 # [linux and aarch64]
- libx11-conda-aarch64 # [linux and aarch64]
- libxau-conda-aarch64 # [linux and aarch64]
- libxcb-conda-aarch64 # [linux and aarch64]
- libxdamage-conda-aarch64 # [linux and aarch64]
- libxext-conda-aarch64 # [linux and aarch64]
- libxfixes-conda-aarch64 # [linux and aarch64]
- libxi-conda-aarch64 # [linux and aarch64]
- libxi-devel-conda-aarch64 # [linux and aarch64]
- libxxf86vm-conda-aarch64 # [linux and aarch64]
- mesa-dri-drivers-conda-aarch64 # [linux and aarch64]
- mesa-khr-devel-conda-aarch64 # [linux and aarch64]
- mesa-libegl-conda-aarch64 # [linux and aarch64]
- mesa-libegl-devel-conda-aarch64 # [linux and aarch64]
- mesa-libgbm-conda-aarch64 # [linux and aarch64]
- mesa-libgl-conda-aarch64 # [linux and aarch64]
- mesa-libgl-devel-conda-aarch64 # [linux and aarch64]
- mesa-libglapi-conda-aarch64 # [linux and aarch64]
- pixman-conda-aarch64 # [linux and aarch64]
- sysroot_linux-aarch64 # [linux and aarch64]
- xorg-x11-server-common-conda-aarch64 # [linux and aarch64]
- xorg-x11-server-xvfb-conda-aarch64 # [linux and aarch64]
- sed # [unix]
- ccache
- clang-format
- cmake
- coin3d
- compilers
- gcc==13.3.* # [linux]
- gxx==13.3.* # [linux]
- clang==18.1.* # [osx]
- clangxx==18.1.* # [osx]
- conda
- conda-devenv
- debugpy
@@ -98,4 +100,4 @@ dependencies:
- xerces-c
- yaml-cpp
- zlib
- zstd==1.5.6
- zstd
+5 -45
View File
@@ -16,30 +16,10 @@
],
"linux": {
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Load QT pretty-printers for GDB",
"text": "python import sys; sys.path.append('${workspaceFolder}/contrib/debugger'); from qt_pretty_printers_gdb import register_qt_printers; register_qt_printers()",
"ignoreFailures": false
},
{
"description": "Enable pretty-printing for GDB",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
"miDebuggerPath": "/usr/bin/gdb"
},
"osx": {
"MIMode": "lldb",
"preRunCommands": [
"command script import ${workspaceFolder}/contrib/debugger/qt_pretty_printers_lldb.py"
]
"MIMode": "lldb"
},
"stopAtEntry": false,
"externalConsole": false,
@@ -67,30 +47,10 @@
],
"linux": {
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Load QT pretty-printers for GDB",
"text": "python import sys; sys.path.append('${workspaceFolder}/contrib/debugger'); from qt_pretty_printers_gdb import register_qt_printers; register_qt_printers()",
"ignoreFailures": false
},
{
"description": "Enable pretty-printing for GDB",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
"miDebuggerPath": "/usr/bin/gdb"
},
"osx": {
"MIMode": "lldb",
"preRunCommands": [
"command script import ${workspaceFolder}/contrib/debugger/qt_pretty_printers_lldb.py"
]
"MIMode": "lldb"
},
"stopAtEntry": false,
"externalConsole": false,
@@ -106,7 +66,7 @@
"redirectOutput": true,
"connect": {
"host": "localhost",
"port": 5679
"port": 5678
},
"pathMappings": [
{
+1 -5
View File
@@ -7,11 +7,7 @@ from freecad.utils import get_python_exe
# By default it attempts to use Freecad's PID mistaking it for python.
# https://github.com/microsoft/debugpy/issues/262
debugpy.configure(python=get_python_exe())
# As of Python 3.12, debugpy runs a forwarding process that listens both on the port specified here for the debugger
# to connect to, but also on an internal port for the underlying pydevd within the python process to connect to. The
# default for that internal port is 5678, so we need to not duplicate it for the external port. Also, on Linux the
# attempt to spawn the forwarding process separately fails, so we force it to be internal to our main process.
debugpy.listen(('localhost', 5679),in_process_debug_adapter=True)
debugpy.listen(('localhost', 5678))
# Turns out you cannot probe debugpy to see if it is up:
# https://github.com/microsoft/debugpy/issues/974
+2 -2
View File
@@ -13,8 +13,8 @@ def check_socket(host, port):
return sock.connect_ex((host, port)) == 0
def main():
# DO NOT CHECK the actual port 5678/5879 or debugpy will break
# Check that the other port 39999 used as a flag is manually opened instead
# DO NOT CHECK 5678 or debugpy will break
# Check other port manually opened instead
attempt_counter = 0
while (not check_socket('localhost', 39999)) and attempt_counter < MAX_ATTEMPTS:
time.sleep(RETRY_DELAY_S)
-12
View File
@@ -1,12 +0,0 @@
import pydevd
from multiprocessing.connection import Listener
print("CLion debugger macro running. Starting listener to get port")
listen = Listener(('localhost', 39998), backlog=1)
link = listen.accept()
port = link.recv()
link.close()
listen.close()
print("Port", port, "received, starting debugger. Check CLion to see if a breakpoint has been hit and continue")
pydevd.settrace(port=port)
print("Debugger operating, leaving macro.")
-18
View File
@@ -1,18 +0,0 @@
--- attach_pydevd.py.orig 2024-09-26 10:36:47.131066345 -0400
+++ attach_pydevd.py 2024-09-26 10:16:48.687714133 -0400
@@ -48,6 +48,15 @@
import add_code_to_python_process
show_debug_info_on_target_process = 0
+ print("attach_pydevd is trying to relay the port",setup['port'])
+ try:
+ from multiprocessing.connection import Client
+ link = Client(('localhost',39998))
+ link.send(setup['port'])
+ link.close()
+ except ConnectionError as ce:
+ pass
+
pydevd_dirname = os.path.dirname(os.path.dirname(__file__))
if sys.platform == 'win32':
-7
View File
@@ -1,7 +0,0 @@
#!/bin/bash
# Change to the directory of this script (any subdirectory in the repository should work)
cd "$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" &> /dev/null && pwd -P)"
# Activate pixi default environment
eval "$(pixi shell-hook)"
-10
View File
@@ -1,10 +0,0 @@
@echo off
REM Change to the directory of this script (any subdirectory in the repository should work)
cd /d "%~dp0"
REM Activate pixi default environment
REM Write the output of pixi shell-hook to a temporary batch file and execute it
set TEMP_BATCH_FILE=%TEMP%\pixi_shell_hook_freecad.bat
pixi shell-hook > "%TEMP_BATCH_FILE%"
call "%TEMP_BATCH_FILE%"
del "%TEMP_BATCH_FILE%"
-124
View File
@@ -1,124 +0,0 @@
# pylint: disable=line-too-long
"""
QT Pretty Printer for GDB
Currently supports displaying the following QT types in the debugger
* QString
Can be used from GDB via:
(gdb) python
>import sys
>sys.path.insert(0, '{Your FreeCAD source dir}/contrib/debugger')
>from qt_pretty_printers_gdb import register_qt_printers
>register_qt_printers()
>end
QT pretty-printer script loaded.
QT pretty-printer registered.
(gdb) run
*breakpoint*
(gdb) p testString
$1 = This is a QString in the debugger!
(gdb)
Can be used in VSCode via launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bin/FreeCAD",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}/build",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Load QT pretty-printers for GDB",
"text": "python import sys; sys.path.append('${workspaceFolder}/contrib/debugger'); from qt_pretty_printers_gdb import register_qt_printers; register_qt_printers()",
"ignoreFailures": false
},
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
Note: There may be variances between different operating systems and/or build configurations
in how QString data is stored internally. This was tested on debian12/amd64. @BootsSiR
"""
# pylint: enable=line-too-long
import gdb
class QStringPrinter:
"""Pretty-printer class for QString objects in GDB."""
def __init__(self, val):
self.val = val
def to_string(self):
"""Pretty-printer function for QString objects in LLDB."""
try:
d = self.val["d"]
if d == 0:
return 'null'
offset = int(d["offset"])
data_ptr = d.cast(gdb.lookup_type("char").pointer()) + offset
char16_t_ptr = data_ptr.cast(gdb.lookup_type("char16_t").pointer())
string_data = []
i = 0
while char16_t_ptr[i] != 0:
string_data.append(chr(char16_t_ptr[i]))
i += 1
return "".join(string_data)
except gdb.error as e:
if "Cannot access memory at address" in str(e):
return "<uninitialized>"
return f"<error: {str(e)}>"
except Exception as e: # pylint: disable=broad-except
return f"<unexpected error: {str(e)}>"
def lookup_function(val):
"""Maps a type to the appropriate pretty printer"""
try:
qstring_type = gdb.lookup_type("QString")
if val.type.strip_typedefs() == qstring_type:
return QStringPrinter(val)
return None
except gdb.error:
return None
def register_qt_printers(objfile=None):
"""Register the QString pretty-printer with GDB."""
if objfile is None:
objfile = gdb.current_objfile()
# Check if the printer is already registered
if not any(printer == lookup_function for printer in gdb.pretty_printers): # pylint: disable=comparison-with-callable
print("QT pretty-printer script loaded.")
gdb.pretty_printers.append(lookup_function)
print("QT pretty-printer registered.")
-107
View File
@@ -1,107 +0,0 @@
# pylint: disable=line-too-long
"""
QT Pretty Printer for LLDB
Currently supports displaying the following QT types in the debugger
* QString
Can be used from LLDB via:
(lldb) command script import {Your FreeCAD source dir}/contrib/debugger/qt_pretty_printers_lldb.py
(lldb) frame variable test
(QString) test = "This is a test string."
(lldb)
Can be used in VSCode via launch.json (tested with CodeLLDB extension)
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug LLDB",
"stopOnEntry": false,
"program": "${workspaceFolder}/build/bin/FreeCAD",
"args": [],
"cwd": "${workspaceFolder}/build/",
"preLaunchTask": "CMake: build",
"preRunCommands": [
"command script import ${workspaceFolder}/contrib/debugger/qt_pretty_printers_lldb.py"
]
}
]
}
Note: There may be variances between different operating systems and/or build configurations
in how QString data is stored internally. This was tested on debian12/amd64 and
macOS/arm64. @BootsSiR
"""
# pylint: enable=line-too-long
import lldb
def QStringPrinter(val, _internal_dict):
"""Pretty-printer for QString objects in LLDB."""
try:
# Access the 'd' member of QString
d = val.GetChildMemberWithName("d")
if not d.IsValid():
return 'null'
# some machines have a different QString object layout (macOS? arm64?) so
# first we must check if a ptr member exists
ptr_field = d.GetChildMemberWithName("ptr")
# if the ptr member exists, we will use that as the base address for our text data.
if ptr_field.IsValid():
# use the ptr value
data_base_address = ptr_field.GetValueAsUnsigned()
else:
# we don't have a ptr member, so let's use an offset from the address of the
# QString::Data as our base address
d_address = d.GetValueAsUnsigned()
# Assume the string data starts immediately after the first 24 bytes
data_base_address = d_address + 24
# if at this point, we don't have a valid data base address
# we cannot proceed
if data_base_address == 0:
return "null"
# Initialize variables for memory reading
process = val.GetTarget().GetProcess()
error = lldb.SBError()
chunk_size = 256 # Size of each memory chunk to read
string_data = []
offset = 0
# Read memory in chunks until null-terminator is found
while True:
raw_data = process.ReadMemory(data_base_address + offset, chunk_size, error)
if not error.Success():
return f"<error: unable to read memory: {error.GetCString()}>"
# Parse UTF-16 data from the chunk
for i in range(0, len(raw_data), 2): # char16_t is 2 bytes
char16_val = int.from_bytes(raw_data[i:i+2], byteorder='little')
if char16_val == 0: # Null-terminator found
return f'"{ "".join(string_data) }"'
string_data.append(chr(char16_val))
# Increase the offset for the next chunk
offset += chunk_size
except Exception as e: # pylint: disable=broad-except
return f"<error: {str(e)}>"
def __lldb_init_module(debugger, _internal_dict):
"""Register the QString pretty-printer with LLDB."""
print("QT pretty-printer script loaded.")
debugger.HandleCommand('type summary add QString -F qt_pretty_printers_lldb.QStringPrinter')
print("QT pretty-printer registered.")
Binary file not shown.
-1
View File
@@ -7,7 +7,6 @@ SET(Examples_Files
BIMExample.FCStd
FEMExample.FCStd
AssemblyExample.FCStd
ArchDetail.FCStd
)
ADD_CUSTOM_TARGET(Example_data ALL
+15 -12
View File
@@ -10,17 +10,18 @@
%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libOndselSolver libSMDS libSMESH libSMESHDS libStdMeshers libarea-native
# Some configuration options for other environments
# rpmbuild --with=bundled_zipios: use bundled version of zipios++
%global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1}
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
%global bundled_pycxx %{?_with_bundled_pycxx: 1} %{?!_with_bundled_pycxx: 0}
# rpmbuild --with=pcl_enabled: build with pcl support
%global pcl_enabled %{?_with_pcl_enabled: 1} %{?!_with_pcl_enabled: 0}
# rpmbuild --without=bundled_pycxx: use bundled version of pycxx
%global bundled_pycxx %{?_without_bundled_pycxx: 0} %{?!_without_bundled_pycxx: 1}
# rpmbuild --without=bundled_zipios: use bundled version of zipios++
%global bundled_zipios %{?_without_bundled_zipios: 0} %{?!_without_bundled_zipios: 1}
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
%global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1}
# Prevent RPM from doing its magical 'build' directory for now
%global __cmake_in_source_build 0
# See FreeCAD-main/src/3rdParty/salomesmesh/CMakeLists.txt to find this out.
%global bundled_smesh_version 7.7.1.0
@@ -32,8 +33,8 @@
Name: %{name}
Epoch: 1
Version: 1.1.0
Release: pre_{{{git_commit_no}}}%{?dist}
Version: 1.0.2
Release: {{{git_commit_no}}}%{?dist}
Summary: A general purpose 3D CAD modeler
Group: Applications/Engineering
@@ -43,8 +44,6 @@ Source0: {{{ git_repo_pack }}}
#add all submodule as source
Source1: {{{ git_pack path=$GIT_ROOT/src/3rdParty/OndselSolver/ dir_name="OndselSolver" }}}
Source2: {{{ git_pack path=$GIT_ROOT/src/3rdParty/GSL/ dir_name="GSL" }}}
Source3: {{{ git_pack path=$GIT_ROOT/src/Mod/AddonManager/ dir_name="AddonManager" }}}
# Utilities
BuildRequires: cmake gcc-c++ gettext
@@ -98,7 +97,9 @@ BuildRequires: openmpi-devel
BuildRequires: med-devel
BuildRequires: libkdtree++-devel
%if %{pcl_enabled}
BuildRequires: pcl-devel
%endif
BuildRequires: python3
BuildRequires: libglvnd-devel
BuildRequires: yaml-cpp-devel
@@ -171,11 +172,9 @@ rm -rf %{github_name}
# extract submodule archive and move in correct path
%setup -T -a 1 -c -q -D -n %{github_name}/src/3rdParty/ #OndselSolver
%setup -T -a 2 -c -q -D -n %{github_name}/src/3rdParty/ #GSL
%setup -T -a 3 -c -q -D -n %{github_name}/src/Mod/ #AddonManager
%setup -T -b 0 -q -D -n %{github_name}
# Remove bundled pycxx if we're not using it
%if ! %{bundled_pycxx}
rm -rf src/CXX
@@ -206,7 +205,6 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
-DRESOURCEDIR=%{_datadir}/%{name} \
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
-DFREECAD_USE_PCL:BOOL=OFF \
-DFREECAD_QT_VERSION:STRING=6 \
-DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken6 \
-DSHIBOKEN_LIBRARY=-lshiboken6.%{py_suffix} \
@@ -219,6 +217,11 @@ LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
-DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin4 \
-DCOIN3D_DOC_PATH=%{_datadir}/Coin4/Coin \
-DUSE_OCC=TRUE \
%if %{pcl_enabled}
-DFREECAD_USE_PCL:BOOL=ON \
%else
-DFREECAD_USE_PCL:BOOL=OFF \
%endif
%if ! %{bundled_smesh}
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
-DSMESH_FOUND=TRUE \
-37
View File
@@ -1,37 +0,0 @@
@echo on
@REM :: free up extra disk space, compare
@REM :: https://github.com/conda-forge/conda-smithy/issues/1949
@REM rmdir /s /q C:\hostedtoolcache\windows
@REM set "CFLAGS= "
@REM set "CXXFLAGS= -DBOOST_PROGRAM_OPTIONS_DYN_LINK=1"
@REM set "LDFLAGS_SHARED= ucrt.lib"
set "CMAKE_GENERATOR="
set "CMAKE_GENERATOR_PLATFORM="
cmake ^
--preset conda-windows-release ^
-D CMAKE_INCLUDE_PATH:FILEPATH="%LIBRARY_PREFIX%/include" ^
-D CMAKE_INSTALL_LIBDIR:FILEPATH="%LIBRARY_PREFIX%/lib" ^
-D CMAKE_INSTALL_PREFIX:FILEPATH="%LIBRARY_PREFIX%" ^
-D CMAKE_LIBRARY_PATH:FILEPATH="%LIBRARY_PREFIX%/lib" ^
-D CMAKE_PREFIX_PATH:FILEPATH="%LIBRARY_PREFIX%" ^
-D FREECAD_USE_OCC_VARIANT="Official Version" ^
-D INSTALL_TO_SITEPACKAGES:BOOL=ON ^
-D OCC_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%/include" ^
-D OCCT_CMAKE_FALLBACK:BOOL=OFF ^
-D Python_EXECUTABLE:FILEPATH="%PYTHON%" ^
-D Python3_EXECUTABLE:FILEPATH="%PYTHON%" ^
-B build ^
-S . ^
${CMAKE_PLATFORM_FLAGS[@]}
if %ERRORLEVEL% neq 0 exit 1
ninja -C build install
if %ERRORLEVEL% neq 0 exit 1
rmdir /s /q "%LIBRARY_PREFIX%\doc"
ren %LIBRARY_PREFIX%\bin\FreeCAD.exe freecad.exe
ren %LIBRARY_PREFIX%\bin\FreeCADCmd.exe freecadcmd.exe
-47
View File
@@ -1,47 +0,0 @@
if [[ ${HOST} =~ .*linux.* ]]; then
CMAKE_PRESET=conda-linux-release
fi
if [[ ${HOST} =~ .*darwin.* ]]; then
CMAKE_PRESET=conda-macos-release
# add hacks for osx here!
echo "adding hacks for osx"
# install space-mouse
/usr/bin/curl -o /tmp/3dFW.dmg -L 'https://download.3dconnexion.com/drivers/mac/10-7-0_B564CC6A-6E81-42b0-82EC-418EA823B81A/3DxWareMac_v10-7-0_r3411.dmg'
hdiutil attach -readonly /tmp/3dFW.dmg
sudo installer -package /Volumes/3Dconnexion\ Software/Install\ 3Dconnexion\ software.pkg -target /
diskutil eject /Volumes/3Dconnexion\ Software
CMAKE_PLATFORM_FLAGS+=(-DFREECAD_USE_3DCONNEXION:BOOL=ON)
CMAKE_PLATFORM_FLAGS+=(-D3DCONNEXIONCLIENT_FRAMEWORK:FILEPATH="/Library/Frameworks/3DconnexionClient.framework")
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi
unset CMAKE_GENERATOR
unset CMAKE_GENERATOR_PLATFORM
cmake \
--preset ${CMAKE_PRESET} \
-D CMAKE_IGNORE_PREFIX_PATH="/opt/homebrew;/usr/local/homebrew" \
-D CMAKE_INCLUDE_PATH:FILEPATH="$PREFIX/include" \
-D CMAKE_INSTALL_LIBDIR:FILEPATH="$PREFIX/lib" \
-D CMAKE_INSTALL_PREFIX:FILEPATH="$PREFIX" \
-D CMAKE_LIBRARY_PATH:FILEPATH="$PREFIX/lib" \
-D CMAKE_PREFIX_PATH:FILEPATH="$PREFIX" \
-D FREECAD_USE_OCC_VARIANT="Official Version" \
-D INSTALL_TO_SITEPACKAGES:BOOL=ON \
-D OCC_INCLUDE_DIR:FILEPATH="$PREFIX/include" \
-D OCCT_CMAKE_FALLBACK:BOOL=OFF \
-D Python_EXECUTABLE:FILEPATH="$PYTHON" \
-D Python3_EXECUTABLE:FILEPATH="$PYTHON" \
-B build \
-S . \
${CMAKE_PLATFORM_FLAGS[@]}
cmake --build build
cmake --install build
mv ${PREFIX}/bin/FreeCAD ${PREFIX}/bin/freecad || true
mv ${PREFIX}/bin/FreeCADCmd ${PREFIX}/bin/freecadcmd || true
@@ -1,7 +0,0 @@
c_compiler: # [win]
- vs2022 # [win]
cxx_compiler: # [win]
- vs2022 # [win]
MACOSX_SDK_VERSION: # [osx]
- '11.0' # [osx]
-34
View File
@@ -1,34 +0,0 @@
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
export PREFIX=${HERE}/usr
# export LD_LIBRARY_PATH=${HERE}/usr/lib${LD_LIBRARY_PATH:+':'}$LD_LIBRARY_PATH
export PYTHONHOME=${HERE}/usr
export PATH_TO_FREECAD_LIBDIR=${HERE}/usr/lib
# export QT_QPA_PLATFORM_PLUGIN_PATH=${HERE}/usr/plugins
# export QT_XKB_CONFIG_ROOT=${HERE}/usr/lib
export FONTCONFIG_FILE=/etc/fonts/fonts.conf
export FONTCONFIG_PATH=/etc/fonts
# Fix: Use X to run on Wayland
export QT_QPA_PLATFORM=xcb
# Show packages info if DEBUG env variable is set
if [ "$DEBUG" = 1 ]; then
cat ${HERE}/packages.txt
fi
# SSL
# https://forum.freecad.org/viewtopic.php?f=4&t=34873&start=20#p327416
export SSL_CERT_FILE=$PREFIX/ssl/cacert.pem
# https://github.com/FreeCAD/FreeCAD-AppImage/pull/20
export GIT_SSL_CAINFO=$HERE/usr/ssl/cacert.pem
# Support for launching other applications (from /usr/bin)
# https://github.com/FreeCAD/FreeCAD-AppImage/issues/30
if [ ! -z "$1" ] && [ -e "$HERE/usr/bin/$1" ] ; then
MAIN="$HERE/usr/bin/$1" ; shift
else
MAIN="$HERE/usr/bin/freecad"
fi
"${MAIN}" "$@"
@@ -1,81 +0,0 @@
#!/bin/bash
set -e
set -x
conda_env="AppDir/usr"
mkdir -p ${conda_env}
cp -a ../.pixi/envs/default/* ${conda_env}
export PATH="${PWD}/${conda_env}/bin:${PATH}"
export CONDA_PREFIX="${PWD}/${conda_env}"
echo -e "\nDelete unnecessary stuff"
rm -rf ${conda_env}/include
find ${conda_env} -name \*.a -delete
mv ${conda_env}/bin ${conda_env}/bin_tmp
mkdir ${conda_env}/bin
cp ${conda_env}/bin_tmp/freecad ${conda_env}/bin/
cp ${conda_env}/bin_tmp/freecadcmd ${conda_env}/bin
cp ${conda_env}/bin_tmp/ccx ${conda_env}/bin/
cp ${conda_env}/bin_tmp/python ${conda_env}/bin/
cp ${conda_env}/bin_tmp/pip ${conda_env}/bin/
cp ${conda_env}/bin_tmp/pyside6-rcc ${conda_env}/bin/
cp ${conda_env}/bin_tmp/gmsh ${conda_env}/bin/
cp ${conda_env}/bin_tmp/dot ${conda_env}/bin/
cp ${conda_env}/bin_tmp/unflatten ${conda_env}/bin/
rm -rf ${conda_env}/bin_tmp
sed -i '1s|.*|#!/usr/bin/env python|' ${conda_env}/bin/pip
echo -e "\nCopying Icon and Desktop file"
cp ${conda_env}/share/applications/org.freecad.FreeCAD.desktop AppDir/
sed -i 's/Exec=FreeCAD/Exec=AppRun/g' AppDir/org.freecad.FreeCAD.desktop
cp ${conda_env}/share/icons/hicolor/scalable/apps/org.freecad.FreeCAD.svg AppDir/
# Remove __pycache__ folders and .pyc files
find . -path "*/__pycache__/*" -delete
find . -name "*.pyc" -type f -delete
# reduce size
rm -rf ${conda_env}/conda-meta/
rm -rf ${conda_env}/doc/global/
rm -rf ${conda_env}/share/gtk-doc/
rm -rf ${conda_env}/lib/cmake/
find . -name "*.h" -type f -delete
find . -name "*.cmake" -type f -delete
python_version=$(python -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
version_name="FreeCAD_${BUILD_TAG}-Linux-$(uname -m)-${python_version}"
echo -e "\################"
echo -e "version_name: ${version_name}"
echo -e "################"
pixi list -e default > AppDir/packages.txt
sed -i "1s/.*/\nLIST OF PACKAGES:/" AppDir/packages.txt
curl -LO https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage
chmod a+x appimagetool-$(uname -m).AppImage
echo -e "\nCreate the appimage"
# export GPG_TTY=$(tty)
chmod a+x ./AppDir/AppRun
./appimagetool-$(uname -m).AppImage \
--comp zstd \
--mksquashfs-opt -Xcompression-level \
--mksquashfs-opt 22 \
-u "gh-releases-zsync|FreeCAD|FreeCAD|${BUILD_TAG}|FreeCAD*$(uname -m)*.AppImage.zsync" \
AppDir ${version_name}.AppImage
# -s --sign-key ${GPG_KEY_ID} \
echo -e "\nCreate hash"
sha256sum ${version_name}.AppImage > ${version_name}.AppImage-SHA256.txt
if [ "${UPLOAD_RELEASE}" == "true" ]; then
gh release upload --clobber ${BUILD_TAG} "${version_name}.AppImage" "${version_name}.AppImage-SHA256.txt"
fi
@@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>FreeCAD</string>
<key>CFBundleGetInfoString</key>
<string></string>
<key>CFBundleIconFile</key>
<string>freecad.icns</string>
<key>CFBundleIdentifier</key>
<string>org.freecad.FreeCAD</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string></string>
<key>CFBundleName</key>
<string>APPLICATION_MENU_NAME</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string></string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>FREECAD_VERSION</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>NSRequiresAquaSystemAppearance</key>
<string>False</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>FCStd</string>
<string>FCMat</string>
<string>FCParam</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>freecad-doc.icns</string>
<key>LSIsAppleDefaultForType</key>
<true/>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>FCMacro</string>
<string>FCScript</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>freecad-script.icns</string>
<key>LSIsAppleDefaultForType</key>
<true/>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>FreeCAD Document</string>
<key>UTTypeIdentifier</key>
<string>org.freecad.fcstd</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>FCStd</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>
@@ -1,85 +0,0 @@
#!/bin/bash
set -e
set -x
conda_env="FreeCAD.app/Contents/Resources"
mkdir -p ${conda_env}
cp -a ../.pixi/envs/default/* ${conda_env}
export PATH="${PWD}/${conda_env}/bin:${PATH}"
export CONDA_PREFIX="${PWD}/${conda_env}"
# delete unnecessary stuff
rm -rf ${conda_env}/include
find ${conda_env} -name \*.a -delete
mv ${conda_env}/bin ${conda_env}/bin_tmp
mkdir ${conda_env}/bin
cp ${conda_env}/bin_tmp/freecad ${conda_env}/bin/
cp ${conda_env}/bin_tmp/freecadcmd ${conda_env}/bin
cp ${conda_env}/bin_tmp/ccx ${conda_env}/bin/
cp ${conda_env}/bin_tmp/python ${conda_env}/bin/
cp ${conda_env}/bin_tmp/pip ${conda_env}/bin/
cp ${conda_env}/bin_tmp/pyside6-rcc ${conda_env}/bin/
cp ${conda_env}/bin_tmp/gmsh ${conda_env}/bin/
cp ${conda_env}/bin_tmp/dot ${conda_env}/bin/
cp ${conda_env}/bin_tmp/unflatten ${conda_env}/bin/
rm -rf ${conda_env}/bin_tmp
sed -i '1s|.*|#!/usr/bin/env python|' ${conda_env}/bin/pip
# copy resources
cp resources/* ${conda_env}
# Remove __pycache__ folders and .pyc files
find . -path "*/__pycache__/*" -delete
find . -name "*.pyc" -type f -delete
# fix problematic rpaths and reexport_dylibs for signing
# see https://github.com/FreeCAD/FreeCAD/issues/10144#issuecomment-1836686775
# and https://github.com/FreeCAD/FreeCAD-Bundle/pull/203
# and https://github.com/FreeCAD/FreeCAD-Bundle/issues/375
python ../scripts/fix_macos_lib_paths.py ${conda_env}/lib
# build and install the launcher
cmake -B build launcher
cmake --build build
mkdir -p FreeCAD.app/Contents/MacOS
cp build/FreeCAD FreeCAD.app/Contents/MacOS/FreeCAD
python_version=$(python -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
version_name="FreeCAD_${BUILD_TAG}-macOS-$(uname -m)-${python_version}"
application_menu_name="FreeCAD_${BUILD_TAG}"
echo -e "\################"
echo -e "version_name: ${version_name}"
echo -e "################"
cp Info.plist.template ${conda_env}/../Info.plist
sed -i "s/FREECAD_VERSION/${version_name}/" ${conda_env}/../Info.plist
sed -i "s/APPLICATION_MENU_NAME/${application_menu_name}/" ${conda_env}/../Info.plist
pixi list -e default > FreeCAD.app/Contents/packages.txt
sed -i '1s/.*/\nLIST OF PACKAGES:/' FreeCAD.app/Contents/packages.txt
# copy the plugin into its final location
cp -a ${conda_env}/Library ${conda_env}/..
rm -rf ${conda_env}/Library
if [[ "${SIGN_RELEASE}" == "true" ]]; then
# create the signed dmg
./macos_sign_and_notarize.zsh -p "FreeCAD" -k ${SIGNING_KEY_ID} -o "${version_name}.dmg"
else
# create the dmg
dmgbuild -s dmg_settings.py "FreeCAD" "${version_name}.dmg"
fi
# create hash
sha256sum ${version_name}.dmg > ${version_name}.dmg-SHA256.txt
if [[ "${UPLOAD_RELEASE}" == "true" ]]; then
gh release upload --clobber ${BUILD_TAG} "${version_name}.dmg" "${version_name}.dmg-SHA256.txt"
fi
-12
View File
@@ -1,12 +0,0 @@
# Ensure default values are set in defines if they are not already provided
defines.setdefault('containing_folder', '.')
defines.setdefault('app_name', 'FreeCAD.app')
defines.setdefault('icon_path', 'Contents/Resources/freecad.icns')
files = [f"{defines['containing_folder']}/{defines['app_name']}"]
symlinks = {"Applications": "/Applications"}
badge_icon = f"{defines['containing_folder']}/{defines['app_name']}/{defines['icon_path']}"
window_rect = ((200, 200), (600, 400))
icon_locations = {f"{defines['app_name']}": (180, 150), "Applications": (420, 150)}
size = "4g"
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
@@ -1,8 +0,0 @@
cmake_minimum_required(VERSION 3.20)
project(freecad-launcher LANGUAGES CXX)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version" FORCE)
set(CMAKE_CXX_STANDARD 17)
add_executable(FreeCAD FreeCAD.cpp)
target_link_libraries(FreeCAD)
@@ -1,73 +0,0 @@
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <vector>
#include <libgen.h>
#include <unistd.h>
int main(int argc, char *argv[], char *const *envp) {
char *cwd = dirname(realpath(argv[0], NULL));
std::string FreeCAD = realpath((std::string(cwd) + "/../Resources/bin/freecad").c_str(), NULL);
std::map<std::string, std::string> env;
for(int i = 0; envp[i] != NULL; ++i) {
std::string e(envp[i]);
auto sep = e.find('=');
auto var = e.substr(0, sep);
auto value = e.substr(sep+1, std::string::npos);
env[var] = value;
}
std::string prefix = realpath((std::string(cwd) + "/../Resources").c_str(), NULL);
env["PREFIX"] = prefix;
env["LD_LIBRARY_PATH"] = prefix + "/lib";
env["PYTHONPATH"] = prefix;
env["PYTHONHOME"] = prefix;
env["FONTCONFIG_FILE"] = "/etc/fonts/fonts.conf";
env["FONTCONFIG_PATH"] = "/etc/fonts";
env["SSL_CERT_FILE"] = prefix + "/ssl/cacert.pem"; // https://forum.freecad.org/viewtopic.php?f=3&t=42825
env["GIT_SSL_CAINFO"] = prefix + "/ssl/cacert.pem";
char **new_env = new char*[env.size() + 1];
int i = 0;
for (const auto& [var, value] : env) {
auto line = var + '=' + value;
size_t len = line.length() + 1;
new_env[i] = new char[len];
memset(new_env[i], 0, len);
strncpy(new_env[i], line.c_str(), len);
i++;
}
new_env[i] = NULL;
i = 0;
while(new_env[i] != NULL) {
std::cout << new_env[i] << std::endl;
i++;
}
std::cout << "Running: " << FreeCAD << std::endl;
i = 0;
while(argv[i] != NULL) {
i++;
}
char **new_argv = new char*[i + 1];
new_argv[0] = new char[FreeCAD.length() + 1];
memset(new_argv[0], 0, FreeCAD.length() + 1);
strncpy(new_argv[0], FreeCAD.c_str(), FreeCAD.length());
i = 1;
while(argv[i] != NULL) {
new_argv[i] = new char[strlen(argv[i])+1];
memset(new_argv[i], 0, strlen(argv[i])+1);
strncpy(new_argv[i], argv[i], strlen(argv[i]));
i++;
}
new_argv[i] = NULL;
return execve(FreeCAD.c_str(), new_argv, new_env);
}
@@ -1,126 +0,0 @@
#!/bin/zsh
# SPDX-License-Identifier: LGPL-2.1-or-later
# Default values
SIGNING_KEY_ID="${FREECAD_SIGNING_KEY_ID}"
KEYCHAIN_PROFILE="FreeCAD"
CONTAINING_FOLDER="."
APP_NAME="FreeCAD.app"
VOLUME_NAME="FreeCAD"
DMG_NAME="FreeCAD-macOS-$(uname -m).dmg"
DMG_SETTINGS="dmg_settings.py"
# Function to display usage information
function usage {
echo "Usage: $0 [-k|--key-id <signing_key_id>] [-p|--keychain-profile <keychain_profile>]"
echo " [-d|--dir <containing_folder>] [-n|--app-name <app_name.app>]"
echo " [-v|--volume-name <volume_name>] [-o|--output <image_name.dmg>]"
echo " [-s|--dmg-settings <dmg_settings.py>]"
echo
echo "This script signs and notarizes a FreeCAD.app bundle. It expects that the bundle is in a folder"
echo "by itself (that folder will be used as the basis for the created disk image file, so anything"
echo "else in it will become part of the image). That folder should be located in the same folder as"
echo "this script."
echo
echo "If <signing_key_id> is not passed it defaults to env variable FREECAD_SIGNING_KEY_ID, it should"
echo "be a Developer ID Application certificate that has been installed into the login keychain."
echo "For a list of available keys see the output of"
echo " security find-identity -p basic -v"
echo "For instructions on how to configure the credentials for the tool for use before running this"
echo "script see the documentation for"
echo " xcrun notarytool store-credentials"
exit 1
}
# Parse command line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
-k|--key-id)
SIGNING_KEY_ID="$2"
shift 2
;;
-p|--keychain-profile)
KEYCHAIN_PROFILE="$2"
shift 2
;;
-d|--dir)
CONTAINING_FOLDER="$2"
shift 2
;;
-n|--app-name)
APP_NAME="$2"
shift 2
;;
-v|--volume-name)
VOLUME_NAME="$2"
shift 2
;;
-o|--output)
DMG_NAME="$2"
shift 2
;;
-s|--dmg-settings)
DMG_SETTINGS="$2"
shift 2
;;
-h|--help)
usage
;;
*)
echo "Unknown parameter passed: $1"
usage
;;
esac
done
# Check if SIGNING_KEY_ID is set
if [ -z "$SIGNING_KEY_ID" ]; then
echo "Error: Signing key ID is required."
usage
fi
# Check for dmgbuild executable
if ! command -v dmgbuild &> /dev/null; then
echo "Error: dmgbuild not installed. Please install it for example using pip:"
echo 'pip3 install "dmgbuild[badge_icons]>=1.6.0,<1.7.0"'
exit 1
fi
function run_codesign {
echo "Signing $1"
/usr/bin/codesign --options runtime -f -s ${SIGNING_KEY_ID} --timestamp --entitlements entitlements.plist "$1"
}
IFS=$'\n'
dylibs=($(/usr/bin/find "${CONTAINING_FOLDER}/${APP_NAME}" -name "*.dylib"))
shared_objects=($(/usr/bin/find "${CONTAINING_FOLDER}/${APP_NAME}" -name "*.so"))
bundles=($(/usr/bin/find "${CONTAINING_FOLDER}/${APP_NAME}" -name "*.bundle"))
executables=($(/usr/bin/find "${CONTAINING_FOLDER}/${APP_NAME}" -type f -perm +111 -exec file {} + | grep "Mach-O 64-bit executable" | sed 's/:.*//g'))
IFS=$' \t\n' # The default
signed_files=("${dylibs[@]}" "${shared_objects[@]}" "${bundles[@]}" "${executables[@]}")
# This list of files is generated from:
# file `find . -type f -perm +111 -print` | grep "Mach-O 64-bit executable" | sed 's/:.*//g'
for exe in ${signed_files}; do
run_codesign "${exe}"
done
# Two additional files that must be signed that aren't caught by the above searches:
run_codesign "${CONTAINING_FOLDER}/${APP_NAME}/Contents/packages.txt"
run_codesign "${CONTAINING_FOLDER}/${APP_NAME}/Contents/Library/QuickLook/QuicklookFCStd.qlgenerator/Contents/MacOS/QuicklookFCStd"
# Finally, sign the app itself (must be done last)
run_codesign "${CONTAINING_FOLDER}/${APP_NAME}"
# Create a disk image from the folder
echo "Creating disk image ${DMG_NAME}"
dmgbuild -s ${DMG_SETTINGS} -Dcontaining_folder="${CONTAINING_FOLDER}" -Dapp_name="${APP_NAME}" "${VOLUME_NAME}" "${DMG_NAME}"
# Submit it for notarization (requires that an App Store API Key has been set up in the notarytool)
time xcrun notarytool submit --wait --keychain-profile "${KEYCHAIN_PROFILE}" "${DMG_NAME}"
# Assuming that notarization succeeded, it's a good practice to staple that notarization to the DMG
xcrun stapler staple "${DMG_NAME}"

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