AddHtmlTarget.cmake (gnucash-docs-4.13) | : | AddHtmlTarget.cmake (gnucash-docs-5.0) | ||
---|---|---|---|---|
# | # | |||
# Functions to generate html documentation | # Functions to generate html documentation | |||
# | # | |||
# Paremeters: | # Paremeters: | |||
# - docname: basename of the main xml file. Will be used to locate | # - targetbase: basename of the target to build. Will also be used | |||
# this primary xml file and for various output files/directories | # as part of various output files/directories | |||
# - lang: language of the current document | # - lang: language of the current document | |||
# - entities: list of all xml files this document is composed of | # - entities: list of all xml files this document is composed of | |||
# - figdir: name of the directory holding the images | # - figdir: name of the directory holding the images | |||
function (add_html_target docname lang entities figures) | function (add_html_target targetbase lang entities figures) | |||
set(docname "gnucash-${targetbase}") | ||||
set(styledir "${CMAKE_SOURCE_DIR}/stylesheet") | set(styledir "${CMAKE_SOURCE_DIR}/stylesheet") | |||
file(GLOB styleicons "${CMAKE_SOURCE_DIR}/stylesheet/*.png") | file(GLOB styleicons "${CMAKE_SOURCE_DIR}/stylesheet/*.png") | |||
set(BUILD_DIR "${DOCDIR_BUILD}/${lang}/${docname}") | set(BUILD_DIR "${DOCDIR_BUILD}/${lang}/${docname}") | |||
# Convert xml to html with xsltproc | # Convert xml to html with xsltproc | |||
# xsltproc --xinclude -o outputdir/ /usr/share/sgml/docbook/xsl-stylesheets/ html/chunk.xsl filename.xml | # xsltproc --xinclude -o outputdir/ /usr/share/sgml/docbook/xsl-stylesheets/ html/chunk.xsl filename.xml | |||
add_custom_command( | add_custom_command( | |||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger" | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger" | |||
COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}" | COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}" | |||
COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}/figures" | COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}/figures" | |||
skipping to change at line 59 | skipping to change at line 60 | |||
DEPENDS ${source_figures} "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger") | DEPENDS ${source_figures} "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger") | |||
endif() | endif() | |||
# Copy style icons for this document (warning, info,...) | # Copy style icons for this document (warning, info,...) | |||
add_custom_command( | add_custom_command( | |||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/styletrigger" | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/styletrigger" | |||
COMMAND ${CMAKE_COMMAND} -E copy ${styleicons} "${BUILD_DIR}/stylesheet " | COMMAND ${CMAKE_COMMAND} -E copy ${styleicons} "${BUILD_DIR}/stylesheet " | |||
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/styletrigger" | COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/styletrigger" | |||
DEPENDS ${styleicons} "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger") | DEPENDS ${styleicons} "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger") | |||
add_custom_target("${lang}-${docname}-html" | add_custom_target("${lang}-${targetbase}-html" | |||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger" | DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/htmltrigger" | |||
${dest_figures} | ${dest_figures} | |||
"${CMAKE_CURRENT_BINARY_DIR}/styletrigger") | "${CMAKE_CURRENT_BINARY_DIR}/styletrigger") | |||
add_dependencies(${docname}-html "${lang}-${docname}-html") | add_dependencies(${lang}-html "${lang}-${targetbase}-html") | |||
if(WITH_HTML_INSTALL) | if(WITH_HTML_INSTALL) | |||
install(DIRECTORY ${BUILD_DIR} | install(DIRECTORY ${BUILD_DIR} | |||
DESTINATION "${CMAKE_INSTALL_DOCDIR}/${lang}") | DESTINATION "${CMAKE_INSTALL_DOCDIR}/${lang}") | |||
endif() | endif() | |||
endfunction() | endfunction() | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added |