Add example for users new to cmake
Closed this issue · 3 comments
Just migrated my project to cmake for Qt6, and had a nightmare of a time getting QuaZip to build and link on Windows 10.
I think it would be worthwhile adding an example project to the repo here, with some extra documentation to explain the steps:
- Configure QuaZip with cmake
- Build and Install with compiler with admin privileges
Documentation:
- Some basic instruction for linking and adding to your own project
I appreciate that this project is intended to use both 0.x and 1.x side by side, but that really only seems useful to me for people using cmake already. Many, I think, myself included, will have been using qmake projects of Quazip builds in the past.
So in short, I'm not really sure what the virtue is of having both side by side, but I guess you've had these discussions in-depth already. I tried to follow that and had a lot of linking problems with zlib that I had to recompile everything and start over.
Anyway -- thank you for the work on this, it will be invaluable for me in my Qt6 projects. I just wanted to offer along my experiences and feedback how this might be a better experience for users looking for Qt6 QuaZip.
Adding an example project is a good idea. I'll think about it, although I don't promise anything any time soon.
Building and linking for Windows, however, is a nightmare for myself (not just for QuaZip), as there are too many things to consider: which C++ compiler is used, how and where Qt and CMake are installed, how zlib was built and so on. There is no single flawless procedure I'm aware of that would simply just work.
I didn't really understand the part about 0.x with 1.x side by side. 0.x is pretty much an unsupported legacy version. If you refer to the fact that the major version is a part of some CMake identifiers, then it's not intended to support 0.x, but rather a precaution for a possible future 2.x version.
Just wanted to thank you @stachenov and you're right with the complexity of building on Windows (compilers, where things are installed can cause all sorts of issues as I found).
Once you get to know CMake, building dependencies is relatively easy on any platform. I created a basic qt sample which extracts a zip archive provided as an argument to the program. Step by step instructions to build quazip and zlib in the readme. Feel free to try it out and give feedback if you encounter any problems: https://github.com/cen1/quazip/tree/feature/examples/examples/qmake
I can also provide an example using CMake as project tool for the qt instead of qmake.