Can someone point me to an smart way to keep a CMakeFiles compatible for those who want to build also a project in ESP-IDF v5. But of course keeping backwards compatibility to 4.4 at least. I searched for CMakeFiles and IDF_VERSION but didn't found anything related. Please forgive me if it was asked before
IDEA (I know pre-processor directives won't work but just to illustrate it)
Code: Select all
idf_component_register(SRCS ${app_sources}
INCLUDE_DIRS "include"
REQUIRES esp_timer
#if IDF_VERSION > 5.0
driver esp_adc
#else
esp_adc_cal
#endif
)
Without this keeping Firmware's that might be compiled in either IDF 4.4 or 5 will be a real pain to maintain.