diff --git a/OpenCVFindOpenEXR.cmake b/OpenCVFindOpenEXR.cmake index 1e493f9f1..85016ae9f 100644 --- a/OpenCVFindOpenEXR.cmake +++ b/OpenCVFindOpenEXR.cmake @@ -1,4 +1,4 @@ -# The script is taken f +# The script is taken from http://code.google.com/p/nvidia-texture-tools/ # # Try to find OpenEXR's libraries, and include path. @@ -9,6 +9,8 @@ # OPENEXR_LIBRARIES = libraries that are needed to use OpenEXR. # +SET(OPENEXR_LIBRARIES) + SET(LIBRARY_PATHS /usr/lib /usr/local/lib @@ -39,31 +41,24 @@ FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY NAMES IlmImf PATHS ${LIBRARY_PATHS}) -FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY - NAMES IlmThread - PATHS ${LIBRARY_PATHS}) - -#MESSAGE(STATUS ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} zlib) - IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) SET(OPENEXR_FOUND TRUE) SET(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR") - SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} zlib CACHE STRING "The libraries needed to use OpenEXR") -ENDIF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) + SET(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} zlib CACHE STRING "The libraries needed to use OpenEXR") +ENDIF () IF(OPENEXR_FOUND) IF(NOT OPENEXR_FIND_QUIETLY) MESSAGE(STATUS "Found OpenEXR: ${OPENEXR_ILMIMF_LIBRARY}") - ENDIF(NOT OPENEXR_FIND_QUIETLY) -ELSE(OPENEXR_FOUND) + ENDIF() +ELSE() IF(OPENEXR_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find OpenEXR library") - ENDIF(OPENEXR_FIND_REQUIRED) -ENDIF(OPENEXR_FOUND) + ENDIF() +ENDIF() MARK_AS_ADVANCED( OPENEXR_INCLUDE_PATHS - OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_IMATH_LIBRARY OPENEXR_IEX_LIBRARY