forked from Gnucash/gnucash-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pdf targets to CMake build system
This comes with a few additional changes - Japanese font selection logic is reduced to a minimum. That is, one can pass fonts and a font directory on the cmake command line with the appropriate -D flags, but none of these are checked for correctness. I thought of porting the autotools rules for this but looking closer they are totally broken. If really needed an improved variation could be written later in cmake. - Every fop run now requires a fop config file (fop.xconf) in cmake. This allows fop to find our figures in the source tree instead eliminates the need for a link or copy of these figures in the build tree. The existing config files for Russian and Japanese are amended for this. - All settings that just mimic the defaults have been removed from the Japanese fop config file. In addition the target structure has been slightly re-arranged. There are a few global targets like html, check, pdf, xml. Each of these will depend on the equivalent targets per document. For example: the global html target depends on gnucash-guide-html and gnucash-help-html. Each of these in turn then depend on the equivalent targets per language. For example gnucash-help-html in turn depends on C-gnucash-help-html, it-gnucash-help-html and so on. This allows to make all documents in one go or only one document in all supported languages or only one single document.
- Loading branch information
Showing
19 changed files
with
195 additions
and
505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
function (add_pdf_target docname lang entities figdir) | ||
|
||
set(fofile "${docname}.fo") | ||
set(pdffile "${docname}.pdf") | ||
file(GLOB figures "${CMAKE_CURRENT_SOURCE_DIR}/${figdir}/*.png") | ||
|
||
|
||
add_custom_target("${lang}-${docname}-fo" | ||
COMMAND ${XSLTPROC} ${XSLTPROCFLAGS} ${XSLTPROCFLAGS_FO} | ||
-o "${CMAKE_CURRENT_BINARY_DIR}/${fofile}" | ||
--stringparam fop1.extensions 1 | ||
"${CMAKE_SOURCE_DIR}/xsl/1.79.2/fo/docbook.xsl" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/${docname}.xml" | ||
DEPENDS ${entities} "${docname}.xml" "${CMAKE_SOURCE_DIR}/docbook/gnc-docbookx.dtd") | ||
|
||
configure_file("${FOP_XCONF}" "${CMAKE_CURRENT_BINARY_DIR}/fop.xconf") | ||
add_custom_target("${lang}-${docname}-pdf" | ||
COMMAND ${FOP} ${FOPFLAGS} | ||
-l ${lang} | ||
-c "${CMAKE_CURRENT_BINARY_DIR}/fop.xconf" | ||
-fo "${CMAKE_CURRENT_BINARY_DIR}/${fofile}" | ||
-pdf "${CMAKE_CURRENT_BINARY_DIR}/${pdffile}" | ||
DEPENDS ${lang}-${docname}-fo ${figures}) | ||
|
||
add_dependencies(${docname}-pdf "${lang}-${docname}-pdf") | ||
|
||
# $(pdffile): $(figfiles) | ||
# | ||
# pdf: $(abs_builddir)/figures $(pdffile) | ||
# | ||
# # This is only needed for out of tree builds. If you build | ||
# # from within the source directory, the build system | ||
# # will ignore this (mentioning a circular dependency) | ||
# $(abs_builddir)/figures: $(abs_srcdir)/figures | ||
# ln -s '$<' '$@' | ||
# | ||
# $(fofile): $(entities) | ||
# | ||
# .xml.fo: | ||
# $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTFLAGS_FO) -o '$@' --stringparam fop1.extensions 1 $(top_srcdir)/xsl/1.79.2/fo/docbook.xsl '$<' | ||
# | ||
# .fo.pdf: | ||
# $(FOP) $(FOPFLAGS) -fo '$<' -pdf '$@' | ||
# | ||
# CLEANFILES += $(pdffile) $(fofile) | ||
|
||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0"?> | ||
<!-- $Id: fop.xconf 1616312 2014-08-06 19:19:31Z gadams $ --> | ||
<!-- More details about this configuration file can be found here: | ||
https://xmlgraphics.apache.org/fop/0.95/configuration.html --> | ||
|
||
<!-- NOTE: This is the version of the configuration --> | ||
<fop version="1.0"> | ||
|
||
<!-- Base URL for resolving relative URLs --> | ||
<base>${CMAKE_CURRENT_SOURCE_DIR}</base> | ||
|
||
</fop> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.