vcpkg/ports/openvdb/portfile.cmake

68 lines
2.4 KiB
CMake
Raw Normal View History

2017-11-22 01:55:55 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AcademySoftwareFoundation/openvdb
2021-07-16 15:48:26 +08:00
REF 587c9ae84c2822bbc03d0d7eceb52898582841b9 # v8.0.0
SHA512 4abc442a86dd0614492edf70e887886b755102f04d44eebd1a154df24e05e53a80de8e9b47b370946bcc3888ab7a94ae331a3addac8d784e25ae5da7523afca9
2017-11-22 01:55:55 +08:00
HEAD_REF master
PATCHES
0003-fix-cmake.patch
2017-11-22 01:55:55 +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)
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
set(OPENVDB_BUILD_TOOLS OFF)
2017-11-22 01:55:55 +08:00
if ("tools" IN_LIST FEATURES)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
2017-11-22 01:55:55 +08:00
set(OPENVDB_BUILD_TOOLS ON)
else()
message(FATAL_ERROR "Unable to build tools if static libraries are required")
endif()
2017-11-22 01:55:55 +08:00
endif()
2021-07-16 15:48:26 +08:00
if ("ax" IN_LIST FEATURES)
if(NOT VCPKG_TARGET_IS_WINDOWS)
set(OPENVDB_BUILD_AX ON)
else()
message(FATAL_ERROR "Currently no support for building OpenVDB AX on Windows.")
endif()
endif()
vcpkg_cmake_configure(
2017-11-22 01:55:55 +08:00
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DOPENVDB_BUILD_UNITTESTS=OFF
-DOPENVDB_BUILD_PYTHON_MODULE=OFF
-DOPENVDB_ENABLE_3_ABI_COMPATIBLE=OFF
-DUSE_GLFW3=ON
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
-DOPENVDB_BUILD_VDB_PRINT=${OPENVDB_BUILD_TOOLS}
-DOPENVDB_BUILD_VDB_VIEW=${OPENVDB_BUILD_TOOLS}
-DOPENVDB_BUILD_VDB_RENDER=${OPENVDB_BUILD_TOOLS}
-DOPENVDB_BUILD_VDB_LOD=${OPENVDB_BUILD_TOOLS}
-DUSE_PKGCONFIG=OFF
2021-07-16 15:48:26 +08:00
${OPENVDB_BUILD_AX}
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)
2017-11-22 01:55:55 +08:00
vcpkg_copy_pdbs()
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)
vcpkg_copy_tools(TOOL_NAMES vdb_print vdb_render vdb_view vdb_lod AUTO_CLEAN)
2017-11-22 01:55:55 +08:00
endif()
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)