Skip to content

mr_add_resources: define the icon folder regex inside the function - #7210

Merged
Fedr merged 1 commit into
masterfrom
resource-helpers-local-regex
Oct 21, 2026
Merged

Fedr merged 1 commit into
masterfrom
resource-helpers-local-regex

Conversation

@Fedr

@Fedr Fedr commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

MR_ICON_FOLDERS_REGEX was set at the file scope of cmake/Modules/ResourceHelpers.cmake, so only the directory that includes the module (MeshLib's root CMakeLists.txt) could see it. A project that adds MeshLib as a subdirectory and calls mr_add_resources() from its own directories got an empty regex, and REGEX "" EXCLUDE in file(COPY) and install(DIRECTORY) matched every path, so none of that target's resource files were copied or installed (only icons-<target>.zip remained).

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 same REGEX "/(icons|object_icons|independent_icons|logos)$" EXCLUDE as 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 only icons-App.zip; after, they also hold pdf/LogoMeshInspector.png and top.txt, while icons/ is still excluded. Also checked by configuring MeshLib on Windows (CMake + Ninja + cl).

🤖 Generated with Claude Code

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>
@Fedr
Fedr merged commit e19e66f into master Oct 21, 2026
62 checks passed
@Fedr
Fedr deleted the resource-helpers-local-regex branch October 21, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants