1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
# This file is part of the Spring engine (GPL v2 or later), see LICENSE.html
# - Find AsciiDoc, XSLTProc and DocBook
# These toolds are used to compile man pages
#
# ASCIIDOC_BIN - will be set to the AsciiDoc executable (eg. asciidoc)
# XSLTPROC_BIN - will be set to the XSLTProc executable (eg. xsltproc)
# DOCBOOK_XSL - will be set to the DocBook XSL Style-Sheet (eg. /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl)
# ASCIIDOC_FOUND - TRUE if AsciiDoc was found
# XSLTPROC_FOUND - TRUE if XSLTProc was found
# DOCBOOK_FOUND - TRUE if DocBook was found
INCLUDE(FindPackageHandleStandardArgs)
# Already in cache, be silent
if (ASCIIDOC_BIN)
SET(AsciiDoc_FIND_QUIETLY TRUE)
endif ()
if (XSLTPROC_BIN)
SET(XSLTProc_FIND_QUIETLY TRUE)
endif ()
if (DOCBOOK_XSL)
SET(DocBook_FIND_QUIETLY TRUE)
endif ()
find_program(ASCIIDOC_BIN
NAMES asciidoc
PATH_SUFFIXES bin
DOC "AsciiDoc executable"
)
find_program(XSLTPROC_BIN
NAMES xsltproc
PATH_SUFFIXES bin
DOC "XSLTProc executable"
)
find_file(DOCBOOK_XSL
NAMES docbook.xsl
PATHS /usr /usr/share /usr/local /usr/local/share
PATH_SUFFIXES
xml/docbook/stylesheet/nwalsh/manpages
xml/docbook/stylesheet/nwalsh/1.78.1/manpages
xml/docbook/stylesheet/nwalsh/1.79.0/manpages
sgml/docbook/xsl-stylesheets/manpages
xsl/docbook/manpages
DOC "DocBook XSL Style-Sheet"
)
if (NOT DOCBOOK_XSL)
file(GLOB DOCBOOK_XSL / /usr/share/xml/docbook/xsl-stylesheets-*/manpages/docbook.xsl)
if (DOCBOOK_XSL)
list(GET DOCBOOK_XSL 0 DOCBOOK_XSL)
endif ()
endif ()
# handle the QUIETLY and REQUIRED arguments and set ASCIIDOC_FOUND to TRUE if
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(AsciiDoc DEFAULT_MSG ASCIIDOC_BIN)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XSLTProc DEFAULT_MSG XSLTPROC_BIN)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DocBook DEFAULT_MSG DOCBOOK_XSL)
MARK_AS_ADVANCED(ASCIIDOC_BIN XSLTPROC_BIN DOCBOOK_XSL)
|