2010-07-09 13:00:26 +02:00
# The script is taken from http://code.google.com/p/nvidia-texture-tools/
2010-07-04 14:32:31 +02:00
#
# Try to find OpenEXR's libraries, and include path.
# Once done this will define:
#
# OPENEXR_FOUND = OpenEXR found.
# OPENEXR_INCLUDE_PATHS = OpenEXR include directories.
# OPENEXR_LIBRARIES = libraries that are needed to use OpenEXR.
#
2010-07-09 13:00:26 +02:00
SET ( OPENEXR_LIBRARIES )
2010-07-05 10:11:52 +02:00
SET ( LIBRARY_PATHS
/ u s r / l i b
/ u s r / l o c a l / l i b
/ s w / l i b
/ o p t / l o c a l / l i b
$ E N V { P R O G R A M _ F I L E S } / O p e n E X R / l i b / s t a t i c )
2010-07-04 14:32:31 +02:00
2010-07-05 10:11:52 +02:00
FIND_PATH ( OPENEXR_INCLUDE_PATH ImfRgbaFile.h
P A T H _ S U F F I X E S O p e n E X R
/ u s r / i n c l u d e
/ u s r / l o c a l / i n c l u d e
/ s w / i n c l u d e
/ o p t / l o c a l / i n c l u d e )
2010-07-04 14:32:31 +02:00
2010-07-05 10:11:52 +02:00
FIND_LIBRARY ( OPENEXR_HALF_LIBRARY
N A M E S H a l f
P A T H S $ { L I B R A R Y _ P A T H S } )
2010-07-04 14:32:31 +02:00
2010-07-05 10:11:52 +02:00
FIND_LIBRARY ( OPENEXR_IEX_LIBRARY
N A M E S I e x
P A T H S $ { L I B R A R Y _ P A T H S } )
2010-07-04 14:32:31 +02:00
2010-07-05 10:11:52 +02:00
FIND_LIBRARY ( OPENEXR_IMATH_LIBRARY
N A M E S I m a t h
P A T H S $ { L I B R A R Y _ P A T H S } )
2010-07-04 14:32:31 +02:00
2010-07-05 10:11:52 +02:00
FIND_LIBRARY ( OPENEXR_ILMIMF_LIBRARY
N A M E S I l m I m f
P A T H S $ { L I B R A R Y _ P A T H S } )
2010-07-04 14:32:31 +02:00
IF ( OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY )
2010-07-05 10:11:52 +02:00
SET ( OPENEXR_FOUND TRUE )
SET ( OPENEXR_INCLUDE_PATHS ${ OPENEXR_INCLUDE_PATH } CACHE STRING "The include paths needed to use OpenEXR" )
2011-04-26 17:46:15 +02:00
SET ( OPENEXR_LIBRARIES ${ OPENEXR_IMATH_LIBRARY } ${ OPENEXR_ILMIMF_LIBRARY } ${ OPENEXR_IEX_LIBRARY } ${ OPENEXR_HALF_LIBRARY } CACHE STRING "The libraries needed to use OpenEXR" )
2010-07-09 13:00:26 +02:00
ENDIF ( )
2010-07-04 14:32:31 +02:00
IF ( OPENEXR_FOUND )
2010-07-05 10:11:52 +02:00
IF ( NOT OPENEXR_FIND_QUIETLY )
MESSAGE ( STATUS "Found OpenEXR: ${OPENEXR_ILMIMF_LIBRARY}" )
2010-07-09 13:00:26 +02:00
ENDIF ( )
ELSE ( )
2010-07-05 10:11:52 +02:00
IF ( OPENEXR_FIND_REQUIRED )
MESSAGE ( FATAL_ERROR "Could not find OpenEXR library" )
2010-07-09 13:00:26 +02:00
ENDIF ( )
ENDIF ( )
2010-07-04 14:32:31 +02:00
MARK_AS_ADVANCED (
2010-07-05 10:11:52 +02:00
O P E N E X R _ I N C L U D E _ P A T H S
O P E N E X R _ I L M I M F _ L I B R A R Y
O P E N E X R _ I M A T H _ L I B R A R Y
O P E N E X R _ I E X _ L I B R A R Y
O P E N E X R _ H A L F _ L I B R A R Y )