Skip to content
Snippets Groups Projects
  • Ben Cumming's avatar
    refactor git submodule support in cmake (#448) · 4c66432f
    Ben Cumming authored
    In some places our CMake scripts were attempting to check out git submodules when required, if they have not already been checked out. The code that does this was cut and pasted, and was getting unwieldy.
    
    To minimise the responsibilities of CMake, this PR
    
    removes calls to git
    introduces a function check_git_submodule that can be used to test if a git submodule is installed, and print a helpful message that informs the user how to check it out if needed.
    introduces a function add_error_target that makes a target that prints a message then quits with an error. This can be used to generate a proxy target when a problem is detected during CMake setup. This means that an error is only generated when building a target with a missing dependency, instead of an error during CMake setup.
    refactors the CMake setup for the docs and ubenches targets to use these new features.
    4c66432f