步骤
- 先git clone想要的三方库,以yaml-cpp0.8为例
- 根据readme进行cmake编译
- 最后
make install DESTDIR=$YOUR_OUT_PATH
将编译产物放在指定目录内
三方库推荐工程目录架构
|–thirdparty
|----yaml-cpp-0.8.0-aarch64
|----yaml-cpp-0.8.0-x86_64文章来源地址https://www.toymoban.com/news/detail-856604.html
CMakeLists.txt 指定目录查找链接
set(YAMLCPP_LOCAL_DIR "thirdparty/yaml-cpp-0.8.0-${CMAKE_HOST_SYSTEM_PROCESSOR}")
set(YamlCPP_DIR "${YAMLCPP_LOCAL_DIR}/lib/cmake/yaml-cpp")
find_package(yaml-cpp REQUIRED NO_DEFAULT_PATH PATHS ${YamlCPP_DIR})
message(STATUS " YAML_CPP_INCLUDE_DIR: ${YAML_CPP_INCLUDE_DIR} ...")
message(STATUS " YAML_CPP_LIBRARY_DIR: ${YAML_CPP_LIBRARY_DIR} ...")
message(STATUS " YAML_CPP_SHARED_LIBS_BUILT: ${YAML_CPP_SHARED_LIBS_BUILT} ...")
message(STATUS " YAML_CPP_LIBRARIES: ${YAML_CPP_LIBRARIES} ...")
find_library(YAML_CPP_LIB ${YAML_CPP_LIBRARIES} NO_DEFAULT_PATH PATHS ${YAML_CPP_LIBRARY_DIR})
message(STATUS "Building ${PROJECT_NAME}: Found YAML CPP Lib - ${YAML_CPP_LIB} ...")
set(YAML_CPP_INCLUDE_DIRS "${YAMLCPP_LOCAL_DIR}/include")
include_directories(${YAML_CPP_INCLUDE_DIRS})
target_link_libraries(rectify
${OpenCV_LIBS}
${YAML_CPP_LIB})
文章来源:https://www.toymoban.com/news/detail-856604.html
到了这里,关于算法开发固定三方库版本的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!