1 diff --git a/CMakeModules/FindOpenEXR.cmake b/CMakeModules/FindOpenEXR.cmake
2 index 233be972b..d1b022881 100644
3 --- a/CMakeModules/FindOpenEXR.cmake
4 +++ b/CMakeModules/FindOpenEXR.cmake
5 @@ -51,11 +51,11 @@ MACRO(OPENEXR_FIND libname)
6 OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY_DEBUG ${libname}d)
10 +OPENEXR_FIND(OpenEXR)
12 SET(OPENEXR_FOUND "NO")
13 -IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY)
14 - SET(OPENEXR_LIBRARIES ${OPENEXR_IlmImf_LIBRARY} )
15 - SET(OPENEXR_LIBRARIES_VARS OPENEXR_IlmImf_LIBRARY )
16 +IF(OPENEXR_INCLUDE_DIR AND OPENEXR_OpenEXR_LIBRARY)
17 + SET(OPENEXR_LIBRARIES ${OPENEXR_OpenEXR_LIBRARY} )
18 + SET(OPENEXR_LIBRARIES_VARS OPENEXR_OpenEXR_LIBRARY )
19 SET(OPENEXR_FOUND "YES")
20 -ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY)
21 +ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_OpenEXR_LIBRARY)
22 diff --git a/CMakeModules/Findilmbase.cmake b/CMakeModules/Findilmbase.cmake
23 index 4b076c7c9..4610497fa 100644
24 --- a/CMakeModules/Findilmbase.cmake
25 +++ b/CMakeModules/Findilmbase.cmake
27 # Created by Robert Osfield.
30 -FIND_PATH(ILMBASE_INCLUDE_DIR OpenEXR/ImathVec.h
31 +FIND_PATH(ILMBASE_INCLUDE_DIR Imath/ImathVec.h
32 $ENV{ILMBASE_DIR}/include
35 @@ -28,7 +28,7 @@ FIND_PATH(ILMBASE_INCLUDE_DIR OpenEXR/ImathVec.h
36 # example: ILMBASE_FIND_VAR(OPENEXR_IlmThread_LIBRARY IlmThread)
37 MACRO(ILMBASE_FIND_VAR varname libname)
38 FIND_LIBRARY( ${varname}
39 - NAMES ${libname} ${libname}-2_1 ${libname}-2_2
40 + NAMES ${libname} ${libname}-2_1 ${libname}-2_2 ${libname}-3_0
44 @@ -53,11 +53,11 @@ ENDMACRO(ILMBASE_FIND)
46 ILMBASE_FIND(IlmThread)
51 SET(ILMBASE_FOUND "NO")
52 -IF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)
53 - SET(ILMBASE_LIBRARIES ${ILMBASE_IlmThread_LIBRARY} ${ILMBASE_Half_LIBRARY} ${ILMBASE_Iex_LIBRARY} )
54 - SET(ILMBASE_LIBRARIES_VARS ILMBASE_IlmThread_LIBRARY ILMBASE_Half_LIBRARY ILMBASE_Iex_LIBRARY )
55 +IF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Imath_LIBRARY)
56 + SET(ILMBASE_LIBRARIES ${ILMBASE_IlmThread_LIBRARY} ${ILMBASE_Imath_LIBRARY} ${ILMBASE_Iex_LIBRARY} )
57 + SET(ILMBASE_LIBRARIES_VARS ILMBASE_IlmThread_LIBRARY ILMBASE_Imath_LIBRARY ILMBASE_Iex_LIBRARY )
58 SET(ILMBASE_FOUND "YES")
59 -ENDIF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)
60 +ENDIF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Imath_LIBRARY)
61 diff --git a/src/osgPlugins/exr/CMakeLists.txt b/src/osgPlugins/exr/CMakeLists.txt
62 index 6191ed18f..9a368b2c2 100644
63 --- a/src/osgPlugins/exr/CMakeLists.txt
64 +++ b/src/osgPlugins/exr/CMakeLists.txt
66 -INCLUDE_DIRECTORIES( ${ILMBASE_INCLUDE_DIR}/OpenEXR )
67 +INCLUDE_DIRECTORIES( ${ILMBASE_INCLUDE_DIR}/Imath )
68 INCLUDE_DIRECTORIES( ${OPENEXR_INCLUDE_DIR}/OpenEXR )
70 SET(TARGET_SRC ReaderWriterEXR.cpp )
71 diff --git a/src/osgPlugins/exr/ReaderWriterEXR.cpp b/src/osgPlugins/exr/ReaderWriterEXR.cpp
72 index 7132e97f8..96c5507ef 100644
73 --- a/src/osgPlugins/exr/ReaderWriterEXR.cpp
74 +++ b/src/osgPlugins/exr/ReaderWriterEXR.cpp
76 #include <osgDB/FileNameUtils>
77 #include <osgDB/FileUtils>
79 +#include <ImfInt64.h>
80 #include <ImfRgbaFile.h>