Fix for building Blender with OSL, and no OpenEXR headers in standard paths (like /usr/include/OpenEXR).

As OSL headers mix #include <OpenEXR/foo.h> and #include <foo.h>, we need both /path/to/openexr/include and /path/to/openexr/include/OpenEXR include paths... :/

Issue investigated by doug65536 on IRC, thanks.
This commit is contained in:
Bastien Montagne 2013-06-16 18:59:50 +00:00
parent 8683006143
commit 8e5cd99e0b

@ -52,11 +52,11 @@ SET(_openexr_SEARCH_DIRS
FIND_PATH(OPENEXR_INCLUDE_DIR FIND_PATH(OPENEXR_INCLUDE_DIR
NAMES NAMES
ImfXdr.h OpenEXR/ImfXdr.h
HINTS HINTS
${_openexr_SEARCH_DIRS} ${_openexr_SEARCH_DIRS}
PATH_SUFFIXES PATH_SUFFIXES
include/OpenEXR include
) )
SET(_openexr_LIBRARIES) SET(_openexr_LIBRARIES)
@ -82,7 +82,8 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR DEFAULT_MSG
IF(OPENEXR_FOUND) IF(OPENEXR_FOUND)
SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES}) SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES})
SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR}) # Both include paths are needed because of dummy OSL headers mixing #include <OpenEXR/foo.h> and #include <foo.h> :(
SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}/OpenEXR)
ENDIF() ENDIF()
MARK_AS_ADVANCED(OPENEXR_INCLUDE_DIR) MARK_AS_ADVANCED(OPENEXR_INCLUDE_DIR)