本文档翻译自:https://docs.conan.io/en/latest/reference/commands/development/source.html
$ conan source [-h] [-sf SOURCE_FOLDER] [-if INSTALL_FOLDER] path
调用您本地的conanfile.py的“ source()”方法。
通常下载并解压缩软件包源。
positional arguments:
path Path to a folder containing a conanfile.py or to a
recipe file e.g., my_folder/conanfile.py
optional arguments:
-h, --help show this help message and exit
-sf SOURCE_FOLDER, --source-folder SOURCE_FOLDER
Destination directory. Defaulted to current directory
-if INSTALL_FOLDER, --install-folder INSTALL_FOLDER
Directory containing the conaninfo.txt and
conanbuildinfo.txt files (from previous 'conan
install'). Defaulted to --build-folder Optional,
source method will run without the information
retrieved from the conaninfo.txt and
conanbuildinfo.txt, only required when using
conditional source() based on settings, options,
env_info and user_info
source()方法可能会使用(可选)指定配置文件中的设置,选项和环境变量以及conanfile要求中已声明的deps_XXX_info对象的依赖项信息。。
所有这些信息都将运行柯南install命令自动在conaninfo.txt和conanbuildinfo.txt文件保存分别。这些文件必须位于指定—install文件夹。
Examples:
调用本地配方的source方法:在用户空间中,该命令将在当前目录的src文件夹中执行local conanfile.py source()方法。
$ conan new lib/1.0@conan/stable
$ conan source . --source-folder mysrc
如果你需要设置/选项或要求的任何信息,首先进行的安装:
$ conan install . --install-folder mybuild
$ conan source . --source-folder mysrc --install-folder mybuild