Page 1 of 1

Standard way to require a specific IDF version?

Posted: Fri Sep 25, 2020 6:36 am
by meowsqueak
Is there anything provided by ESP-IDF (v4.1) that can be used to verify that a specific version of the IDF is being used, and abort if it's not available?

For example, I'd like my CMakeLists.txt to signal to a user that they have to use v4.1 and anything else is unsupported.

Obviously I can do this:

Code: Select all

if (NOT (IDF_VERSION_MAJOR EQUAL 4 AND IDF_VERSION_MINOR EQUAL 1))
    message(FATAL_ERROR "ESP-IDF v4.1 is required")
endif()
However this gets a bit cumbersome when I want to extend it to support a number of different versions, perhaps including ranges or excluding specific versions: E.g. v3.2 - v3.3, not v4.0, and v4.1 only.

Re: Standard way to require a specific IDF version?

Posted: Tue Oct 18, 2022 7:36 pm
by phatpaul
I would also like to do this. Your suggestion of checking IDF_VERSION_ is helpful, but doesn't guarantee that you have the exact commit checked out.

Currently I have esp-idf as a git submodule of my project repo, so that I know I have the right version after I do:

git submodule update --init --recursive

But that has been cumbersome. I had to add to my build script to check that the submodule is in fact at the correct version.