mirror of https://github.com/microsoft/vcpkg.git
[assimp] add draco feature (#50974)
Co-authored-by: Kai Pastor <dg0yt@darc.de>
This commit is contained in:
parent
1765cad8e2
commit
d399db85b6
|
|
@ -81,16 +81,33 @@ index 1242bba..eba5242 100644
|
|||
USE_PKGCONFIG(UNZIP minizip)
|
||||
ENDIF()
|
||||
ENDIF ()
|
||||
@@ -717,9 +715,8 @@ ELSE()
|
||||
SET(DRACO_TESTS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
- IF(ASSIMP_HUNTER_ENABLED)
|
||||
- hunter_add_package(draco)
|
||||
- find_package(draco CONFIG REQUIRED)
|
||||
- SET(draco_LIBRARIES draco::draco)
|
||||
- ELSE()
|
||||
+ IF(1)
|
||||
+ find_package(draco CONFIG REQUIRED)
|
||||
+ SET(draco_LIBRARIES draco::draco)
|
||||
+ ELSE()
|
||||
# Draco 1.4.1 has many warnings and will not build with /WX or -Werror
|
||||
# See https://github.com/google/draco/issues/672
|
||||
diff --git a/cmake-modules/assimp-plain-config.cmake.in b/cmake-modules/assimp-plain-config.cmake.in
|
||||
index 6551dcb..dd65b0b 100644
|
||||
--- a/cmake-modules/assimp-plain-config.cmake.in
|
||||
+++ b/cmake-modules/assimp-plain-config.cmake.in
|
||||
@@ -1,5 +1,17 @@
|
||||
@@ -1,5 +1,20 @@
|
||||
@PACKAGE_INIT@
|
||||
+include(CMakeFindDependencyMacro)
|
||||
|
||||
+if(NOT "@BUILD_SHARED_LIBS@")
|
||||
+ find_dependency(zip CONFIG)
|
||||
+ if(@ASSIMP_BUILD_DRACO@)
|
||||
+ find_dependency(draco CONFIG)
|
||||
+ endif()
|
||||
+ find_dependency(unofficial-minizip CONFIG)
|
||||
+ find_dependency(pugixml CONFIG)
|
||||
+ find_dependency(poly2tri CONFIG)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@ file(REMOVE_RECURSE "${SOURCE_PATH}/contrib/zlib")
|
|||
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
||||
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
draco ASSIMP_BUILD_DRACO
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
|
|
@ -37,6 +42,7 @@ vcpkg_cmake_configure(
|
|||
-DASSIMP_WARNINGS_AS_ERRORS=OFF
|
||||
-DASSIMP_IGNORE_GIT_HASH=ON
|
||||
-DASSIMP_INSTALL_PDB=OFF
|
||||
${FEATURE_OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
|
@ -71,7 +77,10 @@ if(ASSIMP_DBG)
|
|||
endif()
|
||||
|
||||
if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
|
||||
set(assimp_PC_REQUIRES "draco polyclipping pugixml minizip")
|
||||
set(assimp_PC_REQUIRES "polyclipping pugixml minizip")
|
||||
if("draco" IN_LIST FEATURES)
|
||||
string(APPEND assimp_PC_REQUIRES " draco")
|
||||
endif()
|
||||
set(assimp_LIBS_REQUIRES "-lpoly2tri")
|
||||
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/assimp.pc" "Libs:" "Requires.private: ${assimp_PC_REQUIRES}\nLibs:")
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "assimp",
|
||||
"version": "6.0.4",
|
||||
"port-version": 1,
|
||||
"description": "The Open Asset import library",
|
||||
"homepage": "https://github.com/assimp/assimp",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": [
|
||||
"draco",
|
||||
"jhasse-poly2tri",
|
||||
"kubazip",
|
||||
"minizip",
|
||||
|
|
@ -23,5 +23,13 @@
|
|||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
]
|
||||
],
|
||||
"features": {
|
||||
"draco": {
|
||||
"description": "Enable Draco compressed mesh support",
|
||||
"dependencies": [
|
||||
"draco"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "534707328f097e773a0de049e8de9bd0f8a620ee",
|
||||
"version": "6.0.4",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "844278e86f9a397d023eec5b4395f81f5739c3ad",
|
||||
"version": "6.0.4",
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@
|
|||
},
|
||||
"assimp": {
|
||||
"baseline": "6.0.4",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"astr": {
|
||||
"baseline": "0.3.1",
|
||||
|
|
|
|||
Loading…
Reference in New Issue