summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMaksims Svecovs <maksims.svecovs@arm.com>2022-08-03 16:39:35 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2022-08-05 12:49:41 +0000
commitf24f17d9b85343f97ffa59ed2ae581ac6ee8607d (patch)
tree566682d244f31caf061a6086ac186490d574bd82 /docs
parente7113b22146b3c37662288aeba98cad7e412f207 (diff)
downloadml-embedded-evaluation-kit-f24f17d9b85343f97ffa59ed2ae581ac6ee8607d.tar.gz
MLECO-3232: Add basic cmake presets
Assuming cmake 3.21 adds basic configuration and build presets: * Target mps3 board with gcc * Target mps3 board with armclang * Target simple platform with gcc * Target simple platform with armclang * Target native build system Adds test preset for native build to run default ctests. Adds respective doc section to building instructions. Note: hidden configurationPresets are to be moved to respective project directories once cmake 3.24 is supported in the codebase and preset include is supported. Note: it is encouraged to create a personal CMakeUserPresets.json with personal preferences like specific `LOG_LEVEL` and `jobs` for faster compilation time. Usage example: cmake --preset=mps3-gcc Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com> Change-Id: I07a8861ed91160cc3f5167e16be45a921b60a285
Diffstat (limited to 'docs')
-rw-r--r--docs/sections/building.md61
1 files changed, 60 insertions, 1 deletions
diff --git a/docs/sections/building.md b/docs/sections/building.md
index 1c39027..a7b64aa 100644
--- a/docs/sections/building.md
+++ b/docs/sections/building.md
@@ -18,6 +18,7 @@
- [Configuring the build for MPS3 SSE-310](./building.md#configuring-the-build-for-mps3-sse_310)
- [Configuring native unit-test build](./building.md#configuring-native-unit_test-build)
- [Configuring the build for simple-platform](./building.md#configuring-the-build-for-simple_platform)
+ - [Building with CMakePresets](./building.md#building-with-cmakepresets)
- [Building the configured project](./building.md#building-the-configured-project)
- [Building timing adapter with custom options](./building.md#building-timing-adapter-with-custom-options)
- [Add custom inputs](./building.md#add-custom-inputs)
@@ -73,7 +74,7 @@ Before proceeding, it is *essential* to ensure that the following prerequisites
```log
cmake version 3.22.4
- ```
+ ```
> **Note:** Required version of CMake is also installed in the Python3 virtual environment created by
> `setup_default_resources.py` script. See [Fetching resource files](./building.md#fetching-resource-files) section.
@@ -541,6 +542,64 @@ cmake .. \
-DCMAKE_TOOLCHAIN_FILE=scripts/cmake/toolchains/bare-metal-armclang.cmake
```
+### Building with CMakePresets
+
+If you are using CMake version 3.21 or above, then an alternative method of building is by using CMakePresets.
+This can be done by calling the following command:
+```commandline
+cmake --preset <platform>
+cmake --build --preset <platform>
+```
+where platform is one of:
+```commandline
+native
+mps3-gcc
+mps3-clang
+simple-gcc
+simple-clang
+```
+This will automatically configure and build the evaluation-kit into a corresponding folder.
+You can still pass in build flags as usual, for example:
+```commandline
+cmake --preset mps3-gcc -DUSE_CASE_BUILD=inference_runner
+cmake --build --preset mps3-gcc
+```
+Alternatively, you can create a CMakeUserPresets.json in the root of the project with personal user settings, for example:
+```commandline
+{
+ "version": 3,
+ "cmakeMinimumRequired": {
+ "major": 3,
+ "minor": 21,
+ "patch": 0
+ },
+ "configurePresets": [
+ {
+ "name": "my-config",
+ "displayName": "my-config",
+ "inherits": ["mps3-300-gcc"],
+ "cacheVariables": {
+ "LOG_LEVEL": {
+ "type": "STRING",
+ "value": "LOG_LEVEL_DEBUG"
+ }
+ }
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "mps3-300-gcc-custom",
+ "displayName": "mps-300-gcc-custom",
+ "configurePreset": "my-config",
+ "targets": [
+ "ethos-u-object_detection",
+ "ethos-u-inference_runner"],
+ "jobs": 12
+ }
+ ]
+}
+```
+
### Building the configured project
If the CMake command succeeds, build the application as follows: