create_conan_project
Create a new Conan project with specified dependencies and build system templates. Set up libraries or executables quickly by providing project name, version, and required packages.
Instructions
Create a new Conan project with specified dependencies.
This tool creates a new Conan project using templates and automatically adds
the specified dependencies. Useful for setting up new projects with common
libraries like fmt, openssl, boost, etc.
Note: The generated code contains placeholder examples. You need to review
and update: includes/imports, source code usage, and build system targets
(CMakeLists.txt, meson.build, etc.) to properly use your specified dependencies.
Args:
template: Template type for the project.
Libraries (produce libraries to be linked):
- cmake_lib: CMake library (default for libraries)
- header_lib: Header-only library
- meson_lib: Meson build system
- msbuild_lib: Visual Studio / MSBuild (Windows only)
- bazel_lib: Bazel build system (experimental)
- autotools_lib: Autotools (configure/make)
Executables (programs that can be run):
- cmake_exe: CMake executable (default for executables)
- meson_exe: Meson build system
- msbuild_exe: Visual Studio / MSBuild (Windows only)
- bazel_exe: Bazel build system (experimental)
- autotools_exe: Autotools (configure/make)
Note: If the user doesn't specify build system, use cmake_lib
for libraries or cmake_exe for executables as defaults.
name: Name of the project
version: Version of the project (default: "0.1")
requires: List of dependencies with versions (e.g., ['fmt/12.0.0',
'openssl/3.6.0'])
tool_requires: List of tool dependencies with versions. Common examples:
- ['cmake/4.1.2'] - CMake build tool
- ['ninja/1.13.1'] - Ninja build system
- ['meson/1.9.1'] - Meson build system
work_dir: Working directory where the command should be executed.
The project will be created directly in this directory.
Always required.
force: Overwrite existing files if they exist (default: False)
Returns:
Dictionary containing:
- result: Success message with project details, dependency note, and
raw output from the conan new command
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | Yes | Template type for the project. If not specified, use cmake_lib for libraries or cmake_exe for executables | |
| name | Yes | Name of the project | |
| version | No | Version of the project | 0.1 |
| requires | No | List of dependencies with versions | |
| tool_requires | No | List of tool dependencies with versions. Common examples: ['cmake/4.1.2'], ['ninja/1.13.1'], ['meson/1.9.1'] | |
| work_dir | Yes | Working directory where the command should be executed. The project will be created directly in this directory. Always required. | |
| force | No | Overwrite existing files if they exist |