Skip to content

Commit aba2596

Browse files
committed
Build minizip-ng from source
1 parent f490c90 commit aba2596

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ if(NOT FYPP)
4949
endif()
5050

5151
# --- find dependencies
52-
find_library(MINIZIP_LIBRARY NAMES minizip HINTS /opt/homebrew/Caskroom/miniconda/base/envs/minizip/lib)
52+
if (NOT TARGET "minizip::minizip")
53+
find_package("minizip" REQUIRED)
54+
endif()
5355

5456
# Custom preprocessor flags
5557
if(DEFINED CMAKE_MAXIMUM_RANK)

example/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
macro(ADD_EXAMPLE name)
22
add_executable(example_${name} example_${name}.f90)
3-
target_link_libraries(example_${name} "${PROJECT_NAME}")
4-
target_link_libraries(example_${name} ${PROJECT_NAME} ${MINIZIP_LIBRARY})
3+
target_link_libraries(example_${name} ${PROJECT_NAME} "minizip::minizip")
54
add_test(NAME ${name}
65
COMMAND $<TARGET_FILE:example_${name}> ${CMAKE_CURRENT_BINARY_DIR}
76
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

src/stdlib_io_minizip.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
!> Interface to the minizip library for creating and extracting zip files.
1+
!> Interface to the minizip-ng library for creating and extracting zip files.
2+
!>
3+
!> https://github.com/zlib-ng/minizip-ng
24
module stdlib_io_minizip
35
use, intrinsic :: iso_c_binding, only: c_char, c_ptr, c_int, c_long
46
implicit none
@@ -12,6 +14,7 @@ module stdlib_io_minizip
1214
integer, parameter, public :: UNZ_BADZIPFILE = -103
1315
integer, parameter, public :: UNZ_INTERNALERROR = -104
1416
integer, parameter, public :: UNZ_CRCERROR = -105
17+
integer, parameter, public :: UNZ_BADPASSWORD = -106
1518

1619
public :: unz_get_global_info
1720
public :: unz_open

test/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ endif()
44

55
macro(ADDTEST name)
66
add_executable(test_${name} test_${name}.f90)
7-
target_link_libraries(test_${name} "${PROJECT_NAME}" "test-drive::test-drive")
8-
target_link_libraries(test_${name} ${PROJECT_NAME} ${MINIZIP_LIBRARY})
7+
target_link_libraries(test_${name} ${PROJECT_NAME} "minizip::minizip" "test-drive::test-drive")
98
add_test(NAME ${name}
109
COMMAND $<TARGET_FILE:test_${name}> ${CMAKE_CURRENT_BINARY_DIR}
1110
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)