combining multiple build variants into the same package (and install prefix)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

combining multiple build variants into the same package (and install prefix)

Stefan Seefeld


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 ?



      ...ich hab' noch einen Koffer in Berlin...


Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: