Permalink
Browse files

From Simon Julier, "I ran across linking errors with osgdb_exr. Speci…

…fically, 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."
  • Loading branch information...
1 parent c1e85bc commit 6f204e57b1ba437493673a8738d4ee0654814e97 @osg-training-guest osg-training-guest committed Jan 19, 2011
Showing with 39 additions and 4 deletions.
  1. +37 −2 CMakeModules/FindOpenEXR.cmake
  2. +1 −1 src/osgPlugins/CMakeLists.txt
  3. +1 −1 src/osgPlugins/exr/CMakeLists.txt
@@ -39,6 +39,39 @@ FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
/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
NAMES Half
PATHS
@@ -56,10 +89,12 @@ FIND_LIBRARY(OPENEXR_Half_LIBRARY
)
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
${OPENEXR_IlmIlf_LIBRARY}
+ ${OPENEXR_IlmThread_LIBRARY}
${OPENEXR_Half_LIBRARY}
+ ${OPENEXR_Iex_LIBRARY}
)
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)
@@ -84,7 +84,7 @@ ENDIF()
IF(JASPER_FOUND)
ADD_SUBDIRECTORY(jp2)
ENDIF()
-IF(OPENEXR_FOUND)
+IF(OPENEXR_FOUND AND ZLIB_FOUND)
ADD_SUBDIRECTORY(exr)
ENDIF()
IF(GIFLIB_FOUND)
@@ -2,7 +2,7 @@ INCLUDE_DIRECTORIES( ${OPENEXR_INCLUDE_DIR}/OpenEXR )
SET(TARGET_SRC ReaderWriterEXR.cpp )
-SET(TARGET_EXTERNAL_LIBRARIES ${OPENEXR_LIBRARIES} )
+SET(TARGET_EXTERNAL_LIBRARIES ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARY} )
#### end var setup ###
SETUP_PLUGIN(exr)

0 comments on commit 6f204e5

Please sign in to comment.