[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50217] branches/soc-2011-tomato/ build_files/cmake/Modules/FindOpenColorIO.cmake: Color Management: CMake should detect yaml-cpp and tinyxml libraries automatically

Sergey Sharybin sergey.vfx at gmail.com
Sun Aug 26 13:34:33 CEST 2012


Revision: 50217
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50217
Author:   nazgul
Date:     2012-08-26 11:34:33 +0000 (Sun, 26 Aug 2012)
Log Message:
-----------
Color Management: CMake should detect yaml-cpp and tinyxml libraries automatically

This makes Blender compilable with CMake and OCIO libraries from SVN.

Modified Paths:
--------------
    branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake

Modified: branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake	2012-08-26 11:01:18 UTC (rev 50216)
+++ branches/soc-2011-tomato/build_files/cmake/Modules/FindOpenColorIO.cmake	2012-08-26 11:34:33 UTC (rev 50217)
@@ -27,6 +27,12 @@
   SET(OPENCOLORIO_ROOT_DIR $ENV{OPENCOLORIO_ROOT_DIR})
 ENDIF()
 
+SET(_opencolorio_FIND_COMPONENTS
+  OpenColorIO
+  yaml-cpp
+  tinyxml
+)
+
 SET(_opencolorio_SEARCH_DIRS
   ${OPENCOLORIO_ROOT_DIR}
   /usr/local
@@ -44,15 +50,21 @@
     include
 )
 
-FIND_LIBRARY(OPENCOLORIO_LIBRARY
-  NAMES
-    OCIO OpenColorIO
-  HINTS
-    ${_opencolorio_SEARCH_DIRS}
-  PATH_SUFFIXES
-    lib64 lib
-  )
+SET(_opencolorio_LIBRARIES)
+FOREACH(COMPONENT ${_opencolorio_FIND_COMPONENTS})
+  STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
 
+  FIND_LIBRARY(OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY
+    NAMES
+      ${COMPONENT}
+    HINTS
+      ${_opencolorio_SEARCH_DIRS}
+    PATH_SUFFIXES
+      lib64 lib
+    )
+  LIST(APPEND _opencolorio_LIBRARIES "${OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY}")
+ENDFOREACH()
+
 # handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if 
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
@@ -60,7 +72,7 @@
     OPENCOLORIO_LIBRARY OPENCOLORIO_INCLUDE_DIR)
 
 IF(OPENCOLORIO_FOUND)
-  SET(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARY})
+  SET(OPENCOLORIO_LIBRARIES ${_opencolorio_LIBRARIES})
   SET(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO_INCLUDE_DIR})
 ENDIF(OPENCOLORIO_FOUND)
 




More information about the Bf-blender-cvs mailing list