Skip to content

419277 OpenEXR: support 2.3 and 3+

Amy spark requested to merge lsegovia/krita:work/amyspark/openexr-too-old into master


Bug 419277 shows that our current Find module, which is Pixar's, is completely unable to find OpenEXR lower than 2.3 due to a CMake error. This is because it doesn't account properly for spaces in the definition of the OpenEXR version string.

However, replacing it with the ECM version breaks our Windows support. This is because it completely ignores the versioned suffix that OpenEXR applies to its libraries; this implies that it's relying on Linux's symlinks to point it to the correct library. This is a blocker for any level of support for Windows. Moreover, it doesn't cover the IexMath and IlmImfUtil subcomponents.

In any case, both modules are unable to detect OpenEXR v3 -- d66383f6 was a workaround to support it.

What I did

This merge request upgrades our FindOpenEXR module to a heavily modified version of ECM's.

The changes that I made were:

  1. Find and use any CMake config module that OpenEXR provides.
  2. Failing that, construct the library suffix, and manually look up each component.
  3. Add IexMath and IlmImfUtil to the list of libraries.
  4. Add support for the v3 components and target names.

Finally, this MR will also make us use this newly brewed Find module, and clean up any redundant definitions.

Please note that I intend to, once tried and tested, upstream this module for the benefit of the ECM community.

BUG: 419277

Test Plan

Build Krita with any OpenEXR version.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Amy spark

Merge request reports