相关命令如下:
$Conan new hello/1.0.0 # 创建一个Conanfile.py 的模板,修改模板后
$conan create . user/channel -u -s build_type=Debug --build=missing # . 为conanfile.py 所在目录
$conan create . user/channel -u -s build_type=Release --build=missing # . 为conanfile.py 所在目录
执行完上面的命令后,就会在本地的缓存里生成对应的包,下一步就是如何上传
$conan upload hello/1.0.0@user/channel--all -r=remote
几个小问题:
- -u: update
- -s: 配置conanfile.py 中的settings 选项
- --build=missing
- --all: 加上这个选项,会把二进制包和conanfile.py 一起上传,否则只会上传conanfile.py
- -r: --remote 指定远程地址
编译选项如下所示: