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.com/cmake
Kitware offers various services to support the CMake community. For more information on each offering, please visit https://cmake.org/services