当前位置: 首页 > news >正文

Windows conan环境搭建

Windows conan环境搭建

  • 1 安装conan
    • 1.1 安装依赖软件
      • 1.1.1 python安装
      • 1.1.2 git bash安装
      • 1.1.3 安装Visual Studio Community 2019
        • 1.1.3.1 选择安装的组件
        • 1.1.3.2 选择要支持的工具以及对应的SDK
      • 1.1.4 vscode安装
    • 1.3 验证conan功能
    • 1.4 查看conancenter是否包含poco包
    • 1.5 查看poco/1.9.4的conan信息
    • 1.6 新建conanfile.txt
    • 1.7 安装所需的依赖项并生成构建系统的信息

1 安装conan

1.1 安装依赖软件

1.1.1 python安装

pip需要依赖python (>= 3.9),我本地安装的3.10.10版本的python。
Python 软件包:
python软件包直接去官网下载比较慢,在安装时选中安装路径添加到环境变量(Add Python to PATH)的选项,其他的默认安装即可。
python的官方网站:
https://www.python.org/downloads/windows/

1.1.2 git bash安装

可以在http://www.git-scm.com/download/下载对应的windows版本的git去安装使用。

1.1.3 安装Visual Studio Community 2019

打开Microsoft Store中搜索Visual Studio Community 2019,选择安装。
如果选择Visual Studio Community 2022请参考该篇博文:windows环境下VSCode配置C++教程(使用msvc编译器),需要注意的是Visual Studio Community 2022对应的MSVC是17而不是2019版的16,如果使用msvc16去编译需要对应的适配一个msvc17的profile配置文件。

1.1.3.1 选择安装的组件

[图片]

1.1.3.2 选择要支持的工具以及对应的SDK

[图片]

1.1.4 vscode安装

可以直接在vscode官网下载Download Visual Studio Code - Mac, Linux, Windows,需要选择System Installer软件包安装。
在这里插入图片描述

1.2 安装1.55.0版本的conan
conan在windows上最新的版本是2.xx的,conan的1.xx版本和2.xx版本的差异非常大,我们在开发时目前需要的是conan 1.xx版本去做代码库管理工作,在安装时需要制定要安装的1.xx的conan版本号。

pip install conan=1.55

1.3 验证conan功能

直接在windows的powershell视图执行conan命令即可,执行之后会显示conan的帮助信息。

PS C:\Users\test> conan
Consumer commandsinstall    Installs the requirements specified in a recipe (conanfile.py or conanfile.txt).config     Manages Conan configuration.get        Gets a file or list a directory of a given reference or package.info       Gets information about the dependency graph of a recipe.search     Searches package recipes and binaries in the local cache or a remote. Unless aremote is specified only the local cache is searched.
Creator commandsnew        Creates a new package recipe template with a 'conanfile.py' and optionally,'test_package' testing files.create     Builds a binary package for a recipe (conanfile.py).upload     Uploads a recipe and binary packages to a remote.export     Copies the recipe (conanfile.py & associated files) to your local cache.export-pkg Exports a recipe, then creates a package from local source and build folders.test       Tests a package consuming it from a conanfile.py with a test() method.
Package development commandssource     Calls your local conanfile.py 'source()' method.build      Calls your local conanfile.py 'build()' method.package    Calls your local conanfile.py 'package()' method.editable   Manages editable packages (packages that reside in the user workspace, but areconsumed as if they were in the cache).workspace  Manages a workspace (a set of packages consumed from the user workspace thatbelongs to the same project).
Misc commandsprofile    Lists profiles in the '.conan/profiles' folder, or shows profile details.remote     Manages the remote list and the package recipes associated with a remote.user       Authenticates against a remote with user/pass, caching the auth token.imports    Calls your local conanfile.py or conanfile.txt 'imports' method.copy       Copies conan recipes and packages to another user/channel.remove     Removes packages or binaries matching pattern from local cache or remote.alias      Creates and exports an 'alias package recipe'.download   Downloads recipe and binaries to the local cache, without using settings.inspect    Displays conanfile attributes, like name, version, and options. Works locally,in local cache and remote.help       Shows help for a specific command.lock       Generates and manipulates lock files.frogarian  Conan The FrogarianConan commands. Type "conan <command> -h" for help
PS C:\Users\weihanwu>

1.4 查看conancenter是否包含poco包

PS D:\work> conan search poco --remote=conancenter
Existing package recipes:poco/1.8.1
poco/1.9.3
poco/1.9.4
poco/1.10.0
poco/1.10.1
poco/1.11.0
poco/1.11.1
poco/1.11.2
poco/1.11.3
poco/1.12.5p1
poco/1.12.0
poco/1.12.1
poco/1.12.2
poco/1.12.3
poco/1.12.4
PS D:\work>

1.5 查看poco/1.9.4的conan信息

PS D:\work> conan inspect poco/1.9.4
name: poco
version: 1.9.4
url: https://github.com/conan-io/conan-center-index
homepage: https://pocoproject.org
license: BSL-1.0
author: None
description: Modern, powerful open source C++ class libraries for building network- and internet-based applications that run on desktop, server, mobile and embedded systems.
topics: ('building', 'networking', 'server', 'mobile', 'embedded')
generators: ['txt']
exports: None
exports_sources: None
short_paths: False
apply_env: True
build_policy: None
revision_mode: hash
settings: ('os', 'arch', 'compiler', 'build_type')
options:enable_active_record: [True, False, 'deprecated']enable_activerecord: [True, False]enable_activerecord_compiler: [True, False]enable_apacheconnector: [True, False]enable_cppparser: [True, False]enable_crypto: [True, False]enable_data: [True, False]enable_data_mysql: [True, False]enable_data_odbc: [True, False]enable_data_postgresql: [True, False]enable_data_sqlite: [True, False]enable_encodings: [True, False]enable_fork: [True, False]enable_json: [True, False]enable_jwt: [True, False]enable_mongodb: [True, False]enable_net: [True, False]enable_netssl: [True, False]enable_netssl_win: [True, False]enable_pagecompiler: [True, False]enable_pagecompiler_file2page: [True, False]enable_pdf: [True, False]enable_pocodoc: [True, False]enable_prometheus: [True, False]enable_redis: [True, False]enable_sevenzip: [True, False]enable_util: [True, False]enable_xml: [True, False]enable_zip: [True, False]fPIC: [True, False]shared: [True, False]
default_options:enable_active_record: deprecatedenable_activerecord: Trueenable_activerecord_compiler: Falseenable_apacheconnector: Falseenable_cppparser: Falseenable_crypto: Trueenable_data: Trueenable_data_mysql: Trueenable_data_odbc: Falseenable_data_postgresql: Trueenable_data_sqlite: Trueenable_encodings: Trueenable_fork: Trueenable_json: Trueenable_jwt: Trueenable_mongodb: Trueenable_net: Trueenable_netssl: Trueenable_netssl_win: Falseenable_pagecompiler: Falseenable_pagecompiler_file2page: Falseenable_pdf: Falseenable_pocodoc: Falseenable_prometheus: Falseenable_redis: Trueenable_sevenzip: Falseenable_util: Trueenable_xml: Trueenable_zip: TruefPIC: Trueshared: False
deprecated: None
PS D:\work>

1.6 新建conanfile.txt

conanfile.txt [requires]poco/1.9.4[generators]cmake

1.7 安装所需的依赖项并生成构建系统的信息

mkdir build && cd build
conan install .. --build=missing
http://www.lryc.cn/news/230051.html

相关文章:

  • 如何使用Cpolar+Tipask,在ubuntu系统上搭建一个私人问答网站
  • 怎么在uni-app中使用Vuex(第一篇)
  • 【MySQL】库的相关操作 + 库的备份和还原
  • 网络安全基础之php开发文件上传的实现
  • [文件读取]cuberite 文件读取 (CVE-2019-15516)
  • SpringBoot 自定义参数校验(5)
  • Win Docker Desktop + WSL2 部署PyTorch-CUDA服务至k8s算力集群
  • JLMR Micro Super Resolution Algorithm国产微超分算法DEMO
  • Docker的安装配置与使用
  • macOS文本编辑器 BBEdit 最新 for mac
  • Android Audio实战——音量设置Hal(二十)
  • jetson配置笔记
  • 使用select实现定时任务
  • uniapp的实战总结大全
  • No205.精选前端面试题,享受每天的挑战和学习
  • 保序回归:拯救你的校准曲线(APP)
  • 清华镜像源地址,适用于pip下载速度过慢从而导致下载失败的问题
  • arcgis--NoData数据处理
  • 基于单片机教室人数实时检测系统仿真及源程序
  • 【Linux笔记】Linux环境变量与地址空间
  • 【springboot】@restcontroller和@controller的区别
  • oracle 不支持的字符集 orai18n.jar ZHS16GBK 异常问题解决
  • 设计模式-04-原型模式
  • D. Jumping on Walls bfs
  • preg_replace调用system(“ls“)
  • MT8788核心板主要参数介绍_联发科MTK安卓核心板智能模块
  • Matlab批量提取图片特征向量
  • 数据库系统原理与实践 笔记 #8
  • Ubuntu 和 Windows 文件互传
  • 如何在WPF应用程序中全局捕获异常