[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
This commit is contained in:
Kai Pastor 2023-04-26 07:40:19 +02:00 committed by GitHub
parent 463a9b7a40
commit 326968a70b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 274 additions and 275 deletions

View File

@ -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()

View File

@ -1,7 +1,7 @@
{
"name": "collada-dom",
"version": "2.5.0",
"port-version": 8,
"port-version": 9,
"description": "The COLLADA Document Object Model (DOM) is an application programming interface (API) that provides a C++ object representation of a COLLADA XML instance document.",
"homepage": "https://github.com/rdiankov/collada-dom",
"license": null,

View File

@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b01aba5..583e15b 100644
index 690ee5f..2816987 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -230,7 +230,7 @@ configure_file (
@ -7,7 +7,7 @@ index b01aba5..583e15b 100644
)
-set(FMILIB_SHARED_SUBLIBS ${FMIXML_LIBRARIES} ${FMIZIP_LIBRARIES} ${FMICAPI_LIBRARIES} expat minizip zlib c99snprintf)
+set(FMILIB_SHARED_SUBLIBS ${FMIXML_LIBRARIES} ${FMIZIP_LIBRARIES} ${FMICAPI_LIBRARIES} c99snprintf)
+set(FMILIB_SHARED_SUBLIBS ${FMIXML_LIBRARIES} ${FMIZIP_LIBRARIES} ${FMICAPI_LIBRARIES} minizip c99snprintf)
set(FMILIB_SUBLIBS ${FMIIMPORT_LIBRARIES} ${JMUTIL_LIBRARIES} ${FMILIB_SHARED_SUBLIBS})
set(FMILIB_SHARED_SRC ${FMIIMPORTSOURCE} ${JMUTILSOURCE} ${FMIIMPORTHEADERS})
@ -35,16 +35,20 @@ index ddd3c1f..3bafac3 100644
include_directories("${EXPAT_INCLUDE_DIRS}" "${FMILIB_THIRDPARTYLIBS}/FMI/" "${FMIXMLGENDIR}/FMI1" "${FMIXMLGENDIR}/FMI2")
diff --git a/Config.cmake/fmizip.cmake b/Config.cmake/fmizip.cmake
index 091fc4d..c53555f 100644
index c046d47..50e82b3 100644
--- a/Config.cmake/fmizip.cmake
+++ b/Config.cmake/fmizip.cmake
@@ -20,7 +20,8 @@ if(NOT FMIZIPDIR)
@@ -20,7 +20,12 @@ if(NOT FMIZIPDIR)
set(FMIZIP_LIBRARIES fmizip)
- add_subdirectory(Config.cmake/Minizip)
+ find_package(minizip CONFIG REQUIRED)
+ add_library(minizip ALIAS minizip::minizip)
+ add_library(minizip OBJECT
+ "${FMILIB_THIRDPARTYLIBS}/Minizip/minizip/miniunz.c"
+ "${FMILIB_THIRDPARTYLIBS}/Minizip/minizip/minizip.c"
+ )
+ find_package(unofficial-minizip CONFIG REQUIRED)
+ target_link_libraries(minizip PRIVATE unofficial::minizip::minizip)
include_directories("${FMIZIPDIR}/include" "${FMILIB_THIRDPARTYLIBS}/Minizip/minizip" "${FMILIB_THIRDPARTYLIBS}/FMI" "${FMILIB_THIRDPARTYLIBS}/Zlib/zlib-1.2.6" "${FMILibrary_BINARY_DIR}/zlib")

View File

@ -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;
}
}

View File

@ -8,13 +8,16 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
devendor-sublibs.diff
minizip.patch
fix-mergestaticlibs.diff
unofficial-export.diff
)
file(REMOVE RECURSE
file(GLOB vendored_minizip "${SOURCE_PATH}/ThirdParty/Minizip/minizip/*")
list(FILTER vendored_minizip EXCLUDE REGEX "/minizip.[ch]\$|/miniunz.[ch]\$")
file(REMOVE_RECURSE
${vendored_minizip}
"${SOURCE_PATH}/ThirdParty/Expat"
"${SOURCE_PATH}/ThirdParty/Minizip"
"${SOURCE_PATH}/ThirdParty/Zlib"
)

View File

@ -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")

View File

@ -1,7 +1,7 @@
{
"name": "fmilib",
"version": "2.4.1",
"port-version": 1,
"port-version": 2,
"description": "FMI library is intended as a foundation for applications interfacing FMUs (Functional Mockup Units) that follow FMI Standard. This version of the library supports FMI 1.0 and FMI2.0.",
"homepage": "https://www.fmi-standard.org/",
"license": "BSD-3-Clause",

View File

@ -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()
set(SRC
ioapi.c
unzip.c
zip.c
mztools.c
)
set(HEADERS
crypt.h
ioapi.h
unzip.h
zip.h
mztools.h
)
if(WIN32)
list(APPEND SRC iowin32.c)
list(APPEND HEADERS iowin32.h)
endif()
add_library(minizip ${SRC})
target_include_directories(minizip PUBLIC $<INSTALL_INTERFACE:include/minizip>)
find_package(ZLIB REQUIRED)
set(MIN_SRC contrib/minizip)
target_compile_definitions(minizip PRIVATE -D_ZLIB_H)
target_link_libraries(minizip PUBLIC ZLIB::ZLIB)
set(MINIZIP_REQUIRES zlib)
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})
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()
set(SRC
${MIN_SRC}/ioapi.c
${MIN_SRC}/unzip.c
${MIN_SRC}/zip.c
${MIN_SRC}/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
)
if(WIN32)
list(APPEND HEADERS ${MIN_SRC}/iowin32.h)
endif()
add_library(minizip ${SRC})
target_link_libraries(minizip PRIVATE ZLIB::ZLIB)
target_compile_definitions(minizip PRIVATE -D_ZLIB_H)
if(ENABLE_BZIP2)
target_link_libraries(minizip PUBLIC ${BZIP2_LIBRARIES})
target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1)
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)
target_link_libraries(minizip_bin minizip ${MINIZIP_LIBRARIES})
target_link_libraries(miniunz_bin minizip ${MINIZIP_LIBRARIES})
if(NOT DISABLE_INSTALL_TOOLS)
add_executable(minizip_bin minizip.c)
add_executable(miniunz_bin miniunz.c)
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
)

View File

@ -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}/@PROJECT_NAME@Targets.cmake")
check_required_components("@PROJECT_NAME@")

View File

@ -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}

View File

@ -12,38 +12,47 @@ vcpkg_from_github(
0001-remove-ifndef-NOUNCRYPT.patch
0002-add-declaration-for-mkdir.patch
0003-no-io64.patch
pkgconfig.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
bzip2 ENABLE_BZIP2
INVERTED_FEATURES
tools DISABLE_INSTALL_TOOLS
)
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)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
"${CMAKE_CURRENT_LIST_DIR}/unofficial-minizipConfig.cmake.in"
DESTINATION "${SOURCE_PATH}/contrib/minizip"
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
SOURCE_PATH "${SOURCE_PATH}/contrib/minizip"
OPTIONS
${FEATURE_OPTIONS}
-DDISABLE_INSTALL_TOOLS=${VCPKG_TARGET_IS_IOS}
-DPACKAGE_VERSION=${VERSION}
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
-DDISABLE_INSTALL_TOOLS=ON
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/minizip")
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-minizip)
vcpkg_fixup_pkgconfig()
if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES minizip miniunz AUTO_CLEAN)
endif()
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}")
vcpkg_replace_string("${HEADER}" "#ifdef HAVE_BZIP2" "#if 1")
endforeach()
endif()
configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/minizipConfig.cmake" @ONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt")

View File

@ -0,0 +1,10 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(ZLIB)
if ("@ENABLE_BZIP2@")
find_dependency(BZip2)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-minizipTargets.cmake")
check_required_components(unofficial-minizip)

View File

@ -1,4 +1,4 @@
minizip provides CMake targets:
find_package(minizip CONFIG REQUIRED)
target_link_libraries(main PRIVATE minizip::minizip)
find_package(unofficial-minizip CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::minizip::minizip)

View File

@ -1,7 +1,8 @@
{
"name": "minizip",
"version-semver": "1.2.13",
"description": "Zip compression library",
"port-version": 1,
"description": "Minizip zip file manipulation library",
"homepage": "https://github.com/madler/zlib",
"license": "Zlib",
"supports": "!uwp",
@ -22,6 +23,10 @@
"dependencies": [
"bzip2"
]
},
"tools": {
"description": "Install tools",
"supports": "!ios"
}
}
}

View File

@ -1,138 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05c7ee5..28a0206 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,8 @@ INCLUDE_DIRECTORIES(${ANYZIP_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIRS})
# build definitions
-SET(ALLTARGETS)
+SET(ALLTARGETS_LIB)
+SET(ALLTARGETS_EXE)
SET(LINKTYPES)
IF(BUILD_STATIC)
LIST(APPEND LINKTYPES "STATIC")
@@ -106,7 +107,7 @@ FOREACH(LINKTYPE ${LINKTYPES})
ENDIF()
TARGET_INCLUDE_DIRECTORIES(xlsxio_read_${LINKTYPE} PRIVATE lib)
TARGET_LINK_LIBRARIES(xlsxio_read_${LINKTYPE} ${ANYZIP_LIBRARIES} ${EXPAT_LIBRARIES})
- SET(ALLTARGETS ${ALLTARGETS} xlsxio_read_${LINKTYPE})
+ SET(ALLTARGETS_LIB ${ALLTARGETS_LIB} xlsxio_read_${LINKTYPE})
ADD_LIBRARY(xlsxio_write_${LINKTYPE} ${LINKTYPE} lib/xlsxio_write.c)
SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "BUILD_XLSXIO;${ANYZIP_DEF};BUILD_XLSXIO_${LINKTYPE}")
@@ -115,7 +116,7 @@ FOREACH(LINKTYPE ${LINKTYPES})
SET_TARGET_PROPERTIES(xlsxio_write_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_write.def")
ENDIF()
TARGET_LINK_LIBRARIES(xlsxio_write_${LINKTYPE} ${ANYZIP_LIBRARIES} ${THREADLIB})
- SET(ALLTARGETS ${ALLTARGETS} xlsxio_write_${LINKTYPE})
+ SET(ALLTARGETS_LIB ${ALLTARGETS_LIB} xlsxio_write_${LINKTYPE})
IF(WITH_WIDE)
ADD_LIBRARY(xlsxio_readw_${LINKTYPE} ${LINKTYPE} lib/xlsxio_read.c lib/xlsxio_read_sharedstrings.c)
@@ -127,7 +128,7 @@ FOREACH(LINKTYPE ${LINKTYPES})
ENDIF()
TARGET_INCLUDE_DIRECTORIES(xlsxio_readw_${LINKTYPE} PRIVATE lib)
TARGET_LINK_LIBRARIES(xlsxio_readw_${LINKTYPE} ${ANYZIP_LIBRARIES} ${EXPATW_LIBRARIES})
- SET(ALLTARGETS ${ALLTARGETS} xlsxio_readw_${LINKTYPE})
+ SET(ALLTARGETS_LIB ${ALLTARGETS_LIB} xlsxio_readw_${LINKTYPE})
#ADD_LIBRARY(xlsxio_writew_${LINKTYPE} ${LINKTYPE} lib/xlsxio_write.c)
#SET_TARGET_PROPERTIES(xlsxio_writew_${LINKTYPE} PROPERTIES DEFINE_SYMBOL "BUILD_XLSXIO_DLL")
@@ -137,7 +138,7 @@ FOREACH(LINKTYPE ${LINKTYPES})
# SET_TARGET_PROPERTIES(xlsxio_writew_${LINKTYPE} PROPERTIES LINK_FLAGS "-Wl,--output-def=libxlsxio_writew.def")
#ENDIF()
#TARGET_LINK_LIBRARIES(xlsxio_writew_${LINKTYPE} ${ANYZIP_LIBRARIES} ${THREADLIB})
- #SET(ALLTARGETS ${ALLTARGETS} xlsxio_writew_${LINKTYPE})
+ #SET(ALLTARGETS_LIB ${ALLTARGETS_LIB} xlsxio_writew_${LINKTYPE})
ENDIF()
SET(EXELINKTYPE ${LINKTYPE})
@@ -148,35 +149,35 @@ ENDFOREACH()
IF(BUILD_TOOLS)
ADD_EXECUTABLE(xlsxio_xlsx2csv src/xlsxio_xlsx2csv.c)
TARGET_LINK_LIBRARIES(xlsxio_xlsx2csv xlsxio_read_${EXELINKTYPE})
- SET(ALLTARGETS ${ALLTARGETS} xlsxio_xlsx2csv)
+ SET(ALLTARGETS_EXE ${ALLTARGETS_EXE} xlsxio_xlsx2csv)
ADD_EXECUTABLE(xlsxio_csv2xlsx src/xlsxio_csv2xlsx.c)
TARGET_LINK_LIBRARIES(xlsxio_csv2xlsx xlsxio_write_${EXELINKTYPE})
- SET(ALLTARGETS ${ALLTARGETS} xlsxio_csv2xlsx)
+ SET(ALLTARGETS_EXE ${ALLTARGETS_EXE} xlsxio_csv2xlsx)
ENDIF()
IF(BUILD_EXAMPLES)
ADD_EXECUTABLE(example_xlsxio_write_getversion examples/example_xlsxio_write_getversion.c)
TARGET_LINK_LIBRARIES(example_xlsxio_write_getversion xlsxio_write_${EXELINKTYPE})
- SET(ALLTARGETS ${ALLTARGETS} example_xlsxio_write_getversion)
+ SET(ALLTARGETS_EXE ${ALLTARGETS_EXE} example_xlsxio_write_getversion)
ADD_EXECUTABLE(example_xlsxio_write examples/example_xlsxio_write.c)
TARGET_LINK_LIBRARIES(example_xlsxio_write xlsxio_write_${EXELINKTYPE})
- SET(ALLTARGETS ${ALLTARGETS} example_xlsxio_write)
+ SET(ALLTARGETS_EXE ${ALLTARGETS_EXE} example_xlsxio_write)
ADD_EXECUTABLE(example_xlsxio_read examples/example_xlsxio_read.c)
TARGET_LINK_LIBRARIES(example_xlsxio_read xlsxio_read_${EXELINKTYPE})
- SET(ALLTARGETS ${ALLTARGETS} example_xlsxio_read)
+ SET(ALLTARGETS_EXE ${ALLTARGETS_EXE} example_xlsxio_read)
ADD_EXECUTABLE(example_xlsxio_read_advanced examples/example_xlsxio_read_advanced.c)
TARGET_LINK_LIBRARIES(example_xlsxio_read_advanced xlsxio_read_${EXELINKTYPE})
- SET(ALLTARGETS ${ALLTARGETS} example_xlsxio_read_advanced)
+ SET(ALLTARGETS_EXE ${ALLTARGETS_EXE} example_xlsxio_read_advanced)
IF(WITH_WIDE)
ADD_EXECUTABLE(example_xlsxio_readw examples/example_xlsxio_read.c)
SET_TARGET_PROPERTIES(example_xlsxio_readw PROPERTIES COMPILE_DEFINITIONS "XML_UNICODE")
TARGET_LINK_LIBRARIES(example_xlsxio_readw xlsxio_readw_${EXELINKTYPE})
- SET(ALLTARGETS ${ALLTARGETS} example_xlsxio_readw)
+ SET(ALLTARGETS_EXE ${ALLTARGETS_EXE} example_xlsxio_readw)
ENDIF()
ENDIF()
@@ -200,7 +201,43 @@ IF(BUILD_DOCUMENTATION)
ENDIF()
# installation specifications
-INSTALL(TARGETS ${ALLTARGETS}
+INSTALL(TARGETS ${ALLTARGETS_LIB}
+ EXPORT xlsxioTargets
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+)
+INSTALL(EXPORT xlsxioTargets
+ NAMESPACE xlsxio::
+ DESTINATION cmake
+)
+FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xlsxio-config.cmake.in"
+[[INCLUDE(CMakeFindDependencyMacro)
+IF (@WITH_LIBZIP@)
+ FIND_DEPENDENCY(LibZip)
+ELSE()
+ FIND_DEPENDENCY(minizip CONFIG)
+ENDIF()
+IF (@EXPAT_DIR@)
+ FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/include ${EXPAT_DIR})
+ FIND_LIBRARY(EXPAT_LIBRARIES NAMES expat libexpat NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR})
+ELSE()
+ FIND_DEPENDENCY(EXPAT)
+ENDIF()
+
+IF(@WITH_WIDE@)
+ IF(@EXPAT_DIR@)
+ FIND_LIBRARY(EXPATW_LIBRARIES NAMES expatw libexpatw NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR})
+ ELSE()
+ FIND_LIBRARY(EXPATW_LIBRARIES NAMES expatw)
+ ENDIF()
+ENDIF()
+INCLUDE("${CMAKE_CURRENT_LIST_DIR}/xlsxioTargets.cmake")
+]])
+CONFIGURE_FILE("${CMAKE_CURRENT_BINARY_DIR}/xlsxio-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/xlsxio-config.cmake" @ONLY)
+INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/xlsxio-config.cmake" DESTINATION cmake)
+
+INSTALL(TARGETS ${ALLTARGETS_EXE}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin

View File

@ -1,16 +1,41 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 490ee5c..05c7ee5 100644
index 7e86706..f2bdc36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,9 +49,8 @@ IF(WITH_LIBZIP)
SET(ANYZIP_LIBRARIES ${LIBZIP_LIBRARIES})
SET(ANYZIP_DEF USE_LIBZIP)
@@ -57,7 +57,9 @@ ELSEIF(WITH_MINIZIP_NG)
SET(ANYZIP_LIBRARIES minizip${MINIZIP_NG_SUFFIX})
SET(ANYZIP_DEF USE_MINIZIP;USE_MINIZIP_NG)
ELSE()
- FIND_PACKAGE(Minizip REQUIRED)
- SET(ANYZIP_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS})
- SET(ANYZIP_LIBRARIES ${MINIZIP_LIBRARIES})
+ FIND_PACKAGE(minizip CONFIG REQUIRED)
+ SET(ANYZIP_LIBRARIES minizip::minizip)
+ FIND_PACKAGE(Minizip NAMES unofficial-minizip REQUIRED)
+ SET(MINIZIP_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
+ SET(MINIZIP_LIBRARIES unofficial::minizip::minizip)
SET(ANYZIP_INCLUDE_DIRS ${MINIZIP_INCLUDE_DIRS})
SET(ANYZIP_LIBRARIES ${MINIZIP_LIBRARIES})
SET(ANYZIP_DEF USE_MINIZIP)
@@ -68,7 +70,8 @@ IF(EXPAT_DIR)
FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/include ${EXPAT_DIR})
FIND_LIBRARY(EXPAT_LIBRARIES NAMES expat libexpat NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR})
ELSE()
- FIND_PACKAGE(EXPAT REQUIRED)
+ FIND_PACKAGE(EXPAT NAMES expat REQUIRED)
+ SET(EXPAT_LIBRARIES expat::expat)
ENDIF()
# dependancy: expat
# dependancy: expatw (if wide library was requested)
IF(WITH_WIDE)
@@ -225,13 +228,13 @@ FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/xlsxio-config.cmake.in"
IF (@WITH_LIBZIP@)
FIND_DEPENDENCY(LibZip)
ELSE()
- FIND_DEPENDENCY(minizip CONFIG)
+ FIND_DEPENDENCY(unofficial-minizip CONFIG)
ENDIF()
IF (@EXPAT_DIR@)
FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/include ${EXPAT_DIR})
FIND_LIBRARY(EXPAT_LIBRARIES NAMES expat libexpat NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR})
ELSE()
- FIND_DEPENDENCY(EXPAT)
+ FIND_DEPENDENCY(expat CONFIG)
ENDIF()
IF(@WITH_WIDE@)

View File

@ -1,29 +1,22 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO brechtsanders/xlsxio
REF e3acace39e5fb153f5ce3500a4952c2bf93175bd
SHA512 8148b89c43cf45653c583d51fb8050714d3cd0a76ab9a05d46604f3671a06487e4fc58d3f6f9f2a9f9b57a9f9fe1863ef07017c74197f151390576c5aac360ea
REF "${VERSION}"
SHA512 67b9a4e275446f3ca08e91d31f05236855e761c06ed84ea3aea8c25a7cd6729191f6c95b9efe07392775a75e2713e7ec2c6d216b8d310e7b46bee531cccba8be
HEAD_REF master
PATCHES
fix-dependencies.patch
export-targets.patch # https://github.com/brechtsanders/xlsxio/pull/105
)
file(REMOVE "${SOURCE_PATH}/CMake/FindMinizip.cmake")
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
libzip WITH_LIBZIP
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DCMAKE_POLICY_DEFAULT_CMP0012=NEW
-DBUILD_SHARED=${BUILD_SHARED}
-DBUILD_STATIC=${BUILD_STATIC}
-DWITH_WIDE=OFF
@ -41,4 +34,4 @@ vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")

View File

@ -1,7 +1,6 @@
{
"name": "xlsxio",
"version-date": "2021-03-24",
"port-version": 1,
"version": "0.2.34",
"description": "Cross-platform C library for reading values from and writing values to .xlsx files",
"homepage": "https://github.com/brechtsanders/xlsxio",
"license": "MIT",

View File

@ -1650,7 +1650,7 @@
},
"collada-dom": {
"baseline": "2.5.0",
"port-version": 8
"port-version": 9
},
"colmap": {
"baseline": "2023-03-12",
@ -2534,7 +2534,7 @@
},
"fmilib": {
"baseline": "2.4.1",
"port-version": 1
"port-version": 2
},
"fmt": {
"baseline": "9.1.0",
@ -5198,7 +5198,7 @@
},
"minizip": {
"baseline": "1.2.13",
"port-version": 0
"port-version": 1
},
"minizip-ng": {
"baseline": "3.0.7",
@ -8605,8 +8605,8 @@
"port-version": 4
},
"xlsxio": {
"baseline": "2021-03-24",
"port-version": 1
"baseline": "0.2.34",
"port-version": 0
},
"xmlsec": {
"baseline": "1.2.37",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d9c3011f64673cff7d61bac99def8048f4027f32",
"version": "2.5.0",
"port-version": 9
},
{
"git-tree": "52229b10acbed6e24eefd37ef20b30e24c6c7e71",
"version": "2.5.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e875efe56416de71aa671c57a77817c67290f0a9",
"version": "2.4.1",
"port-version": 2
},
{
"git-tree": "aa8b7d569a23fd953d1e4de558a034a6d9f95e33",
"version": "2.4.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c8831fffa825d9fafc38f1e3587046c49051ecba",
"version-semver": "1.2.13",
"port-version": 1
},
{
"git-tree": "c0843dcfad42a538a772797a3f50627b5c8d411a",
"version-semver": "1.2.13",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "fd38fc13e5e2b58d149261e8d692e1df7f93b88a",
"version": "0.2.34",
"port-version": 0
},
{
"git-tree": "6b4eb1ccf9e863a9291e03521af9ff4d62f5eb3d",
"version-date": "2021-03-24",