vcpkg/ports/openimageio/fix-dependency.patch

72 lines
3.1 KiB
Diff
Raw Normal View History

diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
2019-12-27 14:28:50 +08:00
index 2f4f7ce..6419c79 100644
--- a/src/cmake/externalpackages.cmake
+++ b/src/cmake/externalpackages.cmake
@@ -169,10 +169,17 @@ checked_find_package (PNG REQUIRED)
checked_find_package (TIFF 3.0 REQUIRED)
# IlmBase & OpenEXR
+find_package (Threads)
+if (CMAKE_USE_PTHREADS_INIT)
+ set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
+endif ()
checked_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}")
if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3)
# clang C++ >= 11 doesn't like 'register' keyword in old exr headers
add_compile_options (-Wno-deprecated-register)
@@ -217,7 +224,7 @@ checked_find_package (HDF5
ISDEPOF Field3D)
checked_find_package (OpenColorIO
DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1)
-checked_find_package (OpenCV
+checked_find_package (OpenCV CONFIG
DEFINITIONS -DUSE_OPENCV=1)
# Intel TBB
@@ -237,8 +244,12 @@ checked_find_package (OpenJpeg)
checked_find_package (OpenVDB 5.0
DEPS TBB
DEFINITIONS -DUSE_OPENVDB=1)
-checked_find_package (PTex)
-checked_find_package (Webp)
+checked_find_package (ptex CONFIG)
+set(PTEX_FOUND ${ptex_FOUND})
+set(PTEX_LIBRARIES Ptex::Ptex)
+checked_find_package (Webp CONFIG)
+set(WEBP_FOUND ${Webp_FOUND})
+set(WEBP_LIBRARY WebP::webp WebP::webpdemux WebP::webpdecoder)
option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF)
checked_find_package (R3DSDK) # RED camera
2019-12-27 14:28:50 +08:00
@@ -254,7 +265,9 @@ if (OPENGL_FOUND)
list (APPEND qt5_modules OpenGL)
endif ()
option (USE_QT "Use Qt if found" ON)
+if (USE_QT)
checked_find_package (Qt5 COMPONENTS ${qt5_modules})
+endif()
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")
diff --git a/src/raw.imageio/CMakeLists.txt b/src/raw.imageio/CMakeLists.txt
index 81a0ff5..23326a0 100644
--- a/src/raw.imageio/CMakeLists.txt
+++ b/src/raw.imageio/CMakeLists.txt
@@ -5,7 +5,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")