2017-11-22 01:55:55 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2019-02-27 00:16:20 +08:00
|
|
|
REPO AcademySoftwareFoundation/openvdb
|
2023-12-12 17:11:40 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 f2c90ca8435ecbacefda429341000ecb555385c746a3e0233220cd78540cee2a26cc17df7b560fdfe2dc03f2b2e960a2fa226a85980189c3e018164ccc037bd4
|
2017-11-22 01:55:55 +08:00
|
|
|
PATCHES
|
2023-12-12 17:11:40 +08:00
|
|
|
fix_cmake.patch
|
2023-10-04 13:46:59 +08:00
|
|
|
fix_nanovdb.patch
|
2017-11-22 01:55:55 +08:00
|
|
|
)
|
|
|
|
|
2021-12-29 07:04:06 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/FindTBB.cmake")
|
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/FindIlmBase.cmake")
|
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/FindBlosc.cmake")
|
|
|
|
file(REMOVE "${SOURCE_PATH}/cmake/FindOpenEXR.cmake")
|
2019-11-20 02:59:56 +08:00
|
|
|
|
2020-10-14 07:21:27 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OPENVDB_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENVDB_SHARED)
|
2017-11-22 01:55:55 +08:00
|
|
|
|
2023-03-15 06:00:01 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
"tools" OPENVDB_BUILD_TOOLS
|
2023-09-14 07:05:12 +08:00
|
|
|
"ax" OPENVDB_BUILD_AX
|
2023-10-04 13:46:59 +08:00
|
|
|
"nanovdb" OPENVDB_BUILD_NANOVDB
|
2023-03-15 06:00:01 +08:00
|
|
|
)
|
|
|
|
|
2023-10-04 13:46:59 +08:00
|
|
|
if (OPENVDB_BUILD_NANOVDB)
|
|
|
|
set(NANOVDB_OPTIONS
|
|
|
|
-DNANOVDB_BUILD_TOOLS=OFF
|
|
|
|
-DNANOVDB_USE_INTRINSICS=ON
|
|
|
|
-DNANOVDB_USE_CUDA=ON
|
|
|
|
-DNANOVDB_CUDA_KEEP_PTX=ON
|
|
|
|
-DNANOVDB_USE_OPENVDB=ON
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-07-16 15:48:26 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-12-29 07:04:06 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-02-27 00:16:20 +08:00
|
|
|
OPTIONS
|
|
|
|
-DOPENVDB_BUILD_UNITTESTS=OFF
|
|
|
|
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
|
2023-09-14 07:05:12 +08:00
|
|
|
-DOPENVDB_3_ABI_COMPATIBLE=OFF
|
2022-09-26 14:45:07 +08:00
|
|
|
-DUSE_EXR=ON
|
|
|
|
-DUSE_IMATH_HALF=ON
|
2019-06-27 01:33:36 +08:00
|
|
|
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
|
|
|
|
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
|
|
|
|
-DOPENVDB_BUILD_VDB_PRINT=${OPENVDB_BUILD_TOOLS}
|
|
|
|
-DOPENVDB_BUILD_VDB_VIEW=${OPENVDB_BUILD_TOOLS}
|
2020-10-14 07:21:27 +08:00
|
|
|
-DOPENVDB_BUILD_VDB_RENDER=${OPENVDB_BUILD_TOOLS}
|
2019-06-27 01:33:36 +08:00
|
|
|
-DOPENVDB_BUILD_VDB_LOD=${OPENVDB_BUILD_TOOLS}
|
2020-10-14 07:21:27 +08:00
|
|
|
-DUSE_PKGCONFIG=OFF
|
2023-10-04 13:46:59 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2023-09-27 16:28:31 +08:00
|
|
|
-DUSE_EXPLICIT_INSTANTIATION=OFF
|
2023-10-04 13:46:59 +08:00
|
|
|
${NANOVDB_OPTIONS}
|
2023-09-27 16:28:31 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
OPENVDB_3_ABI_COMPATIBLE
|
2023-10-04 13:46:59 +08:00
|
|
|
OPENVDB_BUILD_TOOLS
|
2017-11-22 01:55:55 +08:00
|
|
|
)
|
|
|
|
|
2021-07-16 15:48:26 +08:00
|
|
|
vcpkg_cmake_install()
|
2017-11-22 01:55:55 +08:00
|
|
|
|
2021-07-16 15:48:26 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/OpenVDB)
|
2019-06-27 01:33:36 +08:00
|
|
|
|
2017-11-22 01:55:55 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-09-08 22:56:56 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-11-22 01:55:55 +08:00
|
|
|
|
|
|
|
if (OPENVDB_BUILD_TOOLS)
|
2020-10-14 07:21:27 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES vdb_print vdb_render vdb_view vdb_lod AUTO_CLEAN)
|
2017-11-22 01:55:55 +08:00
|
|
|
endif()
|
|
|
|
|
2021-09-08 22:56:56 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
|
2021-07-16 15:48:26 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
file(INSTALL "${SOURCE_PATH}/openvdb/openvdb/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|