File: FindPOD.cmake

package info (click to toggle)
wireshark 1.8.2-5wheezy18
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 196,124 kB
  • sloc: ansic: 2,186,574; xml: 55,064; python: 30,233; perl: 22,353; sh: 13,118; pascal: 5,964; lex: 4,963; cpp: 3,604; makefile: 3,471; yacc: 266; asm: 156; tcl: 35
file content (71 lines) | stat: -rw-r--r-- 1,483 bytes parent folder | download | duplicates (2)
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
64
65
66
67
68
69
70
71
#
# $Id: FindPOD.cmake 32004 2010-02-25 12:30:44Z jmayer $
#
# - Find unix commands from cygwin
# This module looks for some usual Unix commands.
#

INCLUDE(FindCygwin)

FIND_PROGRAM(POD2MAN_EXECUTABLE
	NAMES
		pod2man
	PATHS
		${CYGWIN_INSTALL_PATH}/bin
		/bin
		/usr/bin
		/usr/local/bin
		/sbin
)

FIND_PROGRAM(POD2HTML_EXECUTABLE
	NAMES
		pod2html
	PATHS
		${CYGWIN_INSTALL_PATH}/bin
		/bin
		/usr/bin
		/usr/local/bin
		/sbin
)

# handle the QUIETLY and REQUIRED arguments and set POD2HTML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(POD DEFAULT_MSG POD2MAN_EXECUTABLE POD2HTML_EXECUTABLE)

MARK_AS_ADVANCED(
	POD2MAN_EXECUTABLE
	POD2HTML_EXECUTABLE
)

# run pod2man and pod2html
MACRO(pod2manhtml _sourcefile _manext)
	GET_FILENAME_COMPONENT(_basefile ${_sourcefile} NAME)
	set(_outman ${_basefile}.${_manext})
	set(_outhtml ${_basefile}.html)
	ADD_CUSTOM_COMMAND(
		OUTPUT
			${_outman}
			${_outhtml}
		COMMAND
			${POD2MAN_EXECUTABLE}
			--section=${_manext}
			--center="The Wireshark Network Analyzer"
			--release=${CPACK_PACKAGE_VERSION}
			${_sourcefile}.pod
			> ${_outman}
		COMMAND
			${POD2HTML_EXECUTABLE}
			--title="${_basefile} - The Wireshark Network Analyzer ${CPACK_PACKAGE_VERSION}"
			--css=${CMAKE_SOURCE_DIR}/docbook/ws.css
			--noindex
			${_sourcefile}.pod
			> ${_outhtml}
		DEPENDS
			${_sourcefile}.pod
			${CMAKE_SOURCE_DIR}/docbook/ws.css
			
	)
ENDMACRO(pod2manhtml)