When the COPY_FILE operation fails optionally capture the error message
with a COPY_FILE_ERROR option instead of reporting the error
immediately. This gives callers a chance to do something else or report
the error.
Teach the RunCMake.try_compile test to cover bad argument combinations
involving COPY_FILE_ERROR. Teach the TryCompile test to cover the case
of a COPY_FILE error message captured by COPY_FILE_ERROR.
Extend the signature
try_compile(RESULT_VAR <bindir> <srcfile> ...)
to allow multiple sources as
try_compile(RESULT_VAR <bindir> SOURCES <srcfile>... ...)
Process the sources to generate a CMakeLists.txt that enables all needed
languages.
Teach the TryCompile test to try cases with two sources of the same
language and of mixed languages. Teach RunCMake.try_compile to cover
error cases for the signature.
Process all arguments in a single loop using a simple state machine.
While at it, fix some error message typos. Also allow LINK_LIBRARIES
with no actual libraries to disable use of the -DLINK_LIBRARIES=...
from the CMAKE_FLAGS. This was already possible in the old logic if
LINK_LIBRARIES was immediately followed by another keyword argument
instead of the end of the argument list, so allow it in general.
Update the RunCMake.try_compile test cases accordingly.