4 ParaView uses XML files to describe filters available in its user interface.
5 Modules may add filters to the UI by providing XML files.
7 TODO: Document the ServerManager XML format.
11 ## Adding XMLs to modules 13 Modules may have associated XML files. They can be added to the module
target 22 cmake_parse_arguments(_paraview_add_sm
28 if (_paraview_add_sm_UNPARSED_ARGUMENTS)
30 "Unparsed arguments for paraview_add_server_manager_xmls: " 31 "${_paraview_add_sm_UNPARSED_ARGUMENTS}")
34 if (NOT _paraview_add_sm_XMLS)
36 "The `XMLS` argument is required.")
39 if (NOT DEFINED _paraview_add_sm_MODULE)
40 set(_paraview_add_sm_MODULE
"${_vtk_build_module}")
43 foreach (_paraview_add_sm_xml IN LISTS _paraview_add_sm_XMLS)
44 if (NOT IS_ABSOLUTE
"${_paraview_add_sm_xml}")
45 set(_paraview_add_sm_xml
"${CMAKE_CURRENT_SOURCE_DIR}/${_paraview_add_sm_xml}")
48 _vtk_module_set_module_property(
"${_paraview_add_sm_MODULE}" APPEND
49 PROPERTY
"paraview_server_manager_xml" 50 VALUE
"${_paraview_add_sm_xml}")
57 There are two functions offered to build server manager XML files. The first
64 [INSTALL_EXPORT <export>]
66 [XML_FILES <variable>])
69 The `MODULES` argument contains the modules to include in the server manager
70 target. The
function gathers the XML files declared
using 73 files are required, they may be passed via `FILES`.
75 If `XML_FILES` is given, the list of process XML files are
set on the given
78 If `INSTALL_EXPORT` is given, the
interface target will be added to the given
82 cmake_parse_arguments(_paraview_sm_process
84 "TARGET;XML_FILES;INSTALL_EXPORT" 88 if (_paraview_sm_process_UNPARSED_ARGUMENTS)
90 "Unparsed arguments for paraview_server_manager_process: " 91 "${_paraview_sm_process_UNPARSED_ARGUMENTS}")
94 if (NOT _paraview_sm_process_MODULES)
96 "The `MODULES` argument is required.")
99 if (NOT DEFINED _paraview_sm_process_TARGET)
101 "The `TARGET` argument is required.")
104 set(_paraview_sm_process_files)
105 foreach (_paraview_sm_process_module IN LISTS _paraview_sm_process_MODULES)
106 _vtk_module_get_module_property(
"${_paraview_sm_process_module}" 107 PROPERTY
"paraview_server_manager_xml" 108 VARIABLE _paraview_sm_process_module_files)
109 list(APPEND _paraview_sm_process_files
110 ${_paraview_sm_process_module_files})
113 list(APPEND _paraview_sm_process_files
114 ${_paraview_sm_process_FILES})
116 set(_paraview_sm_process_export_args)
117 if (DEFINED _paraview_sm_process_INSTALL_EXPORT)
118 set(_paraview_sm_process_export_args
119 INSTALL_EXPORT
"${_paraview_sm_process_INSTALL_EXPORT}")
123 TARGET ${_paraview_sm_process_TARGET}
124 FILES ${_paraview_sm_process_files}
125 ${_paraview_sm_process_export_args})
127 if (DEFINED _paraview_sm_process_XML_FILES)
128 set(
"${_paraview_sm_process_XML_FILES}" 129 "${_paraview_sm_process_files}" 135 The second way to process XML files directly.
141 [INSTALL_EXPORT <export>])
144 The files passed to the `FILES` argument will be processed in to functions
145 which are then consumed by ParaView applications.
147 The
name of the
target is given to the `TARGET` argument. By
default, the
148 filename is `<TARGET>.h` and it contains a
function named
149 `<TARGET>_initialize`. They may be changed
using the `FILE_NAME` and
150 `FUNCTION_NAME` arguments. The
target has an
interface usage requirement that
151 will allow the generated header to be included.
153 If `INSTALL_EXPORT` is given, the interface target will be added to the given
157 cmake_parse_arguments(_paraview_sm_process_files
159 "TARGET;INSTALL_EXPORT" 163 if (_paraview_sm_process_files_UNPARSED_ARGUMENTS)
165 "Unparsed arguments for paraview_server_manager_process_files: " 166 "${_paraview_sm_process_files_UNPARSED_ARGUMENTS}")
169 if (NOT DEFINED _paraview_sm_process_files_TARGET)
171 "The `TARGET` argument is required.")
174 set(_paraview_sm_process_files_output_dir
175 "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_paraview_sm_process_files_TARGET}")
176 set(_paraview_sm_process_files_output
177 "${_paraview_sm_process_files_output_dir}/${_paraview_sm_process_files_TARGET}_data.h")
179 OUTPUT
"${_paraview_sm_process_files_output}" 180 DEPENDS ${_paraview_sm_process_files_FILES}
181 "$<TARGET_FILE:ParaView::ProcessXML>" 182 COMMAND ParaView::ProcessXML
183 "${_paraview_sm_process_files_output}" 184 "${_paraview_sm_process_files_TARGET}" 187 ${_paraview_sm_process_files_FILES}
188 COMMENT
"Generating server manager headers for ${_paraview_sm_process_files_TARGET}.")
189 add_custom_target(
"${_paraview_sm_process_files_TARGET}_xml_content" 191 "${_paraview_sm_process_files_output}")
193 set(_paraview_sm_process_files_init_content
194 "#ifndef ${_paraview_sm_process_files_TARGET}_h 195 #define ${_paraview_sm_process_files_TARGET}_h 197 #include \"${_paraview_sm_process_files_TARGET}_data.h\" 201 void ${_paraview_sm_process_files_TARGET}_initialize(std::vector<std::string>& xmls) 203 foreach (_paraview_sm_process_files_file IN LISTS _paraview_sm_process_files_FILES)
204 get_filename_component(_paraview_sm_process_files_name
"${_paraview_sm_process_files_file}" NAME_WE)
205 string(APPEND _paraview_sm_process_files_init_content
207 char *init_string = ${_paraview_sm_process_files_TARGET}${_paraview_sm_process_files_name}GetInterfaces(); 208 xmls.push_back(init_string); 209 delete [] init_string; 212 string(APPEND _paraview_sm_process_files_init_content
218 OUTPUT
"${_paraview_sm_process_files_output_dir}/${_paraview_sm_process_files_TARGET}.h" 219 CONTENT
"${_paraview_sm_process_files_init_content}")
221 add_library(
"${_paraview_sm_process_files_TARGET}" INTERFACE)
222 add_dependencies(
"${_paraview_sm_process_files_TARGET}" 223 "${_paraview_sm_process_files_TARGET}_xml_content")
224 target_include_directories(
"${_paraview_sm_process_files_TARGET}" 226 "$<BUILD_INTERFACE:${_paraview_sm_process_files_output_dir}>")
227 _vtk_module_apply_properties(
"${_paraview_sm_process_files_TARGET}")
228 if (DEFINED _paraview_sm_process_files_INSTALL_EXPORT)
229 set(_vtk_build_INSTALL_EXPORT
230 "${_paraview_sm_process_files_INSTALL_EXPORT}")
232 _vtk_module_install(
"${_paraview_sm_process_files_TARGET}")
boost::graph_traits< vtkGraph *>::vertex_descriptor target(boost::graph_traits< vtkGraph *>::edge_descriptor e, vtkGraph *)
function paraview_server_manager_process_files()
.md The second way to process XML files directly.
function paraview_add_server_manager_xmls()
.md Server Manager XMLs
function paraview_server_manager_process()
.md Building XML files