Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openvdb] Add vcpkg-cmake-wrapper.cmake #12444

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions ports/openvdb/CONTROL

This file was deleted.

5 changes: 3 additions & 2 deletions ports/openvdb/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/OpenVDB TARGET_PATH share/openvdb)

vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake ${CURRENT_PACKAGES_DIR}/lib/cmake)

if (OPENVDB_BUILD_TOOLS)
# copy tools to tools/openvdb directory
Expand All @@ -68,5 +67,7 @@ if (OPENVDB_BUILD_TOOLS)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vdb_lod.exe)
endif()

configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY)
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
# Handle copyright
file(INSTALL ${SOURCE_PATH}/openvdb/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
5 changes: 5 additions & 0 deletions ports/openvdb/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The package openvdb provides CMake targets:

find_package(openvdb REQUIRED)
target_include_directories(main PRIVATE ${OPENVDB_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${OPENVDB_LIBRARIES})
13 changes: 13 additions & 0 deletions ports/openvdb/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)

find_path(OPENVDB_INCLUDE_DIR openvdb.h PATH_SUFFIXES openvdb)
get_filename_component(OPENVDB_INCLUDE_DIR ${OPENVDB_INCLUDE_DIR} DIRECTORY)

find_library(OPENVDB_LIBRARY_DEBUG NAMES openvdb libopenvdb NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED)
find_library(OPENVDB_LIBRARY_RELEASE NAMES openvdb libopenvdb NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED)

select_library_configurations(OPENVDB)

set(OPENVDB_INCLUDE_DIRS ${OPENVDB_INCLUDE_DIR})
set(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY})
31 changes: 31 additions & 0 deletions ports/openvdb/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "openvdb",
"version-string": "7.0.0",
"port-version": "1",
"description": "Sparse volume data structure and tools",
"homepage": "https:/dreamworksanimation/openvdb",
"dependencies": [
"boost-ptr-container",
"openexr",
"tbb",
"blosc",
"boost-iostreams",
"boost-system",
"boost-thread",
"boost-date-time",
"boost-any",
"boost-uuid",
"boost-interprocess",
"ilmbase"
],
"features": [
{
"name": "tools",
"description": "OpenVDB utilities: view, print and render",
"dependencies": [
"glew",
"glfw3"
]
}
]
}