When running LaTeX in batch mode, it might not print any output when a
failure occurs. So, when running in this mode, cat out the log failure
if a LaTeX error occurs.
The implementation for this wraps the latex call in a CMake script
that runs latex and checks the return value. If not a success value,
reads and then prints the log.
In a large project, it is not uncommon to have LaTeX documents built in
different subdirectories and to have each subdirectory include
UseLATEX.cmake. However, loading UseLATEX.cmake multiple times caused
the pdf, dvi, etc. targets to be created multiple times even though the
intention is to have them loaded once. This change creates each target
only once.