PlatformIO Community

Insert variable from PIO IDE

i can’t see the forest for the trees right now…
I want to use the project directory name as a variable in the code - is there a buildin variable or do I need to create a dynamic entry in the plattformio.ini?

I can import OS variable with "build_flags = -D VAR=${sysenv.VAR} " but not from PIO himself ($PROJECT_DIR)