diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-01-14 15:13:40 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-01-14 23:27:41 +0000 |
commit | 9a19d6de54ffaf1a7aa22b5b619c4e4609ccf391 (patch) | |
tree | 5c51bd5565a6bb9c7afe68f43a54d650c545aa5e /cmake | |
parent | 242f711cfe4fd076f47ef35dfc6e42f7125c5116 (diff) |
CMake: Look for FOP and HHC only when needed.
FOP is only required for generating PDF output and HHC is only needed
for CHM output. Don't look for them unconditionally.
Change-Id: I7bec7d061c9e9e8b99431cab873e8c719469552c
Reviewed-on: https://code.wireshark.org/review/6539
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindXSLTPROC.cmake | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/cmake/modules/FindXSLTPROC.cmake b/cmake/modules/FindXSLTPROC.cmake index df093dbccc..547cf3b435 100644 --- a/cmake/modules/FindXSLTPROC.cmake +++ b/cmake/modules/FindXSLTPROC.cmake @@ -3,11 +3,17 @@ # This module looks for some usual Unix commands. # -INCLUDE(FindCygwin) +include(FindCygwin) -FIND_PACKAGE(SED) +if(ENABLE_PDF_GUIDES) + find_package(FOP) +endif() + +if(ENABLE_CHM_GUIDES) + find_package(SED) +endif() -FIND_PROGRAM(XSLTPROC_EXECUTABLE +find_program(XSLTPROC_EXECUTABLE NAMES xsltproc PATHS @@ -72,11 +78,11 @@ MACRO(XML2HTML _guide _mode _xmlsources _gfxsources) IF(${_mode} STREQUAL "chunked") SET(_basedir ${_guide}_html_chunked) SET(_STYLESHEET "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl") - SET(_modeparams --noout) + SET(_modeparams --noout) ELSE() # single-page SET(_basedir ${_guide}_html) SET(_STYLESHEET "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl") - SET(_modeparams --output ${_basedir}/index.html) + SET(_modeparams --output ${_basedir}/index.html) ENDIF() SET(_outdir ${CMAKE_CURRENT_BINARY_DIR}/${_basedir}) @@ -115,7 +121,7 @@ MACRO(XML2HTML _guide _mode _xmlsources _gfxsources) COMMAND ${XSLTPROC_EXECUTABLE} --path "${_xsltproc_path}" --stringparam base.dir ${_basedir}/ - ${_common_xsltproc_args} + ${_common_xsltproc_args} --stringparam admon.graphics.path ${_gfxdir}/ ${_modeparams} ${_STYLESHEET} @@ -183,29 +189,29 @@ MACRO(XML2HHP _guide _docbooksource) ADD_CUSTOM_COMMAND( OUTPUT ${_output_hhp} - COMMAND ${CMAKE_COMMAND} -E make_directory ${_basedir} - COMMAND ${CMAKE_COMMAND} -E make_directory ${_basedir}/${_gfxdir} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${_gfxdir} ${_basedir}/${_gfxdir} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/common_graphics ${_basedir}/${_gfxdir} - # HTML Help doesn't render decimal character entities in the title. - COMMAND ${SED_EXECUTABLE} - -e "s|er’s Guide</title>|er's Guide</title>|" - < ${_docbooksource} - > ${_docbook_plain_title} + COMMAND ${CMAKE_COMMAND} -E make_directory ${_basedir} + COMMAND ${CMAKE_COMMAND} -E make_directory ${_basedir}/${_gfxdir} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${_gfxdir} ${_basedir}/${_gfxdir} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/common_graphics ${_basedir}/${_gfxdir} + # HTML Help doesn't render decimal character entities in the title. + COMMAND ${SED_EXECUTABLE} + -e "s|er’s Guide</title>|er's Guide</title>|" + < ${_docbooksource} + > ${_docbook_plain_title} COMMAND ${XSLTPROC_EXECUTABLE} --path "${_xsltproc_path}" --stringparam base.dir ${_basedir}/ - --stringparam htmlhelp.chm ${_output_chm} - --stringparam htmlhelp.hhp ${_output_hhp} - --stringparam htmlhelp.hhc ${_output_toc_hhc} - ${_common_xsltproc_args} + --stringparam htmlhelp.chm ${_output_chm} + --stringparam htmlhelp.hhp ${_output_hhp} + --stringparam htmlhelp.hhc ${_output_toc_hhc} + ${_common_xsltproc_args} --stringparam admon.graphics.path ${_gfxdir}/ - --nonet custom_layer_chm.xsl - ${_docbook_plain_title} + --nonet custom_layer_chm.xsl + ${_docbook_plain_title} DEPENDS - # AsciiDoc uses UTF-8 by default, which is unsupported by HTML - # Help. We may want to render an ISO-8859-1 version, or get rid - # of HTML Help. + # AsciiDoc uses UTF-8 by default, which is unsupported by HTML + # Help. We may want to render an ISO-8859-1 version, or get rid + # of HTML Help. ${_docbooksource} ) ENDMACRO(XML2HHP) |