From bb43dbe270976e6c1aa037d47e16f27e13d407d6 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 11 Jun 2024 09:25:32 +0100 Subject: [PATCH] PVReaders: Fix for older versions of ParaView in which Qt major version is not defined --- .../graphics/PVReaders/PVFoamReader/CMakeLists.txt | 5 +++++ .../graphics/PVReaders/PVFoamReader/vtk/CMakeLists.txt | 4 ++++ .../graphics/PVReaders/PVblockMeshReader/CMakeLists.txt | 5 +++++ .../graphics/PVReaders/PVblockMeshReader/vtk/CMakeLists.txt | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt index eeaaa7e6ee..6eb97f9ce6 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt @@ -81,6 +81,11 @@ IF(${ParaView_VERSION} VERSION_LESS 5.5) OpenFOAM ) ELSE() + # Assume QT version 5 if it hasn't been defined + IF(NOT PARAVIEW_QT_MAJOR_VERSION) + set(PARAVIEW_QT_MAJOR_VERSION 5) + ENDIF() + # Paraview-5.5.x and higher needs QT libraries listed in the link command # in order for the headers to be available TARGET_LINK_LIBRARIES( diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtk/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtk/CMakeLists.txt index 364ab0772a..46da964c3d 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtk/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtk/CMakeLists.txt @@ -6,6 +6,10 @@ SET_TARGET_PROPERTIES( LIBRARY_OUTPUT_DIRECTORY "$ENV{PV_PLUGIN_PATH}" ) +IF(NOT PARAVIEW_QT_MAJOR_VERSION) + set(PARAVIEW_QT_MAJOR_VERSION 5) +ENDIF() + TARGET_LINK_LIBRARIES( PVFoamReader_VTK LINK_PUBLIC diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt index 9de9eba5ab..9562721d62 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt @@ -79,6 +79,11 @@ IF(${ParaView_VERSION} VERSION_LESS 5.5) OpenFOAM ) ELSE() + # Assume QT version 5 if it hasn't been defined + IF(NOT PARAVIEW_QT_MAJOR_VERSION) + set(PARAVIEW_QT_MAJOR_VERSION 5) + ENDIF() + # Paraview-5.5.x and higher needs QT libraries listed in the link command # in order for the headers to be available TARGET_LINK_LIBRARIES( diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtk/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtk/CMakeLists.txt index 021cef7842..bebe08798e 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtk/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtk/CMakeLists.txt @@ -6,6 +6,10 @@ SET_TARGET_PROPERTIES( LIBRARY_OUTPUT_DIRECTORY "$ENV{PV_PLUGIN_PATH}" ) +IF(NOT PARAVIEW_QT_MAJOR_VERSION) + set(PARAVIEW_QT_MAJOR_VERSION 5) +ENDIF() + TARGET_LINK_LIBRARIES( PVblockMeshReader_VTK LINK_PUBLIC