From d568e89c34849366bb68a439c54de85c0a2cadca Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Fri, 10 Jul 2026 08:39:56 +0200 Subject: [PATCH] Windows packaging: fail the configure when the OCCT glob matches nothing The glob that replaced the hand-maintained OCCT DLL list traded a loud failure for a silent one. The old code named each DLL explicitly, so an unpopulated deps prefix made file(COPY) error out at configure time. A glob that matches nothing instead yields an empty list, copies nothing, and leaves the install manifest without a single TK*.dll -- producing a package that dies at launch with "error 126 (dependency not found)". This only bites source builds whose CMAKE_PREFIX_PATH lacks bin/occt (OCCT's install layout varies by version); CI populates it, so every shipped artifact is intact. Restore the loudness rather than ship a slicer without OpenCASCADE. Windows-only: every call site of the copy function is inside if (WIN32). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01BVzKmX6Y1aEteit1HTXG4Q --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 053d3cc99a..e034e22c37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -817,6 +817,15 @@ function(orcaslicer_copy_dlls target config postfix output_dlls) # TKOffset/TKBool/TKFeat. Glob everything instead; the built occt/ dir is the one # source of truth. (OCCT is Shared only on Windows — deps/OCCT/OCCT.cmake.) file(GLOB _occt_dlls "${CMAKE_PREFIX_PATH}/bin/occt/*.dll") + # A glob that matches nothing yields an empty list and copies nothing, so the package + # would ship with no OpenCASCADE at all and die at launch with error 126. The explicit + # per-file list this replaced failed the configure instead. Keep that loudness. + if (NOT _occt_dlls) + message(FATAL_ERROR + "No OCCT DLLs found in ${CMAKE_PREFIX_PATH}/bin/occt/. Build the dependencies " + "first (build_release_vs2022.bat deps); refusing to package a slicer without " + "OpenCASCADE, which would fail at startup with error 126.") + endif () file(COPY ${_occt_dlls} ${CMAKE_PREFIX_PATH}/bin/freetype.dll DESTINATION ${_out_dir})