sudo pip install conan conan profile detect --force
生成的默认配置文件在 ~/.conan2/profiles/default
sudo pip install conan --upgrade
conan remote clean conan remote add myconan <your private conan artifactory url> conan remote add bincrafters https://bincrafters.jfrog.io/artifactory/api/conan/public-conan conan remote add conancenter https://center.conan.io # conan remote add conan-center https://conan.bintray.com # 此仓库已被官方废弃
pip install conan --upgrade # Might need sudo or --user
c/c++
插件设置里 includePath
添加 ~/.conan/data/**
android-ndk
包作为 tool_requires, 比如编译 armv8:include(default) [settings] arch=armv8 build_type=Release compiler=clang compiler.libcxx=libc++ compiler.version=11 os=Android os.api_level=21 [tool_requires] android-ndk/r22b [options] [env]
然后install 或 create 时指定跨平台编译
conan install .. --build=missing -pr:h android-armv8 -pr:b default
ANDROID_ABI
ANDROID_PLATFORM
才能正确编译出目标版本。 而 conan 并没有办法在 profile 里直接设置这两个 cmake 变量, 所以就算你的工程的 CMakefile.txt 设置了这两变量,你的依赖包在cmake building 时也会默认选择了错误的arch。