esp-idf/examples/build_system/cmake/import_lib
2024-04-07 12:13:29 +08:00
..
components/tinyxml2 fix(build-system/example): Updated dead URL for downloading tinyxml2 2023-12-04 14:28:52 +08:00
main examples: import_lib: simplify with fatfs partition generator 2022-07-12 15:04:28 +02:00
CMakeLists.txt tools: Increase the minimal supported CMake version to 3.16 2022-06-01 06:35:02 +00:00
partitions_example.csv Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
pytest_import_lib.py ci(build_system): clean-up cmake examples build-test-rules.yml 2024-01-04 11:30:41 +08:00
README.md ci(esp32c5mp): disable the unsupported tests 2024-04-07 12:13:29 +08:00
sdkconfig.defaults examples: remove non-existent options from sdkconfig.defaults 2019-07-29 04:57:38 +02:00

Supported Targets ESP32 ESP32-C2 ESP32-C3 ESP32-C5 ESP32-C6 ESP32-H2 ESP32-P4 ESP32-S2 ESP32-S3

Import Third-Party CMake Library Example

This example demonstrates how to import third-party CMake libraries.

Example Flow

tinyxml2 is a small C++ XML parser.

It is imported, without modification, into the tinyxml2 component. Please refer to the component CMakeLists.txt file for the description of the process: components/tinyxml2/CMakeLists.txt.

To demonstrate the library being used, a sample XML is embedded into the project. This sample XML is then read and parsed using tinyxml2. Please refer to the main component for details.

Output

I (317) example: Setting up...
I (317) example: Copying sample XML to filesystem...
I (647) example: Reading XML file
I (657) example: Read XML data:
<?xml version="1.0" encoding="UTF-8"?>
<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
</note>

I (667) example: Parsed XML data:

To: Tove
From: Jani
Heading: Reminder
Body: Don't forget me this weekend!
I (677) example: Example end

There is a discussion on importing third-party CMake libraries in the programming guide under API Guides -> Build System -> Using Third-Party CMake Projects with Components