Repository navigation
mr_add_resources: define the icon folder regex inside the function - #7210
Merged
Merged
Conversation
MR_ICON_FOLDERS_REGEX was set at the file scope of ResourceHelpers.cmake, so it was visible only in the directory that included the module. A project calling mr_add_resources from another directory got an empty regex, and REGEX "" EXCLUDE dropped every resource file from the copy and the install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grantim
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MR_ICON_FOLDERS_REGEXwas set at the file scope ofcmake/Modules/ResourceHelpers.cmake, so only the directory that includes the module (MeshLib's rootCMakeLists.txt) could see it. A project that adds MeshLib as a subdirectory and callsmr_add_resources()from its own directories got an empty regex, andREGEX "" EXCLUDEinfile(COPY)andinstall(DIRECTORY)matched every path, so none of that target's resource files were copied or installed (onlyicons-<target>.zipremained).The regex is now a local variable of
mr_add_resources(), so the function works the same from any scope. MeshLib's own targets are unaffected: the generated install rule for MRViewer is the sameREGEX "/(icons|object_icons|independent_icons|logos)$" EXCLUDEas before.Checked with a small project that includes the module in one subdirectory and calls
mr_add_resources()from a sibling one: before, the output and install trees held onlyicons-App.zip; after, they also holdpdf/LogoMeshInspector.pngandtop.txt, whileicons/is still excluded. Also checked by configuring MeshLib on Windows (CMake + Ninja + cl).🤖 Generated with Claude Code