From f25a686de971bc7fc52683a058434810b9d49dbc Mon Sep 17 00:00:00 2001 From: wangli28 Date: Thu, 16 Jul 2020 04:30:33 +0000 Subject: [PATCH] [openvdb] Add vcpkg-cmake-wrapper.cmake --- ports/openvdb/CONTROL | 9 ------- ports/openvdb/portfile.cmake | 5 ++-- ports/openvdb/usage | 5 ++++ ports/openvdb/vcpkg-cmake-wrapper.cmake | 13 +++++++++++ ports/openvdb/vcpkg.json | 31 +++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 11 deletions(-) delete mode 100644 ports/openvdb/CONTROL create mode 100644 ports/openvdb/usage create mode 100644 ports/openvdb/vcpkg-cmake-wrapper.cmake create mode 100644 ports/openvdb/vcpkg.json diff --git a/ports/openvdb/CONTROL b/ports/openvdb/CONTROL deleted file mode 100644 index c3e9a984906e33..00000000000000 --- a/ports/openvdb/CONTROL +++ /dev/null @@ -1,9 +0,0 @@ -Source: openvdb -Version: 7.0.0 -Build-Depends: boost-ptr-container, openexr, tbb, blosc, boost-iostreams, boost-system, boost-thread, boost-date-time, boost-any, boost-uuid, boost-interprocess, ilmbase -Homepage: https://github.com/dreamworksanimation/openvdb -Description: Sparse volume data structure and tools - -Feature: tools -Description: OpenVDB utilities: view, print and render -Build-Depends: glew, glfw3 diff --git a/ports/openvdb/portfile.cmake b/ports/openvdb/portfile.cmake index 964088eee135f6..b470d1b5edc1d2 100644 --- a/ports/openvdb/portfile.cmake +++ b/ports/openvdb/portfile.cmake @@ -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 @@ -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) diff --git a/ports/openvdb/usage b/ports/openvdb/usage new file mode 100644 index 00000000000000..8859962d67a43a --- /dev/null +++ b/ports/openvdb/usage @@ -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}) diff --git a/ports/openvdb/vcpkg-cmake-wrapper.cmake b/ports/openvdb/vcpkg-cmake-wrapper.cmake new file mode 100644 index 00000000000000..32046522b4d453 --- /dev/null +++ b/ports/openvdb/vcpkg-cmake-wrapper.cmake @@ -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}) diff --git a/ports/openvdb/vcpkg.json b/ports/openvdb/vcpkg.json new file mode 100644 index 00000000000000..d6218242175817 --- /dev/null +++ b/ports/openvdb/vcpkg.json @@ -0,0 +1,31 @@ +{ + "name": "openvdb", + "version-string": "7.0.0", + "port-version": "1", + "description": "Sparse volume data structure and tools", + "homepage": "https://github.com/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" + ] + } + ] +}