Not exactly what you ask, but to make it very clear (rather than cryptic resources missing messages when you compile) you could just add
#ifndef __AVR_ATmega2560__
#error "please use an Arduino MEGA"
#endif
at the beginning of your library. That will stop the compiler if you are not compiling for a MEGA 2560, and the user will get an error message
exit status 1
#error "please use an Arduino MEGA"