Installing targets from a monorepository

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

Installing targets from a monorepository

What is the recommended way of handling installation of targets in a monorepository?
We've got a fairly large project with many targets. Some of the targets are libraries used by other targets, some are final executables. Different executables depend on different libraries. So far we only support configuring project from top-level CMakeLists.
I am looking for a best way to build a target + its dependencies and install only built files (for simplicity, we don't care about other binaries like 3rd party SDKs at this point). What I expect to receive is CMAKE_BUILD_PREFIX dir with a binary and all of its dependencies that I use for packaging/deployment.
So far I am aware of several approaches, the simplest is to use install(...OPTIONAL...) commands along with CMAKE_SKIP_INSTALL_ALL_DEPENDENCY.
However, this approach looks to me a little hackerish.
Since monorepos are quite popular these days, is there a better approach to do what I am trying?


Powered by

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

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe:

This mailing list is deprecated in favor of