I want to make sure all users building my ESP-IDF project in eclipse are forced/warned to install a minimum version of the ESP-IDF.
I have done a fairly extensive search but was unable to find a solution to implement that. I guess I could do it in code, but I was hoping to implement that in the preprocessor/cmake when I build the project.
Something like:
cmake_minimum_required(VERSION 3.16)
My alternative would probably be using static_assert
? But I was hoping to use a built-in function like above.
One option is to use the ESP-IDF Component Manager which allows you to create a manifest file containing detailed specification of all components used in the project, including the ESP IDF itself. I must admit, the documentation for manifest file is not very good, but have a look at a few examples from the component manager or mDNS project and it becomes clearer.
E.g. this manifest main/idf_component.yml
requires ESP IDF v5.0 or higher, and component from Espressif's component registry called "mdns" with version 1.1.0 (exactly):
dependencies:
espressif/mdns: "==1.1.0"
idf:
version: ">=5.0"
It's not foolproof, obviously, but it's built into the idf.py tool. So running idf.py build
just does all the magic for you.