There is a stable and rarely modified c++ & cmake & gcc/msvs project which statically uses, say, version 1.0 of our libfoo
library for object recognition. Our customer now wants some new functionality (a detector of a new type of specific objects) which demands to use libfoo
version 2.0.
Upgrading libfoo
from version 1.0 to 2.0 in the whole project is not an option for a few reasons, the primary being that it will change recognition behaviour in an undesired way (so subsequent painstaking tweaking would be necessary to come back to the previous quality levels and we are not paid for this work).
I see the following bruteforce solution:
- Wrap all version 2.0 source files with
namespace foo20 {...}
- Rename version 2.0 cmake target names from
foo
tofoo-2.0
. - From the main program link to
foo-2.0
to implement the new functionality.
Apart from 'niceness', this solution is cumbersome for in fact libfoo
depends on a bunch of other our internal libraries and the procedure above should be repeated for each of them.
Does anyone know a better solution for the whole problem or at least for one of the steps?