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.
A user requested the ability to make the target names created by UseLATEX
different than the name of the main tex file. The use case was for a
multi-directory project with two or more subdirectories containing LaTeX
files with the same name.
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.