Is it possible to make global "defines" that work with libraries?

The variables should be in the library and extern in the main code. Having the main code set those for the library is kind of putting the cart before the horse.