diff options
author | Jörg Mayer <jmayer@loplof.de> | 2010-02-25 12:30:44 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2010-02-25 12:30:44 +0000 |
commit | 914983a0dce85c43d8bd8e7c396d3a9c1d44ff63 (patch) | |
tree | 4f012ed120f8cd9530dcc035be8ee6552f952997 /cmake | |
parent | 480582e8e91c409ec8a729ff6c79a2814c50273d (diff) | |
download | wireshark-914983a0dce85c43d8bd8e7c396d3a9c1d44ff63.tar.gz wireshark-914983a0dce85c43d8bd8e7c396d3a9c1d44ff63.tar.bz2 wireshark-914983a0dce85c43d8bd8e7c396d3a9c1d44ff63.zip |
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
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindFOP.cmake | 4 | ||||
-rw-r--r-- | cmake/modules/FindPOD.cmake | 2 | ||||
-rw-r--r-- | cmake/modules/FindXMLLINT.cmake | 25 | ||||
-rw-r--r-- | cmake/modules/FindXSLTPROC.cmake | 150 |
4 files changed, 102 insertions, 79 deletions
diff --git a/cmake/modules/FindFOP.cmake b/cmake/modules/FindFOP.cmake index 1ec136149b..6383ad829d 100644 --- a/cmake/modules/FindFOP.cmake +++ b/cmake/modules/FindFOP.cmake @@ -21,5 +21,9 @@ FIND_PROGRAM(FOP_EXECUTABLE INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(FOP DEFAULT_MSG FOP_EXECUTABLE) +IF(${FOP_EXECUTABLE}) + SET(FOP_OPTS -Xmx256m) + SET(FOP_EXECUTABLE FOP_OPTS=${FOP_OPTS} JAVA_OPTS=${FOP_OPTS} ${FOP_EXECUTABLE}) +ENDIF() MARK_AS_ADVANCED(FOP_EXECUTABLE) diff --git a/cmake/modules/FindPOD.cmake b/cmake/modules/FindPOD.cmake index 63e3112fad..59d8d81b3c 100644 --- a/cmake/modules/FindPOD.cmake +++ b/cmake/modules/FindPOD.cmake @@ -32,7 +32,7 @@ FIND_PROGRAM(POD2HTML_EXECUTABLE # 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(POD2HTML DEFAULT_MSG POD2MAN_EXECUTABLE POD2HTML_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(POD DEFAULT_MSG POD2MAN_EXECUTABLE POD2HTML_EXECUTABLE) MARK_AS_ADVANCED( POD2MAN_EXECUTABLE diff --git a/cmake/modules/FindXMLLINT.cmake b/cmake/modules/FindXMLLINT.cmake index f5ac6459e2..583868050a 100644 --- a/cmake/modules/FindXMLLINT.cmake +++ b/cmake/modules/FindXMLLINT.cmake @@ -25,24 +25,25 @@ MARK_AS_ADVANCED(XMLLINT_EXECUTABLE) # Validate XML MACRO(VALIDATE_XML _validated _sources) - message(STATUS "Source(s): ${${_sources}}") # FIXME: How do I extract the first element of a variable containing a # list of values? Isn't there a "cleaner" solution? - FOREACH(_source ${${_sources}}) + # Oh, and I have no idea why I can't directly use _source instead of + # having to introduce _tmpsource. + FOREACH(_tmpsource ${${_sources}}) + set(_source ${_tmpsource}) BREAK() ENDFOREACH() ADD_CUSTOM_COMMAND( - OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/${_validated} - COMMAND ${XMLLINT_EXECUTABLE} + OUTPUT + ${_validated} + COMMAND ${XMLLINT_EXECUTABLE} + --path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src" --valid --noout - --path "${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR}" - ${_source} - COMMAND touch - ${CMAKE_CURRENT_BINARY_DIR}/${_validated} - DEPENDS - ${_source} - svn_version.xml + ${_source} + COMMAND touch + ${_validated} + DEPENDS + ${${_sources}} ) ENDMACRO(VALIDATE_XML) diff --git a/cmake/modules/FindXSLTPROC.cmake b/cmake/modules/FindXSLTPROC.cmake index 1d18832da0..fbbb200ed4 100644 --- a/cmake/modules/FindXSLTPROC.cmake +++ b/cmake/modules/FindXSLTPROC.cmake @@ -25,91 +25,109 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XSLTPROC DEFAULT_MSG XSLTPROC_EXECUTABLE) MARK_AS_ADVANCED(XSLTPROC_EXECUTABLE) +# Translate xml to html #XML2HTML( -# wsug.validated -# wsug_html/user-guide.html -# single-page -# wsug_html -# WSUG_SOURCE -# WSUG_GFX_SOURCE +# wsug.validated +# wsug_html/user-guide.html or wsub_html/index.html +# single-page or chunked +# WSUG_FILES +# WSUG_GRAPHICS #) - -# Translate xml to html MACRO(XML2HTML _validated _output _mode _xmlsources _gfxsources) - MESSAGE(STATUS "XML source(s): ${${_xmlsources}}") - MESSAGE(STATUS "GFX source(s): ${${_gfxsources}}") - + FOREACH(_tmpgfx ${${_gfxsources}}) + set(_gfx ${_tmpgfx}) + BREAK() + ENDFOREACH() + GET_FILENAME_COMPONENT(_GFXDIR ${_gfx} PATH) GET_FILENAME_COMPONENT(_OUTDIR ${_output} PATH) + SET(_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/${_OUTDIR}) + IF(${_mode} STREQUAL "chunked") + SET(_STYLESHEET "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl") ELSE() # single-page + SET(_STYLESHEET "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl") ENDIF() + # FIXME: How do I extract the first element of a variable containing a + # list of values? Isn't there a "cleaner" solution? + # Oh, and I have no idea why I can't directly use _source instead of + # having to introduce _tmpsource. + FOREACH(_tmpsource ${${_xmlsources}}) + set(_source ${_tmpsource}) + BREAK() + ENDFOREACH() + ADD_CUSTOM_COMMAND( OUTPUT ${_output} - COMMAND - cmake -E make_directory ${_OUTDIR} - COMMAND - cmake -E copy ${${_gfxsources}} ${_OUTDIR} - COMMAND - cmake -E copy ws.css ${_OUTDIR} + # Fixme: find out about subdirs (i.e. toolbar) automatically + # so this works for wsdg as well. + COMMAND cmake + -E make_directory ${_OUTDIR}/${_GFXDIR}/toolbar + COMMAND cp + ${CMAKE_CURRENT_SOURCE_DIR}/${_GFXDIR}/*.* ${_OUTDIR}/${_GFXDIR}/ + COMMAND cp + ${CMAKE_CURRENT_SOURCE_DIR}/${_GFXDIR}/toolbar/*.* ${_OUTDIR}/${_GFXDIR}/toolbar/ + COMMAND cmake + -E copy ${CMAKE_CURRENT_SOURCE_DIR}/ws.css ${_OUTDIR} + COMMAND ${XSLTPROC_EXECUTABLE} + --path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src" + --stringparam base.dir ${_OUTDIR}/ + --stringparam use.id.as.filename 1 + --stringparam admon.graphics 1 + --stringparam admon.graphics.path ${_GFXDIR}/ + --stringparam section.autolabel 1 + --stringparam section.label.includes.component.label 1 + --stringparam html.stylesheet ws.css + --nonet + --output ${_output} + ${_STYLESHEET} + ${_source} + COMMAND chmod + -R og+rX ${_OUTDIR} DEPENDS + ${_validated} ${${_xmlsources}} ${${_gfxsources}} ) -# mkdir -p wsug_html/wsug_graphics/toolbar -# cp wsug_graphics/*.* wsug_html/wsug_graphics -# cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar -# cp ws.css wsug_html - -# mkdir -p wsug_html_chunked/wsug_graphics/toolbar -# cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics -# cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar -# cp ws.css wsug_html_chunked ENDMACRO(XML2HTML) -#wsug_html/user-guide.html: $(WSUG_SOURCE) -# @ echo --- WSUG - HTML SINGLE PAGE --- -# mkdir -p wsug_html/wsug_graphics/toolbar -# cp wsug_graphics/*.* wsug_html/wsug_graphics -# cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar -# cp ws.css wsug_html -# $(XSLTPROC) --stringparam base.dir wsug_html/ --stringparam use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ --stringparam section.autolabel 1 --stringparam section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< > $@ -# -chmod -R og+rX wsug_html -# - -#wsug_html_chunked/index.html: $(WSUG_SOURCE) -# @ echo --- WSUG - HTML CHUNKED --- -# mkdir -p wsug_html_chunked/wsug_graphics/toolbar -# cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics -# cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar -# cp ws.css wsug_html_chunked -# $(XSLTPROC) --stringparam base.dir wsug_html_chunked/ --stringparam use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ --stringparam section.autolabel 1 --stringparam section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $< -# -chmod -R og+rX wsug_html_chunked #XML2PDF( -# WSUG_SOURCE -# custom_layer_pdf.xsl -# A4 -#) -# -#XML2PDF( -# WSUG_SOURCE -# custom_layer_pdf.xsl -# letter +# user-guide-a4.fo or user-guide-us.fo +# WSUG_SOURCE +# custom_layer_pdf.xsl +# A4 or letter #) +MACRO(XML2PDF _output _sources _stylesheet _paper) + # FIXME: How do I extract the first element of a variable containing a + # list of values? Isn't there a "cleaner" solution? + # Oh, and I have no idea why I can't directly use _source instead of + # having to introduce _tmpsource. + FOREACH(_tmpsource ${${_sources}}) + set(_source ${_tmpsource}) + BREAK() + ENDFOREACH() -#user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl -#ifdef FOP -# @ echo --- WSUG - PDF US PAPER --- -# $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl $< > $@ -#endif -# -## create pdf file (through XSL-FO), portrait pages on A4 paper -## you will get lot's of errors, but that's ok -#user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl -#ifdef FOP -# @ echo --- WSUG - PDF A4 PAPER --- -# $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl $< > $@ -#endif + ADD_CUSTOM_COMMAND( + OUTPUT + ${_output} + COMMAND ${XSLTPROC_EXECUTABLE} + --path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src" + --stringparam paper.type ${_paper} + --nonet + --output ${_output}.fo + ${_stylesheet} + ${_source} + # FIXME: The images for tip, warning and note (and maybe more of those) + # are not found by fop. I have no idea why "system" images don't work + # the way other images work. + COMMAND ${FOP_EXECUTABLE} + ${_output}.fo + ${_output} + DEPENDS + ${${_sources}} + ${_stylesheet} + ) +ENDMACRO(XML2PDF) |