wireshark/cmake/modules/FindPOD.cmake
Jörg Mayer 914983a0dc Almost working out-of-tree builds for the documentation,
with a few hacks right now:
- The tip.png, warning.png and note.png images are missing from the
  pdfs and I have no idea how to tell fop how to find them.
- Disabling/enabling building the guides via option currently doesn't
  work (probably too many macros :-), so comment out the subdir instead.
- Right now, in order to build the devleopers guide we need to do the
  following in the source docbook directory:
  touch wsdg_graphics/toolbar/dummy.dummy

Apart from these: The build works with a pristine docbook dir
(svn status --no-ignore).

svn path=/trunk/; revision=32004
2010-02-25 12:30:44 +00:00

72 lines
1.4 KiB
CMake

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