Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lilyinstarlight
Copy link
Contributor

We need to include CImg.h when gmic_core is not defined so that we can work on only shared libs and header files rather than requiring gmic.cpp to exist somewhere on the system

This reverts #172 because gmic_core is fundamentally incompatible with ENABLE_SYSTEM_GMIC because it requires having the G'MIC source rather than just the installed system files

This is implemented via a header indirection to detect when gmic_core is undefined and includes CImg.h similar to how gmic.h does when gmic_core is defined

@stefantalpalaru thoughts?

We need to include "CImg.h" when gmic_core is not defined so that we can
work on only shared libs and header files rather than requiring gmic.cpp
to exist somewhere on the system.
@stefantalpalaru
Copy link
Contributor

it requires having the G'MIC source rather than just the installed system files

Not a problem for my Gentoo ebuild, because I combine gmic and gmic-qt in the same package: https://github.com/stefantalpalaru/gentoo-overlay/blob/9d7fe8de785526a7b9db12943f3bd59d3ef3b98d/media-gfx/gmic/gmic-3.2.0-r100.ebuild

That said, I tested your patch and it works as advertised. The only problem is that things will break when G'MIC and CImg APIs will diverge and there is no automated testing to catch it.

We can't really force upstream to support CImg if they don't want to.

@lilyinstarlight
Copy link
Contributor Author

That said, I tested your patch and it works as advertised. The only problem is that things will break when G'MIC and CImg APIs will diverge and there is no automated testing to catch it.

The trouble is the G'MIC API with gmic_core enabled is just more or less a renamed CImg API (I mean there are references to gmic_library::cimg in gmic-qt even)

With gmic_core disabled, it provides a smaller API that is far too incomplete because gmic-qt expects to have the CImg API in the gmic_library namespace which is way more than the small stubs provide

If upstream has some other solution they would prefer (e.g. expanding the smaller API when gmic_core is not defined or allowing to build with gmic_core with only installed system files), then I'm happy to use anything that just actually fixes the build too

Let me know if I'm misunderstanding any of the internals between gmic-qt/G'MIC/CImg because I really only got acquainted with them over the last week or two

Thanks!

@dtschump
Copy link
Collaborator

dtschump commented Feb 20, 2023 via email

@lilyinstarlight
Copy link
Contributor Author

Closing in favor of #175 and opening one more PR in the gmic repo

@lilyinstarlight lilyinstarlight deleted the fix/enable-system-gmic branch February 24, 2023 19:50
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.

3 participants