Disabling LV_BUILD_EXAMPLES in lv_conf.h but still it gets build

I have disabled macro LV_BUILD_EXAMPLES in lv_conf.h but still. When i do cmake in build directory and perform make it generates lv_eamples library. I have tried disabling some widgets option also in lv_conf.h and they are also getting compiled for lvgl library. The lv_conf.h is kept parallel with lvgl directory as per documentation. I feel like its not considering lv_conf.h properly. Is there something which I am missing. I have kept color depth 16 in conf.h and it looks like it has considered that property.

Thankyou in advance!
Note: I am using v8.3

did you edit the correct lv_conf file? I believe there are 2 of them

There is only one in my environment. Which I had copied “lv_conf_template.h” and renamed it to lv_conf.h and enabled #ifdef

I am sorry for wasting time. The path for lv_conf.h was not correct. I found my mistake.
But even after placing it in correct path. The liblvgl_examples.a is getting created

You have to look around, There is another config file somewhere that is being accessed by the compiler.

Sorry I forgot to update. It had to be disabled in env_support/cmake/custom.cmake

To anyone using lvgl as a submodule in their project and don’t want to change the submodule, you can add:

set(LV_CONF_BUILD_DISABLE_DEMOS 1)
set(LV_CONF_BUILD_DISABLE_EXAMPLES 1)

to your root CMakeLists.txt file

or:

cmake -DLV_CONF_BUILD_DISABLE_DEMOS=0 -DLV_CONF_BUILD_DISABLE_EXAMPLES=0

I’ve had the same problem with LVGL 9.3.0 and I’ve found out it’s CONFIG_LV_BUILD_EXAMPLES and not LV_BUILD_EXAMPLES:
Using the following in CMakeLists.txt helps:
cmake_minimum_required(VERSION 3.14) # I am using 3.14, will probably work with 3.13 too
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # ← VERY IMPORTANT!! Otherwise you won’t be able to set the “normal variables” starting with CONFIG_…

set(CONFIG_LV_BUILD_DEMOS OFF) # for demos
set(CONFIG_LV_BUILD_EXAMPLES OFF) # for examples
set(CONFIG_LV_USE_THORVG_INTERNAL OFF) # for ThorVG