本文档翻译自:https://docs.conan.io/en/latest/reference/commands/development/workspace.html

  1. $ conan workspace [-h] {install} ...

管理工作空间(从属于同一项目的用户工作空间使用的一组软件包)。
使用此命令管理柯南工作区,使用子命令“安装”从文件创建工作区。

  1. positional arguments:
  2. {install} sub-command help
  3. install same as a "conan install" command but using the workspace data
  4. from the file. If no file is provided, it will look for a file
  5. named "conanws.yml"
  6. optional arguments:
  7. -h, --help show this help message and exit

conan workspace install

  1. $ conan workspace install [-h] [-b [BUILD]] [-r REMOTE] [-u] [-l [LOCKFILE]]
  2. [-e ENV_HOST] [-e:b ENV_BUILD] [-e:h ENV_HOST]
  3. [-o OPTIONS_HOST] [-o:b OPTIONS_BUILD] [-o:h OPTIONS_HOST]
  4. [-pr PROFILE_HOST] [-pr:b PROFILE_BUILD]
  5. [-pr:h PROFILE_HOST] [-s SETTINGS_HOST]
  6. [-s:b SETTINGS_BUILD] [-s:h SETTINGS_HOST]
  7. [-if INSTALL_FOLDER]
  8. path
  1. positional arguments:
  2. path path to workspace definition file (it will look for a "conanws.yml"
  3. inside if a directory is given)
  4. optional arguments:
  5. -h, --help show this help message and exit
  6. -b [BUILD], --build [BUILD]
  7. Optional, use it to choose if you want to build from sources:
  8. --build Build all from sources, do not use binary packages.
  9. --build=never Never build, use binary packages or fail if a binary
  10. package is not found. --build=missing Build from code if a binary
  11. package is not found. --build=cascade Will build from code all the
  12. nodes with some dependency being built (for any reason). Can be
  13. used together with any other build policy. Useful to make sure that
  14. any new change introduced in a dependency is incorporated by
  15. building again the package. --build=outdated Build from code if the
  16. binary is not built with the current recipe or when missing a
  17. binary package. --build=[pattern] Build always these packages from
  18. source, but never build the others. Allows multiple --build
  19. parameters. 'pattern' is a fnmatch file pattern of a package
  20. reference. Default behavior: If you don't specify anything, it will
  21. be similar to '--build=never', but package recipes can override it
  22. with their 'build_policy' attribute in the conanfile.py.
  23. -r REMOTE, --remote REMOTE
  24. Look in the specified remote server
  25. -u, --update Check updates exist from upstream remotes
  26. -l [LOCKFILE], --lockfile [LOCKFILE]
  27. Path to a lockfile or folder containing 'conan.lock' file. Lockfile
  28. can be updated if packages change
  29. -e ENV_HOST, --env ENV_HOST
  30. Environment variables that will be set during the package build
  31. (host machine). e.g.: -e CXX=/usr/bin/clang++
  32. -e:b ENV_BUILD, --env:build ENV_BUILD
  33. Environment variables that will be set during the package build
  34. (build machine). e.g.: -e CXX=/usr/bin/clang++
  35. -e:h ENV_HOST, --env:host ENV_HOST
  36. Environment variables that will be set during the package build
  37. (host machine). e.g.: -e CXX=/usr/bin/clang++
  38. -o OPTIONS_HOST, --options OPTIONS_HOST
  39. Define options values (host machine), e.g.: -o Pkg:with_qt=true
  40. -o:b OPTIONS_BUILD, --options:build OPTIONS_BUILD
  41. Define options values (build machine), e.g.: -o Pkg:with_qt=true
  42. -o:h OPTIONS_HOST, --options:host OPTIONS_HOST
  43. Define options values (host machine), e.g.: -o Pkg:with_qt=true
  44. -pr PROFILE_HOST, --profile PROFILE_HOST
  45. Apply the specified profile to the host machine
  46. -pr:b PROFILE_BUILD, --profile:build PROFILE_BUILD
  47. Apply the specified profile to the build machine
  48. -pr:h PROFILE_HOST, --profile:host PROFILE_HOST
  49. Apply the specified profile to the host machine
  50. -s SETTINGS_HOST, --settings SETTINGS_HOST
  51. Settings to build the package, overwriting the defaults (host
  52. machine). e.g.: -s compiler=gcc
  53. -s:b SETTINGS_BUILD, --settings:build SETTINGS_BUILD
  54. Settings to build the package, overwriting the defaults (build
  55. machine). e.g.: -s compiler=gcc
  56. -s:h SETTINGS_HOST, --settings:host SETTINGS_HOST
  57. Settings to build the package, overwriting the defaults (host
  58. machine). e.g.: -s compiler=gcc
  59. -if INSTALL_FOLDER, --install-folder INSTALL_FOLDER
  60. Folder where the workspace files will be created (default to
  61. current working directory)

请注意,这些参数(如设置和选项)主要应用于依赖项,但是在工作空间中定义为可编辑的那些程序包位于用户空间中。 这些软件包将不会通过命令生成(即使使用—build参数也是如此),因为它们是本地生成的。 可编辑的布局负责匹配设置(通常使用设置和选项对布局进行参数化)