Initial import (#720411).

This commit is contained in:
Richard M. Shaw 2011-07-27 20:39:14 -05:00
parent 7fb76c6331
commit 7a63317dbd
6 changed files with 640 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/OpenImageIO-oiio-Release-0.10.0-12-g8055b0f.tar.gz

View File

@ -0,0 +1,119 @@
diff --git a/src/include/thread.h b/src/include/thread.h
index 2303c3e..039a98d 100644
--- a/src/include/thread.h
+++ b/src/include/thread.h
@@ -87,9 +87,15 @@
# include <tbb/spin_mutex.h>
#endif
-#ifdef _WIN32
+#if defined(_WIN32) && !USE_TBB
# include <windows.h>
# include <winbase.h>
+# pragma intrinsic (_InterlockedExchangeAdd)
+# pragma intrinsic (_InterlockedCompareExchange)
+# pragma intrinsic (_InterlockedCompareExchange64)
+# if defined(_WIN64)
+# pragma intrinsic(_InterlockedExchangeAdd64)
+# endif
#endif
#ifdef __APPLE__
@@ -250,7 +256,7 @@ private:
inline int
atomic_exchange_and_add (volatile int *at, int x)
{
-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+#if defined(__GNUC__) && (defined(_GLIBCXX_ATOMIC_BUILTINS) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 401))
return __sync_fetch_and_add ((int *)at, x);
#elif USE_TBB
atomic<int> *a = (atomic<int> *)at;
@@ -260,9 +266,9 @@ atomic_exchange_and_add (volatile int *at, int x)
return OSAtomicAdd32Barrier (x, at) - x;
#elif defined(_WIN32)
// Windows
- return InterlockedExchangeAdd ((volatile LONG *)at, x);
+ return _InterlockedExchangeAdd ((volatile LONG *)at, x);
#else
- error ("No atomics on this platform.")
+# error No atomics on this platform.
#endif
}
@@ -271,7 +277,7 @@ atomic_exchange_and_add (volatile int *at, int x)
inline long long
atomic_exchange_and_add (volatile long long *at, long long x)
{
-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+#if defined(__GNUC__) && (defined(_GLIBCXX_ATOMIC_BUILTINS) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 401))
return __sync_fetch_and_add (at, x);
#elif USE_TBB
atomic<long long> *a = (atomic<long long> *)at;
@@ -281,9 +287,13 @@ atomic_exchange_and_add (volatile long long *at, long long x)
return OSAtomicAdd64Barrier (x, at) - x;
#elif defined(_WIN32)
// Windows
+# if defined(_WIN64)
+ return _InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
+# else
return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
+# endif
#else
- error ("No atomics on this platform.")
+# error No atomics on this platform.
#endif
}
@@ -298,7 +308,7 @@ atomic_exchange_and_add (volatile long long *at, long long x)
inline bool
atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
{
-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+#if defined(__GNUC__) && (defined(_GLIBCXX_ATOMIC_BUILTINS) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 401))
return __sync_bool_compare_and_swap (at, compareval, newval);
#elif USE_TBB
atomic<int> *a = (atomic<int> *)at;
@@ -306,9 +316,9 @@ atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
#elif defined(__APPLE__)
return OSAtomicCompareAndSwap32Barrier (compareval, newval, at);
#elif defined(_WIN32)
- return (InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval);
+ return (_InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval);
#else
- error ("No atomics on this platform.")
+# error No atomics on this platform.
#endif
}
@@ -317,7 +327,7 @@ atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
inline bool
atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
{
-#if defined(__GNUC__) && defined(_GLIBCXX_ATOMIC_BUILTINS)
+#if defined(__GNUC__) && (defined(_GLIBCXX_ATOMIC_BUILTINS) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 401))
return __sync_bool_compare_and_swap (at, compareval, newval);
#elif USE_TBB
atomic<long long> *a = (atomic<long long> *)at;
@@ -325,9 +335,9 @@ atomic_compare_and_exchange (volatile long long *at, long long compareval, long
#elif defined(__APPLE__)
return OSAtomicCompareAndSwap64Barrier (compareval, newval, at);
#elif defined(_WIN32)
- return (InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
+ return (_InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
#else
- error ("No atomics on this platform.")
+# error No atomics on this platform.
#endif
}
diff --git a/src/maketx/CMakeLists.txt b/src/maketx/CMakeLists.txt
index c465960..5c408d8 100644
--- a/src/maketx/CMakeLists.txt
+++ b/src/maketx/CMakeLists.txt
@@ -1,3 +1,6 @@
+if (NOT USE_TBB)
+ add_definitions ("-DUSE_TBB=0")
+endif ()
set (maketx_srcs maketx.cpp)
add_executable (maketx ${maketx_srcs})
link_ilmbase (maketx)

View File

@ -0,0 +1,380 @@
diff -Naur OpenImageIO-0.10.0.orig/Makefile OpenImageIO-0.10.0/Makefile
--- OpenImageIO-0.10.0.orig/Makefile 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/Makefile 2011-07-11 08:44:00.005399646 -0500
@@ -27,7 +27,7 @@
endif
MY_MAKE_FLAGS ?=
-MY_CMAKE_FLAGS ?=
+MY_CMAKE_FLAGS ?= -DSELF_CONTAINED_INSTALL_TREE:BOOL=TRUE
# Site-specific build instructions
ifndef OPENIMAGEIO_SITE
diff -Naur OpenImageIO-0.10.0.orig/src/cmake/externalpackages.cmake OpenImageIO-0.10.0/src/cmake/externalpackages.cmake
--- OpenImageIO-0.10.0.orig/src/cmake/externalpackages.cmake 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/cmake/externalpackages.cmake 2011-07-11 08:44:00.007399556 -0500
@@ -237,3 +237,15 @@
# end Field3d setup
###########################################################################
+###########################################################################
+# Pugixml 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.
+if (USE_EXTERNAL_PUGIXML)
+ find_package (PugiXML REQUIRED)
+ # insert include path to pugixml first, to ensure that the external
+ # pugixml is found, and not the one in OIIO's include directory.
+ include_directories (BEFORE ${PUGIXML_INCLUDE_DIR})
+endif()
+
+###########################################################################
diff -Naur OpenImageIO-0.10.0.orig/src/cmake/modules/FindPugiXML.cmake OpenImageIO-0.10.0/src/cmake/modules/FindPugiXML.cmake
--- OpenImageIO-0.10.0.orig/src/cmake/modules/FindPugiXML.cmake 1969-12-31 18:00:00.000000000 -0600
+++ OpenImageIO-0.10.0/src/cmake/modules/FindPugiXML.cmake 2011-07-11 08:44:00.008399511 -0500
@@ -0,0 +1,21 @@
+# Find the pugixml XML parsing library.
+#
+# Sets the usual variables expected for find_package scripts:
+#
+# PUGIXML_INCLUDE_DIR - header location
+# PUGIXML_LIBRARIES - library to link against
+# PUGIXML_FOUND - true if pugixml was found.
+
+find_path (PUGIXML_INCLUDE_DIR pugixml.hpp)
+find_library (PUGIXML_LIBRARY NAMES pugixml)
+
+# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
+include (FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (PugiXML DEFAULT_MSG PUGIXML_LIBRARY
+ PUGIXML_INCLUDE_DIR)
+
+if (PUGIXML_FOUND)
+ set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
+endif()
+
+mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
diff -Naur OpenImageIO-0.10.0.orig/src/cmake/oiio_macros.cmake OpenImageIO-0.10.0/src/cmake/oiio_macros.cmake
--- OpenImageIO-0.10.0.orig/src/cmake/oiio_macros.cmake 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/cmake/oiio_macros.cmake 2011-07-11 08:44:00.008399511 -0500
@@ -7,9 +7,9 @@
#
macro (oiio_install_targets)
install (TARGETS ${ARGN}
- RUNTIME DESTINATION "${BINDIR}" COMPONENT user
- LIBRARY DESTINATION "${LIBDIR}" COMPONENT user
- ARCHIVE DESTINATION "${LIBDIR}" COMPONENT developer)
+ RUNTIME DESTINATION "${BIN_INSTALL_DIR}" COMPONENT user
+ LIBRARY DESTINATION "${LIB_INSTALL_DIR}" COMPONENT user
+ ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT developer)
endmacro ()
# Macro to add a build target for an IO plugin.
diff -Naur OpenImageIO-0.10.0.orig/src/CMakeLists.txt OpenImageIO-0.10.0/src/CMakeLists.txt
--- OpenImageIO-0.10.0.orig/src/CMakeLists.txt 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/CMakeLists.txt 2011-07-11 08:44:00.006399604 -0500
@@ -29,13 +29,11 @@
set (USE_JASPER ON CACHE BOOL "Use Jasper for JPEG-2000 if found")
set (NOTHREADS OFF CACHE BOOL "Compile with no threads or locking")
set (PYTHON_VERSION 2.6)
+set (USE_EXTERNAL_PUGIXML OFF CACHE BOOL
+ "Use an externally built shared library version of the pugixml library")
-if (NOT SOVERSION)
- set (SOVERSION ${OIIO_VERSION_MAJOR} CACHE STRING "Set the SO version in the SO name of the output library")
-endif ()
-if (NOT ${SOVERSION} STREQUAL ${OIIO_VERSION_MAJOR})
- set (OIIO_VERSION_MAJOR ${SOVERSION})
-endif ()
+set (SOVERSION ${OIIO_VERSION_MAJOR}.${OIIO_VERSION_MINOR}
+ CACHE STRING "Set the SO version in the SO name of the output library")
if (NOTHREADS)
message (STATUS "NO THREADS!")
@@ -89,19 +87,61 @@
add_definitions ("-DDEBUG=1")
endif ()
-# Exec Install Locations
-set (BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
-set (LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
-set (PYLIBDIR "${CMAKE_INSTALL_PREFIX}/python")
-if (EXEC_INSTALL_PREFIX)
- set (BINDIR "${EXEC_INSTALL_PREFIX}/bin")
- set (LIBDIR "${EXEC_INSTALL_PREFIX}/lib")
- set (PYLIBDIR "${EXEC_INSTALL_PREFIX}/python")
+###########################################################################
+# Paths for install tree customization. Note that relative paths are relative
+# to CMAKE_INSTALL_PREFIX.
+set (DEFAULT_BIN_INSTALL_DIR "bin")
+set (DEFAULT_LIB_INSTALL_DIR "lib")
+set (DEFAULT_INCLUDE_INSTALL_DIR "include/OpenImageIO")
+if (UNIX AND NOT SELF_CONTAINED_INSTALL_TREE)
+ # Try to be well-behaved and install into reasonable places according to
+ # the "standard" unix directory heirarchy
+ # TODO: Figure out how to get the correct python directory
+ set (DEFAULT_PYLIB_INSTALL_DIR "lib/python/site-packages")
+ set (DEFAULT_DOC_INSTALL_DIR "share/doc/openimageio")
+ set (DEFAULT_MAN_INSTALL_DIR "share/man/man1")
+else ()
+ # Here is the "self-contained install tree" case: the expectation here is
+ # that everything OIIO related will go into its own directory, not into
+ # some standard system heirarchy.
+ set (DEFAULT_PYLIB_INSTALL_DIR "python")
+ set (DEFAULT_DOC_INSTALL_DIR "doc")
+ set (DEFAULT_MAN_INSTALL_DIR "doc/man")
endif ()
+if (EXEC_INSTALL_PREFIX)
+ # Tack on an extra prefix to support multi-arch builds.
+ set (DEFAULT_BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/${DEFAULT_BIN_INSTALL_DIR}")
+ set (DEFAULT_LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/${DEFAULT_LIB_INSTALL_DIR}")
+ set (DEFAULT_PYLIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/${DEFAULT_PYLIB_INSTALL_DIR}")
+endif ()
+# Set up cmake cache variables corresponding to the defaults deduced above, so
+# that the user can override them as desired:
+set (BIN_INSTALL_DIR ${DEFAULT_BIN_INSTALL_DIR} CACHE STRING
+ "Install location for binaries (relative to CMAKE_INSTALL_PREFIX or absolute)")
+set (LIB_INSTALL_DIR ${DEFAULT_LIB_INSTALL_DIR} CACHE STRING
+ "Install location for libraries (relative to CMAKE_INSTALL_PREFIX or absolute)")
+set (PYLIB_INSTALL_DIR ${DEFAULT_PYLIB_INSTALL_DIR} CACHE STRING
+ "Install location for python libraries (relative to CMAKE_INSTALL_PREFIX or absolute)")
+set (INCLUDE_INSTALL_DIR ${DEFAULT_INCLUDE_INSTALL_DIR} CACHE STRING
+ "Install location of header files (relative to CMAKE_INSTALL_PREFIX or absolute)")
+set (DOC_INSTALL_DIR ${DEFAULT_DOC_INSTALL_DIR} CACHE STRING
+ "Install location for documentation (relative to CMAKE_INSTALL_PREFIX or absolute)")
+if (UNIX)
+ set (MAN_INSTALL_DIR ${DEFAULT_MAN_INSTALL_DIR} CACHE STRING
+ "Install location for manual pages (relative to CMAKE_INSTALL_PREFIX or absolute)")
+endif()
+
+set (INSTALL_DOCS ON CACHE BOOL "Install documentation")
+
-set (CMAKE_INSTALL_RPATH "${LIBDIR}")
+#####
+set (CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
+if (NOT IS_ABSOLUTE ${CMAKE_INSTALL_RPATH})
+ set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
+endif ()
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
###########################################################################
if (MSVC)
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
diff -Naur OpenImageIO-0.10.0.orig/src/doc/CMakeLists.txt OpenImageIO-0.10.0/src/doc/CMakeLists.txt
--- OpenImageIO-0.10.0.orig/src/doc/CMakeLists.txt 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/doc/CMakeLists.txt 2011-07-11 08:44:00.009399468 -0500
@@ -1,11 +1,39 @@
-set (public_docs openimageio.pdf CLA-INDIVIDUAL CLA-CORPORATE)
+project(documentation)
-install (FILES ${public_docs} DESTINATION doc COMPONENT documentation)
+set (public_docs
+ openimageio.pdf
+ ${OpenImageIO_SOURCE_DIR}/../LICENSE
+ ${OpenImageIO_SOURCE_DIR}/../CHANGES
+)
-install (FILES ${PROJECT_SOURCE_DIR}/../LICENSE
- ${PROJECT_SOURCE_DIR}/../INSTALL
- ${PROJECT_SOURCE_DIR}/../CHANGES
- DESTINATION .)
+if (INSTALL_DOCS)
+ install (FILES ${public_docs} DESTINATION ${DOC_INSTALL_DIR}
+ COMPONENT documentation)
+endif ()
-install (DIRECTORY doxygen/html DESTINATION doc
- PATTERN .svn EXCLUDE)
+# generate man pages using txt2man and a tiny python script to munge the
+# result of "$tool --help"
+find_program(TXT2MAN txt2man)
+find_package(PythonInterp)
+if (UNIX AND TXT2MAN AND PYTHONINTERP_FOUND)
+ message (STATUS "Unix man page documentation will be generated")
+ set (cli_tools iinfo maketx idiff iv igrep iprocess iconvert)
+
+ foreach (tool ${cli_tools})
+ set (outfile "${documentation_BINARY_DIR}/${tool}.1")
+ list (APPEND manpage_files ${outfile})
+ add_custom_command (OUTPUT ${outfile}
+ COMMAND ${tool} --help |
+ ${PYTHON_EXECUTABLE} ${documentation_SOURCE_DIR}/help2man_preformat.py |
+ ${TXT2MAN} -v OpenImageIO -s 1 -t ${tool} > ${outfile}
+ DEPENDS ${tool} help2man_preformat.py)
+ endforeach()
+
+ # force man page build before install
+ add_custom_target (man_pages ALL DEPENDS ${manpage_files})
+
+ if (INSTALL_DOCS)
+ install (FILES ${manpage_files}
+ DESTINATION ${MAN_INSTALL_DIR} COMPONENT documentation)
+ endif ()
+endif()
diff -Naur OpenImageIO-0.10.0.orig/src/doc/help2man_preformat.py OpenImageIO-0.10.0/src/doc/help2man_preformat.py
--- OpenImageIO-0.10.0.orig/src/doc/help2man_preformat.py 1969-12-31 18:00:00.000000000 -0600
+++ OpenImageIO-0.10.0/src/doc/help2man_preformat.py 2011-07-11 08:44:00.009399468 -0500
@@ -0,0 +1,35 @@
+#!/usr/bin/python
+
+from __future__ import print_function
+import sys
+
+lines = [l.rstrip().replace('\t', ' '*8) for l in sys.stdin.readlines()]
+
+print('TITLE')
+print(lines[0])
+print()
+
+print('SYNOPSIS')
+for i,line in enumerate(lines[2:]):
+ if line.lstrip().startswith('-'):
+ optStart = i+2
+ break
+ print(line)
+
+print('''DESCRIPTION
+This program is part of the OpenImageIO (http://www.openimageio.org) tool suite.
+Detailed documentation is avaliable in pdf format with the OpenImageIO
+distribution.
+''')
+
+print('OPTIONS')
+for line in lines[optStart:]:
+ if not line.startswith(' '):
+ print()
+ print(line)
+ elif not line.lstrip().startswith('-'):
+ print(line.lstrip())
+ else:
+ print(line)
+print()
+
diff -Naur OpenImageIO-0.10.0.orig/src/include/CMakeLists.txt OpenImageIO-0.10.0/src/include/CMakeLists.txt
--- OpenImageIO-0.10.0.orig/src/include/CMakeLists.txt 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/include/CMakeLists.txt 2011-07-11 09:02:18.495191097 -0500
@@ -4,22 +4,26 @@
imagecache.h imageio.h osdep.h paramlist.h
refcnt.h strutil.h sysutil.h texture.h thread.h timer.h
typedesc.h ustring.h varyingref.h
- colortransfer.h pugixml.hpp pugiconfig.hpp
+ colortransfer.h
)
+if (NOT USE_EXTERNAL_PUGIXML)
+ list (APPEND public_headers pugixml.hpp pugiconfig.hpp)
+endif ()
+
message(STATUS "Create version.h from version.h.in")
+# Mangle the SOVERSION so that it's a valid C++ identifier for the versioning
+# namespace defined in version.h
+string (REGEX REPLACE "\\." "_" MANGLED_SOVERSION ${SOVERSION})
+set (OIIO_VERSION_NS "v${MANGLED_SOVERSION}")
configure_file(version.h.in ${CMAKE_BINARY_DIR}/include/version.h @ONLY)
list(APPEND public_headers ${CMAKE_BINARY_DIR}/include/version.h)
-install (FILES ${public_headers} DESTINATION include/OpenImageIO
+install (FILES ${public_headers} DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT developer)
if (USE_TBB)
- file (GLOB tbb_headers tbb/*.h)
- file (GLOB tbb_headers2 tbb/machine/*.h)
- install (FILES ${tbb_headers} DESTINATION include/OpenImageIO/tbb
- COMPONENT developer)
- install (FILES ${tbb_headers2} DESTINATION include/OpenImageIO/tbb/machine
+ install (DIRECTORY tbb DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT developer)
endif ()
diff -Naur OpenImageIO-0.10.0.orig/src/include/version.h.in OpenImageIO-0.10.0/src/include/version.h.in
--- OpenImageIO-0.10.0.orig/src/include/version.h.in 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/include/version.h.in 2011-07-11 08:44:00.010399428 -0500
@@ -39,7 +39,7 @@
#define OIIO_VERSION_MAJOR @OIIO_VERSION_MAJOR@
#define OIIO_VERSION_MINOR @OIIO_VERSION_MINOR@
#define OIIO_VERSION_PATCH @OIIO_VERSION_PATCH@
-#define OIIO_VERSION_NS v@SOVERSION@
+#define OIIO_VERSION_NS @OIIO_VERSION_NS@
#define OIIO_VERSION (10000 * OIIO_VERSION_MAJOR + \
100 * OIIO_VERSION_MINOR + \
diff -Naur OpenImageIO-0.10.0.orig/src/libOpenImageIO/CMakeLists.txt OpenImageIO-0.10.0/src/libOpenImageIO/CMakeLists.txt
--- OpenImageIO-0.10.0.orig/src/libOpenImageIO/CMakeLists.txt 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/libOpenImageIO/CMakeLists.txt 2011-07-11 08:44:00.011399389 -0500
@@ -12,8 +12,6 @@
../include/osdep.h
../include/paramlist.h
../include/plugin.h
- ../include/pugiconfig.hpp
- ../include/pugixml.hpp
../include/SHA1.h
../include/strutil.h
../include/sysutil.h
@@ -25,6 +23,13 @@
../include/varyingref.h
)
+if (NOT USE_EXTERNAL_PUGIXML)
+ list (APPEND libOpenImageIO_hdrs
+ ../include/pugiconfig.hpp
+ ../include/pugixml.hpp
+ )
+endif()
+
set (libOpenImageIO_srcs formatspec.cpp imagebuf.cpp
imagebufalgo.cpp imagebufalgo_orient.cpp
imageinput.cpp imageio.cpp imageioplugin.cpp
@@ -37,7 +42,6 @@
../libutil/paramlist.cpp
../libutil/plugin.cpp
../libutil/pystring.cpp
- ../libutil/pugixml.cpp
../libutil/SHA1.cpp
../libutil/strutil.cpp
../libutil/sysutil.cpp
@@ -51,6 +55,10 @@
${libOpenImageIO_hdrs}
)
+if (NOT USE_EXTERNAL_PUGIXML)
+ list (APPEND libOpenImageIO_srcs ../libutil/pugixml.cpp)
+endif ()
+
# Include our own TBB if using it
if (USE_TBB)
add_definitions ("-DUSE_TBB=1")
@@ -175,14 +183,16 @@
link_openexr (OpenImageIO)
endif ()
-if (SOVERSION)
+if (USE_EXTERNAL_PUGIXML)
+ target_link_libraries (OpenImageIO ${PUGIXML_LIBRARIES})
+endif ()
+
message(STATUS "Setting SOVERSION to: ${SOVERSION}")
set_target_properties(OpenImageIO
PROPERTIES
VERSION ${OIIO_VERSION_MAJOR}.${OIIO_VERSION_MINOR}.${OIIO_VERSION_PATCH}
SOVERSION ${SOVERSION}
)
-endif ()
oiio_install_targets (OpenImageIO)
diff -Naur OpenImageIO-0.10.0.orig/src/python/CMakeLists.txt OpenImageIO-0.10.0/src/python/CMakeLists.txt
--- OpenImageIO-0.10.0.orig/src/python/CMakeLists.txt 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/python/CMakeLists.txt 2011-07-11 08:44:00.012399349 -0500
@@ -42,7 +42,7 @@
endif()
install (TARGETS PyOpenImageIO
- RUNTIME DESTINATION ${PYLIBDIR} COMPONENT user
- LIBRARY DESTINATION ${PYLIBDIR} COMPONENT user)
+ RUNTIME DESTINATION ${PYLIB_INSTALL_DIR} COMPONENT user
+ LIBRARY DESTINATION ${PYLIB_INSTALL_DIR} COMPONENT user)
endif ()

View File

@ -0,0 +1,31 @@
diff -Naur OpenImageIO-0.10.0.orig/src/libutil/tbb_misc.cpp OpenImageIO-0.10.0/src/libutil/tbb_misc.cpp
--- OpenImageIO-0.10.0.orig/src/libutil/tbb_misc.cpp 2011-06-30 16:34:46.000000000 -0500
+++ OpenImageIO-0.10.0/src/libutil/tbb_misc.cpp 2011-07-18 15:25:14.921923295 -0500
@@ -29,23 +29,22 @@
// Source file for miscellaneous entities that are infrequently referenced by
// an executing program.
-#include "tbb/tbb_stddef.h"
+#include <tbb/tbb_stddef.h>
// Out-of-line TBB assertion handling routines are instantiated here.
-#include "tbb/tbb_assert_impl.h"
-#include "tbb/tbb_misc.h"
+#include <tbb/tbb_misc.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#if defined(__EXCEPTIONS) || defined(_CPPUNWIND) || defined(__SUNPRO_CC)
- #include "tbb/tbb_exception.h"
+ #include <tbb/tbb_exception.h>
#include <string> // std::string is used to construct runtime_error
#include <stdexcept>
#endif
using namespace std;
-#include "tbb/tbb_machine.h"
+#include <tbb/tbb_machine.h>
namespace tbb {

108
OpenImageIO.spec Normal file
View File

@ -0,0 +1,108 @@
Name: OpenImageIO
Version: 0.10.0
Release: 2%{?dist}
Summary: Library for reading and writing images
Group: Development/Libraries
License: BSD
URL: https://sites.google.com/site/openimageio/home
Source0: https://download.github.com/%{name}-oiio-Release-%{version}-12-g8055b0f.tar.gz
Patch0: OpenImageIO-0.10.0-git_backports.patch
Patch1: OpenImageIO-0.10.0-atomic_test_fix.patch
Patch2: OpenImageIO-0.10.0-use_system_tbb.patch
BuildRequires: boost-devel glew-devel qt-devel OpenEXR-devel ilmbase-devel
BuildRequires: python2-devel txt2man
BuildRequires: libpng libtiff-devel
BuildRequires: zlib-devel jasper-devel
BuildRequires: pugixml-devel
# Field3D support is not considered stable at this time and no package
# currently exists for Fedora. Re-enable when fixed.
#BuildRequires: hdf5-devel Field3D-devel
%description
OpenImageIO is a library for reading and writing images, and a bunch of related
classes, utilities, and applications. Main features include:
- Extremely simple but powerful ImageInput and ImageOutput APIs for reading and
writing 2D images that is format agnostic.
- Format plugins for TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, Targa, JPEG-2000,
DPX, Cineon, FITS, BMP, ICO, RMan Zfile, Softimage PIC, DDS, SGI,
PNM/PPM/PGM/PBM, Field3d.
- An ImageCache class that transparently manages a cache so that it can access
truly vast amounts of image data.
- A really nice image viewer, iv, also based on OpenImageIO classes (and so
will work with any formats for which plugins are available).
%package devel
Summary: Documentation for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Development files for package %{name}
%prep
%setup -q -n %{name}-oiio-8055b0f
%patch0 -p1
%patch1 -p1
%patch2 -p1
# Remove bundled pugixml
rm -f src/include/pugixml.hpp \
src/include/pugiconfig.hpp \
src/libutil/pugixml.cpp \
rm -rf src/include/tbb
%build
mkdir -p build
pushd build
%cmake -DCMAKE_SKIP_RPATH:BOOL=TRUE \
-DINCLUDE_INSTALL_DIR:PATH=/usr/include/%{name} \
-DPYLIB_INSTALL_DIR:PATH=%{python_sitearch} \
-DINSTALL_DOCS:BOOL=OFF \
-DUSE_EXTERNAL_PUGIXML:BOOL=TRUE \
-DUSE_TBB:BOOL=OFF \
../src
make %{?_smp_mflags}
%install
pushd build
make DESTDIR=%{buildroot} install
# Move man pages to the right directory
mkdir -p %{buildroot}%{_mandir}/man1
cp -a doc/*.1 %{buildroot}%{_mandir}/man1
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc CHANGES LICENSE
%{_bindir}/*
%{_libdir}/libOpenImageIO.so.*
%{python_sitearch}/OpenImageIO.so
%{_mandir}/man1/*
%files devel
%defattr(-,root,root,-)
%doc src/doc/*.pdf
%{_libdir}/libOpenImageIO.so
%{_includedir}/*
%changelog
* Mon Jul 18 2011 Richard Shaw <hobbes1069@gmail.com> - 0.10.0-2
- Disabled use of the TBB library.
* Tue Jul 05 2011 Richard Shaw <hobbes1069@gmail.com> - 0.10.0-1
- Inital Release.

View File

@ -0,0 +1 @@
29097c71383ba39a4d50bd3de1b6322d OpenImageIO-oiio-Release-0.10.0-12-g8055b0f.tar.gz