How to target a specific version of a Linux distro with CPack?

How to target a specific version of a Linux distro with CPack? Suppose I want to generate several deb files each one targeting a different version of a Linux distro. How do I do that? My hypothesis is that CPack packages for the version of the distro I am running. Is that correct?

I suggest you build on the oldest version of debian (or ubuntu or something) which you want to support, and then see how that package works on the newer versions of the distribution.

You may have to create some post install scripts to handle differences between the distributions.
I.e. you would create only one package, but make that work on all versions.