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.
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>
Previously, the EXCLUDE_FROM_ALL option broke both the dependency from
the all target and the dependency from the dvi, pdf, etc. targets. However,
there is plenty of reason to want only one or the other, so the
EXCLUDE_FROM_ALL option was broken up into a second EXCLUDE_FROM_DEFAULTS
that controls the second set of dependencies.
Removed the DEFAULT_* arguments. Instead, have a CMake variable named
LATEX_DEFAULT_BUILD that specifies what the default build should be.
This CMake variable is initialized with an environment variable of the
same name or PDF if none is specified. This allows each user to specify
a default build without having to change the configuration.
There is also an EXCLUDE_FROM_ALL option that, like the same option in
add_executable, keeps the document from being built in the default all
target.
UseLATEX.cmake finds several executables for compiling documents and
converting files. Previously these were not marked as advanced, but
CMake now conventionally makes them advanced to avoid cluttering the
GUI.
Change "set (" to "set("
Change some set commands that were actually appending a list to a list(append
command, which shows better the point of the command and could be faster.
That module is actually based off the code that originally came from
UseLATEX.cmake, but now that it exists and is supported by the CMake
community, there is no reason to have a second copy here.
The arguments for else and endif commands are now no longer necessary. In
fact, the are no longer encouraged. This is because, in addition to it
being annoying to exactly match expressions, it becomes confusing when
there is an else clause. (The expression is actually the inverse of the
case for the else clause.)
Older versions of Windows use the path C:\Windows\system32. Newer ones
use the path C:\Windows\System32 (with a capitol S). They are somewhat
equivalent because Windows file system is not case sensitive, but it
made the check for the system32 directory fail. This change first converts
the path the lowercase to do a non case sensitive comparison.