Espressif ESP32-S2 Programming Manual page 1304

Table of Contents

Advertisement

Chapter 4. API Guides
idf-component-commands
idf_component_get_property(var component property [GENERATOR_EXPRESSION])
Retrieve a specified component's
Specifying GENERATOR_EXPRESSION will retrieve the generator expression string for that property, instead of the
actual value, which can be used with CMake commands that support generator expressions.
idf_component_set_property(component property val [APPEND])
Set a specified component's
specified value to the current value of the property. If the property does not previously exist or it is currently empty,
the specified value becomes the first element/member instead.
idf_component_register([[SRCS src1 src2 ...] | [[SRC_DIRS dir1 dir2 ...] [EXCLUDE_
SRCS src1 src2 ...]]
Register a component to the build system. Much like the project() CMake command, this should be called
from the component's CMakeLists.txt directly (not through a function or macro) and is recommended to be
called before any other command. Here are some guidelines on what commands can not be called before
idf_component_register:
• commands that are not valid in CMake script mode
• custom commands defined in project_include.cmake
• build system API commands except idf_build_get_property; although consider whether the property
may not have been set yet
Commands that set and operate on variables are generally okay to call before idf_component_register.
The arguments for idf_component_register include:
• SRCS - component source files used for creating a static library for the component; if not specified, component
is a treated as a config-only component and an interface library is created instead.
• SRC_DIRS, EXCLUDE_SRCS - used to glob source files (.c, .cpp, .S) by specifying directories, instead of
specifying source files manually via SRCS. Note that this is subject to the
Source files specified in EXCLUDE_SRCS are removed from the globbed files.
• INCLUDE_DIRS - paths, relative to the component directory, which will be added to the include search path
for all other components which require the current component
• PRIV_INCLUDE_DIRS - directory paths, must be relative to the component directory, which will be added
to the include search path for this component's source files only
• REQUIRES - public component requirements for the component
• PRIV_REQUIRES - private component requirements for the component; ignored on config-only components
• LDFRAGMENTS - component linker fragment files
• REQUIRED_IDF_TARGETS - specify the only target the component supports
• KCONFIG - override the default Kconfig file
• KCONFIG_PROJBUILD - override the default Kconfig.projbuild file
The following are used for
a component is config-only. This means that even if the component does not specify source files, a static library is
still created internally for the component if it specifies either:
• EMBED_FILES - binary files to be embedded in the component
Espressif Systems
component
property, property and store it in var accessible from the current scope.
component
property, property with value val. Specifying APPEND will append the
[INCLUDE_DIRS dir1 dir2 ...]
[PRIV_INCLUDE_DIRS dir1 dir2 ...]
[REQUIRES component1 component2 ...]
[PRIV_REQUIRES component1 component2 ...]
[LDFRAGMENTS ldfragment1 ldfragment2 ...]
[REQUIRED_IDF_TARGETS target1 target2 ...]
[EMBED_FILES file1 file2 ...]
[EMBED_TXTFILES file1 file2 ...]
[KCONFIG kconfig]
[KCONFIG_PROJBUILD kconfig_projbuild])
embedding data into the
component, and is considered as source files when determining if
Submit Document Feedback
1293
limitations of globbing in
CMake.
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF