C++ package manager, no need to compile source code every time

pkg-config

The package manager in Linux
, such as the opencv.pc file, describes in detail the dependencies of the library. cmake's find_package supports searching for pc files

prefix=/usr/local
exec_prefix=${prefix}
includedir=/usr/local/include
libdir=/usr/local/lib
 
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 4.5.5
Libs: -L${exec_prefix}/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core
Libs.private: -ldl -lm -lpthread -lrt
Cflags: -I${includedir}

conan

Use pip install conan to install
Insert image description here
the dependencies described in conanfile.txt or conanfile.py

conan -h View the help, there is an instruction example
conan new cmake_lib -d name=hello -d version=0.1 in the help

vcpkg

https://gitee.com/mirrors/vcpkg.git
After running the bootstrap-vcpkg.bat file, download vcpkg.exe

Official website description: https://vcpkg.io/en

vcpkg install package
vcpkg integrate install
vcpkg list //View installed

  • Using vcpkg with CMake

cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
or copy vcpkg.cmake to

share\cmake-3.26\Modules directory

Guess you like

Origin blog.csdn.net/daoer_sofu/article/details/131083644