aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindXSLTPROC.cmake
blob: 1d18832da0c3cf6901726df103a2260d2f4f2f51 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# $Id$
#
# - Find unix commands from cygwin
# This module looks for some usual Unix commands.
#

INCLUDE(FindCygwin)

FIND_PROGRAM(XSLTPROC_EXECUTABLE
  NAMES
    xsltproc
  PATHS
    ${CYGWIN_INSTALL_PATH}/bin
    /bin
    /usr/bin
    /usr/local/bin
    /sbin
)

# Handle the QUIETLY and REQUIRED arguments and set XSLTPROC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XSLTPROC DEFAULT_MSG XSLTPROC_EXECUTABLE)

MARK_AS_ADVANCED(XSLTPROC_EXECUTABLE)

#XML2HTML(
#       wsug.validated
#       wsug_html/user-guide.html
#       single-page
#       wsug_html
#       WSUG_SOURCE
#       WSUG_GFX_SOURCE
#)

# Translate xml to html
MACRO(XML2HTML _validated _output _mode _xmlsources _gfxsources)
    MESSAGE(STATUS "XML source(s): ${${_xmlsources}}")
    MESSAGE(STATUS "GFX source(s): ${${_gfxsources}}")
    
    GET_FILENAME_COMPONENT(_OUTDIR ${_output} PATH)
    IF(${_mode} STREQUAL "chunked")
    ELSE() # single-page
    ENDIF()

    ADD_CUSTOM_COMMAND(
        OUTPUT
            ${_output}
        COMMAND
            cmake -E make_directory ${_OUTDIR}
        COMMAND
            cmake -E copy ${${_gfxsources}} ${_OUTDIR}
        COMMAND
            cmake -E copy ws.css ${_OUTDIR}
        DEPENDS
            ${${_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-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