本文档翻译自:https://docs.conan.io/en/latest/reference/commands/development/workspace.html
$ conan workspace [-h] {install} ...
管理工作空间(从属于同一项目的用户工作空间使用的一组软件包)。
使用此命令管理柯南工作区,使用子命令“安装”从文件创建工作区。
positional arguments:{install} sub-command helpinstall same as a "conan install" command but using the workspace datafrom the file. If no file is provided, it will look for a filenamed "conanws.yml"optional arguments:-h, --help show this help message and exit
conan workspace install
$ conan workspace install [-h] [-b [BUILD]] [-r REMOTE] [-u] [-l [LOCKFILE]][-e ENV_HOST] [-e:b ENV_BUILD] [-e:h ENV_HOST][-o OPTIONS_HOST] [-o:b OPTIONS_BUILD] [-o:h OPTIONS_HOST][-pr PROFILE_HOST] [-pr:b PROFILE_BUILD][-pr:h PROFILE_HOST] [-s SETTINGS_HOST][-s:b SETTINGS_BUILD] [-s:h SETTINGS_HOST][-if INSTALL_FOLDER]path
positional arguments:path path to workspace definition file (it will look for a "conanws.yml"inside if a directory is given)optional arguments:-h, --help show this help message and exit-b [BUILD], --build [BUILD]Optional, use it to choose if you want to build from sources:--build Build all from sources, do not use binary packages.--build=never Never build, use binary packages or fail if a binarypackage is not found. --build=missing Build from code if a binarypackage is not found. --build=cascade Will build from code all thenodes with some dependency being built (for any reason). Can beused together with any other build policy. Useful to make sure thatany new change introduced in a dependency is incorporated bybuilding again the package. --build=outdated Build from code if thebinary is not built with the current recipe or when missing abinary package. --build=[pattern] Build always these packages fromsource, but never build the others. Allows multiple --buildparameters. 'pattern' is a fnmatch file pattern of a packagereference. Default behavior: If you don't specify anything, it willbe similar to '--build=never', but package recipes can override itwith their 'build_policy' attribute in the conanfile.py.-r REMOTE, --remote REMOTELook in the specified remote server-u, --update Check updates exist from upstream remotes-l [LOCKFILE], --lockfile [LOCKFILE]Path to a lockfile or folder containing 'conan.lock' file. Lockfilecan be updated if packages change-e ENV_HOST, --env ENV_HOSTEnvironment variables that will be set during the package build(host machine). e.g.: -e CXX=/usr/bin/clang++-e:b ENV_BUILD, --env:build ENV_BUILDEnvironment variables that will be set during the package build(build machine). e.g.: -e CXX=/usr/bin/clang++-e:h ENV_HOST, --env:host ENV_HOSTEnvironment variables that will be set during the package build(host machine). e.g.: -e CXX=/usr/bin/clang++-o OPTIONS_HOST, --options OPTIONS_HOSTDefine options values (host machine), e.g.: -o Pkg:with_qt=true-o:b OPTIONS_BUILD, --options:build OPTIONS_BUILDDefine options values (build machine), e.g.: -o Pkg:with_qt=true-o:h OPTIONS_HOST, --options:host OPTIONS_HOSTDefine options values (host machine), e.g.: -o Pkg:with_qt=true-pr PROFILE_HOST, --profile PROFILE_HOSTApply the specified profile to the host machine-pr:b PROFILE_BUILD, --profile:build PROFILE_BUILDApply the specified profile to the build machine-pr:h PROFILE_HOST, --profile:host PROFILE_HOSTApply the specified profile to the host machine-s SETTINGS_HOST, --settings SETTINGS_HOSTSettings to build the package, overwriting the defaults (hostmachine). e.g.: -s compiler=gcc-s:b SETTINGS_BUILD, --settings:build SETTINGS_BUILDSettings to build the package, overwriting the defaults (buildmachine). e.g.: -s compiler=gcc-s:h SETTINGS_HOST, --settings:host SETTINGS_HOSTSettings to build the package, overwriting the defaults (hostmachine). e.g.: -s compiler=gcc-if INSTALL_FOLDER, --install-folder INSTALL_FOLDERFolder where the workspace files will be created (default tocurrent working directory)
请注意,这些参数(如设置和选项)主要应用于依赖项,但是在工作空间中定义为可编辑的那些程序包位于用户空间中。 这些软件包将不会通过命令生成(即使使用—build参数也是如此),因为它们是本地生成的。 可编辑的布局负责匹配设置(通常使用设置和选项对布局进行参数化)
