Standard way to require a specific IDF version?

meowsqueak
Posts: 151
Joined: Thu Jun 15, 2017 4:54 am
Location: New Zealand

Standard way to require a specific IDF version?

Postby meowsqueak » Fri Sep 25, 2020 6:36 am

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.

phatpaul
Posts: 110
Joined: Fri Aug 24, 2018 1:14 pm

Re: Standard way to require a specific IDF version?

Postby phatpaul » Tue Oct 18, 2022 7:36 pm

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.

Who is online

Users browsing this forum: Google [Bot] and 63 guests