标签 vcpkg 下的文章

“”

从github下载vcpkg源码包

git clone https://github.com/Microsoft/vcpkg.git

进入源码目录

cd vcpkg

执行./bootstrap-vcpkg.sh

./bootstrap-vcpkg.sh

编译好后,进行安装

./vcpkg integrate install

vcpkg创建软链接

sudo ln -s /home/const/vcpkg/vcpkg /usr/bin

vcpkg用法

vcpkg list

输出:

ade:x64-linux                                      0.1.1f#1         ADE Framework is a graph construction, manipulat...
angle:x64-linux                                    2020-05-15#2     A conformant OpenGL ES implementation for Window...
assimp:x64-linux                                   5.0.1#4          The Open Asset import library
brotli:x64-linux                                   1.0.9#1          a generic-purpose lossless compression algorithm...
bzip2:x64-linux                                    1.0.8#1          bzip2 is a freely available, patent free, high-q...
curl:x64-linux                                     7.74.0#7         A library for transferring data with URLs
curl[non-http]:x64-linux                                            Enables protocols beyond HTTP/HTTPS/HTTP2
curl[openssl]:x64-linux                                             SSL support (OpenSSL)
curl[ssl]:x64-linux                                                 Default SSL backend

vcpkg search 用法

vcpkg search opencv4

输出:

vcpkg search opencv4
opencv4                  4.5.2            computer vision library
opencv4[ade]                              graph api
opencv4[contrib]                          opencv_contrib module
opencv4[cuda]                             CUDA support for opencv
opencv4[dnn]                              Enable dnn module
opencv4[eigen]                            Eigen support for opencv
opencv4[ffmpeg]                           ffmpeg support for opencv
opencv4[gdcm]                             GDCM support for opencv
opencv4[halide]                           Halide support for opencv
opencv4[ipp]                              Enable Intel Integrated Performance Primitives
opencv4[jasper]                           JPEG 2000 support for opencv
opencv4[jpeg]                             JPEG support for opencv
opencv4[lapack]                           LAPACK support for opencv
opencv4[nonfree]                          allow nonfree and unredistributable libraries
opencv4[openexr]                          OpenEXR support for opencv
opencv4[opengl]                           opengl support for opencv
opencv4[openmp]                           Enable openmp support for opencv
opencv4[ovis]                             opencv_ovis module
opencv4[png]                              PNG support for opencv
opencv4[qt]                               Qt GUI support for opencv
opencv4[quirc]                            Enable QR code module
opencv4[sfm]                              opencv_sfm module
opencv4[tbb]                              Enable Intel Threading Building Blocks
opencv4[tiff]                             TIFF support for opencv
opencv4[vtk]                              vtk support for opencv
opencv4[webp]                             WebP support for opencv
opencv4[world]                            Compile to a single package support for opencv

安装 vcpkg
从 GitHub 存储库下载 vcpkg:

wget -O vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz

创建一个新目录来存储 vcpkg 并将tar.gz文件解压缩到其中:

sudo mkdir /opt/vcpkg
sudo tar xf vcpkg.tar.gz --strip-components=1 -C /opt/vcpkg

运行以下命令来构建 vcpkg 本身:

sudo /opt/vcpkg/bootstrap-vcpkg.sh

在/usr/local/bin目录中,我们可以创建一个指向vcpkg命令的符号链接:

sudo ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg

现在vcpkg可以用作所有用户的系统范围命令。我们可以使用以下命令检查 vcpkg 版本:

vcpkg version

tar.gz不再需要该文件,将其删除:

rm -rf vcpkg.tar.gz

测试 vcpkg
我们可以使用vcpkg install命令来构建和安装库。例如,以下命令安装 zlib 库:

sudo vcpkg install zlib:x64-linux

运行以下命令以获取已安装库的列表:

sudo vcpkg list

卸载 vcpkg
如果想彻底删除vcpkg,删除安装目录:

sudo rm -rf /opt/vcpkg

删除符号链接:

sudo rm -rf /usr/local/bin/vcpkg

您还可以删除 vcpkg 缓存和相关目录:

sudo rm -rf /root/.cache/vcpkg
sudo rm -rf /root/.vcpkg
rm -rf ~/.vcpkg