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
# Cleanup libraries
wclean libso foamPv
wclean libso vtkPVblockMesh
wclean libso vtkPVFoam
wclean libso blockMeshReader/library
wclean libso foamReader/library
# Cleanup client-server and/or combined plugins
rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null
......
......@@ -17,13 +17,28 @@ if have_pvplugin_support
then
(
wmakeLibPv foamPv
wmakeLibPv vtkPVblockMesh
wmakeLibPv vtkPVFoam
wmakeLibPv blockMeshReader/library
wmakeLibPv foamReader/library
unset cmakeType
if [ "$targetType" != objects ]
then
cmakePv $PWD/PVblockMeshReader || warnIncomplete "BlockMesh"
cmakePv $PWD/PVFoamReader || warnIncomplete "OpenFOAM"
case "$PARAVIEW_API" in
(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
......
#-----------------------------------------------------------------------------
# OpenFOAM blockMeshDict reader plugin for ParaView GUI
# OpenFOAM blockMeshDict reader plugin for ParaView GUI (pre-5.7)
link_directories(
$ENV{FOAM_LIBBIN}
......@@ -11,10 +11,12 @@ include_directories(
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
${LIB_SRC}/meshing/blockMesh/lnInclude
${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
blockMesh
)
......@@ -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
TYPE "openfoam_blockMesh_general_controls"
......@@ -36,23 +38,24 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
add_paraview_plugin(
PVblockMeshReader_SM "1.0"
SERVER_MANAGER_XML PVblockMeshReader_SM.xml
SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx
SERVER_MANAGER_XML
plugin/PVblockMeshReader_SM.xml
SERVER_MANAGER_SOURCES
plugin/reader/vtkPVblockMeshReader.cxx
GUI_INTERFACES
${IFACES0}
SOURCES
${IFACES0_SRCS}
${MOC_SRCS}
pqFoamBlockMeshControls.cxx
plugin/pqFoamBlockMeshControls.cxx
)
target_link_libraries(
PVblockMeshReader_SM
LINK_PUBLIC
vtkPVblockMesh-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
${OPENFOAM_LIBRARIES}
foamPv${foamPvLibQualifier}
vtkPVblockMesh${foamPvLibQualifier}
${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()
# Simple discovery and sanity checks
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()
set(foamPvLibQualifier "-pv${pv_api}")
message("OpenFOAM libraries qualified with ${foamPvLibQualifier}")
#-----------------------------------------------------------------------------
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 = \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \
-I$(PARAVIEW_INC_DIR) \
-I$(PARAVIEW_INC_DIR)/vtkkwiml \
-I../foamPv \
-I../PVblockMeshReader
-I../../foamPv \
-I../plugin/reader
LIB_LIBS = \
-lmeshTools \
......
#-----------------------------------------------------------------------------
# OpenFOAM reader plugin for ParaView GUI
# OpenFOAM reader plugin for ParaView GUI (pre-5.7)
link_directories(
$ENV{FOAM_LIBBIN}
......@@ -14,15 +14,17 @@ include_directories(
${LIB_SRC}/finiteArea/lnInclude
${LIB_SRC}/finiteVolume/lnInclude
${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
finiteVolume
finiteArea
fileFormats
conversion
finiteArea
finiteVolume
)
# Set output library destination to plugin directory
......@@ -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
TYPE "openfoam_reader_general_controls"
......@@ -42,23 +44,25 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
add_paraview_plugin(
PVFoamReader_SM "1.0"
SERVER_MANAGER_XML PVFoamReader_SM.xml
SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx
SERVER_MANAGER_XML
plugin/PVFoamReader_SM.xml
SERVER_MANAGER_SOURCES
plugin/reader/vtkPVFoamReader.cxx
GUI_INTERFACES
${IFACES0}
SOURCES
${IFACES0_SRCS}
${MOC_SRCS}
pqFoamReaderControls.cxx
plugin/pqFoamReaderControls.cxx
)
target_link_libraries(
PVFoamReader_SM
LINK_PUBLIC
vtkPVFoam-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
foamPv-pv${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}
${OPENFOAM_LIBRARIES}
foamPv${foamPvLibQualifier}
vtkPVFoam${foamPvLibQualifier}
${OPENFOAM_LIBNAMES}
)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# OpenFOAM reader plugin for ParaView GUI (5.7+)
message(FATAL_ERROR "paraview-${pv_api} not yet supported")
#-----------------------------------------------------------------------------
......@@ -13,13 +13,37 @@ endif()
# Simple discovery and sanity checks
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()
set(foamPvLibQualifier "-pv${pv_api}")
message("OpenFOAM libraries qualified with ${foamPvLibQualifier}")
#-----------------------------------------------------------------------------
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 = \
${c++LESSWARN} \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/conversion/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/dynamicMesh/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)/vtkkwiml \
-I../foamPv \
-I../PVFoamReader
-I../../foamPv \
-I../plugin/reader
LIB_LIBS = \
-lfileFormats \
-lconversion \
-lmeshTools \
-lfiniteVolume \
-lfiniteArea \
-ldynamicMesh \
-lconversion \
-lgenericPatchFields \
-llagrangian \
-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