- Avoid copying of the graphics, specify the graphics source
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 27 Nov 2013 23:07:25 +0000 (23:07 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 27 Nov 2013 23:07:25 +0000 (23:07 +0000)
  dir instead.
- (Finally!) fix the problem of missing admon graphics in out of
  tree builds - specify the admin directory as an absolute path
  This may need porting to Makefile.am

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@53618 f5534014-38df-0310-8fa8-9805f1628bb7

cmake/modules/FindXSLTPROC.cmake

index fbbb200ed4ea0cf768c3dcfaddf54053942e25cd..2b00bd9d86966b3c6765f15fb7a5196e9ee8a4de 100644 (file)
@@ -38,7 +38,8 @@ MACRO(XML2HTML _validated _output _mode _xmlsources _gfxsources)
         set(_gfx ${_tmpgfx})
         BREAK()
     ENDFOREACH()
-    GET_FILENAME_COMPONENT(_GFXDIR ${_gfx} PATH)
+    GET_FILENAME_COMPONENT(_GFXDIR ${_gfx} ABSOLUTE)
+    GET_FILENAME_COMPONENT(_GFXDIR ${_GFXDIR} PATH)
     GET_FILENAME_COMPONENT(_OUTDIR ${_output} PATH)
     SET(_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/${_OUTDIR})
 
@@ -48,10 +49,6 @@ MACRO(XML2HTML _validated _output _mode _xmlsources _gfxsources)
        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()
@@ -60,18 +57,21 @@ MACRO(XML2HTML _validated _output _mode _xmlsources _gfxsources)
     ADD_CUSTOM_COMMAND(
         OUTPUT
             ${_output}
+        COMMAND cmake
+           -E make_directory ${_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 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 img.src.path ${CMAKE_CURRENT_SOURCE_DIR}
            --stringparam base.dir ${_OUTDIR}/
            --stringparam use.id.as.filename 1
            --stringparam admon.graphics 1
@@ -100,10 +100,6 @@ ENDMACRO(XML2HTML)
 #      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()
@@ -115,13 +111,15 @@ MACRO(XML2PDF _output _sources _stylesheet _paper)
        COMMAND ${XSLTPROC_EXECUTABLE}
            --path "${CMAKE_CURRENT_SOURCE_DIR}:${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_BINARY_DIR}/wsluarm_src"
            --stringparam paper.type ${_paper}
+           --stringparam img.src.path ${CMAKE_CURRENT_SOURCE_DIR}
+           --stringparam base.dir ${_OUTDIR}/
+           --stringparam use.id.as.filename 1
+           --stringparam admon.graphics 1
+           --stringparam admon.graphics.path ${_GFXDIR}/
            --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}