本文档翻译自:https://docs.conan.io/en/latest/reference/commands/misc/imports.html
$ conan imports [-h] [-if INSTALL_FOLDER] [-imf IMPORT_FOLDER] [-u] path
调用您本地的conanfile.py或conanfile.txt的“ imports”方法。
它需要预先安装,并且在–install-folder(默认为当前目录)中具有conanbuildinfo.txt生成的文件。
positional arguments:
path Path to a folder containing a conanfile.py or to a
recipe file e.g., my_folder/conanfile.py With --undo
option, this parameter is the folder containing the
conan_imports_manifest.txt file generated in a
previous execution. e.g.: conan imports
./imported_files --undo
optional arguments:
-h, --help show this help message and exit
-if INSTALL_FOLDER, --install-folder INSTALL_FOLDER
Directory containing the conaninfo.txt and
conanbuildinfo.txt files (from previous 'conan
install'). Defaulted to --build-folder
-imf IMPORT_FOLDER, --import-folder IMPORT_FOLDER
Directory to copy the artifacts to. By default it will
be the current directory
-u, --undo Undo imports. Remove imported files
imports()方法可能使用来自指定配置文件的设置,选项和环境变量,以及来自conanfile要求中已声明的deps_XXX_info对象的依赖项信息。
运行conan install时,所有这些信息分别自动保存在conaninfo.txt和conanbuildinfo.txt文件中。 这些文件必须位于指定的—install-folder中。
Examples
从当前目录中的当前conanfile导入文件:
$ conan install . --no-imports # Creates the conanbuildinfo.txt
$ conan imports .
删除复制的文件(撤消导入):
$ conan imports . --undo