Commit 832ce59e authored by Mark Olesen's avatar Mark Olesen

COMP: restructure paraview reader files, add paraview-5.7 guards

- building plugins with paraview-5.7 is quite different
parent 0054b9f4
...@@ -4,8 +4,8 @@ cd ${0%/*} || exit 1 # Run from this directory ...@@ -4,8 +4,8 @@ cd ${0%/*} || exit 1 # Run from this directory
# Cleanup libraries # Cleanup libraries
wclean libso foamPv wclean libso foamPv
wclean libso vtkPVblockMesh wclean libso blockMeshReader/library
wclean libso vtkPVFoam wclean libso foamReader/library
# Cleanup client-server and/or combined plugins # Cleanup client-server and/or combined plugins
rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null
......
...@@ -17,13 +17,28 @@ if have_pvplugin_support ...@@ -17,13 +17,28 @@ if have_pvplugin_support
then then
( (
wmakeLibPv foamPv wmakeLibPv foamPv
wmakeLibPv vtkPVblockMesh wmakeLibPv blockMeshReader/library
wmakeLibPv vtkPVFoam wmakeLibPv foamReader/library
unset cmakeType
if [ "$targetType" != objects ] if [ "$targetType" != objects ]
then then
cmakePv $PWD/PVblockMeshReader || warnIncomplete "BlockMesh" case "$PARAVIEW_API" in
cmakePv $PWD/PVFoamReader || warnIncomplete "OpenFOAM" (5.[0-6])
cmakeType="cmakePv"
;;
(*)
# cmakeType="cmakePvInstall"
warnIncomplete "(unknown/unsupported version: $PARAVIEW_API)"
;;
esac
fi
if [ -n "$cmakeType" ]
then
"$cmakeType" $PWD/blockMeshReader || warnIncomplete "blockMesh"
"$cmakeType" $PWD/foamReader || warnIncomplete "OpenFOAM"
fi fi
) )
fi fi
......
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# OpenFOAM blockMeshDict reader plugin for ParaView GUI # OpenFOAM blockMeshDict reader plugin for ParaView GUI (pre-5.7)
link_directories( link_directories(
$ENV{FOAM_LIBBIN} $ENV{FOAM_LIBBIN}
...@@ -11,10 +11,12 @@ include_directories( ...@@ -11,10 +11,12 @@ include_directories(
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude ${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/meshing/blockMesh/lnInclude ${LIB_SRC}/meshing/blockMesh/lnInclude
${PROJECT_SOURCE_DIR}/../foamPv ${PROJECT_SOURCE_DIR}/../foamPv
${PROJECT_SOURCE_DIR}/../vtkPVblockMesh ${PROJECT_SOURCE_DIR}/library
${PROJECT_SOURCE_DIR}/plugin
${PROJECT_SOURCE_DIR}/plugin/reader
) )
set(OPENFOAM_LIBRARIES set(OPENFOAM_LIBNAMES
OpenFOAM OpenFOAM
blockMesh blockMesh
) )
...@@ -27,7 +29,7 @@ set( ...@@ -27,7 +29,7 @@ set(
) )
qt5_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h) qt5_wrap_cpp(MOC_SRCS plugin/pqFoamBlockMeshControls.h)
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_blockMesh_general_controls" TYPE "openfoam_blockMesh_general_controls"
...@@ -36,23 +38,24 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS ...@@ -36,23 +38,24 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
add_paraview_plugin( add_paraview_plugin(
PVblockMeshReader_SM "1.0" PVblockMeshReader_SM "1.0"
SERVER_MANAGER_XML PVblockMeshReader_SM.xml SERVER_MANAGER_XML
SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx plugin/PVblockMeshReader_SM.xml
SERVER_MANAGER_SOURCES
plugin/reader/vtkPVblockMeshReader.cxx
GUI_INTERFACES GUI_INTERFACES
${IFACES0} ${IFACES0}
SOURCES SOURCES
${IFACES0_SRCS} ${IFACES0_SRCS}
${MOC_SRCS} ${MOC_SRCS}
pqFoamBlockMeshControls.cxx plugin/pqFoamBlockMeshControls.cxx
) )
target_link_libraries( target_link_libraries(
PVblockMeshReader_SM PVblockMeshReader_SM
LINK_PUBLIC LINK_PUBLIC
vtkPVblockMesh-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} foamPv${foamPvLibQualifier}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} vtkPVblockMesh${foamPvLibQualifier}
${OPENFOAM_LIBRARIES} ${OPENFOAM_LIBNAMES}
) )
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# OpenFOAM blockMeshDict reader plugin for ParaView GUI (5.7+)
message(FATAL_ERROR "paraview-${pv_api} not yet supported")
#-----------------------------------------------------------------------------
...@@ -13,13 +13,37 @@ endif() ...@@ -13,13 +13,37 @@ endif()
# Simple discovery and sanity checks # Simple discovery and sanity checks
find_package(ParaView REQUIRED) find_package(ParaView REQUIRED)
if (PARAVIEW_USE_FILE)
include(${PARAVIEW_USE_FILE}) # Qualify OpenFOAM/ParaView libraries with -pvMAJ.MIN
# The pv_api can also be used for paraview-MAJ.MIN
if (DEFINED ENV{PARAVIEW_API})
set(pv_api "$ENV{PARAVIEW_API}")
else()
if (${ParaView_VERSION} GREATER_EQUAL 5.7)
string(REGEX MATCH [0-9]+[.][0-9]+ pv_api ${ParaView_VERSION})
message("The PARAVIEW_API env was unset, "
"extracted value from version="
"${ParaView_VERSION} is ${pv_api}")
else()
set(pv_api "${PARAVIEW_VERSION_MAJOR}.${ParaView_VERSION_MINOR}")
message("The PARAVIEW_API env was unset, "
"assembled from maj/min="
"${ParaView_VERSION_MAJOR}/${ParaView_VERSION_MINOR} is ${pv_api}")
endif()
endif() endif()
set(foamPvLibQualifier "-pv${pv_api}")
message("OpenFOAM libraries qualified with ${foamPvLibQualifier}")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
include(CMakeLists-OpenFOAM.txt) include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-Project.txt)
if (${ParaView_VERSION} GREATER_EQUAL 5.7)
include(CMakeLists-Project57.txt)
else()
include(${PARAVIEW_USE_FILE})
include(CMakeLists-Project.txt)
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
...@@ -6,8 +6,8 @@ EXE_INC = \ ...@@ -6,8 +6,8 @@ EXE_INC = \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \ -I$(LIB_SRC)/mesh/blockMesh/lnInclude \
-I$(PARAVIEW_INC_DIR) \ -I$(PARAVIEW_INC_DIR) \
-I$(PARAVIEW_INC_DIR)/vtkkwiml \ -I$(PARAVIEW_INC_DIR)/vtkkwiml \
-I../foamPv \ -I../../foamPv \
-I../PVblockMeshReader -I../plugin/reader
LIB_LIBS = \ LIB_LIBS = \
-lmeshTools \ -lmeshTools \
......
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# OpenFOAM reader plugin for ParaView GUI # OpenFOAM reader plugin for ParaView GUI (pre-5.7)
link_directories( link_directories(
$ENV{FOAM_LIBBIN} $ENV{FOAM_LIBBIN}
...@@ -14,15 +14,17 @@ include_directories( ...@@ -14,15 +14,17 @@ include_directories(
${LIB_SRC}/finiteArea/lnInclude ${LIB_SRC}/finiteArea/lnInclude
${LIB_SRC}/finiteVolume/lnInclude ${LIB_SRC}/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../foamPv ${PROJECT_SOURCE_DIR}/../foamPv
${PROJECT_SOURCE_DIR}/../vtkPVFoam ${PROJECT_SOURCE_DIR}/library
${PROJECT_SOURCE_DIR}/plugin
${PROJECT_SOURCE_DIR}/plugin/reader
) )
set(OPENFOAM_LIBRARIES set(OPENFOAM_LIBNAMES
OpenFOAM OpenFOAM
finiteVolume
finiteArea
fileFormats fileFormats
conversion conversion
finiteArea
finiteVolume
) )
# Set output library destination to plugin directory # Set output library destination to plugin directory
...@@ -33,7 +35,7 @@ set( ...@@ -33,7 +35,7 @@ set(
) )
qt5_wrap_cpp(MOC_SRCS pqFoamReaderControls.h) qt5_wrap_cpp(MOC_SRCS plugin/pqFoamReaderControls.h)
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_reader_general_controls" TYPE "openfoam_reader_general_controls"
...@@ -42,23 +44,25 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS ...@@ -42,23 +44,25 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
add_paraview_plugin( add_paraview_plugin(
PVFoamReader_SM "1.0" PVFoamReader_SM "1.0"
SERVER_MANAGER_XML PVFoamReader_SM.xml SERVER_MANAGER_XML
SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx plugin/PVFoamReader_SM.xml
SERVER_MANAGER_SOURCES
plugin/reader/vtkPVFoamReader.cxx
GUI_INTERFACES GUI_INTERFACES
${IFACES0} ${IFACES0}
SOURCES SOURCES
${IFACES0_SRCS} ${IFACES0_SRCS}
${MOC_SRCS} ${MOC_SRCS}
pqFoamReaderControls.cxx plugin/pqFoamReaderControls.cxx
) )
target_link_libraries( target_link_libraries(
PVFoamReader_SM PVFoamReader_SM
LINK_PUBLIC LINK_PUBLIC
vtkPVFoam-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} foamPv${foamPvLibQualifier}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR} vtkPVFoam${foamPvLibQualifier}
${OPENFOAM_LIBRARIES} ${OPENFOAM_LIBNAMES}
) )
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# OpenFOAM reader plugin for ParaView GUI (5.7+)
message(FATAL_ERROR "paraview-${pv_api} not yet supported")
#-----------------------------------------------------------------------------
...@@ -13,13 +13,37 @@ endif() ...@@ -13,13 +13,37 @@ endif()
# Simple discovery and sanity checks # Simple discovery and sanity checks
find_package(ParaView REQUIRED) find_package(ParaView REQUIRED)
if (PARAVIEW_USE_FILE)
include(${PARAVIEW_USE_FILE}) # Qualify OpenFOAM/ParaView libraries with -pvMAJ.MIN
# The pv_api can also be used for paraview-MAJ.MIN
if (DEFINED ENV{PARAVIEW_API})
set(pv_api "$ENV{PARAVIEW_API}")
else()
if (${ParaView_VERSION} GREATER_EQUAL 5.7)
string(REGEX MATCH [0-9]+[.][0-9]+ pv_api ${ParaView_VERSION})
message("The PARAVIEW_API env was unset, "
"extracted value from version="
"${ParaView_VERSION} is ${pv_api}")
else()
set(pv_api "${PARAVIEW_VERSION_MAJOR}.${ParaView_VERSION_MINOR}")
message("The PARAVIEW_API env was unset, "
"assembled from maj/min="
"${ParaView_VERSION_MAJOR}/${ParaView_VERSION_MINOR} is ${pv_api}")
endif()
endif() endif()
set(foamPvLibQualifier "-pv${pv_api}")
message("OpenFOAM libraries qualified with ${foamPvLibQualifier}")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
include(CMakeLists-OpenFOAM.txt) include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-Project.txt)
if (${ParaView_VERSION} GREATER_EQUAL 5.7)
include(CMakeLists-Project57.txt)
else()
include(${PARAVIEW_USE_FILE})
include(CMakeLists-Project.txt)
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
EXE_INC = \ EXE_INC = \
${c++LESSWARN} \ ${c++LESSWARN} \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/conversion/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \ -I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/conversion/lnInclude \
-I$(PARAVIEW_INC_DIR) \ -I$(PARAVIEW_INC_DIR) \
-I$(PARAVIEW_INC_DIR)/vtkkwiml \ -I$(PARAVIEW_INC_DIR)/vtkkwiml \
-I../foamPv \ -I../../foamPv \
-I../PVFoamReader -I../plugin/reader
LIB_LIBS = \ LIB_LIBS = \
-lfileFormats \
-lconversion \
-lmeshTools \
-lfiniteVolume \
-lfiniteArea \ -lfiniteArea \
-ldynamicMesh \ -ldynamicMesh \
-lconversion \
-lgenericPatchFields \ -lgenericPatchFields \
-llagrangian \ -llagrangian \
-L$(FOAM_LIBBIN) -lfoamPv-pv${PARAVIEW_API} \ -L$(FOAM_LIBBIN) -lfoamPv-pv${PARAVIEW_API} \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment