[OpenImageIO] Add missing patch.
Richard Shaw
hobbes1069 at fedoraproject.org
Thu Jan 5 19:40:05 UTC 2012
commit 55e2849c8749029582dfcab2df207fad5b8f2d09
Author: Richard M. Shaw <hobbes1069 at gmail.com>
Date: Thu Jan 5 13:39:56 2012 -0600
Add missing patch.
OpenImageIO-0.10.3-use_external_tbb.patch | 74 +++++++++++++++++++++++++++++
OpenImageIO-0.10.3-use_system_tbb.patch | 25 ----------
2 files changed, 74 insertions(+), 25 deletions(-)
---
diff --git a/OpenImageIO-0.10.3-use_external_tbb.patch b/OpenImageIO-0.10.3-use_external_tbb.patch
new file mode 100644
index 0000000..ba243f5
--- /dev/null
+++ b/OpenImageIO-0.10.3-use_external_tbb.patch
@@ -0,0 +1,74 @@
+ src/cmake/externalpackages.cmake | 19 +++++++++++++++++++
+ src/include/CMakeLists.txt | 2 +-
+ src/libOpenImageIO/CMakeLists.txt | 11 ++++++++++-
+ 3 files changed, 30 insertions(+), 2 deletions(-)
+
+diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
+index ddea7e0..aa25df6 100644
+--- a/src/cmake/externalpackages.cmake
++++ b/src/cmake/externalpackages.cmake
+@@ -272,3 +272,22 @@ if (USE_EXTERNAL_PUGIXML)
+ endif()
+
+ ###########################################################################
++
++###########################################################################
++# TBB setup. Normally we just use the version bundled with oiio, but
++# some linux distros are quite particular about having separate packages so we
++# allow this to be overridden to use the distro-provided package if desired.
++#
++# Try to find it first and fall back to built-in if not available.
++find_package (TBB REQUIRED)
++if (TBB_FOUND)
++ set (USE_EXTERNAL_TBB TRUE CACHE BOOL
++ "Use system installed TBB library if avaialble."
++ )
++ mark_as_advanced (FORCE USE_EXTERNAL_TBB)
++ # insert include path to TBB first, to ensure that the external
++ # TBB is found, and not the one in OIIO's include directory.
++ include_directories (BEFORE ${TBB_INCLUDE_DIR})
++endif()
++
++###########################################################################
+diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt
+index 385f98e..4a2da55 100644
+--- a/src/include/CMakeLists.txt
++++ b/src/include/CMakeLists.txt
+@@ -23,7 +23,7 @@ list(APPEND public_headers ${CMAKE_BINARY_DIR}/include/version.h)
+ install (FILES ${public_headers} DESTINATION ${INCLUDE_INSTALL_DIR}
+ COMPONENT developer)
+
+-if (USE_TBB)
++if (USE_TBB AND NOT USE_EXTERNAL_TBB)
+ install (DIRECTORY tbb DESTINATION ${INCLUDE_INSTALL_DIR}
+ COMPONENT developer)
+ endif ()
+diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt
+index f4425f6..62da8dd 100644
+--- a/src/libOpenImageIO/CMakeLists.txt
++++ b/src/libOpenImageIO/CMakeLists.txt
+@@ -61,7 +61,12 @@ if (NOT USE_EXTERNAL_PUGIXML)
+ endif ()
+
+ # Include our own TBB if using it
+-if (USE_TBB)
++if (USE_TBB AND USE_EXTERNAL_TBB)
++ message (STATUS "System TBB library will be used.")
++ add_definitions ("-DUSE_TBB=1")
++ set (libOpenImageIO_srcs ${libOpenImageIO_srcs})
++elseif (USE_TBB AND NOT USE_EXTERNAL_TBB)
++ message (STATUS "Built-in TBB library will be used.")
+ add_definitions ("-DUSE_TBB=1")
+ set (libOpenImageIO_srcs ${libOpenImageIO_srcs} ../libutil/tbb_misc.cpp)
+ else ()
+@@ -221,6 +226,10 @@ if (USE_EXTERNAL_PUGIXML)
+ target_link_libraries (OpenImageIO ${PUGIXML_LIBRARIES})
+ endif ()
+
++if (USE_EXTERNAL_TBB)
++ target_link_libraries (OpenImageIO ${TBB_LIBRARIES})
++endif ()
++
+ message(STATUS "Setting SOVERSION to: ${SOVERSION}")
+ set_target_properties(OpenImageIO
+ PROPERTIES
More information about the scm-commits
mailing list