[minizip] fix linker issues

This commit is contained in:
atkawa7 2017-07-23 11:46:49 -07:00
parent 21b2afb9d7
commit a3f0d84839
2 changed files with 21 additions and 2 deletions

View File

@ -18,7 +18,7 @@ set(SRC
${MIN_SRC}/iowin32.c
${MIN_SRC}/unzip.c
${MIN_SRC}/zip.c
${MIN_SRC}/mz.c
${MIN_SRC}/unzip.c
${MIN_SRC}/mztools.c
)
set(HEADERS
@ -26,6 +26,7 @@ set(HEADERS
${MIN_SRC}/iowin32.h
${MIN_SRC}/unzip.h
${MIN_SRC}/zip.h
${MIN_SRC}/unzip.h
${MIN_SRC}/mztools.h
)
if(BUILD_SHARED_LIBS)
@ -40,6 +41,16 @@ target_compile_definitions(minizip PRIVATE -D_ZLIB_H)
target_link_libraries(minizip PRIVATE ${BZIP2_LIBRARIES})
target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1)
add_executable(minizip_bin ${MIN_SRC}/minizip.c)
add_executable(miniunz_bin ${MIN_SRC}/miniunz.c)
target_link_libraries(minizip_bin minizip ${BZIP2_LIBRARIES} ZLIB::ZLIB)
target_link_libraries(miniunz_bin minizip ${BZIP2_LIBRARIES} ZLIB::ZLIB)
set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip)
set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz)
install(
TARGETS minizip
RUNTIME DESTINATION bin
@ -47,6 +58,12 @@ install(
ARCHIVE DESTINATION lib
)
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)

View File

@ -17,10 +17,12 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/minizip)
file(INSTALL ${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/minizip RENAME copyright)