OpenCVFindLATEX.cmake 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # - Find Latex
  2. # This module finds if Latex is installed and determines where the
  3. # executables are. This code sets the following variables:
  4. #
  5. # LATEX_COMPILER: path to the LaTeX compiler
  6. # PDFLATEX_COMPILER: path to the PdfLaTeX compiler
  7. # BIBTEX_COMPILER: path to the BibTeX compiler
  8. # MAKEINDEX_COMPILER: path to the MakeIndex compiler
  9. # DVIPS_CONVERTER: path to the DVIPS converter
  10. # PS2PDF_CONVERTER: path to the PS2PDF converter
  11. # LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
  12. #
  13. IF (WIN32)
  14. # Try to find the MikTex binary path (look for its package manager).
  15. FIND_PATH(MIKTEX_BINARY_PATH mpm.exe
  16. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin"
  17. DOC
  18. "Path to the MikTex binary directory."
  19. )
  20. MARK_AS_ADVANCED(MIKTEX_BINARY_PATH)
  21. # Try to find the GhostScript binary path (look for gswin32).
  22. GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00
  23. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\8.00;GS_DLL]" PATH
  24. )
  25. GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04
  26. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\7.04;GS_DLL]" PATH
  27. )
  28. FIND_PATH(GHOSTSCRIPT_BINARY_PATH gswin32.exe
  29. ${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00}
  30. ${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04}
  31. DOC "Path to the GhostScript binary directory."
  32. )
  33. MARK_AS_ADVANCED(GHOSTSCRIPT_BINARY_PATH)
  34. FIND_PATH(GHOSTSCRIPT_LIBRARY_PATH ps2pdf13.bat
  35. "${GHOSTSCRIPT_BINARY_PATH}/../lib"
  36. DOC "Path to the GhostScript library directory."
  37. )
  38. MARK_AS_ADVANCED(GHOSTSCRIPT_LIBRARY_PATH)
  39. ENDIF (WIN32)
  40. FIND_HOST_PROGRAM(LATEX_COMPILER
  41. NAMES latex
  42. PATHS ${MIKTEX_BINARY_PATH}
  43. /usr/bin /usr/texbin
  44. )
  45. FIND_HOST_PROGRAM(PDFLATEX_COMPILER
  46. NAMES pdflatex
  47. PATHS ${MIKTEX_BINARY_PATH}
  48. /usr/bin /usr/texbin
  49. )
  50. FIND_HOST_PROGRAM(BIBTEX_COMPILER
  51. NAMES bibtex
  52. PATHS ${MIKTEX_BINARY_PATH}
  53. /usr/bin /usr/texbin
  54. )
  55. FIND_HOST_PROGRAM(MAKEINDEX_COMPILER
  56. NAMES makeindex
  57. PATHS ${MIKTEX_BINARY_PATH}
  58. /usr/bin /usr/texbin
  59. )
  60. FIND_HOST_PROGRAM(DVIPS_CONVERTER
  61. NAMES dvips
  62. PATHS ${MIKTEX_BINARY_PATH}
  63. /usr/bin /usr/texbin
  64. )
  65. FIND_HOST_PROGRAM(DVIPDF_CONVERTER
  66. NAMES dvipdfm dvipdft dvipdf
  67. PATHS ${MIKTEX_BINARY_PATH}
  68. /usr/bin /usr/texbin
  69. )
  70. IF (WIN32)
  71. FIND_HOST_PROGRAM(PS2PDF_CONVERTER
  72. NAMES ps2pdf14.bat
  73. PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
  74. )
  75. ELSE (WIN32)
  76. FIND_HOST_PROGRAM(PS2PDF_CONVERTER
  77. NAMES ps2pdf14 ps2pdf
  78. PATHS /usr/bin /usr/texbin
  79. )
  80. ENDIF (WIN32)
  81. FIND_HOST_PROGRAM(LATEX2HTML_CONVERTER
  82. NAMES latex2html
  83. PATHS ${MIKTEX_BINARY_PATH}
  84. /usr/bin /usr/texbin
  85. )
  86. MARK_AS_ADVANCED(
  87. LATEX_COMPILER
  88. PDFLATEX_COMPILER
  89. BIBTEX_COMPILER
  90. MAKEINDEX_COMPILER
  91. DVIPS_CONVERTER
  92. DVIPDF_CONVERTER
  93. PS2PDF_CONVERTER
  94. LATEX2HTML_CONVERTER
  95. )