combining multiple build variants into the same package (and install prefix)
I'm trying to repackage an upstream project that's using CMake.
The project is set up to allow me to specify whether to build
shared or static libs using the BUILD_SHARED_LIBS when invoking
cmake. However, rather than generating two separate packages for
the two variants, I'd like to combine both into a single package.
The built artefacts themselves allow that, as the only difference
is that one variant produces *.so files and the other *.a.
Everything else (notably headers) should be identical. This means
I can join both into the same install prefix.
The difficulty arises with the generated cmake helper files that
define the targets for downstream projects, as both build variant
would generate the same target names, but one referring to the
shared libs, the other to the static libs.
Is there a way to rename one set of exported target names to
allow both to co-exist without having to install the build
variants into distinct install prefixes ?