Adding a library to CMakeList
Posted: Mon Dec 12, 2022 6:50 pm
Hi,
I have LVGL library:
In this path:
I would like to add this path to my project.
What I did:
1. Created a new environment variable for the library path (c:/path/esp-iot-solution) called IOT_SOLUTION_PATH.
2. In the CMakeLists.txt of the project, I added:
3. Include it:
After compiling:
In general, even though I added the environment variable to the CMakeList.txt, the program still cannot get the related files.
What is the solution?
Thanks
I have LVGL library:
Code: Select all
https://github.com/espressif/esp-iot-solution
Code: Select all
c:/path/esp-iot-solution
What I did:
1. Created a new environment variable for the library path (c:/path/esp-iot-solution) called IOT_SOLUTION_PATH.
2. In the CMakeLists.txt of the project, I added:
Code: Select all
set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} ${IOT_SOLUTION_PATH}/components/button")
Code: Select all
#include "iot_button.h"
Code: Select all
fatal error: #include "iot_button.h": No such file or directory
In general, even though I added the environment variable to the CMakeList.txt, the program still cannot get the related files.
What is the solution?
Thanks