Commit 66bb84e1 authored by mark olesen's avatar mark olesen

Using '+' separator causes problems building documentation (fixes #16880)

  The previous solution of replacing the ";" with a "+" as a list
  separator (to avoid shell issues with ';') causes issues if a "+"
  appears in a directory name. This results in the files not being found
  and the documentation build fails. Eg,

      Error FODC0002 in file:///ParaView-5.1.2/...

Use escape/unescape sequence for semicolons.

   Caller:   replace  '_'  -> '_u' and  ';'  -> '_s'
   Receiver: replace  '_s' -> ';'  and  '_u' -> '_'
parent cbd4c4ba
Pipeline #26416 passed with stage
......@@ -204,6 +204,13 @@ function(generate_header name)
endfunction()
# NOTE: coded-separator lists
#
# Workaround for inability to pass ';'-separated lists via command-line.
# From caller: replace '_' -> '_u' and ';' -> '_s'
# On receiver: replace '_s' -> ';' and '_u' -> '_'
# GENERATE_HTMLS_FROM_XMLS can be used to generate HTML files for
# from a given list of xml files that correspond to server manager xmls.
# ARGUMENTS:
......@@ -214,20 +221,26 @@ endfunction()
function (generate_htmls_from_xmls output_files xmls gui_xmls output_dir)
# create a string from the xmls list to pass
# since this list needs to be passed as an argument, we cannot escape the ";".
# generate_proxydocumentation.cmake has code to convert these strings back to
# lists.
# generate_proxydocumentation.cmake and generate_qhp.cmake have code to convert
# these strings back to lists.
set (xmls_string "")
foreach (xml ${xmls})
get_filename_component(xml "${xml}" ABSOLUTE)
set (xmls_string "${xmls_string}${xml}+")
set (xmls_string "${xmls_string}${xml};")
endforeach()
set (gui_xmls_string "")
foreach (gui_xml ${gui_xmls})
get_filename_component(gui_xml "${gui_xml}" ABSOLUTE)
set (gui_xmls_string "${gui_xmls_string}${gui_xml}+")
set (gui_xmls_string "${gui_xmls_string}${gui_xml};")
endforeach()
# Escape ';' in lists
string(REPLACE "_" "_u" xmls_string "${xmls_string}")
string(REPLACE ";" "_s" xmls_string "${xmls_string}")
string(REPLACE "_" "_u" gui_xmls_string "${gui_xmls_string}")
string(REPLACE ";" "_s" gui_xmls_string "${gui_xmls_string}")
set (all_xmls ${xmls} ${gui_xmls})
list (GET all_xmls 0 first_xml)
if (NOT first_xml)
......@@ -363,7 +376,10 @@ function(build_help_project name)
if (NOT DEFINED arg_TABLE_OF_CONTENTS)
# sanitize arg_FILEPATTERNS since we pass it as a command line argument.
string (REPLACE ";" "+" arg_FILEPATTERNS "${arg_FILEPATTERNS}")
# Escape ';' in lists
string(REPLACE "_" "_u" arg_FILEPATTERNS "${arg_FILEPATTERNS}")
string(REPLACE ";" "_s" arg_FILEPATTERNS "${arg_FILEPATTERNS}")
set (extra_args ${extra_args}
# generate the toc at run-time.
......
......@@ -9,20 +9,24 @@ cmake_minimum_required(VERSION 3.3)
# :- xsl file to generate a categoryindex for Readers and Writers
# xml_to_html_xsl :- xsl file to conevrt the internal xml to html.
# xml_to_wiki_xsl :- xsl file to conevrt the internal xml to wiki.
# input_xmls :- + separated list of SM xml files
# input_gui_xmls :- + separated list of GUI xml files used to generate the
# input_xmls :- coded-separator list of SM xml files
# input_gui_xmls :- coded-separator list of GUI xml files used to generate the
# CatergoryIndex.html
# output_dir :- Directory where all HTMLs are written out.
# output_file :- File written out on successful completion.
# This file is also used to save intermediate results.
#
# see ParaViewMacros.cmake for information about coded-separator lists
if (NOT EXISTS "${xmlpatterns}")
message(FATAL_ERROR "No xmlpatterns executable was defined!!!")
endif()
# input_xmls is a pseudo-list. Convert it to a real CMake list.
string(REPLACE "+" ";" input_xmls "${input_xmls}")
string(REPLACE "+" ";" input_gui_xmls "${input_gui_xmls}")
string(REPLACE "_s" ";" input_xmls "${input_xmls}")
string(REPLACE "_u" "_" input_xmls "${input_xmls}")
string(REPLACE "_s" ";" input_gui_xmls "${input_gui_xmls}")
string(REPLACE "_u" "_" input_gui_xmls "${input_gui_xmls}")
set (xslt_xml)
......
# Used by build_help_project CMake function to generate the qhp file.
# The WORKING_DIRECTORY for this script must be the same as the location for the
# qhp file otherwise the toc won't be generated correctly.
# Input environment:
# output_file :-
# file_patterns :-
# namespace :-
# folder :-
# name :-
# INPUT VARIABLES:
# output_file :-
# file_patterns :- coded-separator list of patterns
# namespace :-
# folder :-
# name :-
#
# see ParaViewMacros.cmake for information about coded-separator lists
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
......@@ -44,7 +48,9 @@ if (NOT output_file OR NOT file_patterns OR NOT namespace OR NOT folder OR NOT n
message(FATAL_ERROR "Missing one of the required arguments!!")
endif ()
string (REPLACE "+" ";" file_patterns "${file_patterns}")
# Recover original ';' separated list.
string(REPLACE "_s" ";" file_patterns "${file_patterns}")
string(REPLACE "_u" "_" file_patterns "${file_patterns}")
get_filename_component(working_dir "${output_file}" PATH)
......
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