Add -D option via boards.txt
Yes, it is possible in the 1.5.+ IDE. while not possible in the 1.0.+ and earlier.

Hardware-specification refers to both the boards.txt and platform.txt files.

in short the boards.txt file specifies...

uno.build.f_cpu=16000000L


and the platform.txt uses in the compile commands such as ...

 -DF_CPU={build.f_cpu}


You can your own. There is already a "build.extra_flags=" that some of the USB devices use to add their own FLAGs conditionally on the board type.