diff --git a/CMakeModules/FindOpenEXR.cmake b/CMakeModules/FindOpenEXR.cmake index 50ef9ec58..5b73b1522 100644 --- a/CMakeModules/FindOpenEXR.cmake +++ b/CMakeModules/FindOpenEXR.cmake @@ -39,6 +39,39 @@ FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY /usr/freeware/lib64 ) +FIND_LIBRARY(OPENEXR_IlmThread_LIBRARY + NAMES IlmThread + PATHS + $ENV{OPENEXR_DIR}/lib + $ENV{OPENEXR_DIR} + ~/Library/Frameworks + /Library/Frameworks + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + + +FIND_LIBRARY(OPENEXR_Iex_LIBRARY + NAMES Iex + PATHS + $ENV{OPENEXR_DIR}/lib + $ENV{OPENEXR_DIR} + ~/Library/Frameworks + /Library/Frameworks + /usr/local/lib + /usr/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + FIND_LIBRARY(OPENEXR_Half_LIBRARY NAMES Half PATHS @@ -56,10 +89,12 @@ FIND_LIBRARY(OPENEXR_Half_LIBRARY ) SET(OPENEXR_FOUND "NO") -IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY) +IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY) SET(OPENEXR_LIBRARIES ${OPENEXR_IlmIlf_LIBRARY} + ${OPENEXR_IlmThread_LIBRARY} ${OPENEXR_Half_LIBRARY} + ${OPENEXR_Iex_LIBRARY} ) SET(OPENEXR_FOUND "YES") -ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY) +ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY) diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt index a35533062..50768cf76 100644 --- a/src/osgPlugins/CMakeLists.txt +++ b/src/osgPlugins/CMakeLists.txt @@ -84,7 +84,7 @@ ENDIF() IF(JASPER_FOUND) ADD_SUBDIRECTORY(jp2) ENDIF() -IF(OPENEXR_FOUND) +IF(OPENEXR_FOUND AND ZLIB_FOUND) ADD_SUBDIRECTORY(exr) ENDIF() IF(GIFLIB_FOUND) diff --git a/src/osgPlugins/exr/CMakeLists.txt b/src/osgPlugins/exr/CMakeLists.txt index c1adf7f03..8d6f83b50 100644 --- a/src/osgPlugins/exr/CMakeLists.txt +++ b/src/osgPlugins/exr/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${OPENEXR_INCLUDE_DIR}/OpenEXR ) SET(TARGET_SRC ReaderWriterEXR.cpp ) -SET(TARGET_EXTERNAL_LIBRARIES ${OPENEXR_LIBRARIES} ) +SET(TARGET_EXTERNAL_LIBRARIES ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARY} ) #### end var setup ### SETUP_PLUGIN(exr)