本文档翻译自: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 arecipe file e.g., my_folder/conanfile.py With --undooption, this parameter is the folder containing theconan_imports_manifest.txt file generated in aprevious execution. e.g.: conan imports./imported_files --undooptional arguments:-h, --help show this help message and exit-if INSTALL_FOLDER, --install-folder INSTALL_FOLDERDirectory containing the conaninfo.txt andconanbuildinfo.txt files (from previous 'conaninstall'). Defaulted to --build-folder-imf IMPORT_FOLDER, --import-folder IMPORT_FOLDERDirectory to copy the artifacts to. By default it willbe 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
