mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 05:49:02 +08:00
[openvdb] Fix dependency issue and usage issue (#14651)
This commit is contained in:
parent
048d760168
commit
a6966c2021
@ -1,76 +1,162 @@
|
|||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
index f2e8c2a..4fd3f40 100644
|
index f2e8c2a..749e12c 100644
|
||||||
--- a/CMakeLists.txt
|
--- a/CMakeLists.txt
|
||||||
+++ b/CMakeLists.txt
|
+++ b/CMakeLists.txt
|
||||||
@@ -360,7 +360,6 @@ if(OPENVDB_INSTALL_CMAKE_MODULES)
|
@@ -353,14 +353,10 @@ endif()
|
||||||
cmake/FindLog4cplus.cmake
|
|
||||||
cmake/FindOpenEXR.cmake
|
if(OPENVDB_INSTALL_CMAKE_MODULES)
|
||||||
cmake/FindOpenVDB.cmake
|
set(OPENVDB_CMAKE_MODULES
|
||||||
- cmake/FindTBB.cmake
|
- cmake/FindBlosc.cmake
|
||||||
cmake/OpenVDBGLFW3Setup.cmake
|
cmake/FindCppUnit.cmake
|
||||||
cmake/OpenVDBHoudiniSetup.cmake
|
cmake/FindJemalloc.cmake
|
||||||
cmake/OpenVDBMayaSetup.cmake
|
- cmake/FindIlmBase.cmake
|
||||||
diff --git a/cmake/FindOpenVDB.cmake b/cmake/FindOpenVDB.cmake
|
cmake/FindLog4cplus.cmake
|
||||||
index b065192..286e8b6 100644
|
- cmake/FindOpenEXR.cmake
|
||||||
--- a/cmake/FindOpenVDB.cmake
|
cmake/FindOpenVDB.cmake
|
||||||
+++ b/cmake/FindOpenVDB.cmake
|
- cmake/FindTBB.cmake
|
||||||
@@ -430,7 +430,7 @@ endif()
|
cmake/OpenVDBGLFW3Setup.cmake
|
||||||
# Add standard dependencies
|
cmake/OpenVDBHoudiniSetup.cmake
|
||||||
|
cmake/OpenVDBMayaSetup.cmake
|
||||||
find_package(IlmBase REQUIRED COMPONENTS Half)
|
diff --git a/cmake/FindOpenVDB.cmake b/cmake/FindOpenVDB.cmake
|
||||||
-find_package(TBB REQUIRED COMPONENTS tbb)
|
index b065192..7549843 100644
|
||||||
+find_package(TBB CONFIG REQUIRED)
|
--- a/cmake/FindOpenVDB.cmake
|
||||||
find_package(ZLIB REQUIRED)
|
+++ b/cmake/FindOpenVDB.cmake
|
||||||
|
@@ -224,8 +224,9 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
|
||||||
if(NOT OPENVDB_USE_STATIC_LIBS AND NOT Boost_USE_STATIC_LIBS)
|
${OPENVDB_${COMPONENT}_ROOT}
|
||||||
diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt
|
${OPENVDB_${COMPONENT}_INCLUDEDIR}
|
||||||
index 45b302c..e208bcf 100644
|
)
|
||||||
--- a/openvdb/CMakeLists.txt
|
- list(REMOVE_DUPLICATES _VDB_COMPONENT_SEARCH_DIRS)
|
||||||
+++ b/openvdb/CMakeLists.txt
|
-
|
||||||
@@ -47,7 +47,7 @@ message(STATUS "----------------------------------------------------")
|
+ if(_VDB_COMPONENT_SEARCH_DIRS)
|
||||||
##########################################################################
|
+ list(REMOVE_DUPLICATES _VDB_COMPONENT_SEARCH_DIRS)
|
||||||
|
+ endif()
|
||||||
# Collect and configure lib dependencies
|
# Look for a standard header files.
|
||||||
-
|
if(${COMPONENT} STREQUAL "openvdb")
|
||||||
+if(0)
|
# Look for a standard OpenVDB header file.
|
||||||
if(USE_EXR)
|
@@ -429,8 +430,8 @@ endif()
|
||||||
find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED)
|
|
||||||
find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED)
|
# Add standard dependencies
|
||||||
@@ -57,8 +57,14 @@ if(USE_EXR)
|
|
||||||
"is deprecated and will be removed.")
|
-find_package(IlmBase REQUIRED COMPONENTS Half)
|
||||||
endif()
|
-find_package(TBB REQUIRED COMPONENTS tbb)
|
||||||
endif()
|
+find_package(IlmBase CONFIG REQUIRED)
|
||||||
+endif()
|
+find_package(TBB CONFIG REQUIRED)
|
||||||
+endif()
|
find_package(ZLIB REQUIRED)
|
||||||
+
|
|
||||||
+if(USE_EXR)
|
if(NOT OPENVDB_USE_STATIC_LIBS AND NOT Boost_USE_STATIC_LIBS)
|
||||||
+ find_package(IlmBase REQUIRED)
|
@@ -540,7 +541,7 @@ if(NOT OPENVDB_USE_STATIC_LIBS)
|
||||||
+ find_package(OpenEXR REQUIRED)
|
endif()
|
||||||
else()
|
|
||||||
- find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half)
|
if(OpenVDB_USES_BLOSC)
|
||||||
+ find_package(IlmBase REQUIRED COMPONENTS Half)
|
- find_package(Blosc REQUIRED)
|
||||||
endif()
|
+ find_package(blosc CONFIG REQUIRED)
|
||||||
|
endif()
|
||||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ILMBASE_VERSION)
|
|
||||||
@@ -68,7 +74,7 @@ if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ILMBASE_VERSION)
|
if(OpenVDB_USES_LOG4CPLUS)
|
||||||
endif()
|
@@ -548,8 +549,8 @@ if(OpenVDB_USES_LOG4CPLUS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
-find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbb)
|
if(OpenVDB_USES_EXR)
|
||||||
+find_package(TBB CONFIG REQUIRED)
|
- find_package(IlmBase REQUIRED)
|
||||||
|
- find_package(OpenEXR REQUIRED)
|
||||||
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_TBB_VERSION)
|
+ find_package(IlmBase CONFIG REQUIRED)
|
||||||
if(${Tbb_VERSION} VERSION_LESS FUTURE_MINIMUM_TBB_VERSION)
|
+ find_package(OpenEXR CONFIG REQUIRED)
|
||||||
diff --git a/openvdb/cmd/CMakeLists.txt b/openvdb/cmd/CMakeLists.txt
|
endif()
|
||||||
index 2b831bb..2fa11d4 100644
|
|
||||||
--- a/openvdb/cmd/CMakeLists.txt
|
if(UNIX)
|
||||||
+++ b/openvdb/cmd/CMakeLists.txt
|
@@ -610,7 +611,7 @@ set(_OPENVDB_HIDDEN_DEPENDENCIES)
|
||||||
@@ -50,7 +50,7 @@ if(CONCURRENT_MALLOC STREQUAL "Jemalloc")
|
|
||||||
find_package(Jemalloc REQUIRED)
|
if(NOT OPENVDB_USE_STATIC_LIBS)
|
||||||
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS Jemalloc::jemalloc)
|
if(OpenVDB_USES_BLOSC)
|
||||||
elseif(CONCURRENT_MALLOC STREQUAL "Tbbmalloc")
|
- list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES Blosc::blosc)
|
||||||
- find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbbmalloc)
|
+ list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES blosc)
|
||||||
+ find_package(TBB CONFIG REQUIRED)
|
endif()
|
||||||
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS TBB::tbbmalloc)
|
|
||||||
endif()
|
list(APPEND _OPENVDB_HIDDEN_DEPENDENCIES ZLIB::ZLIB)
|
||||||
|
diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt
|
||||||
|
index 45b302c..d75cfd1 100644
|
||||||
|
--- a/openvdb/CMakeLists.txt
|
||||||
|
+++ b/openvdb/CMakeLists.txt
|
||||||
|
@@ -47,7 +47,7 @@ message(STATUS "----------------------------------------------------")
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
# Collect and configure lib dependencies
|
||||||
|
-
|
||||||
|
+if(0)
|
||||||
|
if(USE_EXR)
|
||||||
|
find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED)
|
||||||
|
find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED)
|
||||||
|
@@ -57,8 +57,14 @@ if(USE_EXR)
|
||||||
|
"is deprecated and will be removed.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
+endif()
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
+if(USE_EXR)
|
||||||
|
+ find_package(IlmBase CONFIG REQUIRED)
|
||||||
|
+ find_package(OpenEXR CONFIG REQUIRED)
|
||||||
|
else()
|
||||||
|
- find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half)
|
||||||
|
+ find_package(IlmBase CONFIG REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ILMBASE_VERSION)
|
||||||
|
@@ -68,7 +74,7 @@ if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_ILMBASE_VERSION)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
-find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbb)
|
||||||
|
+find_package(TBB CONFIG REQUIRED)
|
||||||
|
|
||||||
|
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_TBB_VERSION)
|
||||||
|
if(${Tbb_VERSION} VERSION_LESS FUTURE_MINIMUM_TBB_VERSION)
|
||||||
|
@@ -84,14 +90,7 @@ if(USE_LOG4CPLUS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_BLOSC)
|
||||||
|
- find_package(Blosc ${MINIMUM_BLOSC_VERSION} REQUIRED)
|
||||||
|
- if(Blosc_FOUND AND Blosc_VERSION VERSION_GREATER MINIMUM_BLOSC_VERSION)
|
||||||
|
- message(WARNING "The version of Blosc located is greater than ${MINIMUM_BLOSC_VERSION}. "
|
||||||
|
- "There have been reported issues with using later versions of Blosc with OpenVDB. "
|
||||||
|
- "OpenVDB has been tested fully against Blosc ${MINIMUM_BLOSC_VERSION}, it is "
|
||||||
|
- "recommended that you use this version where possible."
|
||||||
|
- )
|
||||||
|
- endif()
|
||||||
|
+ find_package(blosc CONFIG REQUIRED)
|
||||||
|
else()
|
||||||
|
message(WARNING "Blosc support is disabled. It is strongly recommended to "
|
||||||
|
"enable blosc for optimal builds of OpenVDB and to support compatible "
|
||||||
|
@@ -163,7 +162,7 @@ endif()
|
||||||
|
# See FindOpenVDB.cmake
|
||||||
|
|
||||||
|
if(USE_BLOSC)
|
||||||
|
- list(APPEND OPENVDB_CORE_DEPENDENT_LIBS Blosc::blosc)
|
||||||
|
+ list(APPEND OPENVDB_CORE_DEPENDENT_LIBS blosc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND OPENVDB_CORE_DEPENDENT_LIBS
|
||||||
|
diff --git a/openvdb/cmd/CMakeLists.txt b/openvdb/cmd/CMakeLists.txt
|
||||||
|
index 2b831bb..a13b63b 100644
|
||||||
|
--- a/openvdb/cmd/CMakeLists.txt
|
||||||
|
+++ b/openvdb/cmd/CMakeLists.txt
|
||||||
|
@@ -50,7 +50,7 @@ if(CONCURRENT_MALLOC STREQUAL "Jemalloc")
|
||||||
|
find_package(Jemalloc REQUIRED)
|
||||||
|
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS Jemalloc::jemalloc)
|
||||||
|
elseif(CONCURRENT_MALLOC STREQUAL "Tbbmalloc")
|
||||||
|
- find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbbmalloc)
|
||||||
|
+ find_package(TBB CONFIG REQUIRED)
|
||||||
|
list(APPEND OPENVDB_BINARIES_DEPENDENT_LIBS TBB::tbbmalloc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
@@ -120,8 +120,8 @@ endif()
|
||||||
|
#### vdb_render
|
||||||
|
|
||||||
|
if(OPENVDB_BUILD_VDB_RENDER)
|
||||||
|
- find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half Iex IlmThread Imath)
|
||||||
|
- find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED COMPONENTS IlmImf)
|
||||||
|
+ find_package(IlmBase CONFIG REQUIRED)
|
||||||
|
+ find_package(OpenEXR CONFIG REQUIRED)
|
||||||
|
|
||||||
|
set(VDB_RENDER_SOURCE_FILES openvdb_render.cc)
|
||||||
|
add_executable(vdb_render ${VDB_RENDER_SOURCE_FILES})
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
Source: openvdb
|
Source: openvdb
|
||||||
Version: 7.1.0
|
Version: 7.1.0
|
||||||
|
Port-Version: 1
|
||||||
Build-Depends: boost-ptr-container, openexr, tbb, blosc, boost-iostreams, boost-system, boost-thread, boost-date-time, boost-any, boost-uuid, boost-interprocess, ilmbase
|
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
|
Homepage: https://github.com/dreamworksanimation/openvdb
|
||||||
Description: Sparse volume data structure and tools
|
Description: Sparse volume data structure and tools
|
||||||
|
@ -9,6 +9,9 @@ vcpkg_from_github(
|
|||||||
)
|
)
|
||||||
|
|
||||||
file(REMOVE ${SOURCE_PATH}/cmake/FindTBB.cmake)
|
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}" "static" OPENVDB_STATIC)
|
||||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENVDB_SHARED)
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENVDB_SHARED)
|
||||||
@ -51,5 +54,6 @@ if (OPENVDB_BUILD_TOOLS)
|
|||||||
vcpkg_copy_tools(TOOL_NAMES vdb_print vdb_render vdb_view vdb_lod AUTO_CLEAN)
|
vcpkg_copy_tools(TOOL_NAMES vdb_print vdb_render vdb_view vdb_lod AUTO_CLEAN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Handle copyright
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||||
file(INSTALL ${SOURCE_PATH}/openvdb/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
|
||||||
|
file(INSTALL ${SOURCE_PATH}/openvdb/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||||
|
4
ports/openvdb/usage
Normal file
4
ports/openvdb/usage
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
The package openvdb provides CMake targets:
|
||||||
|
|
||||||
|
find_package(OpenVDB CONFIG REQUIRED)
|
||||||
|
target_link_libraries(main PRIVATE OpenVDB::openvdb)
|
10
ports/openvdb/vcpkg-cmake-wrapper.cmake
Normal file
10
ports/openvdb/vcpkg-cmake-wrapper.cmake
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
set(OPENVDB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
|
list(REMOVE_ITEM ARGS "NO_MODULE")
|
||||||
|
list(REMOVE_ITEM ARGS "CONFIG")
|
||||||
|
list(REMOVE_ITEM ARGS "MODULE")
|
||||||
|
|
||||||
|
_find_package(${ARGS})
|
||||||
|
|
||||||
|
set(CMAKE_MODULE_PATH ${OPENVDB_PREV_MODULE_PATH})
|
Loading…
Reference in New Issue
Block a user