Commit d8374d3d authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Added new macro to generate qhp file.

Changing ParaView to use this macro/function by default, instead of configuring
the paraview.qhp file.

Change-Id: Iabfa4e6b6b558208d9212b0a1a2b053698aaacf3
parent 5f32f40a
......@@ -269,3 +269,57 @@ function (generate_htmls_from_xmls output_files xmlpatterns xmls gui_xmls output
"${CMAKE_CURRENT_BINARY_DIR}/temporary.xml")
set (${output_files} ${dependencies} PARENT_SCOPE)
endfunction()
# Function used to build a qhp file.
# build_help_project(NAME
# WORKING_DIRECTORY directory
# [NAMESPACE namespacename (default:${NAME}.org)]
# [FOLDER virtualfoldername (default:${NAME})]
# [TABLE_OF_CONTENTS toc]
# [TABLE_OF_CONTENTS_FILE toc_file_name]
# [FILES relative filenames/wildcard-expressions]
# )
# NAME :- specifies the name for the qhp. The generated qhp file will be
# ${WORKING_DIRECTORY}/${name}.qhp
# WORKING_DIRECTORY :- output-directory for the qhp file.
# NAMESPACE :- (optional; default=${name}.org") Namespace to use in qhp file.
# FOLDER :- (optional; default=${name}") virtual folder in qhp file.
# TABLE_OF_CONTENTS :- (optional) XML string <toc>..</toc> (see qhp file
# documentation). Used only when TABLE_OF_CONTENTS_FILE is
# not specified.
# TABLE_OF_CONTENTS_FILE :- file to read in to obtain the TABLE_OF_CONTENTS
# FILES :- (optional: default="*.*") list of files (names or wildcards) to list
# in the qhp file.
function(build_help_project name)
pv_parse_arguments(arg
"WORKING_DIRECTORY;NAMESPACE;FOLDER;TABLE_OF_CONTENTS;TABLE_OF_CONTENTS_FILE;FILES"
""
${ARGN}
)
message ("wd ${arg_WORKING_DIRECTORY}")
if (NOT DEFINED arg_WORKING_DIRECTORY)
message(FATAL_ERROR "No WORKING_DIRECTORY specified in build_help_project()")
endif()
pv_set_if_not_set(arg_FILES "*.*")
pv_set_if_not_set(arg_NAMESPACE "${name}.org")
pv_set_if_not_set(arg_FOLDER "${name}")
# if filename is specified, it takes precendence.
# setup toc variable to refer to the TOC xml dom.
if (DEFINED arg_TABLE_OF_CONTENTS_FILE)
file(READ ${arg_TABLE_OF_CONTENTS_FILE} arg_TABLE_OF_CONTENTS)
endif()
pv_set_if_not_set(arg_TABLE_OF_CONTENTS
"<toc><section title=\"${name}\" ref=\"index.html\"></section></toc>")
set (files)
foreach(filename ${arg_FILES})
set (files "${files}<file>${filename}</file>\n")
endforeach()
configure_file(${ParaView_CMAKE_DIR}/build_help_project.qhp.in
${arg_WORKING_DIRECTORY}/${name}.qhp)
endfunction(build_help_project)
<?xml version="1.0" encoding="UTF-8"?>
<QtHelpProject version="1.0">
<namespace>${arg_NAMESPACE}</namespace>
<virtualFolder>${arg_FOLDER}</virtualFolder>
<filterSection>
${arg_TABLE_OF_CONTENTS}
<keywords>
<!-- how to handle keywords? -->
</keywords>
<files>
${files}
</files>
</filterSection>
</QtHelpProject>
......@@ -39,14 +39,27 @@ generate_htmls_from_xmls(proxy_html_outputs
"${gui_xmls}"
"${CMAKE_CURRENT_BINARY_DIR}")
build_help_project(paraview
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
TABLE_OF_CONTENTS
"<toc>
<section title=\"ParaView User Manual\" ref=\"index.html\">
<section title=\"Introduction\" ref=\"Book/Book_Chapter1.html\"/>
<section title=\"Plugins\" ref=\"Book/Book_Chapter16.html\"/>
<section title=\"Appendices\" ref=\"Book/Book_Chapter17.html\"/>
<section title=\"Sources\" ref=\"CategoryIndex.html#Sources\"/>
<section title=\"Filters\" ref=\"CategoryIndex.html#Filters\"/>
<section title=\"Readers\" ref=\"CategoryIndex.html#Readers\"/>
<section title=\"Writers\" ref=\"CategoryIndex.html#Writers\"/>
</section>
</toc>"
FILES "*.html;*.css;*.png;*.jpg;Book/*.html;Book/*.css;Book/*.png;Book/*.jpg"
)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/paraview.qch
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/paraview.qhp
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/paraview.qhp
${proxy_html_outputs}
COMMAND ${CMAKE_COMMAND}
-E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/paraview.qhp"
"${CMAKE_CURRENT_BINARY_DIR}/paraview.qhp"
COMMAND ${QT_HELP_GENERATOR}
${CMAKE_CURRENT_BINARY_DIR}/paraview.qhp
-o ${CMAKE_CURRENT_BINARY_DIR}/paraview.qch
......
<?xml version="1.0" encoding="UTF-8"?>
<QtHelpProject version="1.0">
<namespace>paraview.org</namespace>
<virtualFolder>paraview</virtualFolder>
<filterSection>
<toc>
<section title="ParaView User Manual" ref="index.html">
<section title="Introduction" ref="Book/Book_Chapter1.html"/>
<section title="Plugins" ref="Book/Book_Chapter16.html"/>
<section title="Appendices" ref="Book/Book_Chapter17.html"/>
<section title="Sources" ref="CategoryIndex.html#Sources"/>
<section title="Filters" ref="CategoryIndex.html#Filters"/>
<section title="Readers" ref="CategoryIndex.html#Readers"/>
<section title="Writers" ref="CategoryIndex.html#Writers"/>
</section>
</toc>
<keywords>
</keywords>
<files>
<file>*.html</file>
<file>*.css</file>
<file>*.png</file>
<file>*.jpg</file>
<file>Book/*.html</file>
<file>Book/*.css</file>
<file>Book/*.png</file>
<file>Book/*.jpg</file>
</files>
</filterSection>
</QtHelpProject>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment