|
From: <ai...@us...> - 2013-10-05 12:06:52
|
Revision: 12578
http://sourceforge.net/p/plplot/code/12578
Author: airwin
Date: 2013-10-05 12:06:48 +0000 (Sat, 05 Oct 2013)
Log Message:
-----------
Implement new "dblatex --backend=xetex" method for generating pdf form
of DocBook documentation by default. (The older xmlto method is
still available using -DDOCBOOK_DBLATEX_BACKEND=OFF).
The (big) advantage of this new method compared to the previous xmlto
method of generating the pdf form of our documentation is it allows a
wide range of UTF-8 glyphs in the DocBook source.
So if the default fonts selected for the xelatex step in the procedure
are comprehensive (such as FreeSans, FreeSerif, and
FreeMono) a very wide range of UTF-8 glyphs can be rendered properly
in our print documentation.
The disadvantage of this method compared to the previous xmlto
procedure is that PostScript results can only be generated using
pdf2ps. I have implemented that method but then disabled that part of
the code because the result is literally 50 times larger than the pdf
form of our documentation, takes a very long time to generate, takes a
long time to view, and produces rather ugly results.
ToDo: move from the present rather limited defaults fonts to FreeSans,
FreeSerif, and FreeMono.
Modified Paths:
--------------
trunk/cmake/modules/docbook.cmake
trunk/doc/docbook/src/CMakeLists.txt
Modified: trunk/cmake/modules/docbook.cmake
===================================================================
--- trunk/cmake/modules/docbook.cmake 2013-10-04 21:43:12 UTC (rev 12577)
+++ trunk/cmake/modules/docbook.cmake 2013-10-05 12:06:48 UTC (rev 12578)
@@ -68,7 +68,7 @@
# This option is used for the BUILD_DOC case below and elsewhere and also
# for the PREBUILT_DOC case elsewhere (when stylesheet.css is configured).
-option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" YES)
+option(DOCBOOK_XML_BACKEND "Use DocBook XML/XSLT backend tools to generate our documentation from DocBook source" ON)
# Check for required programs and perl libraries.
if(BUILD_DOC)
@@ -110,40 +110,79 @@
endif(PERL_FOUND AND PERL_XML_PARSER AND PERL_XML_DOM)
if(DOCBOOK_XML_BACKEND)
- # For this case only use xmlto. That tool does its own warnings at
- # run time when components are missing so don't bother with looking
- # for missing components at cmake time.
+
+ # For this case never build dvi form of documentation.
+ set(BUILD_DVI OFF CACHE BOOL "Build dvi form of documentation" FORCE)
+
+ # For this case use xmlto for just html
+ # (DOCBOOK_DBLATEX_BACKEND=ON) or both html and print
+ # (DOCBOOK_DBLATEX_BACKEND=OFF). The xml tool does its own
+ # warnings at run time when components are missing so don't bother
+ # with looking for missing components at cmake time.
find_program(XMLTO xmlto)
if(NOT XMLTO)
message(STATUS "WARNING: xmlto not found")
endif(NOT XMLTO)
- find_program(GZIP gzip)
- if(NOT GZIP)
- message(STATUS "WARNING: gzip not found")
- endif(NOT GZIP)
if(XMLTO)
set(BUILD_HTML ON)
- if(GZIP)
- set(BUILD_PRINT ON)
- set(BUILD_DVI OFF CACHE BOOL "Build dvi form of documentation" FORCE)
- else(GZIP)
- set(BUILD_PRINT OFF)
- message(STATUS
- "WARNING: Not building print documentation - "
- "gzip is not installed"
- )
- endif(GZIP)
else(XMLTO)
- set(BUILD_HTML OFF)
- set(BUILD_PRINT OFF)
message(STATUS
- "WARNING: Not building html or print documentation - "
- "xmlto script is not installed"
+ "WARNING: xmlto script is not installed so not building html documentation"
)
+ set(BUILD_HTML OFF)
endif(XMLTO)
+ # Deal with configuration of build of print documentation.
+ # For this case never build dvi form of print documentation.
+ set(BUILD_DVI OFF CACHE BOOL "Build dvi form of documentation" FORCE)
+
+ find_program(GZIP gzip)
+ if(GZIP)
+ set(BUILD_PRINT ON)
+ else(GZIP)
+ message(STATUS "WARNING: gzip not found so not building print documentation")
+ set(BUILD_PRINT OFF)
+ endif(GZIP)
+
+ if(BUILD_PRINT)
+ option(DOCBOOK_DBLATEX_BACKEND "Use \"dblatex --backend=xetex\" XML/XSLT backend tool to generate our print documentation from DocBook source" ON)
+
+ if(DOCBOOK_DBLATEX_BACKEND)
+ find_program(DBLATEX dblatex)
+ if(NOT DBLATEX)
+ message(STATUS "WARNING: dblatex not found so not building print documentation")
+ set(BUILD_PRINT OFF)
+ endif(NOT DBLATEX)
+
+ if(BUILD_PRINT)
+ # Note that the "dblatex --backend=xetex" command must have
+ # some sort of xetex or xelatex python dependency. I
+ # haven't tracked down those details, but it is likely that
+ # the xelatex is called as part of that processing (or if
+ # not some dependency of xelatex is called) so if xelatex is
+ # present it is likely that "dblatex --backend=xetex" will
+ # work.
+ find_program(XELATEX xelatex)
+ if(NOT XELATEX)
+ message(STATUS "WARNING: xelatex not found so not building print documentation")
+ set(BUILD_PRINT OFF)
+ endif(NOT XELATEX)
+ endif(BUILD_PRINT)
+
+ if(BUILD_PRINT)
+ # Need pdf2ps to provide PostScript from the PDF results.
+ find_program(PDF2PS pdf2ps)
+ if(NOT PDF2PS)
+ message(STATUS "WARNING: pdf2ps not found so not building print documentation")
+ set(BUILD_PRINT OFF)
+ endif(NOT PDF2PS)
+ endif(BUILD_PRINT)
+
+ endif(DOCBOOK_DBLATEX_BACKEND)
+ endif(BUILD_PRINT)
+
else(DOCBOOK_XML_BACKEND)
# Deprecated SGML/DSSSL backends to generate html and print documentation.
Modified: trunk/doc/docbook/src/CMakeLists.txt
===================================================================
--- trunk/doc/docbook/src/CMakeLists.txt 2013-10-04 21:43:12 UTC (rev 12577)
+++ trunk/doc/docbook/src/CMakeLists.txt 2013-10-05 12:06:48 UTC (rev 12578)
@@ -350,7 +350,7 @@
)
if(BUILD_PRINT)
- # Custom commands for building html version of documentation
+ # Custom commands for building print version of documentation
set(STYLESHEET_PRINT ${PLPLOTDOC}-print.xsl)
set(STYLESHEET_PRINT_IN ${STYLESHEET_PRINT}.in)
configure_file(
@@ -383,75 +383,131 @@
docbook_plplot-symbols_txt
docbook_plplot-structs_txt
)
-
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
+ "${BASE}.dvi\n"
+ )
endif(BUILD_DVI)
- file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
- "${BASE}.ps.gz\n"
- )
+ if(DOCBOOK_DBLATEX_BACKEND)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
+ COMMAND ${DBLATEX} --verbose --backend=xetex --type=pdf -o ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
+ DEPENDS
+ ${SOURCE_FILES}
+ ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent
+ VERBATIM
+ )
+ add_custom_target(
+ pdf_target ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
+ )
+ # These files used for more than one target. Therefore must
+ # use target dependencies rather than file dependencies to build
+ # them. Otherwise, parallel builds won't work.
+ add_dependencies(pdf_target
+ docbook_plplot-symbols_txt
+ docbook_plplot-structs_txt
+ )
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz
- # xmlto --with-fop is currently (at least on Debian) craps out
- # if DESTDIR is specified so make sure it is NOT specified.
- COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} ps ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
- COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.ps ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps
- COMMAND ${GZIP} -f ${BASE}.ps
- DEPENDS
- ${SOURCE_FILES}
- ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent
- VERBATIM
- )
- add_custom_target(
- ps_target ALL
- DEPENDS
- ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz
- )
- # These files used for more than one target. Therefore must
- # use target dependencies rather than file dependencies to build
- # them. Otherwise, parallel builds won't work.
- add_dependencies(ps_target
- docbook_plplot-symbols_txt
- docbook_plplot-structs_txt
- )
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
+ "${BASE}.pdf\n"
+ )
- file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
- "${BASE}.ps.gz\n"
- )
+ add_custom_target(
+ print ALL
+ )
+ add_dependencies(print pdf_target)
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
- # xmlto --with-fop is currently (at least on Debian) craps out
- # if DESTDIR is specified so make sure it is NOT specified.
- COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} pdf ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
- COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
- DEPENDS
- ${SOURCE_FILES}
- ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent
- VERBATIM
- )
- add_custom_target(
- pdf_target ALL
- DEPENDS
- ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
- )
- # These files used for more than one target. Therefore must
- # use target dependencies rather than file dependencies to build
- # them. Otherwise, parallel builds won't work.
- add_dependencies(pdf_target
- docbook_plplot-symbols_txt
- docbook_plplot-structs_txt
- )
+ # Disable this because the result is big (50 (!) times larger
+ # than corresponding pdf), takes a long time to generate, and
+ # is really ugly looking.
+ if(0)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz
+ COMMAND ${PDF2PS} -dLanguageLevel=3 ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps
+ COMMAND ${GZIP} -f ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
+ )
+
+ add_custom_target(
+ ps_target ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz
+ )
+ add_dependencies(ps_target pdf_target)
+ add_dependencies(print ps_target)
+
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
+ "${BASE}.ps.gz\n"
+ )
+ endif(0)
+ else(DOCBOOK_DBLATEX_BACKEND)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz
+ # xmlto --with-fop is currently (at least on Debian) craps out
+ # if DESTDIR is specified so make sure it is NOT specified.
+ COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} ps ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
+ COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.ps ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps
+ COMMAND ${GZIP} -f ${BASE}.ps
+ DEPENDS
+ ${SOURCE_FILES}
+ ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent
+ VERBATIM
+ )
+ add_custom_target(
+ ps_target ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.ps.gz
+ )
+ # These files used for more than one target. Therefore must
+ # use target dependencies rather than file dependencies to build
+ # them. Otherwise, parallel builds won't work.
+ add_dependencies(ps_target
+ docbook_plplot-symbols_txt
+ docbook_plplot-structs_txt
+ )
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
+ "${BASE}.ps.gz\n"
+ )
- file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
- "${BASE}.pdf\n"
- )
- add_custom_target(
- print ALL
- )
- add_dependencies(print ps_target pdf_target)
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
+ # xmlto --with-fop is currently (at least on Debian) craps out
+ # if DESTDIR is specified so make sure it is NOT specified.
+ COMMAND env DESTDIR= ${XMLTO} -vv --with-fop -x ${CMAKE_CURRENT_BINARY_DIR}/${STYLESHEET_PRINT} pdf ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
+ COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/plplotdoc-print.pdf ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
+ DEPENDS
+ ${SOURCE_FILES}
+ ${CMAKE_CURRENT_BINARY_DIR}/${PLPLOTDOC}-print.xml
+ ${CMAKE_CURRENT_SOURCE_DIR}/inline-print_xsl.ent
+ VERBATIM
+ )
+ add_custom_target(
+ pdf_target ALL
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/${BASE}.pdf
+ )
+ # These files used for more than one target. Therefore must
+ # use target dependencies rather than file dependencies to build
+ # them. Otherwise, parallel builds won't work.
+ add_dependencies(pdf_target
+ docbook_plplot-symbols_txt
+ docbook_plplot-structs_txt
+ )
+
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/static_built_files
+ "${BASE}.pdf\n"
+ )
+
+ add_custom_target(
+ print ALL
+ )
+ add_dependencies(print ps_target pdf_target)
+ endif(DOCBOOK_DBLATEX_BACKEND)
+
if(BUILD_DVI)
add_dependencies(print dvi_target)
endif(BUILD_DVI)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|