VCPKG is a tool that can help your team effortlessly download and use C++ packages within your project, without worrying about dependencies or platforms.
Here's how to get started using it:
We assume you are using cmake as your build system
git submodule add <https://github.com/microsoft/vcpkg>
git submodule init --update
{
"name": "your_project_name",
"version-string": "0.1.0",
"dependencies": [
"openssl", //Add libraries name here to download & import them
]
}
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
endif()
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
CACHE STRING "Vcpkg toolchain file")
On Windows:
.\\vcpkg\\bootstrap-vcpkg.bat
.\\vcpkg\\vcpkg integrate install
.\\vcpkg\\vcpkg install
On MacOS/Linux:
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg integrate install
./vcpkg/vcpkg install
<aside> ⚠️ If one of those commands fail, check the following:
brew install pkg-config
)</aside>