vcpkg/ports/paraview/qt_plugin.patch
Alexander Neumann 03766d0834
[CGNS/ParaView] Add new ports (#9960)
* [cgns] add port cgns

* [paraview] add new port

* [paraview] correct dependencies; disable catalyst

* [VTK/ParaView] Make ParaView build

* [paraview] add missing patch

* [paraview] add cgns patch

* [paraview] add qt plugin patches back in. Remove in the future

* [vtk] slightly improved patches

* [vtk] don't disable findPython

* [paraview] add more features

* [paraview] remove X11Extras from OSX

* [vtk] make vtk workcorrectly with python and prepare for paraview with python

* [paraview] Python fixes

* [paraview] small bin -> lib replacement fix for static builds

* [vtk] fix patch path

* update baseline to exclude paraview for the time being on osx and linux.
requires a fix in qt5-base linkage of libpq.

* [paraview]try setting LD_LIBRARY_PATH for unix systems

* [paraview] a bit of cleanup

* update baseline

* fix typo in baseline

* [paraview] remove unnecessary patch

* [vtk] replace custom patch with upstream patch

* [paraview] cleanup in the portfile.

* Update ports/paraview/CONTROL

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2020-06-23 10:20:18 -07:00

51 lines
1.8 KiB
Diff

diff --git a/Qt/Widgets/CMakeLists.txt b/Qt/Widgets/CMakeLists.txt
index 93000c493..5f2a06752 100644
--- a/Qt/Widgets/CMakeLists.txt
+++ b/Qt/Widgets/CMakeLists.txt
@@ -139,17 +139,43 @@ set(CMAKE_AUTORCC 1)
set(CMAKE_AUTOUIC 1)
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/Resources/UI")
+##
+if(NOT PARAVIEW_BUILD_SHARED_LIBS) # Should be a check if Qt is built statically and not ParaView
+ list(APPEND qt_components Svg Sql) # added due to svg rescources, sql due to VTK::GUISupportQtSQL
+ set(qt_plugin_list)
+ foreach(qt_component ${qt_components})
+ list(APPEND qt_plugin_list ${Qt5${qt_component}_PLUGINS})
+ message(STATUS "QtPlugin List: ${qt_plugin_list}")
+ endforeach()
+ set(qt_plugin_source "${CMAKE_CURRENT_BINARY_DIR}/qt_static_plugins.cxx")
+ if(EXISTS "${qt_plugin_source}")
+ file(REMOVE "${qt_plugin_source}")
+ endif()
+ set(qt_source_text "#include <QtPlugin>\n")
+ set(qt_source_text "#ifdef QT_STATIC\n")
+ foreach(qt_plugin ${qt_plugin_list})
+ STRING(REGEX REPLACE "[^:]+::" "" qt_plugin_name "${qt_plugin}")
+ message(STATUS "RAW PLUGIN NAME: ${qt_plugin_name}")
+ string(APPEND qt_source_text " Q_IMPORT_PLUGIN(${qt_plugin_name})\n")
+ endforeach()
+ string(APPEND qt_source_text "#endif\n")
+ file(WRITE "${qt_plugin_source}" "${qt_source_text}")
+endif()
+##
+
vtk_module_add_module(ParaView::pqWidgets
CLASSES ${classes}
SOURCES ${ui_files}
- ${resource_files})
+ ${resource_files}
+ ${qt_plugin_source})
vtk_module_link(ParaView::pqWidgets
PUBLIC
Qt5::Core
Qt5::Gui
Qt5::Widgets
PRIVATE
- Qt5::Network)
+ Qt5::Network
+ ${qt_plugin_list})
if (APPLE)
vtk_module_link(ParaView::pqWidgets