You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
# Building and Running the Project (Conan 2.x with CMake Presets)
2
2
3
-
This document provides instructions for building and running the project using **Conan 2.x** and **CMake Presets**. This approach simplifies the build process by defining all build configurations in a single `CMakePresets.json` file.
3
+
This document provides instructions for building and running the project using **Conan 2.x** and **CMake Presets**. This approach simplifies the build process.
TODO: There are also scripts that run generation phase accordingly for Windows system `configure.cmd` script and for Linux `configure.sh`.
26
+
There are also scripts that run generation phase accordingly for Windows system `configure.cmd` and for Linux `configure.sh`.
27
27
28
28
#### 1. Generate the Conan Toolchain and Dependencies
29
-
This step uses Conan to download all project dependencies and generate the conan_toolchain.cmake file that CMake needs.
29
+
This step uses Conan to download all project dependencies and generate the conan_toolchain.cmake file that CMake needs. This is an example, parameters like profile used or build type can be changed.
This command will create the build directory and populate it with Conan's toolchain file and other necessary configuration.
41
+
This command will create the build directory and populate it with Conan's toolchain file and other necessary configuration. Also `CMakeUserPresets.json` and `compile_commands.json` files will be generated.
42
42
43
-
#### 2. Configure the Project
43
+
#### 2. Build the Project
44
44
45
-
The `cmake --preset` command will automatically resolve and install all project dependencies using Conan. It will create a build directory and generate the necessary files for building.
45
+
Once the project is configured, you can build it using the same profile. This is an example, parameters like profile used or build type can be changed.
The `cmake --preset` command is the key to this workflow. It tells CMake to:
92
-
93
-
1. Read the configuration specified in the `CMakePresets.json` file.
94
-
95
-
2. Automatically invoke Conan to download all the dependencies defined in your `conanfile.py`.
96
-
97
-
3. Set up the build environment with Conan's toolchain file, ensuring that the compiler, C++ standard, and other settings are correctly configured for your chosen preset.
98
-
99
-
This eliminates the need to run manual `conan install` and `cmake -DCMAKE_TOOLCHAIN_FILE=...` commands separately, creating a single, consistent entry point for building your project.
Repository template for a cross-platform project written in C++ with use of Conan and CMake. This template has also GitHub actions configured for CI/CD with static analysis by clang-tidy and cppcheck. It has also clang-format configuration file for code formatting.
0 commit comments