mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-02 22:35:31 +08:00
[openimageio]Upgrade version and add features.
This commit is contained in:
parent
2b049c47b5
commit
283abf3836
@ -1,5 +1,5 @@
|
||||
Source: openimageio
|
||||
Version: 2019-08-08-4
|
||||
Version: 2019-10-10-1
|
||||
Homepage: https://github.com/OpenImageIO/oiio
|
||||
Description: A library for reading and writing images, and a bunch of related classes, utilities, and application
|
||||
Build-Depends: libjpeg-turbo, tiff, libpng, openexr, boost-thread, boost-smart-ptr, boost-foreach, boost-regex, boost-type-traits, boost-static-assert, boost-unordered, boost-config, boost-algorithm, boost-filesystem, boost-system, boost-thread, boost-asio, boost-random, robin-map, boost-stacktrace
|
||||
@ -10,4 +10,36 @@ Description: Enable RAW image files support
|
||||
|
||||
Feature: opencolorio
|
||||
Build-Depends: opencolorio
|
||||
Description: Enable opencolorio support for openimageio
|
||||
Description: Enable opencolorio support for openimageio
|
||||
|
||||
Feature: ffmpeg
|
||||
Build-Depends: ffmpeg
|
||||
Description: Enable ffmpeg support for openimageio
|
||||
|
||||
Feature: field3d
|
||||
Build-Depends: field3d
|
||||
Description: Enable field3D support for openimageio
|
||||
|
||||
Feature: freetype
|
||||
Build-Depends: freetype
|
||||
Description: Enable freetype support for openimageio
|
||||
|
||||
Feature: opencv
|
||||
Build-Depends: opencv
|
||||
Description: Enable opencv support for openimageio
|
||||
|
||||
Feature: gif
|
||||
Build-Depends: giflib
|
||||
Description: Enable giflib support for openimageio
|
||||
|
||||
Feature: openjpeg
|
||||
Build-Depends: openjpeg
|
||||
Description: Enable openjpeg support for openimageio
|
||||
|
||||
Feature: ptex
|
||||
Build-Depends: ptex
|
||||
Description: Enable ptex support for openimageio
|
||||
|
||||
Feature: webp
|
||||
Build-Depends: libwebp
|
||||
Description: Enable libwebp support for openimageio
|
167
ports/openimageio/fix-dependency.patch
Normal file
167
ports/openimageio/fix-dependency.patch
Normal file
@ -0,0 +1,167 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8a5f120..37d048c 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -53,6 +53,18 @@ include (compiler)
|
||||
# Helpful macros for our project
|
||||
include (oiio_macros)
|
||||
|
||||
+option (USE_FFMPEG "Use ffmpeg if found" ON)
|
||||
+option (USE_DCMTK "Use DCMTK if found" ON)
|
||||
+option (USE_FIELD3D "Use Field3D if found" ON)
|
||||
+option (USE_FREETYPE "Use FreeType if found" ON)
|
||||
+option (USE_GIF "Use Gif if found" ON)
|
||||
+option (USE_NUKE "Use Nuke if found" ON)
|
||||
+option (USE_OPENCV "Use OpenCV if found" ON)
|
||||
+option (USE_OPENJPEG "Use OpenJPEG if found" ON)
|
||||
+option (USE_PTEX "Use Ptex if found" ON)
|
||||
+option (USE_QT "Use QT if found" ON)
|
||||
+option (USE_WEBP "Use WebP if found" ON)
|
||||
+
|
||||
|
||||
option (VERBOSE "Print lots of messages while compiling" OFF)
|
||||
set (${PROJ_NAME}_NAMESPACE ${PROJECT_NAME} CACHE STRING
|
||||
diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
|
||||
index 2410d84..2a8e076 100644
|
||||
--- a/src/cmake/externalpackages.cmake
|
||||
+++ b/src/cmake/externalpackages.cmake
|
||||
@@ -182,10 +182,17 @@ oiio_find_package (PNG REQUIRED)
|
||||
oiio_find_package (TIFF 3.0 REQUIRED)
|
||||
|
||||
# IlmBase & OpenEXR
|
||||
-oiio_find_package (OpenEXR 2.0 REQUIRED)
|
||||
+find_package (Threads)
|
||||
+if (CMAKE_USE_PTHREADS_INIT)
|
||||
+ set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
|
||||
+endif ()
|
||||
+find_package (OpenEXR 2.0 REQUIRED)
|
||||
# We use Imath so commonly, may as well include it everywhere.
|
||||
-include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}"
|
||||
- "${ILMBASE_INCLUDES}/OpenEXR")
|
||||
+set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
|
||||
+set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
|
||||
+set(ILMBASE_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR})
|
||||
+set(ILMBASE_FOUND TRUE)
|
||||
+include_directories ("${OPENEXR_INCLUDE_DIR}")
|
||||
|
||||
# JPEG -- prefer Turbo-JPEG to regular libjpeg
|
||||
oiio_find_package (JPEGTurbo
|
||||
@@ -217,41 +224,72 @@ if (NOT BZIP2_FOUND)
|
||||
set (BZIP2_LIBRARIES "") # TODO: why does it break without this?
|
||||
endif ()
|
||||
|
||||
-oiio_find_package (Freetype
|
||||
- DEFINITIONS -DUSE_FREETYPE=1 )
|
||||
+if (USE_FREETYPE)
|
||||
+ oiio_find_package (Freetype
|
||||
+ DEFINITIONS -DUSE_FREETYPE=1 )
|
||||
+endif()
|
||||
|
||||
oiio_find_package (HDF5
|
||||
ISDEPOF Field3D)
|
||||
oiio_find_package (OpenColorIO
|
||||
DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1)
|
||||
-oiio_find_package (OpenCV
|
||||
- DEFINITIONS -DUSE_OPENCV=1)
|
||||
-
|
||||
+if (USE_OPENCV)
|
||||
+ oiio_find_package (OpenCV
|
||||
+ DEFINITIONS -DUSE_OPENCV=1)
|
||||
+endif()
|
||||
# Intel TBB
|
||||
oiio_find_package (TBB 2017
|
||||
DEFINITIONS -DUSE_TBB=1
|
||||
ISDEPOF OpenVDB)
|
||||
|
||||
-oiio_find_package (DCMTK 3.6.1) # For DICOM images
|
||||
-oiio_find_package (FFmpeg 2.6)
|
||||
-oiio_find_package (Field3D
|
||||
- DEPS HDF5
|
||||
- DEFINITIONS -DUSE_FIELD3D=1)
|
||||
-oiio_find_package (GIF 4)
|
||||
+if (USE_DCMTK)
|
||||
+ oiio_find_package (DCMTK 3.6.1) # For DICOM images
|
||||
+else()
|
||||
+ set(DCMTK_FOUND OFF)
|
||||
+endif()
|
||||
+if (USE_FFMPEG)
|
||||
+ oiio_find_package (FFmpeg 2.6)
|
||||
+else()
|
||||
+ set(FFMPEG_FOUND OFF)
|
||||
+endif()
|
||||
+if (USE_FIELD3D)
|
||||
+ oiio_find_package (Field3D
|
||||
+ DEPS HDF5
|
||||
+ DEFINITIONS -DUSE_FIELD3D=1)
|
||||
+endif()
|
||||
+if (USE_GIF)
|
||||
+ oiio_find_package (GIF 4)
|
||||
+else()
|
||||
+ set(GIF_FOUND OFF)
|
||||
+endif()
|
||||
oiio_find_package (Libheif 1.3) # For HEIF/HEIC format
|
||||
oiio_find_package (LibRaw)
|
||||
-oiio_find_package (OpenJpeg)
|
||||
+if (USE_OPENJPEG)
|
||||
+ oiio_find_package (OpenJpeg)
|
||||
+else()
|
||||
+ set(OPENJPEG_FOUND OFF)
|
||||
+endif()
|
||||
oiio_find_package (OpenVDB 5.0
|
||||
DEPS TBB
|
||||
DEFINITIONS -DUSE_OPENVDB=1)
|
||||
-oiio_find_package (PTex)
|
||||
-oiio_find_package (Webp)
|
||||
+if (USE_PTEX)
|
||||
+ oiio_find_package (PTex)
|
||||
+else()
|
||||
+ set (PTEX_FOUND FALSE)
|
||||
+endif()
|
||||
+if (USE_WEBP)
|
||||
+ oiio_find_package (Webp)
|
||||
+else()
|
||||
+ set (WEBP_FOUND FALSE)
|
||||
+endif()
|
||||
|
||||
option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF)
|
||||
oiio_find_package (R3DSDK) # RED camera
|
||||
|
||||
set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target")
|
||||
-oiio_find_package (Nuke)
|
||||
+if (USE_NUKE)
|
||||
+ oiio_find_package (Nuke)
|
||||
+endif()
|
||||
|
||||
oiio_find_package (OpenGL) # used for iv
|
||||
|
||||
@@ -260,11 +298,12 @@ set (qt5_modules Core Gui Widgets)
|
||||
if (OPENGL_FOUND)
|
||||
list (APPEND qt5_modules OpenGL)
|
||||
endif ()
|
||||
-option (USE_QT "Use Qt if found" ON)
|
||||
-oiio_find_package (Qt5 COMPONENTS ${qt5_modules})
|
||||
-if (USE_QT AND NOT Qt5_FOUND AND APPLE)
|
||||
- message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,")
|
||||
- message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH")
|
||||
+if (USE_QT)
|
||||
+ oiio_find_package (Qt5 COMPONENTS ${qt5_modules})
|
||||
+ if (NOT Qt5_FOUND AND APPLE)
|
||||
+ message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,")
|
||||
+ message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH")
|
||||
+ endif()
|
||||
endif ()
|
||||
|
||||
|
||||
diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt
|
||||
index f629ff9..43c7b85 100644
|
||||
--- a/src/raw.imageio/CMakeLists.txt
|
||||
+++ b/src/raw.imageio/CMakeLists.txt
|
||||
@@ -1,7 +1,7 @@
|
||||
if (LIBRAW_FOUND)
|
||||
add_oiio_plugin (rawinput.cpp
|
||||
INCLUDE_DIRS ${LibRaw_INCLUDE_DIR}
|
||||
- LINK_LIBRARIES ${LibRaw_r_LIBRARIES}
|
||||
+ LINK_LIBRARIES ${LibRaw_LIBRARIES}
|
||||
DEFINITIONS "-DUSE_LIBRAW=1")
|
||||
else ()
|
||||
message (WARNING "Raw plugin will not be built")
|
@ -1,35 +0,0 @@
|
||||
diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
|
||||
index 2692bb0..f2709d0 100644
|
||||
--- a/src/cmake/externalpackages.cmake
|
||||
+++ b/src/cmake/externalpackages.cmake
|
||||
@@ -380,7 +380,7 @@ if (USE_LIBRAW)
|
||||
message (STATUS "Looking for LibRaw with ${LIBRAW_PATH}")
|
||||
endif ()
|
||||
find_package (LibRaw)
|
||||
- if (LibRaw_r_LIBRARIES AND LibRaw_INCLUDE_DIR)
|
||||
+ if (LibRaw_LIBRARIES AND LibRaw_INCLUDE_DIR)
|
||||
set (LIBRAW_FOUND TRUE)
|
||||
include_directories (${LibRaw_INCLUDE_DIR})
|
||||
if (NOT LibRaw_FIND_QUIETLY)
|
||||
@@ -394,7 +394,7 @@ if (USE_LIBRAW)
|
||||
if (LINKSTATIC)
|
||||
find_package (Jasper)
|
||||
find_library (LCMS2_LIBRARIES NAMES lcms2)
|
||||
- set (LibRaw_r_LIBRARIES ${LibRaw_r_LIBRARIES} ${JASPER_LIBRARIES} ${LCMS2_LIBRARIES})
|
||||
+ set (LibRaw_LIBRARIES ${LibRaw_LIBRARIES} ${JASPER_LIBRARIES} ${LCMS2_LIBRARIES})
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "Not using LibRaw")
|
||||
diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt
|
||||
index e3608a2..f503035 100644
|
||||
--- a/src/raw.imageio/CMakeLists.txt
|
||||
+++ b/src/raw.imageio/CMakeLists.txt
|
||||
@@ -1,7 +1,7 @@
|
||||
if (USE_LIBRAW AND LIBRAW_FOUND)
|
||||
add_oiio_plugin (rawinput.cpp
|
||||
INCLUDE_DIRS ${LibRaw_INCLUDE_DIR}
|
||||
- LINK_LIBRARIES ${LibRaw_r_LIBRARIES}
|
||||
+ LINK_LIBRARIES ${LibRaw_LIBRARIES}
|
||||
DEFINITIONS "-DUSE_LIBRAW=1")
|
||||
else ()
|
||||
message (WARNING "Raw plugin will not be built")
|
@ -3,14 +3,11 @@ include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO OpenImageIO/oiio
|
||||
REF ad1ab61a56c63d770e4beb335efe8b1f1a9e36cd
|
||||
SHA512 48ee7862583e7adb86b56b20634c34aebf83ef0a3a14ad96182494ce6a84cb027334840a6c4c335e9342110c3a36532e3eeae22a3ed7363cd91b27cb7ca58154
|
||||
REF 781bc97c35a74cb2e24387075b69414080bca9e1
|
||||
SHA512 b75b7c3f36c7ba7daeb014312c3dfaeaae4d24e0826e439bdb19a4879866fb3eb4a09baf4eb8f706e68afcccf9409b6d168ded3dc8d81d0f3299b603958f8953
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix_libraw.patch
|
||||
use-webp.patch
|
||||
remove_wrong_dependency.patch
|
||||
use-vcpkg-find-openexr.patch
|
||||
fix-dependency.patch
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE "${SOURCE_PATH}/ext")
|
||||
@ -20,17 +17,17 @@ file(REMOVE "${SOURCE_PATH}/src/cmake/modules/FindOpenEXR.cmake")
|
||||
|
||||
file(MAKE_DIRECTORY "${SOURCE_PATH}/ext/robin-map/tsl")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
set(BUILDSTATIC ON)
|
||||
set(LINKSTATIC ON)
|
||||
else()
|
||||
set(BUILDSTATIC OFF)
|
||||
set(LINKSTATIC OFF)
|
||||
endif()
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
libraw USE_LIBRAW
|
||||
opencolorio USE_OCIO
|
||||
opencolorio USE_OCIO
|
||||
ffmpeg USE_FFMPEG
|
||||
field3d USE_FIELD3D
|
||||
freetype USE_FREETYPE
|
||||
gif USE_GIF
|
||||
opencv USE_OPENCV
|
||||
openjpeg USE_OPENJPEG
|
||||
ptex USE_PTEX
|
||||
webp USE_WEBP
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
@ -40,27 +37,14 @@ vcpkg_configure_cmake(
|
||||
-DOIIO_BUILD_TOOLS=OFF
|
||||
-DOIIO_BUILD_TESTS=OFF
|
||||
-DHIDE_SYMBOLS=ON
|
||||
-DUSE_DICOM=OFF
|
||||
-DUSE_FFMPEG=OFF
|
||||
-DUSE_FIELD3D=OFF
|
||||
-DUSE_FREETYPE=OFF
|
||||
-DUSE_GIF=OFF
|
||||
-DUSE_DCMTK=OFF
|
||||
-DUSE_NUKE=OFF
|
||||
-DUSE_OPENCV=OFF
|
||||
-DUSE_OPENJPEG=OFF
|
||||
-DUSE_OPENSSL=OFF
|
||||
-DUSE_PTEX=OFF
|
||||
-DUSE_PYTHON=OFF
|
||||
-DUSE_QT=OFF
|
||||
-DUSE_WEBP=OFF
|
||||
-DBUILDSTATIC=${BUILDSTATIC}
|
||||
-DLINKSTATIC=${LINKSTATIC}
|
||||
-DBUILD_MISSING_PYBIND11=OFF
|
||||
-DBUILD_MISSING_DEPS=OFF
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
|
||||
-DVERBOSE=ON
|
||||
OPTIONS_DEBUG
|
||||
-DOPENEXR_CUSTOM_LIB_DIR=${CURRENT_INSTALLED_DIR}/debug/lib
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
@ -1,15 +0,0 @@
|
||||
diff --git a/src/libOpenImageIO/CMakeLists.txt b/src/libOpenImageIO/CMakeLists.txt
|
||||
index 5449675..cdd5235 100644
|
||||
--- a/src/libOpenImageIO/CMakeLists.txt
|
||||
+++ b/src/libOpenImageIO/CMakeLists.txt
|
||||
@@ -171,10 +171,6 @@ elseif(MINGW)
|
||||
target_link_libraries (OpenImageIO psapi ws2_32)
|
||||
endif ()
|
||||
|
||||
-if (VISIBILITY_MAP_FILE)
|
||||
- add_dependencies (OpenImageIO "${VISIBILITY_MAP_FILE}")
|
||||
-endif ()
|
||||
-
|
||||
if (USE_EXTERNAL_PUGIXML)
|
||||
target_link_libraries (OpenImageIO ${PUGIXML_LIBRARIES})
|
||||
endif ()
|
@ -1,27 +0,0 @@
|
||||
diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
|
||||
index 7ebc1cf..a920c72 100644
|
||||
--- a/src/cmake/externalpackages.cmake
|
||||
+++ b/src/cmake/externalpackages.cmake
|
||||
@@ -64,12 +64,19 @@ find_package (PNG REQUIRED)
|
||||
###########################################################################
|
||||
# IlmBase & OpenEXR setup
|
||||
|
||||
+find_package (Threads)
|
||||
+if (CMAKE_USE_PTHREADS_INIT)
|
||||
+ set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
|
||||
+endif ()
|
||||
+
|
||||
find_package (OpenEXR 2.0 REQUIRED)
|
||||
#OpenEXR 2.2 still has problems with importing ImathInt64.h unqualified
|
||||
#thus need for ilmbase/OpenEXR
|
||||
-include_directories ("${OPENEXR_INCLUDE_DIR}"
|
||||
- "${ILMBASE_INCLUDE_DIR}"
|
||||
- "${ILMBASE_INCLUDE_DIR}/OpenEXR")
|
||||
+set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
|
||||
+set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
|
||||
+set(ILMBASE_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR})
|
||||
+set(ILMBASE_FOUND TRUE)
|
||||
+include_directories ("${OPENEXR_INCLUDE_DIR}")
|
||||
if (NOT OpenEXR_FIND_QUIETLY)
|
||||
message (STATUS "OPENEXR_INCLUDE_DIR = ${OPENEXR_INCLUDE_DIR}")
|
||||
message (STATUS "OPENEXR_LIBRARIES = ${OPENEXR_LIBRARIES}")
|
@ -1,34 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 7f43455..393af70 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -96,6 +96,7 @@ option (USE_GIF "Use GIF if found" ON)
|
||||
option (USE_PTEX "Use PTex if found" ON)
|
||||
option (USE_WEBP "Use WebP if found" ON)
|
||||
option (USE_LIBRAW "Use LibRaw if found" ON)
|
||||
+option (USE_WEBP "Use WebP if found" ON)
|
||||
set (LIBRAW_PATH "" CACHE STRING "Custom LibRaw path")
|
||||
option (OIIO_THREAD_ALLOW_DCLP "OIIO threads may use DCLP for speed" ON)
|
||||
option (USE_NUKE "Build Nuke plugins, if Nuke is found" ON)
|
||||
diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
|
||||
index f2709d0..3a95da6 100644
|
||||
--- a/src/cmake/externalpackages.cmake
|
||||
+++ b/src/cmake/externalpackages.cmake
|
||||
@@ -411,6 +411,7 @@ if (USE_WEBP)
|
||||
if (NOT WEBP_FIND_QUIETLY)
|
||||
message (STATUS "WEBP_HOME=${WEBP_HOME}")
|
||||
endif ()
|
||||
+ if(USE_WEBP)
|
||||
find_path (WEBP_INCLUDE_DIR webp/encode.h
|
||||
"${PROJECT_SOURCE_DIR}/src/include"
|
||||
"${WEBP_HOME}")
|
||||
@@ -427,6 +428,9 @@ if (USE_WEBP)
|
||||
set (WEBP_FOUND FALSE)
|
||||
message (STATUS "WebP library not found")
|
||||
endif()
|
||||
+ else()
|
||||
+ set (WEBP_FOUND FALSE)
|
||||
+ endif()
|
||||
else ()
|
||||
message (STATUS "Not using WebP")
|
||||
endif ()
|
Loading…
x
Reference in New Issue
Block a user