1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 4e8f456492..9a3ae863ec 100644
5 @@ -649,15 +649,20 @@ set_package_properties(ZLIB PROPERTIES
6 PURPOSE "Optionally used by the G'Mic and the PSD plugins")
7 macro_bool_to_01(ZLIB_FOUND HAVE_ZLIB)
10 +find_package(OpenEXR 3.0 CONFIG QUIET)
11 +if(TARGET OpenEXR::OpenEXR)
12 + set(OPENEXR_LIBRARIES OpenEXR::OpenEXR)
14 + find_package(OpenEXR)
16 set_package_properties(OpenEXR PROPERTIES
17 DESCRIPTION "High dynamic-range (HDR) image file format"
18 URL "https://www.openexr.com"
20 PURPOSE "Required by the Krita OpenEXR filter")
21 -macro_bool_to_01(OPENEXR_FOUND HAVE_OPENEXR)
22 +macro_bool_to_01(OpenEXR_FOUND HAVE_OPENEXR)
26 include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
27 set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
28 add_definitions(${OPENEXR_DEFINITIONS})
29 diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt
30 index e9ff363df3..59e567fa04 100644
31 --- a/libs/image/CMakeLists.txt
32 +++ b/libs/image/CMakeLists.txt
33 @@ -367,7 +367,7 @@ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
39 target_link_libraries(kritaimage PUBLIC ${OPENEXR_LIBRARIES})
42 diff --git a/libs/pigment/CMakeLists.txt b/libs/pigment/CMakeLists.txt
43 index 3e8bcf9e25..d55fd8714f 100644
44 --- a/libs/pigment/CMakeLists.txt
45 +++ b/libs/pigment/CMakeLists.txt
46 @@ -14,7 +14,7 @@ include_directories(
48 set(FILE_OPENEXR_SOURCES)
52 include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
53 set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
54 add_definitions(${OPENEXR_DEFINITIONS})
55 diff --git a/plugins/color/lcms2engine/CMakeLists.txt b/plugins/color/lcms2engine/CMakeLists.txt
56 index 86b83710dc..801783c1f3 100644
57 --- a/plugins/color/lcms2engine/CMakeLists.txt
58 +++ b/plugins/color/lcms2engine/CMakeLists.txt
59 @@ -28,7 +28,7 @@ include_directories(
60 ${CMAKE_CURRENT_SOURCE_DIR}/colorprofiles
63 -if (HAVE_LCMS24 AND OPENEXR_FOUND)
64 +if (HAVE_LCMS24 AND OpenEXR_FOUND)
66 ${CMAKE_CURRENT_SOURCE_DIR}/colorspaces/gray_f16
67 ${CMAKE_CURRENT_SOURCE_DIR}/colorspaces/rgb_f16
68 @@ -38,7 +38,7 @@ endif ()
70 set(FILE_OPENEXR_SOURCES)
74 include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
75 set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
76 add_definitions(${OPENEXR_DEFINITIONS})
77 @@ -77,7 +77,7 @@ set ( lcmsengine_SRCS
81 -if (HAVE_LCMS24 AND OPENEXR_FOUND)
82 +if (HAVE_LCMS24 AND OpenEXR_FOUND)
85 colorspaces/gray_f16/GrayF16ColorSpace.cpp
86 diff --git a/plugins/color/lcms2engine/tests/CMakeLists.txt b/plugins/color/lcms2engine/tests/CMakeLists.txt
87 index ae69220698..8c5fe5d061 100644
88 --- a/plugins/color/lcms2engine/tests/CMakeLists.txt
89 +++ b/plugins/color/lcms2engine/tests/CMakeLists.txt
90 @@ -11,7 +11,7 @@ include_directories( ../colorspaces/cmyk_u16
96 include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
98 include_directories( ${LCMS2_INCLUDE_DIR} )
99 diff --git a/plugins/impex/CMakeLists.txt b/plugins/impex/CMakeLists.txt
100 index 63df1fd69a..c94674b381 100644
101 --- a/plugins/impex/CMakeLists.txt
102 +++ b/plugins/impex/CMakeLists.txt
103 @@ -19,7 +19,7 @@ if(PNG_FOUND)
104 add_subdirectory(csv)
109 add_subdirectory(exr)
112 diff --git a/plugins/impex/exr/exr_converter.cc b/plugins/impex/exr/exr_converter.cc
113 index f63ab73cd9..d620062594 100644
114 --- a/plugins/impex/exr/exr_converter.cc
115 +++ b/plugins/impex/exr/exr_converter.cc
118 #include <ImfAttribute.h>
119 #include <ImfChannelList.h>
120 +#include <ImfFrameBuffer.h>
121 +#include <ImfHeader.h>
122 #include <ImfInputFile.h>
123 #include <ImfOutputFile.h>
125 diff --git a/plugins/impex/raw/CMakeLists.txt b/plugins/impex/raw/CMakeLists.txt
126 index 71cb5b355c..f65bc770a5 100644
127 --- a/plugins/impex/raw/CMakeLists.txt
128 +++ b/plugins/impex/raw/CMakeLists.txt
130 add_subdirectory(tests)
134 include_directories(${OPENEXR_INCLUDE_DIRS})
136 include_directories(${LibRaw_INCLUDE_DIR})