2005-12-14 21:51:08 +03:00
|
|
|
# - Find Latex
|
2002-09-30 20:24:41 +04:00
|
|
|
# This module finds if Latex is installed and determines where the
|
|
|
|
# executables are. This code sets the following variables:
|
2005-12-14 21:51:08 +03:00
|
|
|
#
|
2005-12-15 18:41:19 +03:00
|
|
|
# LATEX_COMPILER: path to the LaTeX compiler
|
|
|
|
# PDFLATEX_COMPILER: path to the PdfLaTeX compiler
|
|
|
|
# BIBTEX_COMPILER: path to the BibTeX compiler
|
|
|
|
# MAKEINDEX_COMPILER: path to the MakeIndex compiler
|
|
|
|
# DVIPS_CONVERTER: path to the DVIPS converter
|
|
|
|
# PS2PDF_CONVERTER: path to the PS2PDF converter
|
|
|
|
# LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
|
2002-09-30 20:24:41 +04:00
|
|
|
#
|
|
|
|
|
2009-09-28 19:45:50 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2002-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
|
|
|
# (To distributed this file outside of CMake, substitute the full
|
|
|
|
# License text for the above reference.)
|
|
|
|
|
2003-01-23 18:37:46 +03:00
|
|
|
IF (WIN32)
|
|
|
|
|
|
|
|
# Try to find the MikTex binary path (look for its package manager).
|
|
|
|
|
|
|
|
FIND_PATH(MIKTEX_BINARY_PATH mpm.exe
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin"
|
|
|
|
DOC
|
|
|
|
"Path to the MikTex binary directory."
|
|
|
|
)
|
|
|
|
MARK_AS_ADVANCED(MIKTEX_BINARY_PATH)
|
|
|
|
|
|
|
|
# Try to find the GhostScript binary path (look for gswin32).
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\8.00;GS_DLL]" PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\7.04;GS_DLL]" PATH
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_PATH(GHOSTSCRIPT_BINARY_PATH gswin32.exe
|
|
|
|
${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00}
|
|
|
|
${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04}
|
|
|
|
DOC "Path to the GhostScript binary directory."
|
|
|
|
)
|
|
|
|
MARK_AS_ADVANCED(GHOSTSCRIPT_BINARY_PATH)
|
|
|
|
|
|
|
|
FIND_PATH(GHOSTSCRIPT_LIBRARY_PATH ps2pdf13.bat
|
|
|
|
"${GHOSTSCRIPT_BINARY_PATH}/../lib"
|
|
|
|
DOC "Path to the GhostScript library directory."
|
|
|
|
)
|
|
|
|
MARK_AS_ADVANCED(GHOSTSCRIPT_LIBRARY_PATH)
|
|
|
|
|
|
|
|
ENDIF (WIN32)
|
|
|
|
|
|
|
|
FIND_PROGRAM(LATEX_COMPILER
|
2002-09-30 20:24:41 +04:00
|
|
|
NAMES latex
|
2003-01-23 18:37:46 +03:00
|
|
|
PATHS ${MIKTEX_BINARY_PATH}
|
2003-01-28 16:53:27 +03:00
|
|
|
/usr/bin
|
2002-09-30 20:24:41 +04:00
|
|
|
)
|
|
|
|
|
2003-08-08 00:32:20 +04:00
|
|
|
FIND_PROGRAM(PDFLATEX_COMPILER
|
|
|
|
NAMES pdflatex
|
|
|
|
PATHS ${MIKTEX_BINARY_PATH}
|
|
|
|
/usr/bin
|
|
|
|
)
|
|
|
|
|
2003-01-23 18:37:46 +03:00
|
|
|
FIND_PROGRAM(BIBTEX_COMPILER
|
2002-09-30 20:24:41 +04:00
|
|
|
NAMES bibtex
|
2003-01-23 18:37:46 +03:00
|
|
|
PATHS ${MIKTEX_BINARY_PATH}
|
2003-01-28 16:53:27 +03:00
|
|
|
/usr/bin
|
2002-09-30 20:24:41 +04:00
|
|
|
)
|
|
|
|
|
2003-01-23 18:37:46 +03:00
|
|
|
FIND_PROGRAM(MAKEINDEX_COMPILER
|
|
|
|
NAMES makeindex
|
|
|
|
PATHS ${MIKTEX_BINARY_PATH}
|
2003-01-28 16:53:27 +03:00
|
|
|
/usr/bin
|
2002-09-30 20:24:41 +04:00
|
|
|
)
|
|
|
|
|
2003-01-23 18:37:46 +03:00
|
|
|
FIND_PROGRAM(DVIPS_CONVERTER
|
2002-09-30 20:24:41 +04:00
|
|
|
NAMES dvips
|
2003-01-23 18:37:46 +03:00
|
|
|
PATHS ${MIKTEX_BINARY_PATH}
|
2003-01-28 16:53:27 +03:00
|
|
|
/usr/bin
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_PROGRAM(DVIPDF_CONVERTER
|
|
|
|
NAMES dvipdfm dvipdft dvipdf
|
|
|
|
PATHS ${MIKTEX_BINARY_PATH}
|
|
|
|
/usr/bin
|
2002-09-30 20:24:41 +04:00
|
|
|
)
|
|
|
|
|
2003-01-23 18:37:46 +03:00
|
|
|
IF (WIN32)
|
|
|
|
FIND_PROGRAM(PS2PDF_CONVERTER
|
2003-01-23 18:42:06 +03:00
|
|
|
NAMES ps2pdf14.bat
|
2003-01-23 18:37:46 +03:00
|
|
|
PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
|
|
|
|
)
|
|
|
|
ELSE (WIN32)
|
|
|
|
FIND_PROGRAM(PS2PDF_CONVERTER
|
2003-08-19 16:53:14 +04:00
|
|
|
NAMES ps2pdf14 ps2pdf
|
2003-01-23 18:37:46 +03:00
|
|
|
)
|
|
|
|
ENDIF (WIN32)
|
2003-01-22 19:11:41 +03:00
|
|
|
|
2003-08-08 00:32:20 +04:00
|
|
|
FIND_PROGRAM(LATEX2HTML_CONVERTER
|
|
|
|
NAMES latex2html
|
|
|
|
PATHS ${MIKTEX_BINARY_PATH}
|
|
|
|
/usr/bin
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2003-01-23 18:37:46 +03:00
|
|
|
MARK_AS_ADVANCED(
|
|
|
|
LATEX_COMPILER
|
2003-08-08 00:32:20 +04:00
|
|
|
PDFLATEX_COMPILER
|
2003-01-23 18:37:46 +03:00
|
|
|
BIBTEX_COMPILER
|
|
|
|
MAKEINDEX_COMPILER
|
|
|
|
DVIPS_CONVERTER
|
2003-10-30 21:33:51 +03:00
|
|
|
DVIPDF_CONVERTER
|
2003-01-23 18:37:46 +03:00
|
|
|
PS2PDF_CONVERTER
|
2003-08-08 00:32:20 +04:00
|
|
|
LATEX2HTML_CONVERTER
|
2003-01-23 18:37:46 +03:00
|
|
|
)
|