-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[minizip,xlsxio,fmilib,collada-dom] Minizip fixes, xlsxio update (#30930
) * [minizip] Misc fixes * [minizip] CMake config is unofficial * [xlsxio] Update, fixes * [collada-dom] Fix minizip * [fmilib] Fix minizip * [xlsxio] Fix vcpkg quirk
- Loading branch information
Showing
23 changed files
with
267 additions
and
268 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,13 +1,14 @@ | ||
diff --git a/dom/src/modules/LIBXMLPlugin/daeLIBXMLPlugin.cpp b/dom/src/modules/LIBXMLPlugin/daeLIBXMLPlugin.cpp | ||
index 4536275..77651f9 100644 | ||
--- a/dom/src/modules/LIBXMLPlugin/daeLIBXMLPlugin.cpp | ||
+++ b/dom/src/modules/LIBXMLPlugin/daeLIBXMLPlugin.cpp | ||
@@ -32,7 +32,7 @@ | ||
#include <iomanip> | ||
using namespace std; | ||
|
||
-#include <zip.h> // for saving compressed files | ||
+#include <minizip/zip.h> // for saving compressed files | ||
#ifdef _WIN32 | ||
#include <iowin32.h> | ||
#else | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index f6c2bb6..3351ab0 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -222,7 +222,8 @@ else() | ||
endif() | ||
endif() | ||
|
||
-pkg_check_modules(minizip minizip) | ||
+find_package(minizip NAMES unofficial-minizip REQUIRED) | ||
+add_library(minizip ALIAS unofficial::minizip::minizip) | ||
if(minizip_FOUND) | ||
set(MINIZIP_INCLUDE_DIR ${minizip_INCLUDE_DIRS}) | ||
else() |
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,52 @@ | ||
diff --git a/ThirdParty/Minizip/minizip/miniunz.c b/ThirdParty/Minizip/minizip/miniunz.c | ||
index 1931161..d7a8be1 100644 | ||
--- a/ThirdParty/Minizip/minizip/miniunz.c | ||
+++ b/ThirdParty/Minizip/minizip/miniunz.c | ||
@@ -45,6 +45,7 @@ | ||
#include <time.h> | ||
#include <errno.h> | ||
#include <fcntl.h> | ||
+#include <sys/stat.h> | ||
#include <stdarg.h> | ||
|
||
#ifdef _WIN32 | ||
@@ -107,7 +108,7 @@ void change_file_date(filename,dosdate,tmu_date) | ||
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); | ||
CloseHandle(hFile); | ||
#else | ||
-#ifdef unix || __APPLE__ | ||
+#if defined(unix) || defined(__APPLE__) | ||
struct utimbuf ut; | ||
struct tm newdate; | ||
newdate.tm_sec = tmu_date.tm_sec; | ||
@@ -137,7 +138,7 @@ int mymkdir(dirname) | ||
int ret=0; | ||
#ifdef _WIN32 | ||
ret = _mkdir(dirname); | ||
-#elif unix | ||
+#elif 1 | ||
ret = mkdir (dirname,0775); | ||
#elif __APPLE__ | ||
ret = mkdir (dirname,0775); | ||
diff --git a/ThirdParty/Minizip/minizip/minizip.c b/ThirdParty/Minizip/minizip/minizip.c | ||
index e22f80d..548b6ca 100644 | ||
--- a/ThirdParty/Minizip/minizip/minizip.c | ||
+++ b/ThirdParty/Minizip/minizip/minizip.c | ||
@@ -101,7 +101,7 @@ uLong filetime(f, tmzip, dt) | ||
return ret; | ||
} | ||
#else | ||
-#ifdef unix || __APPLE__ | ||
+#if defined(unix) || defined(__APPLE__) | ||
uLong filetime(f, tmzip, dt) | ||
char *f; /* name of file to get info on */ | ||
tm_zip *tmzip; /* return value: access, modific. and creation times */ | ||
@@ -453,7 +453,7 @@ int minizip(argc,argv) | ||
} | ||
if( lastslash != NULL ) | ||
{ | ||
- savefilenameinzip = lastslash+1; // base filename follows last slash. | ||
+ savefilenameinzip = lastslash+1; | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include(CMakeFindDependencyMacro) | ||
find_dependency(expat CONFIG) | ||
find_dependency(minizip CONFIG) | ||
find_dependency(unofficial-minizip CONFIG) | ||
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-fmilib-targets.cmake") |
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 |
---|---|---|
@@ -1,104 +1,111 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(minizip VERSION 1.2.13 LANGUAGES C) | ||
cmake_minimum_required(VERSION 3.25) | ||
project(minizip LANGUAGES C) | ||
|
||
if(MSVC) | ||
add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) | ||
endif() | ||
|
||
find_package(ZLIB REQUIRED) | ||
set(MIN_SRC contrib/minizip) | ||
|
||
include_directories(${MIN_SRC} ${ZLIB_INCLUDE_DIRS}) | ||
|
||
set(MINIZIP_LIBRARIES ZLIB::ZLIB) | ||
if(ENABLE_BZIP2) | ||
message(STATUS "Building with bzip2 support") | ||
find_package(BZip2) | ||
|
||
include_directories(${BZIP2_INCLUDE_DIR}) | ||
set(MINIZIP_LIBRARIES ${MINIZIP_LIBRARIES} ${BZIP2_LIBRARIES}) | ||
else() | ||
message(STATUS "Building without bzip2 support") | ||
endif() | ||
|
||
set(SRC | ||
${MIN_SRC}/ioapi.c | ||
${MIN_SRC}/unzip.c | ||
${MIN_SRC}/zip.c | ||
${MIN_SRC}/mztools.c | ||
ioapi.c | ||
unzip.c | ||
zip.c | ||
mztools.c | ||
) | ||
if(WIN32) | ||
list(APPEND SRC ${MIN_SRC}/iowin32.c) | ||
endif() | ||
|
||
set(HEADERS | ||
${MIN_SRC}/crypt.h | ||
${MIN_SRC}/ioapi.h | ||
${MIN_SRC}/unzip.h | ||
${MIN_SRC}/zip.h | ||
${MIN_SRC}/mztools.h | ||
crypt.h | ||
ioapi.h | ||
unzip.h | ||
zip.h | ||
mztools.h | ||
) | ||
if(WIN32) | ||
list(APPEND HEADERS ${MIN_SRC}/iowin32.h) | ||
list(APPEND SRC iowin32.c) | ||
list(APPEND HEADERS iowin32.h) | ||
endif() | ||
|
||
add_library(minizip ${SRC}) | ||
target_include_directories(minizip PUBLIC $<INSTALL_INTERFACE:include/minizip>) | ||
|
||
target_link_libraries(minizip PRIVATE ZLIB::ZLIB) | ||
find_package(ZLIB REQUIRED) | ||
target_compile_definitions(minizip PRIVATE -D_ZLIB_H) | ||
target_link_libraries(minizip PUBLIC ZLIB::ZLIB) | ||
set(MINIZIP_REQUIRES zlib) | ||
|
||
if(ENABLE_BZIP2) | ||
target_link_libraries(minizip PUBLIC ${BZIP2_LIBRARIES}) | ||
message(STATUS "Building with bzip2 support") | ||
find_package(BZip2 REQUIRED) | ||
target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1) | ||
target_link_libraries(minizip PUBLIC BZip2::BZip2) | ||
list(APPEND MINIZIP_REQUIRES bzip2) | ||
else() | ||
message(STATUS "Building without bzip2 support") | ||
endif() | ||
|
||
if(ANDROID) | ||
target_compile_definitions(minizip PRIVATE IOAPI_NO_64) | ||
endif() | ||
|
||
if(NOT DISABLE_INSTALL_TOOLS) | ||
add_executable(minizip_bin ${MIN_SRC}/minizip.c) | ||
add_executable(miniunz_bin ${MIN_SRC}/miniunz.c) | ||
add_executable(minizip_bin minizip.c) | ||
add_executable(miniunz_bin miniunz.c) | ||
|
||
target_link_libraries(minizip_bin minizip ${MINIZIP_LIBRARIES}) | ||
target_link_libraries(miniunz_bin minizip ${MINIZIP_LIBRARIES}) | ||
target_link_libraries(minizip_bin minizip) | ||
target_link_libraries(miniunz_bin minizip) | ||
|
||
set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip) | ||
set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz) | ||
|
||
install ( | ||
TARGETS minizip_bin miniunz_bin | ||
RUNTIME DESTINATION bin | ||
) | ||
endif() | ||
|
||
install( | ||
TARGETS minizip | ||
EXPORT minizipTargets | ||
EXPORT unofficial-minizipTargets | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib | ||
) | ||
|
||
include(CMakePackageConfigHelpers) | ||
write_basic_package_version_file("${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake" | ||
COMPATIBILITY SameMajorVersion) | ||
write_basic_package_version_file("${PROJECT_BINARY_DIR}/unofficial-minizipConfigVersion.cmake" | ||
VERSION "${PACKAGE_VERSION}" | ||
COMPATIBILITY SameMajorVersion | ||
) | ||
|
||
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/minizipConfig.cmake.in | ||
minizipConfig.cmake | ||
INSTALL_DESTINATION share/minizip) | ||
configure_package_config_file(unofficial-minizipConfig.cmake.in | ||
unofficial-minizipConfig.cmake | ||
INSTALL_DESTINATION share/unofficial-minizip | ||
) | ||
|
||
install(FILES | ||
"${PROJECT_BINARY_DIR}/minizipConfig.cmake" | ||
"${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake" | ||
DESTINATION share/minizip | ||
"${PROJECT_BINARY_DIR}/unofficial-minizipConfig.cmake" | ||
"${PROJECT_BINARY_DIR}/unofficial-minizipConfigVersion.cmake" | ||
DESTINATION share/unofficial-minizip | ||
) | ||
|
||
install(EXPORT minizipTargets | ||
NAMESPACE minizip:: | ||
DESTINATION share/minizip | ||
install(EXPORT unofficial-minizipTargets | ||
NAMESPACE unofficial::minizip:: | ||
DESTINATION share/unofficial-minizip | ||
) | ||
|
||
if(NOT DISABLE_INSTALL_TOOLS) | ||
install ( | ||
TARGETS minizip_bin miniunz_bin | ||
RUNTIME DESTINATION tools/minizip | ||
) | ||
endif() | ||
|
||
if(NOT DISABLE_INSTALL_HEADERS) | ||
install(FILES ${HEADERS} DESTINATION include/minizip) | ||
endif() | ||
|
||
list(JOIN MINIZIP_REQUIRES " " MINIZIP_REQUIRES) | ||
set(exec_prefix "\${prefix}") | ||
set(libdir "\${prefix}/lib") | ||
set(includedir "\${prefix}/include") | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/minizip.pc.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/minizip.pc" | ||
@ONLY | ||
) | ||
install( | ||
FILES "${CMAKE_CURRENT_BINARY_DIR}/minizip.pc" | ||
DESTINATION lib/pkgconfig | ||
) | ||
|
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,12 +1,10 @@ | ||
#@PACKAGE_INIT@ | ||
message(WARNING "'find_package(minizip CONFIG)' is deprecated. Please use 'find_package(unofficial-minizip CONFIG)' instead.") | ||
|
||
include(CMakeFindDependencyMacro) | ||
|
||
find_dependency(ZLIB) | ||
|
||
if (@ENABLE_BZIP2@) | ||
find_dependency(BZip2) | ||
find_dependency(unofficial-minizip ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} CONFIG) | ||
if(NOT TARGET unofficial::minizip::minizip) | ||
set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) | ||
elseif(NOT TARGET minizip::minizip) | ||
add_library(minizip::minizip INTERFACE IMPORTED) | ||
set_target_properties(minizip::minizip PROPERTIES INTERFACE_LINK_LIBRARIES unofficial::minizip::minizip) | ||
endif() | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff --git a/contrib/minizip/minizip.pc.in b/contrib/minizip/minizip.pc.in | ||
index 69b5b7f..9e43084 100644 | ||
--- a/contrib/minizip/minizip.pc.in | ||
+++ b/contrib/minizip/minizip.pc.in | ||
@@ -8,5 +8,5 @@ Description: Minizip zip file manipulation library | ||
Requires: | ||
Version: @PACKAGE_VERSION@ | ||
Libs: -L${libdir} -lminizip | ||
-Libs.private: -lz | ||
+Requires.private: @MINIZIP_REQUIRES@ | ||
Cflags: -I${includedir} |
Oops, something went wrong.