查阅。 它自动下载和建造你的附属设施,只字节外法。 亨特基于 cm的进出口目标。
For example if you want to use the GoogleTest library in your cmake based project you would add the following lines to your root CMakeLists.txt
# file root CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
# To get hunter you need to download and include a single cmake file
# see documentation for correct name
include("../gate.cmake")
project(download-gtest)
# set the location of all your hunter-packages
set( HUNTER_ROOT_DIR C:/CppLibraries/HunterLibraries )
# This call automaticall downloads and compiles gtest the first time
# cmake is executed. The library is then cached in the HUNTER_ROOT_DIR
hunter_add_package(GTest)
# Now the GTest library can be found and linked to by your own project
find_package(GTest CONFIG REQUIRED)
add_executable(foo foo.cpp)
target_link_libraries(foo GTest::main)
并非所有你名单上的图书馆都作为“秘密包裹”提供,但该项目是开放的,因此,你可以为你们的附属公司制造猎物,并致力于该项目。 https://docs.hunter.sh/en/latest/ Pack/all.html” rel=“nofollow noreferer”>Here是一份已经作为狩猎包提供的图书馆清单。
这不会在盒子之外解决你的所有问题,因为你必须为你们的家属制造包裹。 但是,现有的框架已经做了很多工作,最好利用这一框架,而不是半量自行制定的解决办法。