Skip to content

Fix compilation when not using image plugin#40

Merged
hugtalbot merged 3 commits intosofa-framework:masterfrom
olivier-roussel:fix_image_plugin_use
Dec 11, 2025
Merged

Fix compilation when not using image plugin#40
hugtalbot merged 3 commits intosofa-framework:masterfrom
olivier-roussel:fix_image_plugin_use

Conversation

@olivier-roussel
Copy link
Copy Markdown
Contributor

@olivier-roussel olivier-roussel commented Dec 1, 2025

In cases where compiling the CGALPlugin wihtout image plugin support, such as the supported-plugins SOFA CMake presets, this plugin was not compiling anymore due to the absence of definition of registerMeshGenerationFromImage method.
This PR proposes to fix this by setting a preprocessor definition when compiling with image plugin.

@olivier-roussel olivier-roussel added bug Something isn't working pr: status to review labels Dec 1, 2025
@bakpaul
Copy link
Copy Markdown
Contributor

bakpaul commented Dec 4, 2025

Your proposition is good and makes sens. The only issue is that you are doing it wrong. We want anyone building upon this plugin (which will certainly never be the case but anyway) to know if it has been compiled with it or not. To do so you need to add a #cmakedefine in the config.h.in file of the project so that a variable exists in the header. And actually the macro sofa-find_package already creates a cmake variable CGALPLUGIN_HAVE_IMAGE when image is found.

@olivier-roussel
Copy link
Copy Markdown
Contributor Author

@bakpaul Thanks for the feedback, I agree with that and I'll make the changes.

@olivier-roussel
Copy link
Copy Markdown
Contributor Author

olivier-roussel commented Dec 4, 2025

@bakpaul So there is no config.h.in yet right ? we have to set up this and its configuration from scratch just for that ?
Ok I just missed it actually

@hugtalbot hugtalbot merged commit e8d2bf3 into sofa-framework:master Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working pr: status ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants