2008-12-01 00:33:11 +08:00
|
|
|
# Locate OpenEXR
|
2008-11-26 20:35:49 +08:00
|
|
|
# This module defines
|
|
|
|
# OPENEXR_LIBRARY
|
2008-12-01 00:33:11 +08:00
|
|
|
# OPENEXR_FOUND, if false, do not try to link to OpenEXR
|
2008-11-26 20:35:49 +08:00
|
|
|
# OPENEXR_INCLUDE_DIR, where to find the headers
|
|
|
|
#
|
|
|
|
# $OPENEXR_DIR is an environment variable that would
|
|
|
|
# correspond to the ./configure --prefix=$OPENEXR_DIR
|
|
|
|
#
|
|
|
|
# Created by Robert Osfield.
|
|
|
|
|
2015-04-13 17:50:27 +08:00
|
|
|
|
2008-11-26 20:35:49 +08:00
|
|
|
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
|
|
|
|
$ENV{OPENEXR_DIR}/include
|
|
|
|
$ENV{OPENEXR_DIR}
|
|
|
|
~/Library/Frameworks
|
|
|
|
/Library/Frameworks
|
|
|
|
/usr/local/include
|
|
|
|
/usr/include
|
|
|
|
/sw/include # Fink
|
|
|
|
/opt/local/include # DarwinPorts
|
|
|
|
/opt/csw/include # Blastwave
|
|
|
|
/opt/include
|
|
|
|
/usr/freeware/include
|
|
|
|
)
|
|
|
|
|
2015-04-13 17:50:27 +08:00
|
|
|
# Macro to find exr libraries (deduplicating search paths)
|
2015-06-11 00:48:28 +08:00
|
|
|
# example: OPENEXR_FIND_VAR(OPENEXR_IlmImf_LIBRARY IlmImf)
|
2015-04-13 17:50:27 +08:00
|
|
|
MACRO(OPENEXR_FIND_VAR varname libname)
|
|
|
|
FIND_LIBRARY( ${varname}
|
|
|
|
NAMES ${libname}
|
|
|
|
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
|
|
|
|
)
|
|
|
|
ENDMACRO(OPENEXR_FIND_VAR)
|
2011-01-19 18:57:58 +08:00
|
|
|
|
2015-04-13 17:50:27 +08:00
|
|
|
# Macro to find exr libraries (and debug versions)
|
2015-06-11 00:48:28 +08:00
|
|
|
# example: OPENEXR_FIND(IlmImf)
|
2015-04-13 17:50:27 +08:00
|
|
|
MACRO(OPENEXR_FIND libname)
|
|
|
|
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY ${libname})
|
|
|
|
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY_DEBUG ${libname}d)
|
|
|
|
ENDMACRO(OPENEXR_FIND)
|
2011-01-19 18:57:58 +08:00
|
|
|
|
2015-06-11 00:48:28 +08:00
|
|
|
OPENEXR_FIND(IlmImf)
|
2015-04-13 17:50:27 +08:00
|
|
|
OPENEXR_FIND(IlmThread)
|
|
|
|
OPENEXR_FIND(Iex)
|
|
|
|
OPENEXR_FIND(Half)
|
2008-12-01 00:33:11 +08:00
|
|
|
|
2008-11-26 20:35:49 +08:00
|
|
|
SET(OPENEXR_FOUND "NO")
|
2015-06-11 00:48:28 +08:00
|
|
|
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
|
|
|
|
SET(OPENEXR_LIBRARIES ${OPENEXR_IlmImf_LIBRARY} ${OPENEXR_IlmThread_LIBRARY} ${OPENEXR_Half_LIBRARY} ${OPENEXR_Iex_LIBRARY} )
|
|
|
|
SET(OPENEXR_LIBRARIES_VARS OPENEXR_IlmImf_LIBRARY OPENEXR_IlmThread_LIBRARY OPENEXR_Half_LIBRARY OPENEXR_Iex_LIBRARY )
|
2008-11-26 20:35:49 +08:00
|
|
|
SET(OPENEXR_FOUND "YES")
|
2015-06-11 00:48:28 +08:00
|
|
|
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
|