2 cmake_policy(SET CMP0057 NEW)
4 set(_ParaViewPlugin_cmake_dir
"${CMAKE_CURRENT_LIST_DIR}")
7 # ParaView Plugin CMake API
14 ## Conditionally output debug statements
17 controlled by the `_paraview_plugin_log` variable which contains a list of
24 If the `domain` is
enabled for debugging, the `format` argument is configured
25 and printed. It should contain `@` variable expansions to
replace rather than
26 it being done outside. This helps to avoid the cost of generating large strings
27 when debugging is disabled.
30 if (NOT _paraview_plugin_log STREQUAL
"ALL" AND
31 NOT domain IN_LIST _paraview_plugin_log)
35 string(CONFIGURE "${format}
" _paraview_plugin_debug_msg) 36 if (_paraview_plugin_debug_msg) 38 "ParaView plugin debug ${domain}: ${_paraview_plugin_debug_msg}
") 45 Similar to VTK modules, plugins first have to be discovered. The 46 `paraview_plugin_find_plugins` function does this. The output variable is the 47 list of discovered `paraview.plugin` files. 50 paraview_plugin_find_plugins(<output> [<directory>...]) 53 function (paraview_plugin_find_plugins output) 54 set(_paraview_find_plugins_all) 55 foreach (_paraview_find_plugins_directory IN LISTS ARGN) 56 file(GLOB_RECURSE _paraview_find_plugins_plugins 57 "${_paraview_find_plugins_directory}/paraview.plugin
") 58 list(APPEND _paraview_find_plugins_all 59 ${_paraview_find_plugins_plugins}) 61 set("${output}
" ${_paraview_find_plugins_all} PARENT_SCOPE) 67 The `paraview.plugin` file is parsed and used as arguments to a CMake function. 77 Pixie file reader using ADIOS 82 The supported arguments are: 84 * `NAME`: (Required) The name of the plugin. 85 * `DESCRIPTION`: (Recommended) Short text describing what the plugin does. 86 * `CONDITION`: Arguments to CMake's `if` command which may be used to hide 87 the plugin for certain platforms or other reasons. If the expression is 88 false, the module is completely ignored. 89 * `REQUIRES_MODULES`: If the plugin is enabled, these modules will be listed 90 as those required to build the enabled plugins. 92 macro (_paraview_plugin_parse_args name_output) 93 cmake_parse_arguments("_name
" 101 "A ParaView plugin requires a
name (from ${_paraview_scan_plugin_file}).
") 103 set("${name_output}
" "${_name_NAME}
") 105 cmake_parse_arguments("${_name_NAME}
" 108 "DESCRIPTION;REQUIRES_MODULES;CONDITION
" 111 if (${_name_NAME}_UNPARSED_ARGUMENTS) 113 "Unparsed arguments
for ${_name_NAME}:
" 114 "${${_name_NAME}_UNPARSED_ARGUMENTS}
") 117 if (NOT ${_name_NAME}_DESCRIPTION) 118 message(WARNING "The ${_name_NAME} module should have a
description") 120 string(REPLACE ";
" " " "${_name_NAME}_DESCRIPTION
" "${${_name_NAME}_DESCRIPTION}
") 126 Once the `paraview.plugin` files have been found, they need to be scanned to 127 determine which should be built. Generally, plugins should be scanned first in 128 order to use the `REQUIRES_MODULES` list to enable them during the scan for 129 their required modules. 132 paraview_plugin_scan( 133 PLUGIN_FILES <file>... 134 PROVIDES_PLUGINS <variable> 135 [ENABLE_BY_DEFAULT <ON|OFF>] 136 [HIDE_PLUGINS_FROM_CACHE <ON|OFF>] 137 [REQUIRES_MODULES <module>...]) 140 * `PLUGIN_FILES`: (Required) The list of plugin files to scan. 141 * `PROVIDES_PLUGINS`: (Required) This variable contains a list of the plugins 143 * `ENABLE_BY_DEFAULT`: (Defaults to `OFF`) Whether to enable plugins by 145 * `HIDE_PLUGINS_FROM_CACHE`: (Defaults to `OFF`) Whether to display options 146 to enable and disable plugins in the cache or not. 147 * `REQUIRES_MODULES`: The list of modules required by the enabled plugins. 150 function (paraview_plugin_scan) 151 cmake_parse_arguments(_paraview_scan 153 "ENABLE_BY_DEFAULT;HIDE_PLUGINS_FROM_CACHE;REQUIRES_MODULES;PROVIDES_PLUGINS
" 157 if (_paraview_scan_UNPARSED_ARGUMENTS) 160 "${_paraview_scan_UNPARSED_ARGUMENTS}
") 163 if (NOT DEFINED _paraview_scan_ENABLE_BY_DEFAULT) 164 set(_paraview_scan_ENABLE_BY_DEFAULT OFF) 167 if (NOT DEFINED _paraview_scan_HIDE_PLUGINS_FROM_CACHE) 168 set(_paraview_scan_HIDE_PLUGINS_FROM_CACHE OFF) 171 if (NOT DEFINED _paraview_scan_PROVIDES_PLUGINS) 173 "The `PROVIDES_PLUGINS` argument is required.
") 176 if (NOT _paraview_scan_PLUGIN_FILES) 178 "No plugin files given to scan.
") 181 set(_paraview_scan_option_default_type BOOL) 182 if (_paraview_scan_HIDE_PLUGINS_FROM_CACHE) 183 set(_paraview_scan_option_default_type INTERNAL) 186 set(_paraview_scan_provided_plugins) 187 set(_paraview_scan_required_modules) 189 foreach (_paraview_scan_plugin_file IN LISTS _paraview_scan_PLUGIN_FILES) 190 if (NOT IS_ABSOLUTE "${_paraview_scan_plugin_file}
") 191 set(_paraview_scan_plugin_file 192 "${CMAKE_CURRENT_SOURCE_DIR}/${_paraview_scan_plugin_file}
") 195 set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}
" APPEND 197 CMAKE_CONFIGURE_DEPENDS "${_paraview_scan_plugin_file}
") 199 file(READ "${_paraview_scan_plugin_file}
" _paraview_scan_plugin_args) 201 string(REGEX REPLACE "#[^\n]*\n
" "\n
" _paraview_scan_plugin_args "${_paraview_scan_plugin_args}
") 202 # Use argument splitting. 203 string(REGEX REPLACE "( |\n)+
" ";
" _paraview_scan_plugin_args "${_paraview_scan_plugin_args}
") 204 _paraview_plugin_parse_args(_paraview_scan_plugin_name ${_paraview_scan_plugin_args}) 205 _paraview_plugin_debug(plugin "@_paraview_scan_plugin_name@ declared by @_paraview_scan_plugin_file
@") 207 list(APPEND _paraview_scan_all_plugins 208 "${_paraview_scan_plugin_name}
") 210 set(_paraview_scan_plugin_default "${_paraview_scan_ENABLE_BY_DEFAULT}
") 211 if (DEFINED "_paraview_plugin_default_${_paraview_scan_plugin_name}
") 212 set(_paraview_scan_plugin_default "${_paraview_plugin_default_${_paraview_scan_plugin_name}}
") 214 option("PARAVIEW_PLUGIN_ENABLE_${_paraview_scan_plugin_name}
" 215 "Enable the ${_paraview_scan_plugin_name} plugin. ${${_paraview_scan_plugin_name}_DESCRIPTION}
" 216 "${_paraview_scan_plugin_default}
") 217 set("_paraview_scan_enable_${_paraview_scan_plugin_name}
" 218 "${PARAVIEW_PLUGIN_ENABLE_${_paraview_scan_plugin_name}}
") 220 set_property(CACHE "PARAVIEW_PLUGIN_ENABLE_${_paraview_scan_plugin_name}
" 222 TYPE "${_paraview_scan_option_default_type}
") 224 if (DEFINED ${_paraview_scan_plugin_name}_CONDITION) 225 if (NOT (${${_paraview_scan_plugin_name}_CONDITION})) 226 if (DEFINED "PARAVIEW_PLUGIN_ENABLE_${_paraview_scan_plugin_name}
") 227 set_property(CACHE "PARAVIEW_PLUGIN_ENABLE_${_paraview_scan_plugin_name}
" 231 _paraview_plugin_debug(plugin "@_paraview_scan_plugin_name@ hidden by its `CONDITION`
") 236 if (_paraview_scan_enable_${_paraview_scan_plugin_name}) 237 _paraview_plugin_debug(plugin "@_paraview_scan_plugin_name@ requested via cache
value") 238 list(APPEND _paraview_scan_provided_plugins 239 "${_paraview_scan_plugin_name}
") 240 list(APPEND _paraview_scan_required_modules 241 ${${_paraview_scan_plugin_name}_REQUIRES_MODULES}) 246 "_paraview_plugin_${_paraview_scan_plugin_name}_file
" "${_paraview_scan_plugin_file}
") 249 "_paraview_plugin_${_paraview_scan_plugin_name}_description
" "${${_paraview_scan_plugin_name}_DESCRIPTION}
") 252 "_paraview_plugin_${_paraview_scan_plugin_name}_required_modules
" "${${_paraview_scan_plugin_name}_REQUIRES_MODULES}
") 255 if (DEFINED _paraview_scan_REQUIRES_MODULES) 256 set("${_paraview_scan_REQUIRES_MODULES}
" 257 ${_paraview_scan_required_modules} 261 set("${_paraview_scan_PROVIDES_PLUGINS}
" 262 ${_paraview_scan_provided_plugins} 266 function (_paraview_plugin_check_destdir variable) 267 if (NOT DEFINED "${variable}
") 269 "It appears as though ${variable} is not defined, but is needed to
" 270 "default a destination directory
for build artifacts. Usually
this is
" 271 "resolved by `include(GNUInstallDirs)` at the
top of the project.
") 278 Once all plugins have been scanned, they need to be built. 281 paraview_plugin_build( 283 [AUTOLOAD <plugin>...] 284 [DELAYED_LOAD <plugin>...] 285 [PLUGINS_COMPONENT <component>] 288 [INSTALL_EXPORT <export>] 289 [CMAKE_DESTINATION <destination>] 290 [TARGET_COMPONENT <component>] 291 [INSTALL_HEADERS <ON|OFF>] 292 [USE_FILE_SETS <ON|OFF>] 294 [HEADERS_DESTINATION <destination>] 295 [RUNTIME_DESTINATION <destination>] 296 [LIBRARY_DESTINATION <destination>] 297 [LIBRARY_SUBDIRECTORY <subdirectory>] 298 [ADD_INSTALL_RPATHS <ON|OFF>] 300 [PLUGINS_FILE_NAME <filename>] 301 [DISABLE_XML_DOCUMENTATION <ON|OFF>]) 303 [GENERATE_SPDX <ON|OFF>] 304 [SPDX_DOCUMENT_NAMESPACE <uri>] 305 [SPDX_DOWNLOAD_LOCATION <url>] 308 * `PLUGINS`: (Required) The list of plugins to build. May be empty. 309 * `AUTOLOAD`: A list of plugins to mark for autoloading. 310 * `DELAYED_LOAD`: A list of plugins to mark for delayed loading. A delayed load 311 plugin is a plugin where only the XMLs are loaded on load, while the actual 312 shared library of the plugin is loaded only when a proxy defined in these XMLs 314 * `PLUGINS_COMPONENT`: (Defaults to `paraview_plugins`) The installation 315 component to use for installed plugins. 316 * `TARGET`: (Recommended) The name of an interface target to generate. This 317 provides. an initialization function `<TARGET>_initialize` which 318 initializes static plugins. The function is provided, but is a no-op for 319 shared plugin builds. 320 * `INSTALL_EXPORT`: If provided, the generated target will be added to the 322 * `CMAKE_DESTINATION`: If provided, the plugin target's properties will be 323 written to a file named `<TARGET>-paraview-plugin-properties.cmake` in the 324 specified destination. 325 * `TARGET_COMPONENT`: (Defaults to `development`) The component to use for 327 * `INSTALL_HEADERS`: (Defaults to `ON`) Whether to install headers or not. 328 * `USE_FILE_SETS`: (Defaults to `OFF`) Whether to use `FILE_SET` source 329 specification or not. 330 * `HEADERS_DESTINATION`: (Defaults to `${CMAKE_INSTALL_INCLUDEDIR}`) Where to 331 install include files. 332 * `RUNTIME_DESTINATION`: (Defaults to `${CMAKE_INSTALL_BINDIR}`) Where to 333 install runtime files. 334 * `LIBRARY_DESTINATION`: (Defaults to `${CMAKE_INSTALL_LIBDIR}`) Where to 335 install modules built by plugins. 336 * `LIBRARY_SUBDIRECTORY`: (Defaults to `""`) Where to install the plugins 337 themselves. Each plugin lives in a directory of its name in 338 `<RUNTIME_DESTINATION>/<LIBRARY_SUBDIRECTORY>` (for Windows) or 339 `<LIBRARY_DESTINATION>/<LIBRARY_SUBDIRECTORY>` for other platforms. 340 * `ADD_INSTALL_RPATHS`: (Defaults to `ON`) If specified, an RPATH to load 341 dependent libraries from the `LIBRARY_DESTINATION` from the plugins will be 343 * `PLUGINS_FILE_NAME`: The name of the XML plugin file to generate for the 344 built plugins. This file will be placed under 345 `<LIBRARY_DESTINATION>/<LIBRARY_SUBDIRECTORY>`. It will be installed with 346 the `plugin` component. 347 * `DISABLE_XML_DOCUMENTATION`: (Defaults to `OFF`) Whether to forcefully 348 disable XML documentation or not. 349 * ``GENERATE_SPDX``: (Defaults to ``OFF``) Whether or not to generate and install 350 SPDX file for each modules. 351 * ``SPDX_DOCUMENT_NAMESPACE``: (Defaults to ``""``) Document namespace to use when 352 generating SPDX files. 353 * ``SPDX_DOWNLOAD_LOCATION``: (Defaults to ``""``) Download location to use when 354 generating SPDX files. 356 function (paraview_plugin_build) 357 cmake_parse_arguments(_paraview_build 359 "HEADERS_DESTINATION;RUNTIME_DESTINATION;LIBRARY_DESTINATION;LIBRARY_SUBDIRECTORY;TARGET;PLUGINS_FILE_NAME;INSTALL_EXPORT;CMAKE_DESTINATION;PLUGINS_COMPONENT;TARGET_COMPONENT;ADD_INSTALL_RPATHS;INSTALL_HEADERS;DISABLE_XML_DOCUMENTATION;GENERATE_SPDX;SPDX_DOCUMENT_NAMESPACE;SPDX_DOWNLOAD_LOCATION;USE_FILE_SETS
" 360 "PLUGINS;AUTOLOAD;DELAYED_LOAD
" 363 if (_paraview_build_UNPARSED_ARGUMENTS) 366 "${_paraview_build_UNPARSED_ARGUMENTS}
") 369 if (NOT DEFINED _paraview_build_HEADERS_DESTINATION) 370 _paraview_plugin_check_destdir(CMAKE_INSTALL_INCLUDEDIR) 371 set(_paraview_build_HEADERS_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}
") 374 if (NOT DEFINED _paraview_build_RUNTIME_DESTINATION) 375 _paraview_plugin_check_destdir(CMAKE_INSTALL_BINDIR) 376 set(_paraview_build_RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}
") 379 if (NOT DEFINED _paraview_build_LIBRARY_DESTINATION) 380 _paraview_plugin_check_destdir(CMAKE_INSTALL_LIBDIR) 381 set(_paraview_build_LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}
") 384 if (NOT DEFINED _paraview_build_LIBRARY_SUBDIRECTORY) 385 set(_paraview_build_LIBRARY_SUBDIRECTORY "") 388 if (NOT _paraview_build_DISABLE_XML_DOCUMENTATION) 389 set(_paraview_build_DISABLE_XML_DOCUMENTATION OFF) 392 if (NOT DEFINED _paraview_build_GENERATE_SPDX) 393 set(_paraview_build_GENERATE_SPDX OFF) 396 if (NOT _paraview_build_SPDX_DOCUMENT_NAMESPACE) 397 set(_paraview_build_SPDX_DOCUMENT_NAMESPACE "") 400 if (NOT _paraview_build_SPDX_DOWNLOAD_LOCATION) 401 set(_paraview_build_SPDX_DOWNLOAD_LOCATION "") 404 if (NOT DEFINED _paraview_build_INSTALL_HEADERS) 405 set(_paraview_build_INSTALL_HEADERS ON) 408 if (NOT DEFINED _paraview_build_USE_FILE_SETS) 409 set(_paraview_build_USE_FILE_SETS OFF) 412 if (NOT DEFINED _paraview_build_ADD_INSTALL_RPATHS) 413 set(_paraview_build_ADD_INSTALL_RPATHS ON) 415 if (_paraview_build_ADD_INSTALL_RPATHS) 416 if (NOT _paraview_build_LIBRARY_SUBDIRECTORY STREQUAL "") 417 file(RELATIVE_PATH _paraview_build_relpath 418 "/prefix/${_paraview_build_LIBRARY_DESTINATION}/${_paraview_build_LIBRARY_SUBDIRECTORY}/plugin
" 419 "/prefix/${_paraview_build_LIBRARY_DESTINATION}
") 421 file(RELATIVE_PATH _paraview_build_relpath 422 "/prefix/${_paraview_build_LIBRARY_DESTINATION}/plugin
" 423 "/prefix/${_paraview_build_LIBRARY_DESTINATION}
") 426 list(APPEND CMAKE_INSTALL_RPATH 427 "@loader_path/${_paraview_build_relpath}
") 429 list(APPEND CMAKE_INSTALL_RPATH 430 "$ORIGIN/${_paraview_build_relpath}
") 434 if (DEFINED _paraview_build_INSTALL_EXPORT 435 AND NOT DEFINED _paraview_build_TARGET) 437 "The `INSTALL_EXPORT` argument requires the `TARGET` argument.
") 440 if (DEFINED _paraview_build_INSTALL_EXPORT 441 AND NOT DEFINED _paraview_build_CMAKE_DESTINATION) 443 "The `INSTALL_EXPORT` argument requires the `CMAKE_DESTINATION` argument.
") 446 set(_paraview_build_extra_destinations) 447 if (DEFINED _paraview_build_CMAKE_DESTINATION) 448 list(APPEND _paraview_build_extra_destinations 450 if (NOT DEFINED _paraview_build_TARGET) 452 "The `CMAKE_DESTINATION` argument requires the `TARGET` argument.
") 456 if (DEFINED _paraview_build_TARGET) 457 _vtk_module_split_module_name("${_paraview_build_TARGET}
" _paraview_build) 458 string(REPLACE "::
" "_
" _paraview_build_target_safe "${_paraview_build_TARGET}
") 461 _vtk_module_check_destinations(_paraview_build_ 466 ${_paraview_build_extra_destinations}) 468 if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) 469 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${_paraview_build_RUNTIME_DESTINATION}
") 471 if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) 472 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${_paraview_build_LIBRARY_DESTINATION}
") 474 if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY) 475 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${_paraview_build_LIBRARY_DESTINATION}
") 479 set(_paraview_build_plugin_destination "${_paraview_build_RUNTIME_DESTINATION}
") 481 set(_paraview_build_plugin_destination "${_paraview_build_LIBRARY_DESTINATION}
") 483 if (NOT _paraview_build_LIBRARY_SUBDIRECTORY STREQUAL "") 484 string(APPEND _paraview_build_plugin_destination "/${_paraview_build_LIBRARY_SUBDIRECTORY}
") 487 foreach (_paraview_build_plugin IN LISTS _paraview_build_PLUGINS) 488 get_property(_paraview_build_plugin_file GLOBAL 489 PROPERTY "_paraview_plugin_${_paraview_build_plugin}_file
") 490 if (NOT _paraview_build_plugin_file) 492 "The requested ${_paraview_build_plugin} plugin is not a ParaView plugin.
") 495 _paraview_plugin_debug(building "@_paraview_build_plugin@ is being built
") 497 # Make a variable for where the plugin should go. 498 set(_paraview_build_plugin_directory 499 "${_paraview_build_plugin_destination}/${_paraview_build_plugin}
") 501 # TODO: Support external plugins? 502 get_filename_component(_paraview_build_plugin_dir "${_paraview_build_plugin_file}
" DIRECTORY) 503 file(RELATIVE_PATH _paraview_build_plugin_subdir "${CMAKE_SOURCE_DIR}
" "${_paraview_build_plugin_dir}
") 505 "${CMAKE_SOURCE_DIR}/${_paraview_build_plugin_subdir}
" 506 "${CMAKE_BINARY_DIR}/${_paraview_build_plugin_subdir}
") 509 if (DEFINED _paraview_build_TARGET) 510 add_library("${_paraview_build_TARGET_NAME}
" INTERFACE) 511 if (_paraview_build_NAMESPACE) 512 add_library("${_paraview_build_TARGET}
" ALIAS "${_paraview_build_TARGET_NAME}
") 514 target_include_directories("${_paraview_build_TARGET_NAME}
" 516 "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_paraview_build_target_safe}>
" 517 "$<INSTALL_INTERFACE:${_paraview_build_HEADERS_DESTINATION}>
") 518 set(_paraview_build_include_file 519 "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_paraview_build_target_safe}/${_paraview_build_target_safe}.h
") 521 set(_paraview_static_plugins) 522 foreach (_paraview_build_plugin IN LISTS _paraview_build_PLUGINS) 523 get_property(_paraview_build_plugin_type 524 TARGET "${_paraview_build_plugin}
" 526 if (_paraview_build_plugin_type STREQUAL "STATIC_LIBRARY
") 527 list(APPEND _paraview_static_plugins 528 "${_paraview_build_plugin}
") 532 if (_paraview_static_plugins) 533 target_link_libraries("${_paraview_build_TARGET_NAME}
" 535 ParaView::RemotingCore 536 ${_paraview_static_plugins}) 538 set(_paraview_build_declarations) 539 set(_paraview_build_calls) 540 set(_paraview_build_names) 541 foreach (_paraview_build_plugin IN LISTS _paraview_static_plugins) 542 string(APPEND _paraview_build_declarations 543 "PV_PLUGIN_IMPORT_INIT(${_paraview_build_plugin});\n
") 544 string(APPEND _paraview_build_calls 545 " if (sname == \
"${_paraview_build_plugin}\") 549 static bool loaded = false; 552 loaded = PV_PLUGIN_IMPORT(${_paraview_build_plugin}); 557 string(APPEND _paraview_build_names
558 " names.emplace_back(\"${_paraview_build_plugin}\");\n")
561 set(_paraview_build_include_content
562 "#ifndef ${_paraview_build_target_safe}_h 563 #define ${_paraview_build_target_safe}_h 565 #define PARAVIEW_BUILDING_PLUGIN 566 #define PARAVIEW_PLUGIN_BUILT_SHARED 0 567 #include \"vtkPVPlugin.h\" 568 #include \"vtkPVPluginLoader.h\" 569 #include \"vtkPVPluginTracker.h\" 572 ${_paraview_build_declarations} 573 static bool ${_paraview_build_target_safe}_static_plugins_load(const char* name); 574 static bool ${_paraview_build_target_safe}_static_plugins_search(const char* name); 575 static void ${_paraview_build_target_safe}_static_plugins_list(const char* appname, std::vector<std::string>& names); 577 static void ${_paraview_build_target_safe}_initialize() 579 vtkPVPluginLoader::RegisterLoadPluginCallback(${_paraview_build_target_safe}_static_plugins_load); 580 vtkPVPluginTracker::RegisterStaticPluginSearchFunction(${_paraview_build_target_safe}_static_plugins_search); 581 vtkPVPluginTracker::RegisterStaticPluginListFunction(${_paraview_build_target_safe}_static_plugins_list); 584 static bool ${_paraview_build_target_safe}_static_plugins_func(const char* name, bool load); 586 static bool ${_paraview_build_target_safe}_static_plugins_load(const char* name) 588 return ${_paraview_build_target_safe}_static_plugins_func(name, true); 591 static bool ${_paraview_build_target_safe}_static_plugins_search(const char* name) 593 return ${_paraview_build_target_safe}_static_plugins_func(name, false); 596 static void ${_paraview_build_target_safe}_static_plugins_list(const char* appname, std::vector<std::string>& names) 598 ${_paraview_build_names} 603 static bool ${_paraview_build_target_safe}_static_plugins_func(const char* name, bool load) 605 std::string const sname = name; 607 ${_paraview_build_calls} 613 set(_paraview_build_include_content
614 "#ifndef ${_paraview_build_target_safe}_h 615 #define ${_paraview_build_target_safe}_h 617 static void ${_paraview_build_target_safe}_initialize() 625 OUTPUT
"${_paraview_build_include_file}" 626 CONTENT
"${_paraview_build_include_content}")
627 if (_paraview_build_INSTALL_HEADERS)
629 FILES
"${_paraview_build_include_file}" 630 DESTINATION
"${_paraview_build_HEADERS_DESTINATION}" 631 COMPONENT
"${_paraview_build_TARGET_COMPONENT}")
634 if (DEFINED _paraview_build_INSTALL_EXPORT)
636 TARGETS
"${_paraview_build_TARGET_NAME}" 637 EXPORT "${_paraview_build_INSTALL_EXPORT}" 638 COMPONENT
"${_paraview_build_TARGET_COMPONENT}")
640 set(_paraview_build_required_exports_include_file_name
"${_paraview_build_INSTALL_EXPORT}-${_paraview_build_TARGET_NAME}-targets-depends.cmake")
641 set(_paraview_build_required_exports_include_build_file
642 "${CMAKE_BINARY_DIR}/${_paraview_build_CMAKE_DESTINATION}/${_paraview_build_required_exports_include_file_name}")
643 set(_paraview_build_required_exports_include_contents
"")
644 get_property(_paraview_build_required_exports GLOBAL
645 PROPERTY
"paraview_plugin_${_paraview_build_TARGET}_required_exports")
646 if (_paraview_build_required_exports)
647 foreach (_paraview_build_required_export IN LISTS _paraview_build_required_exports)
648 string(APPEND _paraview_build_required_exports_include_contents
649 "include(\"\${CMAKE_CURRENT_LIST_DIR}/${_paraview_build_required_export}-targets.cmake\")\n" 650 "include(\"\${CMAKE_CURRENT_LIST_DIR}/${_paraview_build_required_export}-vtk-module-properties.cmake\")\n" 653 get_property(_paraview_build_modules GLOBAL
654 PROPERTY
"paraview_plugin_${_paraview_build_required_export}_modules")
655 if (_paraview_build_modules)
656 vtk_module_export_find_packages(
657 CMAKE_DESTINATION
"${_paraview_build_CMAKE_DESTINATION}" 658 FILE_NAME
"${_paraview_build_required_export}-vtk-module-find-packages.cmake" 659 MODULES ${_paraview_build_modules})
661 # TODO: The list of modules should be checked
for their `_FOUND`
662 # variables being
false and propagate it up through the parent
663 # project
's `_FOUND` variable. 664 string(APPEND _paraview_build_required_exports_include_contents 665 "set(CMAKE_FIND_PACKAGE_NAME_save \"\${CMAKE_FIND_PACKAGE_NAME}\")\n" 666 "set(${_paraview_build_required_export}_FIND_QUIETLY \"\${\${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY}\")\n" 667 "set(${_paraview_build_required_export}_FIND_COMPONENTS)\n" 668 "set(CMAKE_FIND_PACKAGE_NAME \"${_paraview_build_required_export}\")\n" 669 "include(\"\${CMAKE_CURRENT_LIST_DIR}/${_paraview_build_required_export}-vtk-module-find-packages.cmake\")\n" 670 "set(CMAKE_FIND_PACKAGE_NAME \"\${CMAKE_FIND_PACKAGE_NAME_save}\")\n" 671 "unset(${_paraview_build_required_export}_FIND_QUIETLY)\n" 672 "unset(${_paraview_build_required_export}_FIND_COMPONENTS)\n" 673 "unset(CMAKE_FIND_PACKAGE_NAME_save)\n" 680 OUTPUT "${_paraview_build_required_exports_include_build_file}" 681 CONTENT "${_paraview_build_required_exports_include_contents}") 682 if (_paraview_build_INSTALL_HEADERS) 684 FILES "${_paraview_build_required_exports_include_build_file}" 685 DESTINATION "${_paraview_build_CMAKE_DESTINATION}" 686 COMPONENT "${_paraview_build_TARGET_COMPONENT}") 689 set(_paraview_build_namespace_args) 690 if (_paraview_build_NAMESPACE) 691 list(APPEND _paraview_build_namespace_args 692 NAMESPACE "${_paraview_build_NAMESPACE}::") 695 if (_paraview_build_INSTALL_HEADERS) 697 EXPORT "${_paraview_build_INSTALL_EXPORT}" 698 ${_paraview_build_namespace_args} 699 FILE "${CMAKE_BINARY_DIR}/${_paraview_build_CMAKE_DESTINATION}/${_paraview_build_INSTALL_EXPORT}-targets.cmake") 701 EXPORT "${_paraview_build_INSTALL_EXPORT}" 702 DESTINATION "${_paraview_build_CMAKE_DESTINATION}" 703 ${_paraview_build_namespace_args} 704 FILE "${_paraview_build_INSTALL_EXPORT}-targets.cmake" 705 COMPONENT "${_paraview_build_TARGET_COMPONENT}") 710 if (DEFINED _paraview_build_PLUGINS_FILE_NAME) 711 set(_paraview_build_xml_file 712 "${CMAKE_BINARY_DIR}/${_paraview_build_plugin_destination}/${_paraview_build_PLUGINS_FILE_NAME}") 713 set(_paraview_build_xml_content 714 "<?xml version=\"1.0\"?>\n<Plugins>\n") 715 foreach (_paraview_build_plugin IN LISTS _paraview_build_PLUGINS) 717 # Make a variable for where the plugin should go. 718 set(_paraview_build_plugin_directory 719 "${_paraview_build_plugin_destination}/${_paraview_build_plugin}") 721 set(_paraview_build_autoload 0) 722 if (_paraview_build_plugin IN_LIST _paraview_build_AUTOLOAD) 723 set(_paraview_build_autoload 1) 725 set(_paraview_build_delayed_load 0) 726 if (_paraview_build_plugin IN_LIST _paraview_build_DELAYED_LOAD) 727 set(_paraview_build_delayed_load 1) 729 string(APPEND _paraview_build_xml_content 730 " <Plugin name=\"${_paraview_build_plugin}\" auto_load=\"${_paraview_build_autoload}\" delayed_load=\"${_paraview_build_delayed_load}\"") 732 if (_paraview_build_delayed_load) 733 string(APPEND _paraview_build_xml_content ">\n") 735 get_property(_paraview_build_plugin_delayed_load_xmls GLOBAL 736 PROPERTY "_paraview_plugin_${_paraview_build_plugin}_xmls") 737 foreach (_paraview_build_plugin_delayed_load_xml IN LISTS _paraview_build_plugin_delayed_load_xmls) 738 # Copy XML to build for easier usage 739 configure_file(${_paraview_build_plugin_delayed_load_xml} "${CMAKE_BINARY_DIR}/${_paraview_build_plugin_directory}" COPYONLY) 741 # Add XML relative path to to plugin config file 742 cmake_path(GET _paraview_build_plugin_delayed_load_xml FILENAME _paraview_build_plugin_delayed_load_xml_name) 743 string(APPEND _paraview_build_xml_content " <XML filename=\"${_paraview_build_plugin}/${_paraview_build_plugin_delayed_load_xml_name}\"/>\n") 745 string(APPEND _paraview_build_xml_content " </Plugin>\n") 749 FILES ${_paraview_build_plugin_delayed_load_xmls} 750 DESTINATION "${_paraview_build_plugin_directory}" 751 COMPONENT "${_paraview_build_TARGET_COMPONENT}") 753 string(APPEND _paraview_build_xml_content "/>\n") 757 string(APPEND _paraview_build_xml_content 761 OUTPUT "${_paraview_build_xml_file}" 762 CONTENT "${_paraview_build_xml_content}") 764 FILES "${_paraview_build_xml_file}" 765 DESTINATION "${_paraview_build_plugin_destination}" 766 COMPONENT "${_paraview_build_TARGET_COMPONENT}") 768 if (DEFINED _paraview_build_INSTALL_EXPORT) 769 set_property(TARGET "${_paraview_build_TARGET_NAME}" 771 "INTERFACE_paraview_plugin_plugins_file" "${_paraview_build_xml_file}") 773 if (DEFINED _paraview_build_RUNTIME_DESTINATION) 774 set_property(TARGET "${_paraview_build_TARGET_NAME}" 776 "INTERFACE_paraview_plugin_plugins_file_install" "${_paraview_build_plugin_destination}/${_paraview_build_PLUGINS_FILE_NAME}") 779 if (DEFINED _paraview_build_CMAKE_DESTINATION) 780 set(_paraview_build_properties_filename "${_paraview_build_INSTALL_EXPORT}-paraview-plugin-properties.cmake") 781 set(_paraview_build_properties_build_file 782 "${CMAKE_BINARY_DIR}/${_paraview_build_CMAKE_DESTINATION}/${_paraview_build_properties_filename}") 783 set(_paraview_build_properties_install_file 784 "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_paraview_build_properties_filename}.install") 786 file(WRITE "${_paraview_build_properties_build_file}") 787 file(WRITE "${_paraview_build_properties_install_file}") 789 _vtk_module_write_import_prefix( 790 "${_paraview_build_properties_install_file}" 791 "${_paraview_build_CMAKE_DESTINATION}") 793 file(APPEND "${_paraview_build_properties_build_file}" 794 "set_property(TARGET \"${_paraview_build_TARGET}\" 796 INTERFACE_paraview_plugin_plugins_file \"${_paraview_build_xml_file}\")\n") 797 file(APPEND "${_paraview_build_properties_install_file}" 798 "set_property(TARGET \"${_paraview_build_TARGET}\" 800 INTERFACE_paraview_plugin_plugins_file \"\${_vtk_module_import_prefix}/${_paraview_build_plugin_destination}/${_paraview_build_PLUGINS_FILE_NAME}\") 801 unset(_vtk_module_import_prefix)\n") 803 if (_paraview_build_INSTALL_HEADERS) 805 FILES "${_paraview_build_properties_install_file}" 806 DESTINATION "${_paraview_build_CMAKE_DESTINATION}" 807 RENAME "${_paraview_build_properties_filename}" 808 COMPONENT "${_paraview_build_TARGET_COMPONENT}") 816 ## Plugin configuration files 818 Applications will want to consume plugin targets by discovering their locations 819 at runtime. In order to facilitate this, ParaView supports loading a `conf` 820 file which contains the locations of plugin targets' XML files. The plugins
821 specified in that file is then
826 PLUGINS_TARGETS <target>...
827 BUILD_DESTINATION <destination>
829 [INSTALL_DESTINATION <destination>]
830 [COMPONENT <component>])
833 * `
NAME`: (Required) The base
name of the configuration file.
834 * `PLUGINS_TARGETS`: (Required) The list of plugin targets to add to the
836 * `BUILD_DESTINATION`: (Required) Where to place the configuration file in
838 * `INSTALL_DESTINATION`: Where to install the configuration file in the
839 install tree. If not provided, the configuration file will not be
841 * `COMPONENT`: (Defaults to `runtime`) The
component to use when installing
842 the configuration file.
845 cmake_parse_arguments(_paraview_plugin_conf
847 "NAME;BUILD_DESTINATION;INSTALL_DESTINATION;COMPONENT" 851 if (_paraview_plugin_conf_UNPARSED_ARGUMENTS)
853 "Unparsed arguments for paraview_plugin_write_conf: " 854 "${_paraview_plugin_conf_UNPARSED_ARGUMENTS}")
857 if (NOT _paraview_plugin_conf_NAME)
859 "The `NAME` must not be empty.")
862 if (NOT DEFINED _paraview_plugin_conf_BUILD_DESTINATION)
864 "The `BUILD_DESTINATION` argument is required.")
867 if (NOT DEFINED _paraview_plugin_conf_PLUGINS_TARGETS)
869 "The `PLUGINS_TARGETS` argument is required.")
872 if (NOT DEFINED _paraview_plugin_conf_COMPONENT)
873 set(_paraview_plugin_conf_COMPONENT
"runtime")
876 set(_paraview_plugin_conf_file_name
877 "${_paraview_plugin_conf_NAME}.conf")
878 set(_paraview_plugin_conf_build_file
879 "${CMAKE_BINARY_DIR}/${_paraview_plugin_conf_BUILD_DESTINATION}/${_paraview_plugin_conf_file_name}")
880 set(_paraview_plugin_conf_install_file
881 "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_paraview_plugin_conf_file_name}.install")
882 set(_paraview_plugin_conf_build_contents)
883 set(_paraview_plugin_conf_install_contents)
884 foreach (_paraview_plugin_conf_target IN LISTS _paraview_plugin_conf_PLUGINS_TARGETS)
885 get_property(_paraview_plugin_conf_plugins_target_is_imported
886 TARGET
"${_paraview_plugin_conf_target}" 888 if (_paraview_plugin_conf_plugins_target_is_imported)
889 get_property(_paraview_plugin_conf_plugins_target_xml_build
890 TARGET
"${_paraview_plugin_conf_target}" 891 PROPERTY
"INTERFACE_paraview_plugin_plugins_file")
892 set(_paraview_plugin_conf_plugins_target_xml_install
893 "${_paraview_plugin_conf_plugins_target_xml_build}")
895 file(RELATIVE_PATH _paraview_plugin_conf_rel_path
896 "/prefix/${CMAKE_INSTALL_PREFIX}" 897 "/prefix/${_paraview_plugin_conf_plugins_target_xml_install}")
898 # If the external plugins XML file is under our installation destination, 899 # use a relative path to it, otherwise keep the absolute path. 900 if (NOT _paraview_plugin_conf_rel_path MATCHES
"^\.\./")
901 file(RELATIVE_PATH _paraview_plugin_conf_plugins_target_xml_install
902 "/prefix/${CMAKE_INSTALL_PREFIX}/${_paraview_plugin_conf_INSTALL_DESTINATION}" 903 "/prefix/${_paraview_plugin_conf_plugins_target_xml_install}")
906 get_property(_paraview_plugin_conf_plugins_target_is_alias
907 TARGET
"${_paraview_plugin_conf_target}" 908 PROPERTY ALIASED_TARGET
910 if (_paraview_plugin_conf_plugins_target_is_alias)
911 get_property(_paraview_plugin_conf_target
912 TARGET
"${_paraview_plugin_conf_target}" 913 PROPERTY ALIASED_TARGET)
915 get_property(_paraview_plugin_conf_plugins_target_xml_build
916 TARGET
"${_paraview_plugin_conf_target}" 917 PROPERTY
"INTERFACE_paraview_plugin_plugins_file")
918 get_property(_paraview_plugin_conf_plugins_target_xml_install
919 TARGET
"${_paraview_plugin_conf_target}" 920 PROPERTY
"INTERFACE_paraview_plugin_plugins_file_install")
922 if (_paraview_plugin_conf_plugins_target_xml_install)
923 # Compute the relative path within the install tree. 924 file(RELATIVE_PATH _paraview_plugin_conf_plugins_target_xml_install
925 "/prefix/${_paraview_plugin_conf_INSTALL_DESTINATION}" 926 "/prefix/${_paraview_plugin_conf_plugins_target_xml_install}")
930 # TODO: Write out in JSON instead. 931 if (_paraview_plugin_conf_plugins_target_xml_build)
932 string(APPEND _paraview_plugin_conf_build_contents
933 "${_paraview_plugin_conf_plugins_target_xml_build}\n")
935 if (_paraview_plugin_conf_plugins_target_xml_install)
936 string(APPEND _paraview_plugin_conf_install_contents
937 "${_paraview_plugin_conf_plugins_target_xml_install}\n")
942 OUTPUT
"${_paraview_plugin_conf_build_file}" 943 CONTENT
"${_paraview_plugin_conf_build_contents}")
945 if (_paraview_plugin_conf_INSTALL_DESTINATION)
947 OUTPUT
"${_paraview_plugin_conf_install_file}" 948 CONTENT
"${_paraview_plugin_conf_install_contents}")
950 FILES
"${_paraview_plugin_conf_install_file}" 951 DESTINATION
"${_paraview_plugin_conf_INSTALL_DESTINATION}" 952 RENAME
"${_paraview_plugin_conf_file_name}" 953 COMPONENT
"${_paraview_plugin_conf_COMPONENT}")
957 set(_paraview_plugin_source_dir
"${CMAKE_CURRENT_LIST_DIR}")
966 [REQUIRED_ON_SERVER] [REQUIRED_ON_CLIENT]
969 [MODULE_FILES <vtk.module>...]
970 [MODULE_ARGS <arg>...]
971 [MODULES <module>...]
972 [SOURCES <source>...]
973 [SERVER_MANAGER_XML <xml>...]
974 [MODULE_INSTALL_EXPORT <export>]
976 [UI_INTERFACES <interface>...]
977 [UI_RESOURCES <resource>...]
980 [PYTHON_MODULES <module>...]
982 [INITIALIZERS <initializerFunction>...]
984 [EXTRA_INCLUDES <file>...]
986 [REQUIRED_PLUGINS <plugin>...]
989 [XML_DOCUMENTATION <ON|OFF>]
990 [DOCUMENTATION_DIR <directory>]
991 [DOCUMENTATION_ADD_PATTERNS <pattern>...]
992 [DOCUMENTATION_TOC <string>]
993 [DOCUMENTATION_DEPENDENCIES <target>...]
995 [FORCE_STATIC <ON|OFF>])
997 [TRANSLATIONS_DIRECTORY <directory>]
998 [TRANSLATIONS_TARGET <target>]
1001 * `REQUIRED_ON_SERVER`: The plugin is required to be loaded
on the server
for 1002 proper functionality.
1003 * `REQUIRED_ON_CLIENT`: The plugin is required to be loaded
on the client
for 1004 proper functionality.
1006 * `MODULE_FILES`: Paths to `
vtk.module` files describing modules to include
1008 * `MODULE_ARGS`: Arguments to pass to `vtk_module_build`
for included modules.
1009 * `MODULES`: Modules to include in the plugin. These modules will be wrapped
1010 using client server and have their server manager XML files processed.
1011 * `SOURCES`: Source files
for the plugin.
1012 * `SERVER_MANAGER_XML`: Server manager XML files
for the plugin.
1013 * `UI_INTERFACES`: Interfaces to initialize, in the given
order. See the
1014 plugin interfaces section
for more
details.
1015 * `MODULE_INSTALL_EXPORT`: (Defaults to `<
name>`) If provided, any modules
1016 will be added to the given export
set.
1017 * `UI_RESOURCES`: Qt resource files to include with the plugin.
1018 * `UI_FILES`: Qt `.ui` files to include with the plugin.
1019 * `PYTHON_MODULES`: Python modules to embed into the plugin.
1020 * `INITIALIZERS`: An ordered list of free functions (declared in `EXTRA_INCLUDES`
1021 if needed) to be invoked when the plugin is loaded. Each
function must be
1022 callable with no arguments.
1023 * `EXTRA_INCLUDES`: Headers needed by the generated plugin code (such as `INITIALIZERS`).
1024 Filename paths passed without quotes will be
double-quoted (e.g., \verbatim`#include
"foo.h"`\endverbatim),
1025 while paths that start with angle- or
double-quotes will not be.
1026 * `REQUIRED_PLUGINS`: Plugins which must be loaded
for this plugin to
1027 function. These plugins
do not need to be available at build
time and are
1028 therefore their existence is not checked here.
1029 * `EULA`: A file with
content to display as an end-user license agreement
1030 before the plugin is initialized at runtime.
1031 * `XML_DOCUMENTATION`: (Defaults to `ON`) If
set,
documentation will be
1032 generated
for the associated XML files.
1033 * `DOCUMENTATION_DIR`: If specified, `*.html`, `*.css`, `*.png`, `*.js`, and `*.jpg`
1034 files in
this directory will be copied and made available to the
1036 * `DOCUMENTATION_ADD_PATTERNS`: If specified, adds patterns
for the
documentation files
1037 within `DOCUMENTATION_DIR` other than the
default ones (see `DOCUMENTATION_DIR` help)
1038 * `DOCUMENTATION_TOC`: If specified, use
this string for describing the table of
1040 * `DOCUMENTATION_DEPENDENCIES`: Targets that are needed to be built before
1043 * `FORCE_STATIC`: (Defaults to `OFF`) If
set, the plugin will be built
1044 statically so that it can be embedded into an application.
1045 * `TRANSLATIONS_DIRECTORY`: (Defaults to `${CMAKE_CURRENT_BINARY_DIR}/Translations`)
1046 The path of the directory where translation source files are stored.
1047 * `TRANSLATION_TARGET` : The name of the target on which to add the ts file as
1051 if (NOT name STREQUAL _paraview_build_plugin)
1053 "The ${_paraview_build_plugin}'s CMakeLists.txt may not add the ${name} " 1057 cmake_parse_arguments(_paraview_add_plugin
1058 "REQUIRED_ON_SERVER;REQUIRED_ON_CLIENT"
1059 "
VERSION;EULA;EXPORT;MODULE_INSTALL_EXPORT;XML_DOCUMENTATION;DOCUMENTATION_DIR;FORCE_STATIC;DOCUMENTATION_TOC;TRANSLATIONS_DIRECTORY;TRANSLATIONS_TARGET"
1060 "REQUIRED_PLUGINS;SERVER_MANAGER_XML;SOURCES;MODULES;UI_INTERFACES;UI_RESOURCES;UI_FILES;PYTHON_MODULES;MODULE_FILES;MODULE_ARGS;DOCUMENTATION_ADD_PATTERNS;DOCUMENTATION_DEPENDENCIES;INITIALIZERS;EXTRA_INCLUDES"
1063 if (_paraview_add_plugin_UNPARSED_ARGUMENTS)
1065 "Unparsed arguments for paraview_add_plugin: " 1066 "${_paraview_add_plugin_UNPARSED_ARGUMENTS}")
1069 if (NOT DEFINED _paraview_add_plugin_VERSION)
1071 "The `VERSION` argument is required.")
1074 if (NOT DEFINED _paraview_add_plugin_XML_DOCUMENTATION)
1075 set(_paraview_add_plugin_XML_DOCUMENTATION ON)
1077 if (DEFINED _paraview_add_plugin_DOCUMENTATION_DIR AND
1078 NOT _paraview_add_plugin_XML_DOCUMENTATION)
1080 "Specifying `DOCUMENTATION_DIR` and turning off `XML_DOCUMENTATION` " 1083 if (_paraview_build_DISABLE_XML_DOCUMENTATION)
1084 set(_paraview_add_plugin_XML_DOCUMENTATION OFF)
1087 if (NOT DEFINED _paraview_add_plugin_FORCE_STATIC)
1088 set(_paraview_add_plugin_FORCE_STATIC OFF)
1091 if (DEFINED _paraview_add_plugin_EXPORT)
1093 "The `paraview_add_plugin(EXPORT)` argument is ignored in favor of " 1094 "`paraview_plugin_build(INSTALL_EXPORT)`.")
1097 if (_paraview_add_plugin_MODULE_ARGS)
1098 if (NOT _paraview_add_plugin_MODULE_FILES OR
1099 NOT _paraview_add_plugin_MODULES)
1101 "The `MODULE_ARGS` argument requires `MODULE_FILES` and `MODULES` to be provided.")
1105 if (_paraview_add_plugin_UI_INTERFACES OR _paraview_add_plugin_UI_FILES OR _paraview_add_plugin_UI_RESOURCES)
1106 if (NOT PARAVIEW_USE_QT)
1107 message(FATAL_ERROR
"UI_INTERFACES, UI_FILES and UI_RESOURCES require ParaView to be built with Qt enabled.")
1111 if (DEFINED _paraview_build_INSTALL_EXPORT AND
1112 NOT DEFINED _paraview_add_plugin_MODULE_INSTALL_EXPORT)
1113 set(_paraview_add_plugin_MODULE_INSTALL_EXPORT
1117 if (_paraview_add_plugin_MODULE_FILES)
1118 if (NOT _paraview_add_plugin_MODULES)
1120 "The `MODULE_FILES` argument requires `MODULES` to be provided.")
1123 if (_paraview_build_ADD_INSTALL_RPATHS)
1125 list(INSERT CMAKE_INSTALL_RPATH 0
1128 list(INSERT CMAKE_INSTALL_RPATH 0
1133 set(_paraview_add_plugin_module_install_export_args)
1134 if (DEFINED _paraview_add_plugin_MODULE_INSTALL_EXPORT)
1135 list(APPEND _paraview_add_plugin_module_install_export_args
1136 INSTALL_EXPORT
"${_paraview_add_plugin_MODULE_INSTALL_EXPORT}")
1137 if (DEFINED _paraview_build_TARGET)
1138 set_property(GLOBAL APPEND
1140 "paraview_plugin_${_paraview_build_TARGET}_required_exports" "${_paraview_add_plugin_MODULE_INSTALL_EXPORT}")
1145 MODULE_FILES ${_paraview_add_plugin_MODULE_FILES}
1146 REQUEST_MODULES ${_paraview_add_plugin_MODULES}
1147 PROVIDES_MODULES plugin_modules
1148 REQUIRES_MODULES required_modules
1149 HIDE_MODULES_FROM_CACHE ON)
1151 if (required_modules)
1152 foreach (required_module IN LISTS required_modules)
1153 if (NOT TARGET
"${required_module}")
1155 "Failed to find the required module ${required_module}.")
1161 set(_paraview_plugin_subdir
"${_paraview_build_RUNTIME_DESTINATION}")
1163 set(_paraview_plugin_subdir
"${_paraview_build_LIBRARY_DESTINATION}")
1165 if (NOT _paraview_build_LIBRARY_SUBDIRECTORY STREQUAL
"")
1166 string(APPEND _paraview_plugin_subdir
"/${_paraview_build_LIBRARY_SUBDIRECTORY}")
1168 string(APPEND _paraview_plugin_subdir
"/${_paraview_build_plugin}")
1169 set(_paraview_plugin_CMAKE_RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
1170 set(_paraview_plugin_CMAKE_LIBRARY_OUTPUT_DIRECTORY
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
1171 set(_paraview_plugin_CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
1172 set(_paraview_plugin_CMAKE_INSTALL_NAME_DIR
"${CMAKE_INSTALL_NAME_DIR}")
1173 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/${_paraview_plugin_subdir}")
1174 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/${_paraview_plugin_subdir}")
1175 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/${_paraview_plugin_subdir}")
1176 set(CMAKE_INSTALL_NAME_DIR
"@loader_path")
1179 MODULES ${plugin_modules}
1180 PACKAGE "${_paraview_build_plugin}" 1181 USE_FILE_SETS
"${_paraview_build_USE_FILE_SETS}" 1182 ${_paraview_add_plugin_module_install_export_args}
1183 INSTALL_HEADERS
"${_paraview_build_INSTALL_HEADERS}" 1184 TARGETS_COMPONENT
"${_paraview_build_PLUGINS_COMPONENT}" 1185 HEADERS_DESTINATION
"${_paraview_build_HEADERS_DESTINATION}/${_paraview_build_target_safe}" 1186 ARCHIVE_DESTINATION
"${_paraview_plugin_subdir}" 1187 LIBRARY_DESTINATION
"${_paraview_plugin_subdir}" 1188 RUNTIME_DESTINATION
"${_paraview_plugin_subdir}" 1189 CMAKE_DESTINATION
"${_paraview_build_CMAKE_DESTINATION}" 1190 ${_paraview_add_plugin_MODULE_ARGS}
1191 GENERATE_SPDX
"${_paraview_build_GENERATE_SPDX}" 1192 SPDX_DOCUMENT_NAMESPACE
"${_paraview_build_SPDX_DOCUMENT_NAMESPACE}" 1193 SPDX_DOWNLOAD_LOCATION
"${_paraview_build_SPDX_DOWNLOAD_LOCATION}")
1195 set_property(GLOBAL APPEND
1197 "paraview_plugin_${_paraview_add_plugin_MODULE_INSTALL_EXPORT}_modules" "${plugin_modules}")
1199 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
"${_paraview_plugin_CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
1200 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
"${_paraview_plugin_CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
1201 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"${_paraview_plugin_CMAKE_ARCHIVE_OUTPUT_DIRECTORY}")
1202 set(CMAKE_INSTALL_NAME_DIR
"${_paraview_plugin_CMAKE_INSTALL_NAME_DIR}")
1203 unset(_paraview_plugin_CMAKE_RUNTIME_OUTPUT_DIRECTORY)
1204 unset(_paraview_plugin_CMAKE_LIBRARY_OUTPUT_DIRECTORY)
1205 unset(_paraview_plugin_CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
1206 unset(_paraview_plugin_CMAKE_INSTALL_NAME_DIR)
1209 # TODO: resource initialization for static builds 1211 if (_paraview_add_plugin_REQUIRED_ON_SERVER)
1212 set(_paraview_add_plugin_required_on_server
"true")
1214 set(_paraview_add_plugin_required_on_server
"false")
1217 if (_paraview_add_plugin_REQUIRED_ON_CLIENT)
1218 set(_paraview_add_plugin_required_on_client
"true")
1220 set(_paraview_add_plugin_required_on_client
"false")
1223 set(_paraview_add_plugin_export_args)
1224 set(_paraview_add_plugin_install_export_args)
1225 if (DEFINED _paraview_build_INSTALL_EXPORT)
1226 list(APPEND _paraview_add_plugin_export_args
1227 EXPORT "${_paraview_build_INSTALL_EXPORT}")
1228 list(APPEND _paraview_add_plugin_install_export_args
1229 INSTALL_EXPORT
"${_paraview_build_INSTALL_EXPORT}")
1232 set(_paraview_add_plugin_includes)
1233 set(_paraview_add_plugin_required_libraries)
1235 if (_paraview_add_plugin_EXTRA_INCLUDES)
1236 foreach (_include IN LISTS _paraview_add_plugin_EXTRA_INCLUDES)
1237 if ((${_include} MATCHES
"^\".*\"$") OR (${_include} MATCHES
"^<.*>$"))
1238 string(APPEND _paraview_add_plugin_includes
"#include ${_include}\n")
1240 string(APPEND _paraview_add_plugin_includes
"#include \"${_include}\"\n")
1245 set(_paraview_add_plugin_module_xmls)
1247 if (_paraview_add_plugin_MODULES)
1250 list(APPEND _paraview_add_plugin_required_libraries
1251 ${_paraview_add_plugin_MODULES})
1254 MODULES ${_paraview_add_plugin_MODULES}
1255 TARGET
"${_paraview_build_plugin}_client_server" 1256 ${_paraview_add_plugin_install_export_args})
1258 if (NOT DEFINED _paraview_add_plugin_TRANSLATIONS_DIRECTORY)
1259 set(_paraview_add_plugin_TRANSLATIONS_DIRECTORY
1260 "${CMAKE_CURRENT_BINARY_DIR}/Translations")
1262 set(_paraview_add_plugin_translation_args)
1263 if (_paraview_add_plugin_TRANSLATIONS_DIRECTORY AND _paraview_add_plugin_TRANSLATIONS_TARGET)
1264 list(APPEND _paraview_add_plugin_translation_args
1265 TRANSLATIONS_DIRECTORY
"${_paraview_add_plugin_TRANSLATIONS_DIRECTORY}")
1266 list(APPEND _paraview_add_plugin_translation_args
1267 TRANSLATIONS_TARGET
"${_paraview_add_plugin_TRANSLATIONS_TARGET}")
1271 MODULES ${_paraview_add_plugin_MODULES}
1272 TARGET
"${_paraview_build_plugin}_server_manager_modules" 1273 ${_paraview_add_plugin_install_export_args}
1274 XML_FILES _paraview_add_plugin_module_xmls
1275 ${_paraview_add_plugin_translation_args})
1277 list(APPEND _paraview_add_plugin_required_libraries
1278 "${_paraview_build_plugin}_client_server" 1279 "${_paraview_build_plugin}_server_manager_modules")
1282 set(_paraview_add_plugin_binary_resources
"")
1283 set(_paraview_add_plugin_binary_headers)
1284 if (_paraview_add_plugin_SERVER_MANAGER_XML)
1287 set(_paraview_add_plugin_xmls)
1288 foreach (_paraview_add_plugin_xml IN LISTS _paraview_add_plugin_SERVER_MANAGER_XML)
1289 if (NOT IS_ABSOLUTE
"${_paraview_add_plugin_xml}")
1290 set(_paraview_add_plugin_xml
"${CMAKE_CURRENT_SOURCE_DIR}/${_paraview_add_plugin_xml}")
1293 list(APPEND _paraview_add_plugin_xmls
1294 "${_paraview_add_plugin_xml}")
1297 set_property(GLOBAL APPEND
1299 "_paraview_plugin_${_paraview_build_plugin}_xmls" "${_paraview_add_plugin_xmls}")
1302 TARGET
"${_paraview_build_plugin}_server_manager" 1303 ${_paraview_add_plugin_install_export_args}
1304 FILES ${_paraview_add_plugin_xmls})
1305 list(APPEND _paraview_add_plugin_required_libraries
1306 "${_paraview_build_plugin}_server_manager")
1309 if ((_paraview_add_plugin_module_xmls OR _paraview_add_plugin_xmls) AND
1310 PARAVIEW_USE_QT AND _paraview_add_plugin_XML_DOCUMENTATION)
1312 if (PARAVIEW_QT_MAJOR_VERSION VERSION_GREATER
"5")
1313 # see https://gitlab.kitware.com/paraview/paraview/-/issues/19742 1314 if (NOT DEFINED ENV{CI})
1315 message(AUTHOR_WARNING
"Building the plugin documentation with Qt6 is not supported")
1319 set(_paraview_build_plugin_docdir
1320 "${CMAKE_CURRENT_BINARY_DIR}/paraview_help")
1323 TARGET
"${_paraview_build_plugin}_doc" 1324 OUTPUT_DIR
"${_paraview_build_plugin_docdir}" 1325 XMLS ${_paraview_add_plugin_module_xmls}
1326 ${_paraview_add_plugin_xmls})
1328 set(_paraview_build_plugin_doc_source_args)
1329 if (DEFINED _paraview_add_plugin_DOCUMENTATION_DIR)
1330 list(APPEND _paraview_build_plugin_doc_source_args
1331 SOURCE_DIR
"${_paraview_add_plugin_DOCUMENTATION_DIR}")
1335 NAME "${_paraview_build_plugin}" 1336 OUTPUT_PATH _paraview_build_plugin_qch_path
1337 OUTPUT_DIR
"${_paraview_build_plugin_docdir}" 1338 TARGET
"${_paraview_build_plugin}_qch" 1339 ${_paraview_build_plugin_doc_source_args}
1340 TABLE_OF_CONTENTS
"${_paraview_add_plugin_DOCUMENTATION_TOC}" 1341 DEPENDS
"${_paraview_build_plugin}_doc" 1342 "${_paraview_add_plugin_DOCUMENTATION_DEPENDENCIES}" 1343 PATTERNS
"*.html" "*.css" "*.png" "*.jpg" "*.js" 1344 ${_paraview_add_plugin_DOCUMENTATION_ADD_PATTERNS})
1346 set(_paraview_add_plugin_depends_args)
1347 if (CMAKE_VERSION VERSION_GREATER_EQUAL
"3.27")
1348 list(APPEND _paraview_add_plugin_depends_args
1349 DEPENDS_EXPLICIT_ONLY)
1352 list(APPEND _paraview_add_plugin_extra_include_dirs
1353 "${CMAKE_CURRENT_BINARY_DIR}")
1354 set(_paraview_add_plugin_qch_output
1355 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_build_plugin}_qch.h")
1356 list(APPEND _paraview_add_plugin_binary_headers
1357 "${_paraview_add_plugin_qch_output}")
1359 OUTPUT
"${_paraview_add_plugin_qch_output}" 1360 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}
1361 "$<TARGET_FILE:ParaView::ProcessXML>" 1363 "${_paraview_add_plugin_qch_output}" 1367 "${_paraview_build_plugin_qch_path}
" 1368 DEPENDS "${_paraview_build_plugin_qch_path}
" 1369 "${_paraview_build_plugin}_qch
" 1370 "$<TARGET_FILE:ParaView::ProcessXML>
" 1371 COMMENT "Generating header
for ${_paraview_build_plugin}
documentation" 1372 ${_paraview_add_plugin_depends_args}) 1373 set_property(SOURCE "${_paraview_add_plugin_qch_output}
" 1377 string(APPEND _paraview_add_plugin_includes 1378 "#include \
"${_paraview_build_plugin}_qch.h\"\n")
1379 string(APPEND _paraview_add_plugin_binary_resources
1381 const char *text = ${_paraview_build_plugin}_qch(); 1382 resources.emplace_back(text); 1388 set(_paraview_add_plugin_eula_sources)
1389 if (_paraview_add_plugin_EULA)
1391 INPUT
"${_paraview_add_plugin_EULA}" 1392 NAME "${_paraview_build_plugin}_EULA" 1393 HEADER_OUTPUT _paraview_add_plugin_eula_header
1394 SOURCE_OUTPUT _paraview_add_plugin_eula_source)
1395 list(APPEND _paraview_add_plugin_eula_sources
1396 "${_paraview_add_plugin_eula_header}" 1397 "${_paraview_add_plugin_eula_source}")
1401 set(_paraview_add_plugin_ui_sources)
1402 if (_paraview_add_plugin_UI_INTERFACES)
1404 set(CMAKE_AUTOMOC 1)
1405 set(_paraview_add_plugin_push_back_interfaces
1406 "#define PARAVIEW_ADD_INTERFACES(arg) \\\n")
1407 set(_paraview_add_plugin_include_interfaces
"")
1409 foreach (_paraview_add_plugin_ui_interface IN LISTS _paraview_add_plugin_UI_INTERFACES)
1410 string(APPEND _paraview_add_plugin_push_back_interfaces
1411 " (arg).push_back(new ${_paraview_add_plugin_ui_interface}(this)); \\\n")
1412 string(APPEND _paraview_add_plugin_include_interfaces
1413 "#include \"${_paraview_add_plugin_ui_interface}.h\"\n")
1415 list(APPEND _paraview_add_plugin_required_libraries
1416 ParaView::pqComponents)
1420 if (_paraview_add_plugin_INITIALIZERS)
1422 set(_paraview_add_plugin_invoke_initializers)
1424 foreach (_paraview_add_plugin_initializer IN LISTS _paraview_add_plugin_INITIALIZERS)
1425 string(APPEND _paraview_add_plugin_invoke_initializers
1426 " ${_paraview_add_plugin_initializer}();\n")
1430 set(_paraview_add_plugin_with_resources 0)
1431 set(_paraview_add_plugin_resources_init)
1432 if (_paraview_add_plugin_UI_RESOURCES)
1433 set(_paraview_add_plugin_with_resources 1)
1434 set(CMAKE_AUTORCC 1)
1436 foreach (_paraview_add_plugin_ui_resource IN LISTS _paraview_add_plugin_UI_RESOURCES)
1437 get_filename_component(_paraview_add_plugin_ui_resource_base
"${_paraview_add_plugin_ui_resource}" NAME_WE)
1438 string(APPEND _paraview_add_plugin_resources_init
1439 " Q_INIT_RESOURCE(${_paraview_add_plugin_ui_resource_base});\n")
1442 list(APPEND _paraview_add_plugin_ui_sources
1443 ${_paraview_add_plugin_UI_RESOURCES})
1446 set(_paraview_add_plugin_qt_extra_components)
1447 if (_paraview_add_plugin_UI_FILES)
1449 set(CMAKE_AUTOUIC 1)
1450 list(APPEND _paraview_add_plugin_qt_extra_components
1452 list(APPEND _paraview_add_plugin_required_libraries
1453 "Qt${PARAVIEW_QT_MAJOR_VERSION}::Widgets")
1454 list(APPEND _paraview_add_plugin_ui_sources
1455 ${_paraview_add_plugin_UI_FILES})
1459 include(
"${_ParaViewPlugin_cmake_dir}/paraview-find-package-helpers.cmake" OPTIONAL)
1460 find_package(
"Qt${PARAVIEW_QT_MAJOR_VERSION}" QUIET REQUIRED COMPONENTS Core ${_paraview_add_plugin_qt_extra_components})
1461 list(APPEND _paraview_add_plugin_required_libraries
1462 "Qt${PARAVIEW_QT_MAJOR_VERSION}::Core")
1464 list(APPEND _paraview_add_plugin_required_libraries
1468 # CMake 3.13 started using Qt5's version variables to detect what version 1469 # of Qt's tools to run for automoc, autouic, and autorcc. However, they are 1470 # looked up using the target's directory scope, but these are here in a 1471 # local scope and unset when AutoGen gets around to asking about the 1472 # variables at generate time. 1474 # Fix for 3.13.0–3.13.3. Does not work if `paraview_add_plugin` is called 1475 # from another function. 1476 set(
"Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MAJOR" "${Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MAJOR}" PARENT_SCOPE)
1477 set(
"Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MINOR" "${Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MINOR}" PARENT_SCOPE)
1479 set_property(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" 1481 "Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MAJOR" "${Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MAJOR}")
1482 set_property(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" 1484 "Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MINOR" "${Qt${PARAVIEW_QT_MAJOR_VERSION}Core_VERSION_MAJOR}")
1488 set(_paraview_add_plugin_python_sources)
1489 set(_paraview_add_plugin_python_includes)
1490 set(_paraview_add_plugin_python_modules)
1491 set(_paraview_add_plugin_python_module_sources)
1492 set(_paraview_add_plugin_python_package_flags)
1493 if (_paraview_add_plugin_PYTHON_MODULES)
1495 foreach (_paraview_add_plugin_python_module IN LISTS _paraview_add_plugin_PYTHON_MODULES)
1496 set(_paraview_add_plugin_python_path
1497 "${CMAKE_CURRENT_SOURCE_DIR}/${_paraview_add_plugin_python_module}")
1498 get_filename_component(_paraview_add_plugin_python_package
"${_paraview_add_plugin_python_module}" PATH)
1499 get_filename_component(_paraview_add_plugin_python_name
"${_paraview_add_plugin_python_module}" NAME_WE)
1500 if (_paraview_add_plugin_python_package)
1501 set(_paraview_add_plugin_python_full_name
1502 "${_paraview_add_plugin_python_package}.${_paraview_add_plugin_python_name}")
1504 set(_paraview_add_plugin_python_full_name
1505 "${_paraview_add_plugin_python_name}")
1507 string(REPLACE
"." "_" _paraview_add_plugin_python_module_mangled
"${_paraview_add_plugin_python_full_name}")
1508 set(_paraview_add_plugin_python_is_package 0)
1509 set(_paraview_add_plugin_python_import
1510 "${_paraview_add_plugin_python_full_name}")
1511 if (_paraview_add_plugin_python_name STREQUAL
"__init__")
1512 set(_paraview_add_plugin_python_is_package 1)
1513 set(_paraview_add_plugin_python_import
1514 "${_paraview_add_plugin_python_package}")
1516 set(_paraview_add_plugin_python_header_name
1517 "WrappedPython_${_paraview_build_plugin}_${_paraview_add_plugin_python_module_mangled}.h")
1518 set(_paraview_add_plugin_python_header
1519 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_add_plugin_python_header_name}")
1521 set(_paraview_add_plugin_python_depends_args)
1522 if (CMAKE_VERSION VERSION_GREATER_EQUAL
"3.27")
1523 list(APPEND _paraview_add_plugin_python_depends_args
1524 DEPENDS_EXPLICIT_ONLY)
1528 OUTPUT
"${_paraview_add_plugin_python_header}" 1529 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}
1530 "$<TARGET_FILE:ParaView::ProcessXML>" 1531 "${_paraview_add_plugin_python_header}" 1532 "module_${_paraview_add_plugin_python_module_mangled}_" 1535 "${_paraview_add_plugin_python_path}" 1536 DEPENDS
"${_paraview_add_plugin_python_path}" 1537 "$<TARGET_FILE:ParaView::ProcessXML>" 1538 COMMENT
"Convert Python module ${_paraview_add_plugin_python_module_name} for ${_paraview_build_plugin}" 1539 ${_paraview_add_plugin_python_depends_args})
1541 list(APPEND _paraview_add_plugin_python_sources
1542 "${_paraview_add_plugin_python_header}")
1543 string(APPEND _paraview_add_plugin_python_includes
1544 "#include \"${_paraview_add_plugin_python_header_name}\"\n")
1545 string(APPEND _paraview_add_plugin_python_modules
1546 " \"${_paraview_add_plugin_python_import}\",\n")
1547 string(APPEND _paraview_add_plugin_python_module_sources
1548 " module_${_paraview_add_plugin_python_module_mangled}_${_paraview_add_plugin_python_name}_source(),\n")
1549 string(APPEND _paraview_add_plugin_python_package_flags
1550 " ${_paraview_add_plugin_python_is_package},\n")
1553 # Add terminators to the list. 1554 string(APPEND _paraview_add_plugin_python_modules
1556 string(APPEND _paraview_add_plugin_python_module_sources
1558 string(APPEND _paraview_add_plugin_python_package_flags
1562 set(_paraview_add_plugin_header
1563 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_build_plugin}Plugin.h")
1564 set(_paraview_add_plugin_source
1565 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_build_plugin}Plugin.cxx")
1567 get_property(_paraview_add_plugin_description GLOBAL
1568 PROPERTY
"_paraview_plugin_${_paraview_build_plugin}_description")
1570 set(_paraview_build_plugin_type MODULE)
1573 set(_paraview_build_plugin_type STATIC)
1578 "${_paraview_plugin_source_dir}/paraview_plugin.h.in" 1579 "${_paraview_add_plugin_header}")
1581 "${_paraview_plugin_source_dir}/paraview_plugin.cxx.in" 1582 "${_paraview_add_plugin_source}")
1585 # On Windows, we want `MODULE` libraries to go to the runtime directory, 1586 # but CMake always uses `CMAKE_LIBRARY_OUTPUT_DIRECTORY`. 1587 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
1589 if (NOT _paraview_build_LIBRARY_SUBDIRECTORY STREQUAL
"")
1590 string(APPEND CMAKE_LIBRARY_OUTPUT_DIRECTORY
"/${_paraview_build_LIBRARY_SUBDIRECTORY}")
1592 string(APPEND CMAKE_LIBRARY_OUTPUT_DIRECTORY
"/${_paraview_build_plugin}")
1594 # Place static plugins in the same place they would be if they were shared. 1595 if (NOT _paraview_build_LIBRARY_SUBDIRECTORY STREQUAL
"")
1596 string(APPEND CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"/${_paraview_build_LIBRARY_SUBDIRECTORY}")
1598 string(APPEND CMAKE_ARCHIVE_OUTPUT_DIRECTORY
"/${_paraview_build_plugin}")
1600 add_library(
"${_paraview_build_plugin}" "${_paraview_build_plugin_type}")
1601 target_sources(
"${_paraview_build_plugin}" 1603 ${_paraview_add_plugin_source}
1604 ${_paraview_add_plugin_eula_sources}
1605 ${_paraview_add_plugin_ui_sources}
1606 ${_paraview_add_plugin_python_sources}
1607 ${_paraview_add_plugin_SOURCES})
1608 # Forward the file
set option internally.
1609 set(_vtk_build_USE_FILE_SETS
"${_paraview_build_USE_FILE_SETS}")
1610 _vtk_module_add_file_set(
"${_paraview_build_plugin}" 1611 NAME paraview_plugin_headers
1613 BASE_DIRS
"${CMAKE_CURRENT_BINARY_DIR}" 1614 FILES ${_paraview_add_plugin_header}
1615 ${_paraview_add_plugin_binary_headers})
1617 target_compile_definitions(
"${_paraview_build_plugin}" 1621 target_link_libraries(
"${_paraview_build_plugin}" 1623 ParaView::RemotingCore
1624 ${_paraview_add_plugin_required_libraries})
1625 target_include_directories(
"${_paraview_build_plugin}" 1627 "${CMAKE_CURRENT_SOURCE_DIR}" 1628 ${_paraview_add_plugin_extra_include_dirs})
1629 set_property(TARGET
"${_paraview_build_plugin}" 1633 set(_paraview_add_plugin_destination
1634 "${_paraview_build_plugin_destination}/${_paraview_build_plugin}")
1636 TARGETS
"${_paraview_build_plugin}" 1637 ${_paraview_add_plugin_export_args}
1638 COMPONENT
"${_paraview_build_PLUGINS_COMPONENT}" 1639 ARCHIVE DESTINATION
"${_paraview_add_plugin_destination}" 1640 LIBRARY DESTINATION
"${_paraview_add_plugin_destination}")
1644 ## Plugin interfaces 1646 ParaView plugins may satisfy a number of interfaces. These functions all take a
1647 `INTERFACES` argument which takes the name of a variable to
set with the name
1648 of the
interface generated. This variable's should be passed to
1649 `paraview_add_plugin`'s `UI_INTERFACES` argument.
1655 TODO: What is a
property widget?
1659 KIND <WIDGET|GROUP_WIDGET|WIDGET_DECORATOR>
1662 INTERFACES <variable>
1666 * `KIND`: The kind of widget represented.
1667 * `
TYPE`: The name of the
property type.
1668 * `CLASS_NAME`: The name of the
property widget
class.
1669 * `INTERFACES`: The name of the generated interface.
1670 * `SOURCES`: The
source files generated by the interface.
1673 cmake_parse_arguments(_paraview_property_widget
1675 "KIND;TYPE;CLASS_NAME;INTERFACES;SOURCES" 1679 if (_paraview_property_widget_UNPARSED_ARGUMENTS)
1681 "Unparsed arguments for paraview_plugin_add_property_widget: " 1682 "${_paraview_property_widget_UNPARSED_ARGUMENTS}")
1685 set(_paraview_property_widget_kind_widget 0)
1686 set(_paraview_property_widget_kind_group_widget 0)
1687 set(_paraview_property_widget_kind_widget_decorator 0)
1688 if (_paraview_property_widget_KIND STREQUAL
"WIDGET")
1689 set(_paraview_property_widget_kind_widget 1)
1690 elseif (_paraview_property_widget_KIND STREQUAL
"GROUP_WIDGET")
1691 set(_paraview_property_widget_kind_group_widget 1)
1692 elseif (_paraview_property_widget_KIND STREQUAL
"WIDGET_DECORATOR")
1693 set(_paraview_property_widget_kind_widget_decorator 1)
1696 "The `KIND` argument must be one of `WIDGET`, `GROUP_WIDGET`, or " 1697 "`WIDGET_DECORATOR`.")
1700 if (NOT DEFINED _paraview_property_widget_TYPE)
1702 "The `TYPE` argument is required.")
1705 if (NOT DEFINED _paraview_property_widget_CLASS_NAME)
1707 "The `CLASS_NAME` argument is required.")
1710 if (NOT DEFINED _paraview_property_widget_INTERFACES)
1712 "The `INTERFACES` argument is required.")
1715 if (NOT DEFINED _paraview_property_widget_SOURCES)
1717 "The `SOURCES` argument is required.")
1721 "${_ParaViewPlugin_cmake_dir}/pqPropertyWidgetInterface.h.in" 1722 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_property_widget_CLASS_NAME}PWIImplementation.h" 1725 "${_ParaViewPlugin_cmake_dir}/pqPropertyWidgetInterface.cxx.in" 1726 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_property_widget_CLASS_NAME}PWIImplementation.cxx" 1729 set(
"${_paraview_property_widget_INTERFACES}" 1730 "${_paraview_property_widget_CLASS_NAME}PWIImplementation" 1733 set(
"${_paraview_property_widget_SOURCES}" 1734 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_property_widget_CLASS_NAME}PWIImplementation.cxx" 1735 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_property_widget_CLASS_NAME}PWIImplementation.h" 1742 TODO: What is a dock window?
1747 [DOCK_AREA <Right|Left|Top|Bottom>]
1748 INTERFACES <variable>
1752 * `CLASS_NAME`: The name of the dock window
class.
1753 * `DOCK_AREA`: (Default `Left`) Where to dock the window within the
1755 * `INTERFACES`: The name of the generated interface.
1756 * `SOURCES`: The
source files generated by the interface.
1759 cmake_parse_arguments(_paraview_dock_window
1761 "DOCK_AREA;CLASS_NAME;INTERFACES;SOURCES" 1765 if (_paraview_dock_window_UNPARSED_ARGUMENTS)
1767 "Unparsed arguments for paraview_plugin_add_dock_window: " 1768 "${_paraview_dock_window_UNPARSED_ARGUMENTS}")
1771 if (NOT DEFINED _paraview_dock_window_CLASS_NAME)
1773 "The `CLASS_NAME` argument is required.")
1776 if (NOT DEFINED _paraview_dock_window_INTERFACES)
1778 "The `INTERFACES` argument is required.")
1781 if (NOT DEFINED _paraview_dock_window_SOURCES)
1783 "The `SOURCES` argument is required.")
1786 if (NOT DEFINED _paraview_dock_window_DOCK_AREA)
1787 set(_paraview_dock_window_DOCK_AREA
"Left")
1790 if (NOT _paraview_dock_window_DOCK_AREA STREQUAL
"Left" AND
1791 NOT _paraview_dock_window_DOCK_AREA STREQUAL
"Right" AND
1792 NOT _paraview_dock_window_DOCK_AREA STREQUAL
"Top" AND
1793 NOT _paraview_dock_window_DOCK_AREA STREQUAL
"Bottom")
1795 "`DOCK_AREA` must be one of `Left`, `Right`, `Top`, or `Bottom`. Got " 1796 "`${_paraview_dock_window_DOCK_AREA}`.")
1800 "${_ParaViewPlugin_cmake_dir}/pqDockWindowImplementation.h.in" 1801 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_dock_window_CLASS_NAME}Implementation.h" 1804 "${_ParaViewPlugin_cmake_dir}/pqDockWindowImplementation.cxx.in" 1805 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_dock_window_CLASS_NAME}Implementation.cxx" 1808 set(
"${_paraview_dock_window_INTERFACES}" 1809 "${_paraview_dock_window_CLASS_NAME}Implementation" 1812 set(
"${_paraview_dock_window_SOURCES}" 1813 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_dock_window_CLASS_NAME}Implementation.cxx" 1814 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_dock_window_CLASS_NAME}Implementation.h" 1821 TODO: What is an action group?
1827 INTERFACES <variable>
1831 * `CLASS_NAME`: The name of the action group
class.
1832 * `GROUP_NAME`: The name of the action group.
1833 * `INTERFACES`: The name of the generated interface.
1834 * `SOURCES`: The
source files generated by the interface.
1837 cmake_parse_arguments(_paraview_action_group
1839 "CLASS_NAME;GROUP_NAME;INTERFACES;SOURCES" 1843 if (_paraview_action_group_UNPARSED_ARGUMENTS)
1845 "Unparsed arguments for paraview_plugin_add_action_group: " 1846 "${_paraview_action_group_UNPARSED_ARGUMENTS}")
1849 if (NOT DEFINED _paraview_action_group_CLASS_NAME)
1851 "The `CLASS_NAME` argument is required.")
1854 if (NOT DEFINED _paraview_action_group_GROUP_NAME)
1856 "The `GROUP_NAME` argument is required.")
1859 if (NOT DEFINED _paraview_action_group_INTERFACES)
1861 "The `INTERFACES` argument is required.")
1864 if (NOT DEFINED _paraview_action_group_SOURCES)
1866 "The `SOURCES` argument is required.")
1870 "${_ParaViewPlugin_cmake_dir}/pqActionGroupImplementation.h.in" 1871 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_action_group_CLASS_NAME}Implementation.h" 1874 "${_ParaViewPlugin_cmake_dir}/pqActionGroupImplementation.cxx.in" 1875 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_action_group_CLASS_NAME}Implementation.cxx" 1878 set(
"${_paraview_action_group_INTERFACES}" 1879 "${_paraview_action_group_CLASS_NAME}Implementation" 1882 set(
"${_paraview_action_group_SOURCES}" 1883 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_action_group_CLASS_NAME}Implementation.cxx" 1884 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_action_group_CLASS_NAME}Implementation.h" 1891 TODO: What is a toolbar?
1896 INTERFACES <variable>
1900 * `CLASS_NAME`: The name of the toolbar
class.
1901 * `INTERFACES`: The name of the generated interface.
1902 * `SOURCES`: The
source files generated by the interface.
1905 cmake_parse_arguments(_paraview_toolbar
1907 "CLASS_NAME;INTERFACES;SOURCES" 1911 if (_paraview_toolbar_UNPARSED_ARGUMENTS)
1913 "Unparsed arguments for paraview_plugin_add_toolbar: " 1914 "${_paraview_toolbar_UNPARSED_ARGUMENTS}")
1917 if (NOT DEFINED _paraview_toolbar_CLASS_NAME)
1919 "The `CLASS_NAME` argument is required.")
1922 if (NOT DEFINED _paraview_toolbar_INTERFACES)
1924 "The `INTERFACES` argument is required.")
1927 if (NOT DEFINED _paraview_toolbar_SOURCES)
1929 "The `SOURCES` argument is required.")
1933 "${_ParaViewPlugin_cmake_dir}/pqToolBarImplementation.h.in" 1934 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_toolbar_CLASS_NAME}Implementation.h" 1937 "${_ParaViewPlugin_cmake_dir}/pqToolBarImplementation.cxx.in" 1938 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_toolbar_CLASS_NAME}Implementation.cxx" 1941 set(
"${_paraview_toolbar_INTERFACES}" 1942 "${_paraview_toolbar_CLASS_NAME}Implementation" 1945 set(
"${_paraview_toolbar_SOURCES}" 1946 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_toolbar_CLASS_NAME}Implementation.cxx" 1947 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_toolbar_CLASS_NAME}Implementation.h" 1954 TODO: What is an
auto start?
1959 [STARTUP <function>]
1960 [SHUTDOWN <function>]
1961 INTERFACES <variable>
1965 * `CLASS_NAME`: The name of the
auto start
class.
1966 * `STARTUP`: (Defaults to `startup`) The name of the method to call
on 1968 * `SHUTDOWN`: (Defaults to `shutdown`) The name of the method to call
on 1970 * `INTERFACES`: The name of the generated interface.
1971 * `SOURCES`: The
source files generated by the interface.
1974 cmake_parse_arguments(_paraview_auto_start
1976 "CLASS_NAME;INTERFACES;SOURCES;STARTUP;SHUTDOWN" 1980 if (_paraview_auto_start_UNPARSED_ARGUMENTS)
1982 "Unparsed arguments for paraview_plugin_add_auto_start: " 1983 "${_paraview_auto_start_UNPARSED_ARGUMENTS}")
1986 if (NOT DEFINED _paraview_auto_start_CLASS_NAME)
1988 "The `CLASS_NAME` argument is required.")
1991 if (NOT DEFINED _paraview_auto_start_INTERFACES)
1993 "The `INTERFACES` argument is required.")
1996 if (NOT DEFINED _paraview_auto_start_SOURCES)
1998 "The `SOURCES` argument is required.")
2001 if (NOT DEFINED _paraview_auto_start_STARTUP)
2002 set(_paraview_auto_start_STARTUP
"startup")
2005 if (NOT DEFINED _paraview_auto_start_SHUTDOWN)
2006 set(_paraview_auto_start_SHUTDOWN
"shutdown")
2010 "${_ParaViewPlugin_cmake_dir}/pqAutoStartImplementation.h.in" 2011 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_auto_start_CLASS_NAME}Implementation.h" 2014 "${_ParaViewPlugin_cmake_dir}/pqAutoStartImplementation.cxx.in" 2015 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_auto_start_CLASS_NAME}Implementation.cxx" 2018 set(
"${_paraview_auto_start_INTERFACES}" 2019 "${_paraview_auto_start_CLASS_NAME}Implementation" 2022 set(
"${_paraview_auto_start_SOURCES}" 2023 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_auto_start_CLASS_NAME}Implementation.cxx" 2024 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_auto_start_CLASS_NAME}Implementation.h" 2031 The filesystem
location of dynamically-loaded plugin.
2037 INTERFACES <variable>
2041 * `CLASS_NAME`: The name of the
location class.
2042 * `STORE`: (Defaults to `StoreLocation`) The name of the method to call
on 2043 startup, passing in the plugin
location (
const char*).
2044 * `INTERFACES`: The name of the generated interface.
2045 * `SOURCES`: The
source files generated by the interface.
2048 cmake_parse_arguments(_paraview_location
2050 "CLASS_NAME;INTERFACES;SOURCES;STORE" 2054 if (_paraview_location_UNPARSED_ARGUMENTS)
2056 "Unparsed arguments for paraview_plugin_add_location: " 2057 "${_paraview_location_UNPARSED_ARGUMENTS}")
2060 if (NOT DEFINED _paraview_location_CLASS_NAME)
2062 "The `CLASS_NAME` argument is required.")
2065 if (NOT DEFINED _paraview_location_INTERFACES)
2067 "The `INTERFACES` argument is required.")
2070 if (NOT DEFINED _paraview_location_SOURCES)
2072 "The `SOURCES` argument is required.")
2075 if (NOT DEFINED _paraview_location_STORE)
2076 set(_paraview_location_STORE
"StoreLocation")
2080 "${_ParaViewPlugin_cmake_dir}/pqPluginLocationImplementation.h.in" 2081 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_location_CLASS_NAME}Implementation.h" 2084 "${_ParaViewPlugin_cmake_dir}/pqPluginLocationImplementation.cxx.in" 2085 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_location_CLASS_NAME}Implementation.cxx" 2088 set(
"${_paraview_location_INTERFACES}" 2089 "${_paraview_location_CLASS_NAME}Implementation" 2092 set(
"${_paraview_location_SOURCES}" 2093 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_location_CLASS_NAME}Implementation.cxx" 2094 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_location_CLASS_NAME}Implementation.h" 2099 ### Tree layout strategy 2101 TODO: What is a tree layout strategy?
2105 STRATEGY_TYPE <type>
2106 STRATEGY_LABEL <label>
2107 INTERFACES <variable>
2111 * `STRATEGY_TYPE`: The name of the tree layout strategy
class.
2112 * `STRATEGY_LABEL`: The label to use
for the strategy.
2113 * `INTERFACES`: The name of the generated interface.
2114 * `SOURCES`: The
source files generated by the interface.
2117 cmake_parse_arguments(_paraview_tree_layout_strategy
2119 "INTERFACES;SOURCES;STRATEGY_TYPE;STRATEGY_LABEL" 2123 if (_paraview_tree_layout_strategy_UNPARSED_ARGUMENTS)
2125 "Unparsed arguments for paraview_plugin_add_tree_layout_strategy: " 2126 "${_paraview_tree_layout_strategy_UNPARSED_ARGUMENTS}")
2129 if (NOT DEFINED _paraview_tree_layout_strategy_STRATEGY_TYPE)
2131 "The `STRATEGY_TYPE` argument is required.")
2134 if (NOT DEFINED _paraview_tree_layout_strategy_STRATEGY_LABEL)
2136 "The `STRATEGY_LABEL` argument is required.")
2139 if (NOT DEFINED _paraview_tree_layout_strategy_INTERFACES)
2141 "The `INTERFACES` argument is required.")
2144 if (NOT DEFINED _paraview_tree_layout_strategy_SOURCES)
2146 "The `SOURCES` argument is required.")
2150 "${_ParaViewPlugin_cmake_dir}/pqTreeLayoutStrategyImplementation.h.in" 2151 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_tree_layout_strategy_STRATEGY_TYPE}Implementation.h" 2154 "${_ParaViewPlugin_cmake_dir}/pqTreeLayoutStrategyImplementation.cxx.in" 2155 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_tree_layout_strategy_STRATEGY_TYPE}Implementation.cxx" 2158 set(
"${_paraview_tree_layout_strategy_INTERFACES}" 2159 "${_paraview_tree_layout_strategy_STRATEGY_TYPE}Implementation" 2162 set(
"${_paraview_tree_layout_strategy_SOURCES}" 2163 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_tree_layout_strategy_STRATEGY_TYPE}Implementation.cxx" 2164 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_tree_layout_strategy_STRATEGY_TYPE}Implementation.h" 2171 TODO: What is a proxy?
2176 INTERFACES <variable>
2179 [CLASS_NAME <class>]
2181 <XML_NAME|XML_NAME_REGEX> <name>]...)
2184 * `
NAME`: The name of the proxy.
2185 * `INTERFACES`: The name of the generated interface.
2186 * `SOURCES`: The
source files generated by the interface.
2188 At least one `PROXY_TYPE` must be specified. Each proxy
type must be given an
2189 `XML_GROUP` and either an `XML_NAME` or `XML_NAME_REGEX`. If `CLASS_NAME` is
2190 not given, the `PROXY_TYPE` name is used instead.
2193 cmake_parse_arguments(_paraview_proxy
2195 "INTERFACES;SOURCES;NAME" 2199 if (NOT DEFINED _paraview_proxy_INTERFACES)
2201 "The `INTERFACES` argument is required.")
2204 if (NOT DEFINED _paraview_proxy_SOURCES)
2206 "The `SOURCES` argument is required.")
2209 if (NOT DEFINED _paraview_proxy_NAME)
2211 "The `NAME` argument is required.")
2214 set(_paraview_proxy_parse
"")
2215 set(_paraview_proxy_type)
2216 set(_paraview_proxy_types)
2217 foreach (_paraview_proxy_arg IN LISTS _paraview_proxy_UNPARSED_ARGUMENTS)
2218 if (_paraview_proxy_parse STREQUAL
"")
2219 set(_paraview_proxy_parse
"${_paraview_proxy_arg}")
2220 elseif (_paraview_proxy_parse STREQUAL
"PROXY_TYPE")
2221 set(_paraview_proxy_type
"${_paraview_proxy_arg}")
2222 list(APPEND _paraview_proxy_types
"${_paraview_proxy_type}")
2223 set(_paraview_proxy_parse
"")
2224 elseif (_paraview_proxy_parse STREQUAL
"CLASS_NAME")
2225 if (NOT _paraview_proxy_type)
2227 "Missing `PROXY_TYPE` for `CLASS_NAME`")
2229 if (DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_class_name")
2231 "Duplicate `CLASS_NAME` for `${_paraview_proxy_type}`")
2233 set(
"_paraview_proxy_type_${_paraview_proxy_type}_class_name" 2234 "${_paraview_proxy_arg}")
2235 set(_paraview_proxy_parse
"")
2236 elseif (_paraview_proxy_parse STREQUAL
"XML_GROUP")
2237 if (NOT _paraview_proxy_type)
2239 "Missing `PROXY_TYPE` for `XML_GROUP`")
2241 if (DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_group")
2243 "Duplicate `XML_GROUP` for `${_paraview_proxy_type}`")
2245 set(
"_paraview_proxy_type_${_paraview_proxy_type}_xml_group" 2246 "${_paraview_proxy_arg}")
2247 set(_paraview_proxy_parse
"")
2248 elseif (_paraview_proxy_parse STREQUAL
"XML_NAME")
2249 if (NOT _paraview_proxy_type)
2251 "Missing `PROXY_TYPE` for `XML_NAME`")
2253 if (DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name" OR
2254 DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name_regex")
2256 "Duplicate `XML_NAME` or `XML_NAME_REGEX` for `${_paraview_proxy_type}`")
2258 set(
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name" 2259 "${_paraview_proxy_arg}")
2260 set(_paraview_proxy_parse
"")
2261 elseif (_paraview_proxy_parse STREQUAL
"XML_NAME_REGEX")
2262 if (NOT _paraview_proxy_type)
2264 "Missing `PROXY_TYPE` for `XML_NAME_REGEX`")
2266 if (DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name" OR
2267 DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name_regex")
2269 "Duplicate `XML_NAME` or `XML_NAME_REGEX` for `${_paraview_proxy_type}`")
2271 set(
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name_regex" 2272 "${_paraview_proxy_arg}")
2273 set(_paraview_proxy_parse
"")
2276 "Unknown argument `${_paraview_proxy_parse}`")
2280 if (_paraview_proxy_parse)
2282 "Missing argument for `${_paraview_proxy_parse}`")
2285 if (NOT _paraview_proxy_types)
2287 "No `PROXY_TYPE` arguments given")
2290 set(_paraview_proxy_includes)
2291 set(_paraview_proxy_body)
2292 foreach (_paraview_proxy_type IN LISTS _paraview_proxy_types)
2293 if (NOT DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_group")
2295 "Missing `XML_GROUP` for `${_paraview_proxy_type}`")
2297 if (NOT DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name" AND
2298 NOT DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name_regex")
2300 "Missing `XML_NAME` or `XML_NAME_REGEX` for `${_paraview_proxy_type}`")
2302 if (DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_class_name")
2303 set(_paraview_proxy_class
2304 "${_paraview_proxy_type_${_paraview_proxy_type}_class_name}")
2306 set(_paraview_proxy_class
2307 "${_paraview_proxy_type}")
2310 set(_paraview_proxy_group
"${_paraview_proxy_type_${_paraview_proxy_type}_xml_group}")
2311 if (DEFINED
"_paraview_proxy_type_${_paraview_proxy_type}_xml_name")
2312 set(_paraview_proxy_name
"${_paraview_proxy_type_${_paraview_proxy_type}_xml_name}")
2313 set(_paraview_proxy_name_type
"QString")
2314 set(_paraview_proxy_cmp
"name == proxy->GetXMLName()")
2316 set(_paraview_proxy_name
"${_paraview_proxy_type_${_paraview_proxy_type}_xml_name_regex}")
2317 set(_paraview_proxy_name_type
"QRegularExpression")
2318 set(_paraview_proxy_cmp
"QString(proxy->GetXMLName()).contains(name)")
2321 if (NOT DEFINED
"_paraview_proxy_included_${_paraview_proxy_class}")
2322 string(APPEND _paraview_proxy_includes
2323 "#include \"${_paraview_proxy_class}.h\"\n")
2324 set(
"_paraview_proxy_included_${_paraview_proxy_class}" 1)
2326 string(APPEND _paraview_proxy_body
2328 static const QString group(\"${_paraview_proxy_group}\"); 2329 static const ${_paraview_proxy_name_type} name(\"${_paraview_proxy_name}\"); 2330 if (group == proxy->GetXMLGroup() && ${_paraview_proxy_cmp}) 2332 return new ${_paraview_proxy_class}(regGroup, regName, proxy, server, nullptr); 2338 "${_ParaViewPlugin_cmake_dir}/pqServerManagerModelImplementation.h.in" 2339 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_proxy_NAME}ServerManagerModelImplementation.h" 2342 "${_ParaViewPlugin_cmake_dir}/pqServerManagerModelImplementation.cxx.in" 2343 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_proxy_NAME}ServerManagerModelImplementation.cxx" 2346 set(
"${_paraview_proxy_INTERFACES}" 2347 "${_paraview_proxy_NAME}ServerManagerModelImplementation" 2350 set(
"${_paraview_proxy_SOURCES}" 2351 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_proxy_NAME}ServerManagerModelImplementation.cxx" 2352 "${CMAKE_CURRENT_BINARY_DIR}/${_paraview_proxy_NAME}ServerManagerModelImplementation.h"
#define _paraview_add_plugin_with_ui
function paraview_plugin_scan()
.md Scanning plugins
function paraview_add_plugin(name)
.md Adding a plugin
#define _paraview_add_plugin_with_initializers
#define _paraview_add_plugin_with_xml
function paraview_plugin_add_dock_window()
.md Dock window
function vtk_module_wrap_client_server()
.md Wrapping a set of VTK modules for ClientServer
function paraview_server_manager_process_files()
.md The second way to process XML files directly.
function paraview_plugin_add_location()
.md Location
function paraview_client_documentation()
.md Documentation from XML files
function paraview_plugin_add_toolbar()
.md Toolbar
#define _paraview_add_plugin_built_shared
function paraview_client_generate_help()
.md Generating help documentation
function paraview_plugin_add_auto_start()
.md Auto start
function paraview_plugin_add_action_group()
.md Action group
std::string replace(std::string source, const std::string &search, const std::string &replace, bool all)
function paraview_server_manager_process()
.md Building XML files
function paraview_plugin_build()
.md Building plugins
function paraview_plugin_add_tree_layout_strategy()
.md Tree layout strategy
#define BUILD_SHARED_LIBS
function paraview_plugin_write_conf()
.md Plugin configuration files
function paraview_plugin_add_proxy()
.md Proxy
function _paraview_plugin_debug(domain, format)
.md ParaView Plugin CMake API
#define _paraview_add_plugin_with_python
function paraview_plugin_add_property_widget()
.md Plugin interfaces