Skip to content

Build plugin: add functionality to load targets from an existing cmake build tree

Alexander Neundorf requested to merge work/neundorf/BuildPluginCMakeFileApi into master

This is actually not yet a merge request, but more a review request.

Here I'm adding a menu entry "Load targets from cmake build dir" to the "Build" menu. The user can then select a CMakeCache.txt, and the build plugin will create a target set (for multi-config generators one for each build config) containing the targets which can be built. This should work for all cmake generators (make, ninja, ninja multi-config, also Visual Studio). When saving, only the information that this target set has been created via cmake, is saved, when loading it is reread via the cmake file API.

This does not deal with the loaded files or projects, but is completely independent. This means it does not interfere with the autoloading of projects using git or svn. Also I think this way the functionality is much easer discoverable compared to the user having to open some file from the cmake build tree (before opening a file from the source tree, because then the project wouldn't be loaded). Also, it makes it possible to have target sets for multiple build trees for the same source tree open at the same time.

I still have to merge the permission-asking code for running cmake from the project-branch.

Comments ?

Merge request reports