3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
344 stars 30 forks source link

Add an explicit include for Imath #184

Closed jcelerier closed 1 year ago

jcelerier commented 1 year ago

In recent versions of OpenEXR, it seems that half.h has been moved to a separate package (imath) and separate include paths.

3Dickulus commented 1 year ago

Quote from OpenEXR.org

"With the release of OpenEXR 3, the Imath library formerly distributed via the IlmBase component of OpenEXR is now an independent library dependency"

A few things wrt this... (I know, May 2021, should have done this already)

Fragmentarium is developed with OpenEXR v2.n but it's good to hear that it compiles with v3 cmake uses find_package( OpenEXR ) to locate OpenEXR includes and libraries my dev box (Leap 15.4) comes with OpenEXR 2.2 the windows version (wine) compiles using static OpenEXR 2.4 Qt Creator can also use cmake

this will require some OpenEXR/Imath version testing to compile across all distros until FragM moves to OpenEXR v3

edit: FragM can also be compiled without OpenEXR support, I plan to make OpenEXR required instead of optional in the near future. (this may have been more appropriate as a review than a comment)

What OS/distro does this apply to?

3Dickulus commented 1 year ago

after some digging around I find this... https://github.com/AcademySoftwareFoundation/Imath/blob/main/docs/PortingGuide2-3.md#accommodating-openexrimath-3x-or-openexr-2x-1 as the preferred method for handling v2 > v3 transition

edit: this has already been implemented in the CMakeLists.txt file, DisplayWidget.h and FileManager.h . This accommodates both v2.x and v3.x OpenEXR includes and libraries. Can this be ported to Fragmentarium.pro ?

3Dickulus commented 1 year ago

Beginning to test with openexr v3.1.5 from https://github.com/AcademySoftwareFoundation/openexr ...

3Dickulus commented 1 year ago

half.h is referenced differently by different packages, some use #include <half.h> while others use #include <Imath/half.h> this is handled in the CMakeLists.txt file