1.. _build_cmake:
2
3=====
4CMake
5=====
6
7
8Overview
9********
10
11This project uses CMakePresets to ensure an easy build.
12Find out more on Cmake Presets here: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html
13
14
15Prerequisites
16-------------
17
18You need to install
19
20- CMake
21- Ninja (for Linux builds). Be sure to Add ninja to your PATH!
22
23
24How to build this project using cmake
25-------------------------------------
26
27The recommended way to build this project is to use the provided CMakePresets.json. This file contains 2 configurations
28
29- a windows (msvc) build using Visual Studio
30- a linux (gcc) build using Ninja
31
32
33More configurations will be added once available.
34
35
36Build with IDE
37--------------
38
39The recommend way for consuming CMakePresets is a CMakePresets aware IDE such as
40
41- VS 2022
42- VS Code
43- CLion
44
45
46Simply load this project into your IDE and select your desired preset and you are good to go.
47
48
49Build with CMake GUI
50--------------------
51
52Open this project with CMake GUI and select your desired preset. When hitting the generate button,
53CMake will create solution files (for VS) or Ninja Files (for Linux Ninja Build)
54
55The following targets are available.
56
57- lvgl (the actual library, required)
58- lvgl_thorvg (an vector graphics extension, optional)
59- lvgl_examples (example usages, optional)
60- lvgl_demos (some demos, optional)
61
62
63All optional targets can be disabled by setting the proper cache variables.
64If you use cmake to install lvgl 3 folders will be created.
65
66- include/lvgl (contains all public headers)
67- bin (contains all binaries (\*.dll))
68- lib (contains all precompiled source files (\*.lib))
69
70
71Build with Command line
72-----------------------
73
74You can also build your project using the command line. Run the following commands
75
76- ``cmake --preset windows-base``
77- ``cmake --build --preset windows-base_dbg``
78- ``ctest --preset windows-base_dbg``
79
80
81