I have 3 subprojects in my project, 2 ESP and one СMake embedded with three targets.
When I select the DEBUG configuration, the macro does not work for me:
Thanks for confirming your license. The ESP32 builds are managed by the ESP-IDF build scripts, that indeed do not define separate debug/release macros on the C/C++ level.
You can work around it by adding the following line to the top-level CMakeLists.txt file of your project, before the first include() statement: