pineapple/externals/vcpkg/ports/netcdf-c/fix-dependency-libzip.patch
2022-07-23 03:01:36 +02:00

34 lines
1 KiB
Diff
Executable file

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b93a141..c3763a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -957,7 +957,14 @@ OPTION(ENABLE_DAP_REMOTE_TESTS "Enable DAP remote tests." ON)
SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test")
# See if we have libzip
-FIND_PACKAGE(Zip)
+if(ENABLE_NCZARR_ZIP)
+ find_package(libzip CONFIG REQUIRED)
+ set(Zip_LIBRARIES libzip::zip)
+ set(Zip_FOUND TRUE)
+else()
+ set(Zip_LIBRARIES "")
+ set(Zip_FOUND FALSE)
+endif()
# Define a test flag for have curl library
IF(Zip_FOUND)
diff --git a/netCDFConfig.cmake.in b/netCDFConfig.cmake.in
index b3be259..72b4b25 100644
--- a/netCDFConfig.cmake.in
+++ b/netCDFConfig.cmake.in
@@ -15,6 +15,9 @@ set(netCDF_LIBRARIES netCDF::netcdf)
include(CMakeFindDependencyMacro)
find_dependency(HDF5 CONFIG)
find_dependency(CURL CONFIG)
+if(@ENABLE_NCZARR_ZIP@)
+ find_dependency(libzip CONFIG)
+endif()
include("${CMAKE_CURRENT_LIST_DIR}/netCDFTargets.cmake")
# Compiling Options