11Zip icon indicating copy to clipboard operation
11Zip copied to clipboard

How to install for use in VS project?

Open JTD420 opened this issue 2 years ago • 5 comments

I have a VS C++ project that auto updates my project by downloading the latest zip file from URL. I would like to extract it to a directory I have already created on the users machine.

How do I install and use this within my project? I am a bit confused and don't want to mess anything up

JTD420 avatar May 29 '22 16:05 JTD420

Using Windows as my OS

JTD420 avatar May 29 '22 16:05 JTD420

Usually, you would use a CMakelists.txt to generate your Visual Studio project 11Zip includes a library CMakelists that you can include using the add_subdirectory CMake command

What do you usually use for dependencies in Visual Studio ?

Sygmei avatar May 30 '22 14:05 Sygmei

If you don't want to use CMake, you should be able to create a subproject in Visual Studio, add the 11Zip source files in it, add the proper include path in your main project and you should be good to go.

Sygmei avatar May 30 '22 14:05 Sygmei

I use this lib as follow (with fetch content on my fork to get benefice of pull request just proposed):

include(FetchContent)
FetchContent_Declare(
  Zip
  GIT_REPOSITORY https://github.com/XavierBerger/11Zip.git
  GIT_TAG master
)
FetchContent_MakeAvailable(Zip)

XavierBerger avatar Dec 26 '22 13:12 XavierBerger

Not familiar with FetchContent but you should be able to do a target_link_libraries after the fetch :)

Sygmei avatar Mar 18 '23 16:03 Sygmei