Need mechanism to pass defines to library cpp files

the simplest solution I can think of is to provide two libraries but that is a burden for the developer.

Another way is to use a templates. A very short intro see