summaryrefslogtreecommitdiffstats
path: root/Modules/FindLATEX.cmake
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2003-01-23 15:37:46 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2003-01-23 15:37:46 (GMT)
commit4220725f641f02e1d157586906f94dea04fc2da2 (patch)
treed5221ff4fac09b89e6febfc7b8eb540fb36cb824 /Modules/FindLATEX.cmake
parent37f7074269d2c024290c2bfb5af00f6e1282e791 (diff)
downloadCMake-4220725f641f02e1d157586906f94dea04fc2da2.zip
CMake-4220725f641f02e1d157586906f94dea04fc2da2.tar.gz
CMake-4220725f641f02e1d157586906f94dea04fc2da2.tar.bz2
FIX:
- rename some entries (COMPILE -> COMPILER, and the converters -> _CONVERTER) - make sure that Window system are given a chance to find Latex and the converters if MikTex and GhostScript are installed (but not in the PATH)
Diffstat (limited to 'Modules/FindLATEX.cmake')
-rw-r--r--Modules/FindLATEX.cmake88
1 files changed, 72 insertions, 16 deletions
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index ba00965..e0ef805 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -2,35 +2,91 @@
# This module finds if Latex is installed and determines where the
# executables are. This code sets the following variables:
#
-# LATEX_COMPILE = the full path to the LaTeX compiler
-# BIBTEX_COMPILE = the full path to the BibTeX compiler
-# DVIPDF_COMPILE = the full path to the DVIPDF converter
-# PS2PDF_COMPILE = the full path to the PS2PDF converter
-# DVIPS_COMPILE = the full path to the DVIPS converter
-# MAKEINDEX_COMPILE = the full path to the MakeIndex compiler
+# LATEX_COMPILER = the full path to the LaTeX compiler
+# BIBTEX_COMPILER = the full path to the BibTeX compiler
+# MAKEINDEX_COMPILER = the full path to the MakeIndex compiler
+# DVIPS_CONVERTER = the full path to the DVIPS converter
+# DVIPDF_CONVERTER = the full path to the DVIPDF converter
+# PS2PDF_CONVERTER = the full path to the PS2PDF converter
#
-FIND_PROGRAM(LATEX_COMPILE
+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
NAMES latex
+ PATHS ${MIKTEX_BINARY_PATH}
)
-FIND_PROGRAM(BIBTEX_COMPILE
+FIND_PROGRAM(BIBTEX_COMPILER
NAMES bibtex
+ PATHS ${MIKTEX_BINARY_PATH}
)
-FIND_PROGRAM(DVIPDF_COMPILE
- NAMES dvipdf
+FIND_PROGRAM(MAKEINDEX_COMPILER
+ NAMES makeindex
+ PATHS ${MIKTEX_BINARY_PATH}
)
-FIND_PROGRAM(DVIPS_COMPILE
+FIND_PROGRAM(DVIPS_CONVERTER
NAMES dvips
+ PATHS ${MIKTEX_BINARY_PATH}
)
-FIND_PROGRAM(MAKEINDEX_COMPILE
- NAMES makeindex
+FIND_PROGRAM(DVIPDF_CONVERTER
+ NAMES dvipdf
+ PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
)
-FIND_PROGRAM(PS2PDF_COMPILE
- NAMES ps2pdf
-)
+IF (WIN32)
+ FIND_PROGRAM(PS2PDF_CONVERTER
+ NAMES ps2pdf13.bat
+ PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
+ )
+ELSE (WIN32)
+ FIND_PROGRAM(PS2PDF_CONVERTER
+ NAMES ps2pdf
+ )
+ENDIF (WIN32)
+MARK_AS_ADVANCED(
+ LATEX_COMPILER
+ BIBTEX_COMPILER
+ MAKEINDEX_COMPILER
+ DVIPDF_CONVERTER
+ DVIPS_CONVERTER
+ PS2PDF_CONVERTER
+)