forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[minizip assimp] export minizip cmake targets and fix minizip depende…
…ncy in assimp (microsoft#9075) * [minizip assimp] export minizip cmake targets and fix minizip dependency in assimp * Update CMakeList.txt * Update obsolete functions
- Loading branch information
Showing
7 changed files
with
93 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Source: assimp | ||
Version: 5.0.0-1 | ||
Version: 5.0.0-2 | ||
Homepage: https://github.com/assimp/assimp | ||
Description: The Open Asset import library | ||
Build-Depends: zlib, rapidjson | ||
Build-Depends: zlib, rapidjson, minizip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 6c3d03e..4cb6927 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -470,12 +470,12 @@ ENDIF(HUNTER_ENABLED) | ||
|
||
IF( NOT IOS ) | ||
IF( NOT ASSIMP_BUILD_MINIZIP ) | ||
- use_pkgconfig(UNZIP minizip) | ||
+ find_package(minizip CONFIG REQUIRED) | ||
ENDIF( NOT ASSIMP_BUILD_MINIZIP ) | ||
ELSE ( NOT IOS ) | ||
IF( NOT BUILD_SHARED_LIBS ) | ||
IF( NOT ASSIMP_BUILD_MINIZIP ) | ||
- use_pkgconfig(UNZIP minizip) | ||
+ find_package(minizip CONFIG REQUIRED) | ||
ENDIF( NOT ASSIMP_BUILD_MINIZIP ) | ||
ENDIF ( NOT BUILD_SHARED_LIBS ) | ||
ENDIF ( NOT IOS ) | ||
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt | ||
index 55538d9..30568ff 100644 | ||
--- a/code/CMakeLists.txt | ||
+++ b/code/CMakeLists.txt | ||
@@ -1125,7 +1125,7 @@ IF(HUNTER_ENABLED) | ||
zip::zip | ||
) | ||
ELSE(HUNTER_ENABLED) | ||
- TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} ) | ||
+ TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} minizip::minizip) | ||
ENDIF(HUNTER_ENABLED) | ||
|
||
if(ASSIMP_ANDROID_JNIIOSYSTEM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
check_required_components("@PROJECT_NAME@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,44 @@ | ||
include(vcpkg_common_functions) | ||
|
||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) | ||
message(FATAL_ERROR "WindowsStore not supported") | ||
endif() | ||
|
||
vcpkg_fail_port_install(ON_TARGET "uwp") | ||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO madler/zlib | ||
REF v1.2.11 | ||
SHA512 104c62ed1228b5f1199bc037081861576900eb0697a226cafa62a35c4c890b5cb46622e399f9aad82ee5dfb475bae26ae75e2bd6da3d261361b1c8b996970faf | ||
HEAD_REF master | ||
PATCHES minizip.patch # enable decrypt support for password-encrypted ZIP files | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO madler/zlib | ||
REF v1.2.11 | ||
SHA512 104c62ed1228b5f1199bc037081861576900eb0697a226cafa62a35c4c890b5cb46622e399f9aad82ee5dfb475bae26ae75e2bd6da3d261361b1c8b996970faf | ||
HEAD_REF master | ||
PATCHES minizip.patch # enable decrypt support for password-encrypted ZIP files | ||
) | ||
|
||
set(BUILD_minizip_bzip2 OFF) | ||
if ("bzip2" IN_LIST FEATURES) | ||
set(BUILD_minizip_bzip2 ON) | ||
endif() | ||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
bzip2 ENABLE_BZIP2 | ||
) | ||
|
||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) | ||
configure_file(${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in ${SOURCE_PATH}/cmake/minizipConfig.cmake.in COPYONLY) | ||
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS | ||
-DENABLE_BZIP2=${BUILD_minizip_bzip2} | ||
OPTIONS_DEBUG | ||
-DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS | ||
${FEATURE_OPTIONS} | ||
OPTIONS_DEBUG | ||
-DDISABLE_INSTALL_HEADERS=ON | ||
-DDISABLE_INSTALL_TOOLS=ON | ||
) | ||
|
||
vcpkg_install_cmake() | ||
vcpkg_copy_pdbs() | ||
|
||
vcpkg_fixup_cmake_targets() | ||
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/minizip) | ||
|
||
if ("bzip2" IN_LIST FEATURES) | ||
file(GLOB HEADERS "${CURRENT_PACKAGES_DIR}/include/minizip/*.h") | ||
foreach(HEADER ${HEADERS}) | ||
file(READ "${HEADER}" _contents) | ||
string(REPLACE "#ifdef HAVE_BZIP2" "#if 1" _contents "${_contents}") | ||
file(WRITE "${HEADER}" "${_contents}") | ||
endforeach() | ||
file(GLOB HEADERS "${CURRENT_PACKAGES_DIR}/include/minizip/*.h") | ||
foreach(HEADER ${HEADERS}) | ||
file(READ "${HEADER}" _contents) | ||
string(REPLACE "#ifdef HAVE_BZIP2" "#if 1" _contents "${_contents}") | ||
file(WRITE "${HEADER}" "${_contents}") | ||
endforeach() | ||
endif() | ||
|
||
file(INSTALL ${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/minizip RENAME copyright) | ||
file(INSTALL ${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |