File: FindAsciiDoc.cmake

package info (click to toggle)
spring 105.0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 108,860 kB
  • sloc: cpp: 467,785; ansic: 302,607; python: 12,925; java: 12,201; awk: 5,889; sh: 2,371; xml: 655; perl: 405; php: 276; objc: 194; makefile: 75; sed: 2
file content (63 lines) | stat: -rw-r--r-- 1,994 bytes parent folder | download
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 (ASCIIDOC_BIN)
IF    (XSLTPROC_BIN)
	SET(XSLTProc_FIND_QUIETLY TRUE)
ENDIF (XSLTPROC_BIN)
IF    (DOCBOOK_XSL)
	SET(DocBook_FIND_QUIETLY TRUE)
ENDIF (DOCBOOK_XSL)

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 (DOCBOOK_XSL)
ENDIF (NOT DOCBOOK_XSL)

# 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)