PVReaders: Fixes to compilation against ParaView-5.5.0

This commit is contained in:
Will Bainbridge
2018-05-14 09:01:18 +01:00
parent 5cca0a119a
commit dc499e25a9
2 changed files with 46 additions and 26 deletions

View File

@ -22,8 +22,7 @@ ADD_DEFINITIONS(
-DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE} -DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
) )
# Set the output library destination to the plugin directory
# Set output library destination to plugin directory
SET( SET(
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH} LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
CACHE INTERNAL CACHE INTERNAL
@ -32,7 +31,7 @@ SET(
# Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of # Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of
# version 4.1.? this is no longer needed. # 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( ADD_PARAVIEW_PLUGIN(
PVFoamReader_SM PVFoamReader_SM
"1.0" "1.0"
@ -49,13 +48,24 @@ ELSE()
) )
ENDIF() ENDIF()
# Build the client-side plugin # Build the client-side plugin. Paraview-5.5.? needs QT-5 libraries listed in
TARGET_LINK_LIBRARIES( # 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 PVFoamReader_SM
LINK_PUBLIC LINK_PUBLIC
vtkPVFoam vtkPVFoam
finiteVolume finiteVolume
OpenFOAM OpenFOAM
) )
ELSE()
#----------------------------------------------------------------------------- TARGET_LINK_LIBRARIES(
PVFoamReader_SM
LINK_PUBLIC
vtkPVFoam
finiteVolume
OpenFOAM
Qt5::Core
Qt5::Gui
)
ENDIF()

View File

@ -1,5 +1,5 @@
# Set up the environment # Set up the environment
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
FIND_PACKAGE(ParaView REQUIRED) FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE}) INCLUDE(${PARAVIEW_USE_FILE})
@ -12,7 +12,6 @@ LINK_DIRECTORIES(
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
$ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
$ENV{WM_PROJECT_DIR}/src/meshing/blockMesh/lnInclude
${PROJECT_SOURCE_DIR}/../vtkPVblockMesh ${PROJECT_SOURCE_DIR}/../vtkPVblockMesh
) )
@ -31,7 +30,7 @@ SET(
# Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of # Add the plugin. ParaView-4.0.? requires a GUI_RESOURCE_FILES XML file. As of
# version 4.1.? this is no longer needed. # 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( ADD_PARAVIEW_PLUGIN(
PVblockMeshReader_SM PVblockMeshReader_SM
"1.0" "1.0"
@ -48,11 +47,22 @@ ELSE()
) )
ENDIF() ENDIF()
# Build the client-side plugin # Build the client-side plugin. Paraview-5.5.? needs QT-5 libraries listed in
TARGET_LINK_LIBRARIES( # 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 PVblockMeshReader_SM
LINK_PUBLIC LINK_PUBLIC
vtkPVblockMesh vtkPVblockMesh
blockMesh
OpenFOAM OpenFOAM
) )
ELSE()
TARGET_LINK_LIBRARIES(
PVblockMeshReader_SM
LINK_PUBLIC
vtkPVblockMesh
OpenFOAM
Qt5::Core
Qt5::Gui
)
ENDIF()