Sogartar
Sogartar

Reputation: 2175

CMake: automatically find target dependencies in other CMake projects

If we have a case of highly decentralized development environment, where there are many repositories and projects, is there an existing functionality in CMake that automatically finds dependencies between targets without a top level CMake file?

The workflow is something like this, you specify a directory and all targets are default-configured in the given tree. Then you can go and build any of the projects. I am looking for a behavior similar to that when you build the Android OS.

Upvotes: 2

Views: 791

Answers (1)

languitar
languitar

Reputation: 6794

There is no build-time dependency tracking in CMake across different projects. For this case you need to have a project on the top-level which adds all the subdirectories, so that the target names are available inside a single CMake project.

I am aware of one helper script around CMake which provides the required inter-project dependencies: https://github.com/aldebaran/qibuild I would say that is getting close to a mature code base. However, it requires additional descriptor files for each project. Might be worth to have a look at it.

Upvotes: 1

Related Questions