OpenImageIO/OpenImageIO-1.1.2-use_external_tbb.patch
Richard M. Shaw 2f57d9fa8c - Update to latest upstream release.
- Separate utilities and library packages.
2013-01-14 13:05:42 -06:00

69 lines
2.9 KiB
Diff

diff -Naur oiio-Release-1.1.2.orig/src/CMakeLists.txt oiio-Release-1.1.2/src/CMakeLists.txt
--- oiio-Release-1.1.2.orig/src/CMakeLists.txt 2012-12-05 12:46:56.000000000 -0600
+++ oiio-Release-1.1.2/src/CMakeLists.txt 2013-01-02 15:52:43.941560982 -0600
@@ -83,6 +83,8 @@
set (PYTHON_VERSION 2.6)
set (USE_EXTERNAL_PUGIXML OFF CACHE BOOL
"Use an externally built shared library version of the pugixml library")
+set (USE_EXTERNAL_TBB OFF CACHE BOOL
+ "Use system TBB library instead of bundled.")
set (SOVERSION ${OIIO_VERSION_MAJOR}.${OIIO_VERSION_MINOR}
CACHE STRING "Set the SO version in the SO name of the output library")
diff -Naur oiio-Release-1.1.2.orig/src/include/CMakeLists.txt oiio-Release-1.1.2/src/include/CMakeLists.txt
--- oiio-Release-1.1.2.orig/src/include/CMakeLists.txt 2012-12-05 12:46:56.000000000 -0600
+++ oiio-Release-1.1.2/src/include/CMakeLists.txt 2013-01-02 15:52:43.940561015 -0600
@@ -22,7 +22,7 @@
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 -Naur oiio-Release-1.1.2.orig/src/libOpenImageIO/CMakeLists.txt oiio-Release-1.1.2/src/libOpenImageIO/CMakeLists.txt
--- oiio-Release-1.1.2.orig/src/libOpenImageIO/CMakeLists.txt 2012-12-05 12:46:56.000000000 -0600
+++ oiio-Release-1.1.2/src/libOpenImageIO/CMakeLists.txt 2013-01-02 15:52:43.941560982 -0600
@@ -62,7 +62,13 @@
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.")
+ find_package (TBB REQUIRED)
+ include_directories (${TBB_INCLUDE_DIRS})
+ set (libOpenImageIO_srcs ${libOpenImageIO_srcs})
+elseif (USE_TBB AND NOT USE_EXTERNAL_TBB)
+ message (STATUS "Built-in TBB library will be used.")
set (libOpenImageIO_srcs ${libOpenImageIO_srcs} ../libutil/tbb_misc.cpp)
endif ()
@@ -202,7 +208,11 @@
${VISIBILITY_COMMAND} ${VISIBILITY_MAP_COMMAND}
${Boost_LIBRARIES})
-
+# Link against system TBB library if specified
+if (USE_TBB AND USE_EXTERNAL_TBB)
+ message (STATUS "Linking TBB: ${TBB_LIBRARIES}")
+ target_link_libraries (OpenImageIO ${TBB_LIBRARIES})
+endif ()
# Include OpenColorIO if using it
if (USE_OCIO AND OCIO_FOUND)
diff -Naur oiio-Release-1.1.2.orig/src/libutil/tbb_misc.cpp oiio-Release-1.1.2/src/libutil/tbb_misc.cpp
--- oiio-Release-1.1.2.orig/src/libutil/tbb_misc.cpp 2012-12-05 12:46:56.000000000 -0600
+++ oiio-Release-1.1.2/src/libutil/tbb_misc.cpp 2013-01-02 15:53:10.403678615 -0600
@@ -30,8 +30,7 @@
// an executing program.
#include "tbb/tbb_stddef.h"
-// Out-of-line TBB assertion handling routines are instantiated here.
-#include "tbb/tbb_assert_impl.h"
+#include "tbb/tbb_machine.h"
#include "tbb/tbb_misc.h"
#include <cstdio>