I have a simple CMake find module I've written, for a library of mine used by other projects. It's pretty simplistic, with its full text available here. Mainly there's one find_path()
and one find_library()
, and then some variables are set.
Now, I want CMake, when trying to find my package, to fall back on:
- git-cloning or downloading the package/library from its GitHub repository,
- Unpacking the archive, if it was a download
- Building the package, either be using the running CMake itself somehow (the package has its own
CMakeLists.txt
), or by running an arbitrary shell command in the directory into which the packages was downloaded/cloned
The specifics of what happens post-download are less important to me than actually having a download fall-back.
How can I / how should I make this happen?
Notes:
- Of course if the download/git clone fails, than finding the package has failed.
- No need to worry about specific versions at the repo, although you can if you want to.