135 Commits

Author SHA1 Message Date
Donovan Baarda
807520ca1d Update eigen to v5.0.1 and libigl to v2.6.0. (#11311)
* Update eigen from v3.3.7 to v5.0.1.

This updates eigen from v3.3.7 released on  December 11, 2018-12-11 to v5.0.1
released on 2025-11-11. There have be a large number of bug-fixes,
optimizations, and improvements between these releases. See the details at;

https://gitlab.com/libeigen/eigen/-/releases

It retains the previous custom minimal `CMakeLists.txt`, and adds a
README-OrcaSlicer.md that explains what version and parts of the upstream
eigen release have been included, and where the full release can be found.

* Update libigl from v2.0.0 (or older) to v2.6.0.

This updates libigl from what was probably v2.0.0 released on 2018-10-16 to
v2.6.0 released on 2025-05-15. It's possible the old version was even older
than that but there is no version indicators in the code and I ran out of
patience identifying missing changes and only went back as far as v2.0.0.

There have been a large number of bug-fixes, optimizations, and improvements
between these versions. See the following for details;

https://github.com/libigl/libigl/releases

I retained the minimal custom `CMakeLists.txt`, added `README.md` from the
libigl distribution which identifies the version, and added a
README-OrcaSlicer.md that details the version and parts that have been
included.

* Update libslic3r for libigl v2.6.0 changes.

This updates libslic3r for all changes moving to eigen v5.0.1 and libigl
v2.6.0. Despite the large number of updates to both dependencies, no changes
were required for the eigen update, and only one change was required for the
libigl update.

For libigl, `igl::Hit` was changed to a template taking the Scalar type to
use. Previously it was hard-coded to `float`, so to minimize possible impact
I've updated all places it is used from `igl::Hit` to `igl::Hit<float>`.

* Add compiler option `-DNOMINMAX` for libigl with MSVC.

MSVC by default defines `min(()` and `max()` macros that break
`std::numeric_limits<>::max()`. The upstream cmake that we don't include
adds `-DNOMINMAX` for the libigl module when compiling with MSVC, so we need
to add the same thing here.

* Fix src/libslic3r/TriangleMeshDeal.cpp for the unmodified upstream libigl.

This fixes `TriangleMeshDeal.cpp` to work with the unmodified upstream
libigl v2.6.0. loop.{h,cpp} implementation.

This file and feature was added in PR "BBS Port: Mesh Subdivision" (#12150)
which included changes to `loop.{h,cpp}` in the old version of libigl. This PR
avoids modifying the included dependencies, and uses the updated upstream
versions of those files without any modifications, which requires fixing
TriangleMeshDeal.cpp to work with them.

In particular, the modifications made to `loop.{h,cpp}` included changing the
return type from void to bool, adding additional validation checking of the
input meshes, and returning false if they failed validation. These added
checks looked unnecessary and would only have caught problems if the input
mesh was very corrupt.

To make `TriangleMeshDeal.cpp` work without this built-in checking
functionality, I removed checking/handling of any `false` return value.

There was also a hell of a lot of redundant copying and casting back and forth
between float and double, so I cleaned that up. The input and output meshs use
floats for the vertexes, and there would be no accuracy benefits from casting
to and from doubles for the simple weighted average operations done by
igl::loop(). So this just uses `Eigen:Map` to use the original input mesh
vertex data directly without requiring any copy or casting.

* Move eigen from included `deps_src` to externaly fetched `deps`.

This copys what PrusaSlicer did and moved it from an included dependency under
`deps_src` to an externaly fetched dependency under `deps`. This requires
updating some `CMakeList.txt` configs and removing the old and obsolete
`cmake/modules/FindEigen3.cmake`. The details of when this was done in
PrusaSlicer and the followup fixes are at;

* 21116995d7
* https://github.com/prusa3d/PrusaSlicer/issues/13608
* https://github.com/prusa3d/PrusaSlicer/pull/13609
* e3c277b9ee

For some reason I don't fully understand this also required fixing
`src/slic3r/GUI/GUI_App.cpp` by adding `#include <boost/nowide/cstdio.hpp>` to
fix an `error: ‘remove’ is not a member of ‘boost::nowide'`. The main thing I
don't understand is how it worked before. Note that this include is in the
PrusaSlicer version of this file, but it also significantly deviates from what
is currently in OrcaSlicer in many other ways.

* Whups... I missed adding the deps/Eigen/Eigen.cmake file...

* Tidy some whitespace indenting in CMakeLists.txt.

* Ugh... tabs indenting needing fixes.

* Change the include order of deps/Eigen.

It turns out that although Boost includes some references to Eigen, Eigen also
includes some references to Boost for supporting some of it's additional
numeric types.

I don't think it matters much since we are not using these features, but I
think technically its more correct to say Eigen depends on Boost than the
other way around, so I've re-ordered them.

* Add source for Eigen 5.0.1 download to flatpak yml config.

* Add explicit `DEPENDS dep_Boost to deps/Eigen.

I missed this before. This ensures we don't rely on include orders to make
sure Boost is installed before we configure Eigen.

* Add `DEPENDS dep_Boost dep_GMP dep_MPFR` to deps/Eigen.

It turns out Eigen can also use GMP and MPFR for multi-precision and
multi-precision-rounded numeric types if they are available.

Again, I don't think we are using these so it doesn't really matter, but it is
technically correct and ensures they are there if we ever do need them.

* Fix deps DEPENDENCY ordering for GMP, MPFR, Eigen, and CGAL.

I think this is finally correct. Apparently CGAL also optionally depends on
Eigen, so the correct dependency order from lowest to highest is GMP, MPFR, Eigen, and CGAL.

---------

Co-authored-by: Donovan Baarda <dbaarda@google.com>
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
2026-05-12 20:35:21 +08:00
Jack Boswell (boswelja)
db11e136f7 Hook up deps-windows.cmake too 2026-05-01 19:17:54 +10:00
Jack Boswell (boswelja)
89bf881c6b Add processor mapping for ARM64 -> DEPS_ARCH=arm64
With this change, builds on ARM64 hosts will successfully kick off!
Unfortunately there are still missing/outdated dependencies, so the build doesn't yet succeed. This makes it much easier to check what we're failing on though.
2026-05-01 19:03:59 +10:00
Angus Gratton
b88a314763 deps builld: Try to honour CMAKE_BUILD_PARALLEL_LEVEL (#13158)
* deps: Use CMAKE_BUILD_PARALLEL_LEVEL for dependency builds.

If set when initial CMake is run, don't hard-code the number of CPUs for all the
recursive child builds.

* build_linux: Pass -j1 for dependency build.

This is recommended by the comment at the top of deps/CMakeLists.txt, and makes
sense as the recursive build steps will pick up
CMAKE_BUILD_PARALLEL_LEVEL (otherwise the number of parallel jobs is squared).
2026-04-17 12:34:35 +08:00
SoftFever
09c7ab665c fix some appimage issues (#13210) 2026-04-16 12:43:09 +08:00
SoftFever
3e4af2c723 WIP: Add native Wayland support for Linux (#13197)
* Add runtime display backend detection for Wayland support

Add LinuxDisplayBackend utility to detect X11 vs Wayland at runtime
using GDK_IS_X11_DISPLAY / GDK_IS_WAYLAND_DISPLAY macros. This is
the foundation for removing the forced GDK_BACKEND=x11 and enabling
native Wayland support.

- New files: LinuxDisplayBackend.hpp/.cpp with get_linux_display_backend(),
  is_running_on_wayland(), and is_running_on_x11()
- Propagate wxHAVE_GDK_X11 / wxHAVE_GDK_WAYLAND from FindGTK3.cmake
  as compile definitions to libslic3r_gui
- No-op on non-Linux platforms (returns Unknown / false)

* Fix Phase 1 code quality: pragma once, source ordering, static cache

* Make X11 initialization conditional for Wayland support

Remove the unconditional GDK_BACKEND=x11 force that blocked native
Wayland. Replace with conditional logic:

- EGL safety fallback: re-force X11 only when wxUSE_GLCANVAS_EGL is
  off and WAYLAND_DISPLAY is set, with a warning log
- XInitThreads() only called when DISPLAY is set (X11 in use)
- __GLX_VENDOR_LIBRARY_NAME only set when DISPLAY is present (GLX-specific)
- WEBKIT_DISABLE_COMPOSITING_MODE only set under XWayland (both
  DISPLAY and WAYLAND_DISPLAY present)
- Guard X11/Xlib.h include with __has_include for robustness
- Restore display validation to accept either DISPLAY or WAYLAND_DISPLAY

This is Phase 2 of the Wayland support plan.

* Fix Phase 2: safer EGL macro check, add clarifying comments

* Add GLAD2 library and replace GLEW linkage in build system

Set up GLAD2 as a static library to replace GLEW for OpenGL loading.
GLAD2 supports both GLX and EGL, which is required for Wayland support.

- Create src/glad/ with pre-generated GLAD2 sources (GL 4.6 compat)
- Add src/glad/CMakeLists.txt building glad as a static library
- Wire glad into src/CMakeLists.txt before libvgcode
- Modify libvgcode to use shared glad for GL path (keeps local copy
  only for GLES2/Emscripten) to avoid duplicate symbol conflicts
- Replace GLEW::GLEW with glad in libslic3r_gui link libraries

Note: GLEW is kept in deps for OpenCSG. Code migration from GL/glew.h
to glad/gl.h headers will follow in Phase 3B+3C.

* Fix Phase 3A+3D: libvgcode GLAD include, dead files, dlopen dep, OpenGL link var

* Migrate from GLEW to GLAD: replace headers and API calls across codebase

Replace all #include <GL/glew.h> with <glad/gl.h> across 49 source files.
Migrate GLEW API calls to GLAD equivalents:
- glewInit/glewExperimental -> gladLoaderLoadGL()
- GLEW_EXT_* / GLEW_ARB_* extension checks -> GLAD_GL_EXT_* / GLAD_GL_ARB_*
- Remove GLEW-specific EGL/GLX mismatch #error guards (not needed with GLAD)
- Replace unavailable EXT symbols with core GL equivalents in
  GLCanvas3D.cpp (GL_MAX_SAMPLES, glRenderbufferStorageMultisample,
  glBlitFramebuffer, GL_READ/DRAW_FRAMEBUFFER)
- Update log messages from glewInit to gladLoadGL

* Fix Phase 3B+3C: remove GLEW find, clean EXT symbols, update attribution

- Remove find_package(GLEW) block from root CMakeLists.txt since GLEW
  is no longer linked by any main application code
- Remove "glew" from SLIC3R_STATIC option description
- Replace all remaining EXT framebuffer symbols with core equivalents
  in render_thumbnail_framebuffer_ext and _rectangular_selection_picking_pass
- Update AboutDialog credits from GLEW to GLAD

* Enable EGL in wxWidgets and add runtime GLX/EGL selection for Wayland

- Set wxUSE_GLCANVAS_EGL=ON in wxWidgets build and Flatpak manifest
- Add PreferGLX() call on X11 sessions for driver compatibility
- Remove Phase 2 safety fallback (EGL is now always compiled in)
- Guard SwapBuffers against hidden canvases to prevent Wayland stalls

* Fix Phase 4: move PreferGLX to app startup, fix FPS counter guard

Move wxGLCanvas::PreferGLX() from OpenGLManager::create_wxglcanvas()
(static initializer) to GUI_App::on_init_inner() before any wxGLCanvas
is constructed. This prevents a race where SkipPartCanvas could trigger
wxGLBackend::Init() before the GLX preference is set. The new location
also adds explicit is_running_on_wayland() detection with a warning for
unknown backends.

Move increment_fps_counter() inside the IsShownOnScreen() guard so FPS
is only counted when a frame is actually swapped.

* Update GLFW from 3.3.7 to 3.4 for runtime Wayland/X11 backend selection

Replace the compile-time GLFW_USE_WAYLAND flag (which locked to a single
backend) with GLFW 3.4's GLFW_BUILD_WAYLAND + GLFW_BUILD_X11 flags that
build both backends and auto-select at runtime based on the available
display server. This enables the CLI thumbnail renderer to work on both
Wayland and X11 sessions without separate builds.

* wayland: Fix UI call sites that rely on global screen coordinates

On Wayland, wxGetMousePosition() returns (0,0) and SetPosition() is a
no-op for top-level windows. Fix the highest-impact call sites:

- GLCanvas3D: Use cached m_mouse.position from event handlers instead
  of wxGetMousePosition() + ScreenToClient() in get_local_mouse_position()
- Plater: Use event-relative coords via ClientToScreen(e.GetPosition())
  instead of wxGetMousePosition() in 3 leave-window handlers
- BBLTopbar: Use event.GetPosition() and FindToolByPosition() directly
  in mouse handlers instead of wxGetMousePosition()/FindToolByCurrentPosition()
- Search: Use focus-based dismiss logic on Wayland instead of
  wxGetMousePosition()-based rect checks in SearchDialog and
  SearchObjectDialog
- GUI_App: Skip SetPosition() in window_pos_restore() on Wayland where
  it is a no-op; still restore size and maximize state
- Button: Position tooltip relative to button widget via ClientToScreen
  instead of wxGetMousePosition()

* Fix SearchDialog Wayland dismiss: guard against search_line focus

* flatpak: Add Wayland socket permission for native Wayland support

* spec

* Fix crash on Wayland when wxWidgets lacks EGL support

Restore the safety fallback that forces GDK_BACKEND=x11 when wxWidgets
was not built with wxUSE_GLCANVAS_EGL=ON. Without this, the GLX backend
tries to access a non-existent X11 display on native Wayland, crashing
in wxGLCanvas::IsDisplaySupported() with SIGSEGV at offset 0xe4.

Also add a defense-in-depth guard in detect_multisample() that skips
the IsDisplaySupported call entirely on Wayland without EGL.

Root cause: deps/wxWidgets must be rebuilt after enabling EGL. The
compile-time check in OrcaSlicer.cpp detects the mismatch and falls
back safely.

* Fix EGL detection: use wxHAS_EGL instead of wxUSE_GLCANVAS_EGL

wxUSE_GLCANVAS_EGL is a CMake build option, NOT a C++ preprocessor
macro. The actual macro defined in wxWidgets setup.h is wxHAS_EGL.
All compile-time EGL checks were using the wrong macro, causing
the safety fallback to always trigger even with a properly built
EGL-enabled wxWidgets.

* Fix GL function pointers invalidated on Wayland/EGL

gladLoaderLoadGL() dlopen's libGL.so.1 to resolve GL function pointers
via dlsym, then immediately dlclose's the handle. On X11/GLX this is
fine because the GLX context keeps libGL.so mapped. On Wayland/EGL,
nothing else holds libGL.so open, so dlclose unmaps it and all function
pointers become dangling — causing SIGSEGV on the first GL call.

Fix: on Wayland, use gladLoadGL(eglGetProcAddress) which resolves
function pointers through the EGL loader without opening/closing
libGL.so.

* fix crash on start and various rendering issues

* fix crash on close

* small refactor

* move GPU selection to desktop file

* clean up a bit

* clean up more

* fix appimage error
2026-04-13 19:45:39 +08:00
SoftFever
2553d37236 cherry pick Linux specific changes from 2.3 (#13205)
- add a new mode to build in docker
- Improve AppImage
 1. fix  libbz2 soname differeence issue on appimage
 2. Downgrade to 22.04 for better compatibility
 3. improve appimage overall
2026-04-13 17:21:05 +08:00
SoftFever
fd47370c5c fix Windows build errors - wip 2026-03-26 10:17:19 +08:00
SoftFever
f77e7d833b Copy wx/private headers after wxWidgets install
wxWidgets 3.3 cmake install doesn't include private headers.
OrcaSlicer uses some private headers for accessibility support.
Add a post-install step to copy the private headers directory.
2026-03-25 12:49:35 +08:00
SoftFever
7658cf9076 Disable wxWidgets bundled NanoSVG to avoid duplicate symbols
wxWidgets 3.3 bundles its own NanoSVG in bmpsvg.cpp, conflicting with
OrcaSlicer's bundled copy which includes the nsvgRasterizeXY extension.
Set wxUSE_NANOSVG=OFF in deps cmake to use OrcaSlicer's version only.
2026-03-25 12:44:02 +08:00
SoftFever
7de8fbb0da Remove _wx_opengl_override from wxWidgets dep cmake
wxWidgets 3.3 handles OpenGL discovery natively via imported targets
(OpenGL::GL, OpenGL::OpenGL). The override was corrupting wx-config
output with malformed "-framework OpenGL" entries, causing
FindwxWidgets.cmake to fail.
2026-03-25 11:28:23 +08:00
SoftFever
2d7e26292b Update build system for wxWidgets 3.1.5 → 3.3.2 upgrade
- deps/wxWidgets/wxWidgets.cmake: Add GIT_TAG v3.3.2 to track the
  correct branch; remove -DwxUSE_UNICODE=ON (unicode-only in 3.3,
  option removed)
- src/CMakeLists.txt: Bump find_package minimum version from 3.0/3.1
  to 3.3; remove SLIC3R_WX_STABLE conditional (3.0 no longer supported)
- CMakeLists.txt: Remove SLIC3R_WX_STABLE option definition
- scripts/flatpak/com.orcaslicer.OrcaSlicer.yml: Update wxWidgets
  source URL to v3.3.2 branch archive; remove sha256 (placeholder
  TODO); remove -DwxUSE_UNICODE=ON
2026-03-24 20:22:19 +08:00
SoftFever
acbe5c708e respect clang flag for all deps 2026-03-19 23:14:47 +08:00
SoftFever
e00fcbb44e update cmake to 4.3.x (#12842)
# Description

update cmake to 4.3.x version for better support of new build tools

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->

## Tests

<!--
> Please describe the tests that you have conducted to verify the
changes made in this PR.
-->
2026-03-19 18:17:33 +08:00
SoftFever
4ffe260228 update cmake to 4.3.x 2026-03-19 15:48:32 +08:00
Kevin J. Lynagh
882af4d1fe CMake: Accept ignored prefixes from build_release_macos.sh
Defaults to ignore:

/opt/local    (MacPorts)
/opt/homebrew (Homebrew on ARM)
/opt/local    (Homebrew on x86)

We want to ignore these paths so any dependencies they might contain don't interfere with the build.

This fixes https://github.com/OrcaSlicer/OrcaSlicer/issues/10460
2026-03-18 21:51:54 +01:00
SoftFever
322b44d84a Feature/flatpak clang llvm21 (#12727)
* Fix GIT_COMMIT_HASH not set in Flatpak builds

The env var check was gated inside the .git directory check, so
Flatpak builds (which exclude .git from the sandbox) always fell
back to "0000000". Lift the env var check to top level and inject
the commit hash into the Flatpak manifest via build-options.env.

* Switch Flatpak build to Clang/LLD via LLVM 21 SDK extension

- Add org.freedesktop.Sdk.Extension.llvm21
- Bump runtime to GNOME 49 (SDK 25.08) for llvm21 availability

* fix build errors and improving build speed for flatpak

* fxi more build errors

* Update error messages for GNOME Platform and SDK versions
2026-03-11 14:59:29 +08:00
SoftFever
52a2c033d3 Remove upstreamed wxWidgets dark theme patch for Flatpak
The GNOME dark style support patch has been submitted upstream to wxWidgets, so the local Flatpak patch is no longer needed.
2026-03-05 01:13:26 +08:00
SoftFever
1745e8b910 Reapply "Switch to self hosted mac runner (#12024)" with proper fix (#12278)
* Reapply "Switch to self hosted mac runner (#12024)" with proper fix

This reverts commit 783f9926e3.

* use conditional logic for self-hosted runners

* improve readbility
2026-02-17 16:31:40 +08:00
Matthias Blaicher
bf59fe458f Fix EGL/GLX mismatch causing blank 3D preview on Linux (#12308)
- Add configurable GLEW_USE_EGL option (default OFF) to match wxWidgets
- Explicitly set wxUSE_GLCANVAS_EGL=OFF for vendored wxWidgets build
- Add compile-time check to detect EGL/GLX backend mismatch between
  GLEW and wxWidgets, preventing silent rendering failures

The bug occurred when GLEW was compiled with EGL support (using
eglGetProcAddress) but wxWidgets created GLX contexts. This mismatch
caused OpenGL function pointers to fail loading, resulting in blank
3D model preview.

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-02-15 16:26:16 +08:00
Maeyanie
bb30999673 Add support for Draco (.drc) format (#10681)
* Add read support for Google's Draco (.drc) format.

* Fix build on Linux

* Use boost instead of fstat.

* Switch to boost memory-mapped file to save RAM and potentially improve performance.

* Trim trailing whitespace.

* Initial Draco write support.

Currently always exports with 16-bit precision and speed 0 (best compression).
The back-end function does have arguments to specify them, it's just not hooked into the GUI.

* Add Draco to the About dialogue.

* Fix Linux compile (hopefully)

* Add an option to associate DRC files on Windows.

* Implement a Preferences option to set Draco position quantization bits

* Update src/slic3r/GUI/Preferences.cpp

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>

* Some slight changes to ianalexis's suggestion.

* Implement a create_item_spinctrl() function for numeric inputs, and use that instead of create_item_input().

* Move "bits" to inside the spinctrl box.

* Refactor following yw4z's feedback

* Update src/slic3r/GUI/Preferences.cpp

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>

* Change to 0 bits as the default setting for Draco export precision.

* Change to a lossy checkbox and a bits field with a range of 8-30.

* Proper SpinInput code from yw4z

* Revert "Proper SpinInput code from yw4z"

This reverts commit 7e9c85f31a.

* Revert "Change to a lossy checkbox and a bits field with a range of 8-30."

This reverts commit d642c9bcc0.

* Redo preferences based on SoftFever's feedback

* Refactor to minimize code duplication

* Fix padding

* Improve Draco export quality level tooltip clarity

Clarify that 0 means lossless compression (not uncompressed),
document the valid lossy range (8-30), and better explain the
tradeoff between file size and geometric detail.

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-02-06 18:27:17 +08:00
luzpaz
a036de042b Fix various typos in source documentation (#11553)
* Fix various typos in source documentation

* Delete cmake/modules/Catch2/CatchAddTests.cmake

* Delete tests/example/example_tests_main.cpp

* Revert test_config.cpp

---------

Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
2026-01-21 09:19:25 -03:00
SoftFever
541f3bb93b Merge branch 'main' into feat/configurable-bambu-network-lib 2026-01-05 08:39:21 +08:00
mosfet80
504a5d3b70 Update Qhull.cmake (#10848)
# Description
[Updated Qhull]
changelog
https://github.com/qhull/qhull/releases/tag/v8.0.2

# Screenshots/Recordings/Graphs

<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->

## Tests

<!--
> Please describe the tests that you have conducted to verify the changes made in this PR.
-->
2026-01-03 00:36:04 +08:00
SoftFever
5f18efa9e2 Merge branch 'main' into feat/configurable-bambu-network-lib 2025-12-27 23:40:35 +08:00
mosfet80
3da093b756 Update CGAL.cmake (#10850)
* Update CGAL.cmake

* Delete deps/CGAL/0001-clang19.patch

* Update CGAL.cmake

* Update CGAL.cmake

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-12-23 00:44:36 +08:00
Maciej Wilczyński
a4d4bfff27 Allow selecting specific network plugin versions 2025-12-14 14:26:16 +01:00
Ian Bassi
f71e09a8c6 Fix Flatpak build: Add fallback URL for MPFR source download (#11512)
Add fallback URL for MPFR source download

Updated MPFR.cmake to include both the GNU FTP and mpfr.org URLs for downloading the MPFR source. This improves reliability in case one of the sources is unavailable.
2025-11-29 15:53:40 +08:00
Noisyfox
7f1aad8bc1 Support Visual Studio 2026 (#11349)
* Add script with VS version auto detection

* Add msvc145 toolset support

* Fix issue when build slicer only

* Fix vs2026 OpenCV build

* Set github action to use new build script

* Get vs version from `msbuild --version` so it works for github action
2025-11-13 23:11:56 +08:00
Ocraftyone
026499c5b7 Better CMake Defaults (#10294)
* Auto generate CMAKE_PREFIX_PATH/DESTDIR

* Auto set CMAKE_INSTALL_PREFIX

* Always default SLIC3R_STATIC to on

* Only allow one value for CMAKE_OSX_ARCHITECTURES

* Set arch for OpenSSL from CMAKE_OSX_ARCHITECTURES

* Set CMAKE_INSTALL_RPATH from CMAKE_PREFIX_PATH

* Default CMAKE_MACOSX_RPATH and CMAKE_MACOSX_BUNDLE to on

* Auto set BBL_RELEASE_TO_PUBLIC based on build config

* Default to GTK 3

* Fix linux debug build

Update find modules to also look for the debug variant of the libraries

* Set DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO based on CMAKE_BUILD_TYPE

* Add a fallback value for Windows SDK if the env variables are not set

* Reflect CMake changes in the build scripts

* Add missing line

* Fix auto setting DEP_DEBUG and ORCA_INCLUDE_DEBUG_INFO

* Update dep folder name for linux in GH actions

* Invert dep-folder-name conditions

`''` is considered a falsy value, which was causing the value to always be set to 'OrcaSlicer_dep'

* Properly handle finding the debug version of libnoise

* Convert FindNLopt.cmake to a config mode wrapper

* Use separate build directory for debug builds on Linux

* Move find_package for libnoise

* Cleanup and improve linux build script

- Add dry run
- Add build in RelWithDebInfo
- Add function to print and run commands

* Remove linux destdir deprecation and cleanup

* Fix flatpak build

* Disable fail fast for flatpak builds

* Flatpak improvements

- Build wxWidgets using deps cmake
- Improve handling of space freeing commands while building deps
- Allow cmake to directly download deps
- Set needed flags within cmake instead of the build manifest

* Print clean build commands

* Implement shellcheck recommendations

* Cleanup

* Fix CMakeLists.txt syntax by replacing empty elseif with else statement

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-10-25 22:05:09 +08:00
bytedream
9061b12aee Fix timelapse crash
(cherry picked from commit 1600f476bb8461fbc8b23c538880731977bd3211)
2025-10-05 16:06:55 +08:00
Noisyfox
df1c5722ef Revert "OpenCV don't build its own libjpeg, to avoid symbol conflict"
This reverts commit 7a90b26e57.
2025-10-05 16:06:40 +08:00
Noisyfox
7a90b26e57 OpenCV don't build its own libjpeg, to avoid symbol conflict 2025-09-26 13:29:14 +08:00
SoftFever
883607e1d4 Refactor folder (#10475)
Move many third-party components' source codes from the src folder to a new folder called deps_src. The goal is to make the code structure clearer and easier to navigate.
2025-08-22 20:02:26 +08:00
Jack Boswell
05181779d1 Update WebView2 to 1.0.3351.48 (#10239) 2025-08-11 13:44:01 +08:00
SoftFever
e5ea789b89 Fix broken freetype-2.12.1.tar.gz link 2025-08-02 17:23:26 +08:00
Jack Boswell
c8a27715a9 Replace DEPS_BITS with DEPS_ARCH (#10183)
* Replace DEPS_BITS with DEPS_ARCH

* Restore missing DEP_MSVC_GEN

* STREQUAL

* STREQUAL

* Other cmakelists

* webview2 rename
2025-07-23 19:17:05 +08:00
lodriguez
be3bbfa39e remove OSMesa (#9708)
* remove OSMesa

OSMesa is depricated for quite a while and got removed with Mesa 25.1.0

* remove OSMesa from all buildfiles, readmes, etc…

---------

Co-authored-by: Noisyfox <timemanager.rick@gmail.com>
2025-06-15 14:53:42 +08:00
Vasily Khoruzhick
b72e28c116 Various flatpak fixes and improvements (#9527)
* Revert 98be94a729

We carry a wxgtk patch [1] that detects dark theme automatically. If it
doesn't work, it means that either selected Gtk theme is not installed
in flatpak environment, or appropriate xdg-desktop-portal for the DE is not
installed.

Plasma users may need to install org.gtk.Gtk3theme.Adapta

Also see https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Settings.html

[1] 0001-Enable-using-a-dark-theme-when-Gnome-dark-style-is-s.patch

* flatpak: introduce ORCA_SLICER_DARK_THEME to force dark theme

If ORCA_SLICER_DARK_THEME is set, dark theme will be applied regardless
of system settings.

* FIX: occt build failure

Pick up build error fix from upstream:
7236e83dcc

/run/build/BambuStudio/deps/build/dep_OCCT-prefix/src/dep_OCCT/src/StdPrs/StdPrs_BRepFont.cxx: In member function ‘Standard_Boolean StdPrs_BRepFont::renderGlyph(Standard_Utf32Char, TopoDS_Shape&)’:
/run/build/BambuStudio/deps/build/dep_OCCT-prefix/src/dep_OCCT/src/StdPrs/StdPrs_BRepFont.cxx:465:30: error: invalid conversion from ‘unsigned char*’ to ‘const char*’ [-fpermissive]
  465 |     const char* aTags      = &anOutline->tags[aStartIndex];
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              unsigned char*

* Set policy CMP0167 to NEW

Newer cmake switched to using BoostConfig.cmake shipped with boost-1.70
or later for detecting boost, to preserve old behavior policy CMP0167
was introduced.

Set it to "NEW" to indicate that we want to use .cmake shipped with
boost

* Add OpenSSL tarball link to the manifest

* Add curl zip to the manifest

* flatpak: bump runtime version to 47

Gnome 47 has been released a while ago

---------

Co-authored-by: Bastien Nocera <hadess@hadess.net>
2025-06-15 12:10:51 +08:00
Maciej Lisiewski
2490564f7f Fix building with GCC 15 (#9643)
* Patch GMP to build on GCC15

* Add cstdint include - GCC15 defaults to C23

* Update GMP PATCH_COMMAND to work without a valid git repo

* Set GMP_DIRECTORY_FLAG
2025-05-16 23:48:59 +08:00
Noisyfox
aebc01abfc Removed dependency on libtiff (#9514)
(cherry picked from commit prusa3d/PrusaSlicer@f12e0b4d21)

Co-authored-by: Lukas Matena <lukasmatena@seznam.cz>
2025-05-14 15:04:49 +08:00
Noisyfox
a9d426a3dc Fix Xcode 16.3 build (#9422)
* Fix build with Xcode 16.3

* Simplify OpenVDB patch, from 930c3acb8e (diff-bc3061cc2fe6c64a3d67c8350330bb3a530d01037faace6da27ad9a12aa03e29)

* Fix CGAL header under clang 19
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281880

* Fix compile error due to removal of base template for `std::char_traits` in clang 19
https://releases.llvm.org/19.1.0/projects/libcxx/docs/ReleaseNotes.html#deprecations-and-removals
2025-05-01 17:09:45 +08:00
SoftFever
54a5ac9235 reenable appimage build on ubuntu 24.04 (#9458)
* reenable appimage build on ubuntu 24.04

* update TIFF

* fix build error
2025-04-24 08:13:15 +08:00
SoftFever
658669d103 Universal mac build (#9074)
build universal Mac app
2025-03-27 22:53:37 +08:00
SoftFever
41450b3a64 avoid using https://www.mpfr.org/mpfr-current link (#9034)
* avoid using https://www.mpfr.org/mpfr-current link
2025-03-23 13:25:50 +08:00
lodriguez
c3542ce014 Update to mpfr-4.2.2.tar.bz2 (#9007)
Needed an update, the old link is 404.
2025-03-22 16:42:34 +08:00
Pouria Mousavizadeh Tehrani
a407feed24 fix: typo in CMakeLists.txt (#8707) 2025-03-05 21:29:54 +08:00
Joseph Palazzolo
b82d13a5a9 Fix OCCT and OpenCV patching during build (#8465)
* Fix OCCT and OpenCV patching during build

The inclusion of the `--directory` flag here isn't necessary because of
how `PATCH_COMMAND` applies patches. In fact this causes issues when
trying to build from an archive, `--directory` seems to imply `--index`
and thus this patch only succeeds if you're inside an initialized git
repo. If you simply use the archive without a git repo the build fails
at the patch step.

* Alter patch command based on git repo status

`git apply` has different behavior when inside a git repo vs not. If
we're in a git repo we need to fully quality the path for these patches,
otherwise we can omit the directory flag.

---------

Co-authored-by: Joe Palazzolo <joe@joepalazzolo.net>
2025-02-21 12:50:17 +08:00
SoftFever
6ed68342e0 fix build errors (#8210)
* fix build errors

* fix windows

* fix flatpak
2025-01-28 01:07:27 +08:00
Nick Johnson
fd0b2547f2 Add support for structured noise (perlin) fuzzy skin (#7678)
* Add support for perlin noise fuzzy skin

* Support multiple types of coherent noise

* Updated tooltips for more clarity.

* Reorder options as suggested by @discip

* Fix accidental removal of &

* Move libnoise to deps

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2025-01-27 22:45:16 +08:00