From Simon Julier, "I ran across linking errors with osgdb_exr. Specifically, I found it was necessary to link against libImlIlf, libImlThread, libHalf, libIex and libzip.

I have attached a patch, against the trunk from 13:30 today, which consists of the following:

1. CMakeModules/FindOpenEXR.cmake: Look for libIlmThread and libIex as well. 2. src/osgPlugins/CMakeList.txt: Only include the exr subdirectory if both the OpenEXR and zip libraries were found. 3. src/osgPlugins/exr/CMakeLists.txt: Add ZIP_LIBRARY to TARGET_EXTERNAL_LIBRARIES."
This commit is contained in:
Robert Osfield 2011-01-19 10:57:58 +00:00
parent 6fb5387473
commit d21009c323
3 changed files with 39 additions and 4 deletions

View File

@ -39,6 +39,39 @@ FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
/usr/freeware/lib64 /usr/freeware/lib64
) )
FIND_LIBRARY(OPENEXR_IlmThread_LIBRARY
NAMES IlmThread
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
)
FIND_LIBRARY(OPENEXR_Iex_LIBRARY
NAMES Iex
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
)
FIND_LIBRARY(OPENEXR_Half_LIBRARY FIND_LIBRARY(OPENEXR_Half_LIBRARY
NAMES Half NAMES Half
PATHS PATHS
@ -56,10 +89,12 @@ FIND_LIBRARY(OPENEXR_Half_LIBRARY
) )
SET(OPENEXR_FOUND "NO") SET(OPENEXR_FOUND "NO")
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY) IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
SET(OPENEXR_LIBRARIES SET(OPENEXR_LIBRARIES
${OPENEXR_IlmIlf_LIBRARY} ${OPENEXR_IlmIlf_LIBRARY}
${OPENEXR_IlmThread_LIBRARY}
${OPENEXR_Half_LIBRARY} ${OPENEXR_Half_LIBRARY}
${OPENEXR_Iex_LIBRARY}
) )
SET(OPENEXR_FOUND "YES") SET(OPENEXR_FOUND "YES")
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_Half_LIBRARY) ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)

View File

@ -84,7 +84,7 @@ ENDIF()
IF(JASPER_FOUND) IF(JASPER_FOUND)
ADD_SUBDIRECTORY(jp2) ADD_SUBDIRECTORY(jp2)
ENDIF() ENDIF()
IF(OPENEXR_FOUND) IF(OPENEXR_FOUND AND ZLIB_FOUND)
ADD_SUBDIRECTORY(exr) ADD_SUBDIRECTORY(exr)
ENDIF() ENDIF()
IF(GIFLIB_FOUND) IF(GIFLIB_FOUND)

View File

@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${OPENEXR_INCLUDE_DIR}/OpenEXR )
SET(TARGET_SRC ReaderWriterEXR.cpp ) SET(TARGET_SRC ReaderWriterEXR.cpp )
SET(TARGET_EXTERNAL_LIBRARIES ${OPENEXR_LIBRARIES} ) SET(TARGET_EXTERNAL_LIBRARIES ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARY} )
#### end var setup ### #### end var setup ###
SETUP_PLUGIN(exr) SETUP_PLUGIN(exr)