FindSubversion: need a way to proceed when running Subversion_WC macros on non-SVN directories
Using CMake 3.12.0-rc1 on Windows 10/Ubuntu 18.04.
The FindSubversion module provides macros to eg. check the revision of a working copy. However, if they're run on a directory that isn't a working copy then the whole configure step fails, and no tools are provided to check before calling these macros.
Take Subversion_WC_INFO()
for example. If I run it on a non-working-copy, the entire configure step dies with an error due to the svn
executable returning an error code. But there's no easy way to check if a directory is a working copy, which might be the case if eg. building from a zip file distribution, or a mirrored Git repository. It would certainly be up to the CMake configuration author to handle these cases, but at present, there's not really any way to catch them in the first place.
Either an error value (eg. "NA" or empty or unset) or some sort of guard macro (eg. Subversion_IS_WC(DIRECTORY FLAG)
) would help greatly. I'm happy to try to fix the issue, but I don't know what your preference would be here.