vcpkg/ports/openimageio/portfile.cmake
autoantwort be456649fd
[yaml-cpp] update to 0.7.0 (#19272)
* [yaml-cpp] update to 0.7.0

* [opencolorio] update to 2.0.1

* [openimageio] Update to 2.2.17.0

* [pystring] move header to pystring subfolder

* add version files
2021-08-10 01:11:41 -07:00

94 lines
2.8 KiB
CMake

if("field3d" IN_LIST FEATURES)
vcpkg_fail_port_install(
ON_TARGET WINDOWS UWP
MESSAGE "The field3d feature is not supported on Windows"
)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OpenImageIO/oiio
REF 099c8585e3add6f58fab9aa438a491fa55d3f67e # 2.2.17.0
SHA512 1b6a5e41607bd68590a19672ca777c953b92b347425c9fe8ca7d096959bece789d043a0fae1f7bf00a88dcb11815dd3501414c9ad979e1fe9dd1613bb9e04b0b
HEAD_REF master
PATCHES
fix-config-cmake.patch
fix_static_build.patch
)
file(REMOVE_RECURSE "${SOURCE_PATH}/ext")
file(REMOVE "${SOURCE_PATH}/src/cmake/modules/FindLibRaw.cmake"
"${SOURCE_PATH}/src/cmake/modules/FindOpenEXR.cmake"
"${SOURCE_PATH}/src/cmake/modules/FindOpenCV.cmake"
"${SOURCE_PATH}/src/cmake/modules/FindFFmpeg.cmake")
file(MAKE_DIRECTORY "${SOURCE_PATH}/ext/robin-map/tsl")
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(LINKSTATIC ON)
else()
set(LINKSTATIC OFF)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
libraw USE_LIBRAW
opencolorio USE_OPENCOLORIO
ffmpeg USE_FFMPEG
field3d USE_FIELD3D
freetype USE_FREETYPE
gif USE_GIF
opencv USE_OPENCV
openjpeg USE_OPENJPEG
webp USE_WEBP
pybind11 USE_PYTHON
tools OIIO_BUILD_TOOLS
)
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS ${FEATURE_OPTIONS}
-DOIIO_BUILD_TESTS=OFF
-DUSE_DCMTK=OFF
-DUSE_NUKE=OFF
-DUSE_QT=OFF
-DUSE_PTEX=OFF
-DLINKSTATIC=${LINKSTATIC}
-DBUILD_MISSING_FMT=OFF
-DBUILD_MISSING_ROBINMAP=OFF
-DBUILD_MISSING_DEPS=OFF
-DSTOP_ON_WARNING=OFF
-DVERBOSE=ON
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenImageIO TARGET_PATH share/OpenImageIO)
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(
TOOL_NAMES iconvert idiff igrep iinfo maketx oiiotool iv
AUTO_CLEAN
)
endif()
# Clean
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc
${CURRENT_PACKAGES_DIR}/debug/doc
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share)
file(COPY ${SOURCE_PATH}/src/cmake/modules/FindOpenImageIO.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/OpenImageIO)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)