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.
The newest 3.* CMake versions may be missing in some distributions.
The most recent feature required by UseLATEX and its tests is
ced1d5eccd:
"Skip file-level dependencies on custom targets (#11332)". The commit is
included in the release version 2.8.4.
The following error messages are produced during compilation with
earlier CMake versions:
[100%] Built target UseLATEX_pdf
make[2]: *** No rule to make target `UseLATEX_pdf', needed by `UseLATEX_build/CMakeFiles/UseLATEX'. Stop.
Signed-off-by: Anatoly Borodin <anatoly.borodin@gmail.com>
A recent change from macros to functions changed the scoping rules
that caused the variable that held the raster scale to not be defined
where the build targets were generated (and thus scaling did not occur).