I would like to write a cmake script that will compile the same source against multiple versions of header files. The aim is to be able to easily create shared libraries that are backwards compatible with earlier versions of an API.
I am looking for examples and pointers on the best way to do this.
I am new to both c++ and cmake so any help will be greatly appreciated.