From dc499e25a96d36532329ddb35333ea0514ee08c1 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Mon, 14 May 2018 09:01:18 +0100 Subject: [PATCH] PVReaders: Fixes to compilation against ParaView-5.5.0 --- .../PVReaders/PVFoamReader/CMakeLists.txt | 36 ++++++++++++------- .../PVblockMeshReader/CMakeLists.txt | 36 ++++++++++++------- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt index cf97676a5b..bc8d45484d 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt @@ -22,8 +22,7 @@ ADD_DEFINITIONS( -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE} ) - -# Set output library destination to plugin directory +# Set the output library destination to the plugin directory SET( LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH} CACHE INTERNAL @@ -32,7 +31,7 @@ SET( # Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of # version 4.1.? this is no longer needed. -IF("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) +IF(${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} VERSION_LESS 4.1) ADD_PARAVIEW_PLUGIN( PVFoamReader_SM "1.0" @@ -49,13 +48,24 @@ ELSE() ) ENDIF() -# Build the client-side plugin -TARGET_LINK_LIBRARIES( - PVFoamReader_SM - LINK_PUBLIC - vtkPVFoam - finiteVolume - OpenFOAM -) - -#----------------------------------------------------------------------------- +# Build the client-side plugin. Paraview-5.5.? needs QT-5 libraries listed in +# the link command in order for the headers to be available. +IF(${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} VERSION_LESS 5.5) + TARGET_LINK_LIBRARIES( + PVFoamReader_SM + LINK_PUBLIC + vtkPVFoam + finiteVolume + OpenFOAM + ) +ELSE() + TARGET_LINK_LIBRARIES( + PVFoamReader_SM + LINK_PUBLIC + vtkPVFoam + finiteVolume + OpenFOAM + Qt5::Core + Qt5::Gui + ) +ENDIF() diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt index 3e850ff897..f56a61ee29 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt @@ -1,5 +1,5 @@ # Set up the environment -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) @@ -12,7 +12,6 @@ LINK_DIRECTORIES( INCLUDE_DIRECTORIES( $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude - $ENV{WM_PROJECT_DIR}/src/meshing/blockMesh/lnInclude ${PROJECT_SOURCE_DIR}/../vtkPVblockMesh ) @@ -31,12 +30,12 @@ SET( # Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of # version 4.1.? this is no longer needed. -IF("${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}" EQUAL 4.0) +IF(${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} VERSION_LESS 4.1) ADD_PARAVIEW_PLUGIN( PVblockMeshReader_SM "1.0" SERVER_MANAGER_XML PVblockMeshReader_SM.xml - SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx + SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx GUI_RESOURCE_FILES PVblockMeshReader.xml ) ELSE() @@ -44,15 +43,26 @@ ELSE() PVblockMeshReader_SM "1.0" SERVER_MANAGER_XML PVblockMeshReader_SM.xml - SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx + SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx ) ENDIF() -# Build the client-side plugin -TARGET_LINK_LIBRARIES( - PVblockMeshReader_SM - LINK_PUBLIC - vtkPVblockMesh - blockMesh - OpenFOAM -) +# Build the client-side plugin. Paraview-5.5.? needs QT-5 libraries listed in +# the link command in order for the headers to be available. +IF(${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} VERSION_LESS 5.5) + TARGET_LINK_LIBRARIES( + PVblockMeshReader_SM + LINK_PUBLIC + vtkPVblockMesh + OpenFOAM + ) +ELSE() + TARGET_LINK_LIBRARIES( + PVblockMeshReader_SM + LINK_PUBLIC + vtkPVblockMesh + OpenFOAM + Qt5::Core + Qt5::Gui + ) +ENDIF()