fix to FindOpenEXR pointed out by Sergey Sharybin,
authorCampbell Barton <ideasman42@gmail.com>
Thu, 16 Jun 2011 02:48:07 +0000 (02:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 16 Jun 2011 02:48:07 +0000 (02:48 +0000)
also added check for IlmThread and marked individual library cache variables as advanced.

build_files/cmake/Modules/FindOpenEXR.cmake

index 8ddd3ca344d514d4a3896252de557308d9261a32..a445a90669696babfb9098c5dfd1f63587c78ec5 100644 (file)
@@ -7,6 +7,14 @@
 #  OPENEXR_ROOT_DIR, The base directory to search for OpenEXR.
 #                    This can also be an environment variable.
 #  OPENEXR_FOUND, If false, do not try to use OpenEXR.
+#
+# For indervidual library access these advanced settings are available
+#  OPENEXR_HALF_LIBRARY, Path to Half library
+#  OPENEXR_IEX_LIBRARY, Path to Half library
+#  OPENEXR_ILMIMF_LIBRARY, Path to Ilmimf library
+#  OPENEXR_ILMTHREAD_LIBRARY, Path to IlmThread library
+#  OPENEXR_IMATH_LIBRARY, Path to Imath library
+#
 # also defined, but not for general use are
 #  OPENEXR_LIBRARY, where to find the OpenEXR library.
 
@@ -30,8 +38,9 @@ ENDIF()
 
 SET(_openexr_FIND_COMPONENTS
   Half
-  IlmImf
   Iex
+  IlmImf
+  IlmThread
   Imath
 )
 
@@ -63,14 +72,15 @@ ENDFOREACH()
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR  DEFAULT_MSG
-    ${_openexr_LIBRARIES} OPENEXR_INCLUDE_DIR)
+    _openexr_LIBRARIES OPENEXR_INCLUDE_DIR)
 
 IF(OPENEXR_FOUND)
   SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES})
   SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR})
 ENDIF(OPENEXR_FOUND)
 
-MARK_AS_ADVANCED(
-  ${_openexr_LIBRARIES}
-  OPENEXR_INCLUDE_DIR
-)
+MARK_AS_ADVANCED(OPENEXR_INCLUDE_DIR)
+FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
+  STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+  MARK_AS_ADVANCED(OPENEXR_${UPPERCOMPONENT}_LIBRARY)
+ENDFOREACH()