zlib-ng / minizip-ng

Fork of the popular zip manipulation library found in the zlib distribution.
Other
1.22k stars 430 forks source link

How to Build MiniZip 1.1.0 with VS 2019? #547

Closed ncook-hxgn closed 3 years ago

ncook-hxgn commented 3 years ago

Hi,

I appreciate this might be a bit of a stretch, and apologies if this is the wrong place to post this (I'm more than happy to close and recreate this issue at madler/zlib if it's more appropriate). Also, I am not a CMake expert..

I have perused tags here, and we begin at 2.0.0 (as indeed it says in the README.md) - I am trying to support a products efforts to consume dependencies via nuget, and in this instance I am interested in building zlib 1.2.8 and minizip 1.1.0 from github-hosted sources. As such, I have cloned madler/zlib locally.

I have a nuget for zlib.1.2.8, which contains binaries I build from a Visual Studio 2019 solution that cmake generated with the following commandline: cmake -G "Visual Studio 16 2019" -A x64

However I am wondering how to build minizip from the madler/zlib/contrib/minizip directory? I attempted to throw the cmake command described in the README in this repo at it, with limited success:

  E:\repos\NuGet\zlibNuget\src\contrib\minizip>cmake . -DMZ_BUILD_TEST=ON
CMake Error: The source directory "E:/repos/NuGet/zlibNuget/src/contrib/minizip" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

As such, I guess it's unlikely I'm going to be able to generate a Visual Studio solution..

Digging through some of the READMEs in there, I discovered the madler/zlib/contrib/minizip/vstudio folder containing solutions for various VC versions. I tried to upgrade the vc14 zlibvc.sln and it's projects to VC142 and a modern Windows SDK which went fine, but I was unable to build this solution in Release|x64.. zlibvc.vcxproj can't find zconf.h to include into zlib.h, and so can't compile. I am stuck. Could you please advise?

I appreciate this is a much older version of the library, and much has changed, especially in terms of the bugs you've fixed! I imagine that if I cloned this repo I'd be able to build minizip without much hassle with VS 2019, and honestly I look forward to it.

The reason I ask such an annoying question is that I would like to provide an upgrade path to the aforementioned product via nuget, for Business Reasons™.

Many many thanks.

Nathan (spiderman meme goes here)

gvollant commented 3 years ago

I don’t known well nuget

Pehaps https://github.com/nmoinvaz/minizip has solution

De : ncook-hxgn notifications@github.com Envoyé : mercredi 13 janvier 2021 17:17 À : nmoinvaz/minizip minizip@noreply.github.com Cc : Subscribed subscribed@noreply.github.com Objet : [nmoinvaz/minizip] How to Build MiniZip 1.1.0 with VS 2019? (#547)

Hi,

I appreciate this might be a bit of a stretch, and apologies if this is the wrong place to post this (I'm more than happy to close and recreate this issue at madler/zlib if it's more appropriate). Also, I am not a CMake expert..

I have perused tags here, and we begin at 2.0.0 (as indeed it says in the README.md) - I am trying to support a products efforts to consume dependencies via nuget, and in this instance I am interested in building zlib 1.2.8 and minizip 1.1.0 from github-hosted sources. As such, I have cloned madler/zlib locally.

I have a nuget for zlib.1.2.8, which contains binaries I build from a Visual Studio 2019 solution that cmake generated with the following commandline: cmake -G "Visual Studio 16 2019" -A x64

However I am wondering how to build minizip from the madler/zlib/contrib/minizip directory? I attempted to throw the cmake command described in the README in this repo at it, with limited success:

E:\repos\NuGet\zlibNuget\src\contrib\minizip>cmake . -DMZ_BUILD_TEST=ON

CMake Error: The source directory "E:/repos/NuGet/zlibNuget/src/contrib/minizip" does not appear to contain CMakeLists.txt.

Specify --help for usage, or press the help button on the CMake GUI.

As such, I guess it's unlikely I'm going to be able to generate a Visual Studio solution..

Digging through some of the READMEs in there, I discovered the madler/zlib/contrib/minizip/vstudio folder containing solutions for various VC versions. I tried to upgrade the vc14 zlibvc.sln and it's projects to VC142 and a modern Windows SDK which went fine, but I was unable to build this solution in Release|x64.. zlibvc.vcxproj can't find zconf.h to include into zlib.h, and so can't compile. I am stuck. Could you please advise?

I appreciate this is a much older version of the library, and much has changed, especially in terms of the bugs you've fixed! I imagine that if I cloned this repo I'd be able to build minizip without much hassle with VS 2019, and honestly I look forward to it.

The reason I ask such an annoying question is that I would like to provide an upgrade path to the aforementioned product via nuget, for Business Reasons™.

Many many thanks.

Nathan (spiderman meme goes here)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nmoinvaz/minizip/issues/547 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIKFN5LG7AZ6SAEYTMKOSLSZXBONANCNFSM4WBBL4UA . https://github.com/notifications/beacon/AAIKFNY6CLD6Y2YEFO2MCFDSZXBONA5CNFSM4WBBL4UKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4LWN3FPA.gif

ncook-hxgn commented 3 years ago

Oh my, Mr ZLib himself! I am honoured to speak to you sir!

..I thought I posted this issue to that repo..? This is https://github.com/nmoinvaz/minizip/issues/547.

I would like to use this repo to provide minizip eventually, however it only versions back as far as 2.0.0, I suspect that is when major refactoring began.

Edit: Nuget isn't so much a factor of the problem, as a factor to the Business Reason for my enquiry. It is essentially a packaging system. I am currently using it to deliver prebuilt ZLib 1.2.8 and Minizip 1.1.0 to a software build, alas, I would like to recreate the binaries in these packages from github sources if possible.

nmoinvaz commented 3 years ago

You can find minizip 1.1 here: https://github.com/nmoinvaz/minizip/tree/1.1. It does not contain CMakeLists.txt, so I recommend you creating your own that uses FetchContent to retrieve the madler/zlib repository. You will have to learn CMake if you don't already know it well. You can use my initial CMakeLists.txt from my minizip 1.2 here as a starting point. There is a known issue in zlib about zconf.h - you have to add the src directory and build directory as include directories to minizip.

ncook-hxgn commented 3 years ago

@nmoinvaz thank you for the direction. I will give it a go 👍