find_path(IMATH_INCLUDE NAMES imath.h HINTS ${IMATH_DIR} ENV IMATH_DIR)

find_library(IMATH_LIBRARY NAMES imath HINTS ${IMATH_DIR} ENV IMATH_DIR)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IMATH DEFAULT_MSG IMATH_INCLUDE IMATH_LIBRARY)
mark_as_advanced(IMATH_INCLUDE IMATH_LIBRARY)

set(IMATH_LIBRARIES ${IMATH_LIBRARY})
set(IMATH_INCLUDE_DIRS ${IMATH_INCLUDE})

add_library(IMATH::IMATH INTERFACE IMPORTED)
set_property(TARGET IMATH::IMATH PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${IMATH_INCLUDE_DIRS}")
set_property(TARGET IMATH::IMATH PROPERTY INTERFACE_LINK_LIBRARIES "${IMATH_LIBRARIES}")
