Commands

ue4 conan build

Builds Conan packages using profiles and wrapper packages generated by conan-ue4cli.

Usage syntax:

ue4 conan build [-h] [--rebuild] [--dry-run] [--no-export] [--no-build] [--no-cache] [--no-cwd]
                [-s DIR] [-o PKG:OPTION=VALUE] [-user USER] [-upload REMOTE] [-p PROFILE]
                PACKAGE1 [PACKAGE2 ...]

Overview

This command builds Conan packages using the specified UE4 Conan profile and its accompanying wrapper packages, which ensures the resulting binaries are compatible with the Unreal Engine installation that was used to generate the profile and wrappers. Packages are specified by name, with an optional version number suffix in the form PACKAGE==VERSION. If no version is specified for a given package then the highest available version will be selected automatically. Each package name will be expanded to a fully-qualified reference using the form PACKAGE/VERSION@USER/CHANNEL, where CHANNEL is the Unreal Engine version number associated with the selected Conan profile and USER is the Conan package author, which defaults to adamrehn but can be overridden with the -user USER argument. You can also specify the special keyword all to build the latest versions of all available packages.

Build process

The build command performs two steps:

  • Export recipes: first, the command identifies all available package recipes in the conan-ue4cli recipe cache, the current working directory, and any additional user-specified source directories. Recipes must be organised in the prescribed directory structure to be detected correctly. These recipes are then exported to Conan’s local cache using the conan export command so their recipes are known to Conan and are available for dependency resolution when Conan constructs its build graph.

  • Build package binaries: next, the command resolves the specified list of package names and versions to fully-qualified Conan package references, as described above in the Overview section. Each of these references is then built in turn using the conan install command. Finally, if a Conan remote has been specified then the built package binaries will be uploaded to the specified remote using the conan upload command.

Controlling the build process

Profile selection

You can use the -p PROFILE argument to specify the UE4 Conan profile that should be used to build packages. If no profile is specified then the default profile for the host platform and the Unreal Engine version reported by ue4cli will be used.

Uploading build packages to remotes

You can use the -upload REMOTE argument to specify a Conan remote to upload built packages to. Note that uploading is part of the build step and cannot be run separately via this command, but you can upload package binaries from Conan’s local cache to remotes at any time by using the conan upload command.

Running only the export step or the build step

You can disable the export step by specifying the --no-export flag, and you can disable the build step by specifying the --no-build flag. This facilitates workflows where the user wants to separate these steps, so they can export package recipes using one or more invocations of this command with the --no-build flag and then build package binaries later using a subsequent invocation of this command with the --no-export flag.

Note that you cannot perform the build step using the all specifier if you have disabled the export step (e.g. ue4 conan build all --no-export), since the export step is responsible for computing the list of available package recipes.

Controlling source directory selection

By default, this command searches for and exports all available package recipes in the conan-ue4cli recipe cache and the current working directory. You can control this behaviour, both by suppressing the defaults and specifying additional directories to search:

  • You can exclude the recipe cache from the search list by specifying the --no-cache flag.
  • You can exclude the current working directory from the search list by specifying the --no-cwd flag.
  • You can specify additional search directories by specifying the -s DIR, which can be repeated multiple times (e.g. ue4 conan build all -s /path/to/dir1 -s /path/to/dir2, etc.)

Advanced use

  • By default, this command uses the missing Conan build policy, which means any given package will not be rebuilt if binaries for that package already exist in Conan’s local cache. You can specify the --rebuild flag to override this behaviour, which will use the outdated build policy with the cascade option enabled.

  • The -o PKG:OPTION=VALUE argument can be used to set options for individual packages. The argument can be specified multiple times to set multiple options, and will be passed directly to the conan install command.

  • The --dry-run flag can be specified to have conan-ue4cli print the Conan commands (conan export, conan install, conan upload) that would be run in order to carry out a build instead of actually invoking those commands.

Examples

For examples of using this command, see the Building packages section of the Creating Conan packages page.