From 713595f0c024fee5d08b22d9bab58c80985b738a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 11 Nov 2019 11:21:45 +0100 Subject: [PATCH] COMP: adjust common paraview library name to vtkPVFoamCommon - similar prefixing as the dependent readers, making it easier to identify - add FOAM_API information as server module version --- .../postProcessing/graphics/PVReaders/Allwclean | 2 +- .../postProcessing/graphics/PVReaders/Allwmake | 2 +- .../blockMeshReader/CMakeLists-Project.txt | 6 +++--- .../PVReaders/blockMeshReader/CMakeLists.txt | 15 ++++++++++++++- .../blockMeshReader/library/Make/options | 4 ++-- .../graphics/PVReaders/common/Make/files | 3 +++ .../PVReaders/{foamPv => common}/Make/options | 0 .../PVReaders/{foamPv => common}/foamPvCore.C | 0 .../PVReaders/{foamPv => common}/foamPvCore.H | 0 .../{foamPv => common}/foamPvCoreTemplates.C | 0 .../graphics/PVReaders/foamPv/Make/files | 3 --- .../PVReaders/foamReader/CMakeLists-Project.txt | 7 +++---- .../graphics/PVReaders/foamReader/CMakeLists.txt | 13 ++++++++++++- .../PVReaders/foamReader/library/Make/options | 4 ++-- 14 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 applications/utilities/postProcessing/graphics/PVReaders/common/Make/files rename applications/utilities/postProcessing/graphics/PVReaders/{foamPv => common}/Make/options (100%) rename applications/utilities/postProcessing/graphics/PVReaders/{foamPv => common}/foamPvCore.C (100%) rename applications/utilities/postProcessing/graphics/PVReaders/{foamPv => common}/foamPvCore.H (100%) rename applications/utilities/postProcessing/graphics/PVReaders/{foamPv => common}/foamPvCoreTemplates.C (100%) delete mode 100644 applications/utilities/postProcessing/graphics/PVReaders/foamPv/Make/files diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean index fed57adbdd..e44f07aaa5 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean @@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory get_pvplugin_api || echo "No ParaView plugin information found" 1>&2 # Cleanup libraries -wclean libso foamPv +wclean libso common wclean libso blockMeshReader/library wclean libso foamReader/library diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake index 4e9cccfdb6..c81120f893 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake @@ -15,7 +15,7 @@ warnIncomplete() if have_pvplugin_support then ( - wmakeLibPv foamPv + wmakeLibPv common wmakeLibPv blockMeshReader/library wmakeLibPv foamReader/library diff --git a/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists-Project.txt b/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists-Project.txt index f8b8e457d8..a86eb41adf 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists-Project.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists-Project.txt @@ -10,7 +10,7 @@ include_directories( ${LIB_SRC}/OpenFOAM/lnInclude ${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude ${LIB_SRC}/meshing/blockMesh/lnInclude - ${PROJECT_SOURCE_DIR}/../foamPv + ${PROJECT_SOURCE_DIR}/../common ${PROJECT_SOURCE_DIR}/library ${PROJECT_SOURCE_DIR}/plugin ${PROJECT_SOURCE_DIR}/plugin/reader @@ -37,7 +37,7 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS ) add_paraview_plugin( - PVblockMeshReader_SM "1.0" + PVblockMeshReader_SM "${foam_api}" SERVER_MANAGER_XML plugin/PVblockMeshReader_SM.xml SERVER_MANAGER_SOURCES @@ -53,7 +53,7 @@ add_paraview_plugin( target_link_libraries( PVblockMeshReader_SM LINK_PUBLIC - foamPv${foamPvLibQualifier} + vtkPVFoamCommon${foamPvLibQualifier} vtkPVblockMesh${foamPvLibQualifier} ${OPENFOAM_LIBNAMES} ) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists.txt index 9062310502..77d67c73da 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/CMakeLists.txt @@ -32,16 +32,29 @@ else() endif() endif() +# Pass through the OpenFOAM API value to the reader +set(foam_api "$ENV{FOAM_API}") +if (NOT "${foam_api}") + set(foam_api "2.0") +endif() + set(foamPvLibQualifier "-pv${pv_api}") -message("OpenFOAM libraries qualified with ${foamPvLibQualifier}") + +#----------------------------------------------------------------------------- + +message("================") +message("Using ParaView = $ENV{ParaView_DIR}") +message("OpenFOAM api = ${foam_api}, libs = ${foamPvLibQualifier}") #----------------------------------------------------------------------------- include(CMakeLists-OpenFOAM.txt) if (${ParaView_VERSION} GREATER_EQUAL 5.7) + message("================") include(CMakeLists-Project57.txt) else() + message("================") include(${PARAVIEW_USE_FILE}) include(CMakeLists-Project.txt) endif() diff --git a/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/library/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/library/Make/options index f6b311335e..a3bafe7090 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/library/Make/options +++ b/applications/utilities/postProcessing/graphics/PVReaders/blockMeshReader/library/Make/options @@ -6,11 +6,11 @@ EXE_INC = \ -I$(LIB_SRC)/mesh/blockMesh/lnInclude \ -I$(PARAVIEW_INC_DIR) \ -I$(PARAVIEW_INC_DIR)/vtkkwiml \ - -I../../foamPv \ + -I../../common \ -I../plugin/reader LIB_LIBS = \ -lmeshTools \ -lblockMesh \ - -L$(FOAM_LIBBIN) -lfoamPv-pv${PARAVIEW_API} \ + -L$(FOAM_LIBBIN) -lvtkPVFoamCommon-pv${PARAVIEW_API} \ $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/common/Make/files b/applications/utilities/postProcessing/graphics/PVReaders/common/Make/files new file mode 100644 index 0000000000..8710846366 --- /dev/null +++ b/applications/utilities/postProcessing/graphics/PVReaders/common/Make/files @@ -0,0 +1,3 @@ +foamPvCore.C + +LIB = $(FOAM_LIBBIN)/libvtkPVFoamCommon-pv${PARAVIEW_API} diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamPv/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/common/Make/options similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/foamPv/Make/options rename to applications/utilities/postProcessing/graphics/PVReaders/common/Make/options diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCore.C b/applications/utilities/postProcessing/graphics/PVReaders/common/foamPvCore.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCore.C rename to applications/utilities/postProcessing/graphics/PVReaders/common/foamPvCore.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCore.H b/applications/utilities/postProcessing/graphics/PVReaders/common/foamPvCore.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCore.H rename to applications/utilities/postProcessing/graphics/PVReaders/common/foamPvCore.H diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCoreTemplates.C b/applications/utilities/postProcessing/graphics/PVReaders/common/foamPvCoreTemplates.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/foamPv/foamPvCoreTemplates.C rename to applications/utilities/postProcessing/graphics/PVReaders/common/foamPvCoreTemplates.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamPv/Make/files b/applications/utilities/postProcessing/graphics/PVReaders/foamPv/Make/files deleted file mode 100644 index f3fb1b8d07..0000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/foamPv/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -foamPvCore.C - -LIB = $(FOAM_LIBBIN)/libfoamPv-pv${PARAVIEW_API} diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists-Project.txt b/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists-Project.txt index c3bf5d129f..a3ad24b3b9 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists-Project.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists-Project.txt @@ -13,7 +13,7 @@ include_directories( ${LIB_SRC}/conversion/lnInclude ${LIB_SRC}/finiteArea/lnInclude ${LIB_SRC}/finiteVolume/lnInclude - ${PROJECT_SOURCE_DIR}/../foamPv + ${PROJECT_SOURCE_DIR}/../common ${PROJECT_SOURCE_DIR}/library ${PROJECT_SOURCE_DIR}/plugin ${PROJECT_SOURCE_DIR}/plugin/reader @@ -43,7 +43,7 @@ add_paraview_property_group_widget(IFACES0 IFACES0_SRCS ) add_paraview_plugin( - PVFoamReader_SM "1.0" + PVFoamReader_SM "${foam_api}" SERVER_MANAGER_XML plugin/PVFoamReader_SM.xml SERVER_MANAGER_SOURCES @@ -56,11 +56,10 @@ add_paraview_plugin( plugin/pqFoamReaderControls.cxx ) - target_link_libraries( PVFoamReader_SM LINK_PUBLIC - foamPv${foamPvLibQualifier} + vtkPVFoamCommon${foamPvLibQualifier} vtkPVFoam${foamPvLibQualifier} ${OPENFOAM_LIBNAMES} ) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists.txt index 9062310502..8acb2d6128 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/foamReader/CMakeLists.txt @@ -32,16 +32,27 @@ else() endif() endif() +# Pass through the OpenFOAM API value to the reader +set(foam_api "$ENV{FOAM_API}") +if (NOT "${foam_api}") + set(foam_api "2.0") +endif() + set(foamPvLibQualifier "-pv${pv_api}") -message("OpenFOAM libraries qualified with ${foamPvLibQualifier}") #----------------------------------------------------------------------------- +message("================") +message("Using ParaView = $ENV{ParaView_DIR}") +message("OpenFOAM api = ${foam_api}, libs = ${foamPvLibQualifier}") + include(CMakeLists-OpenFOAM.txt) if (${ParaView_VERSION} GREATER_EQUAL 5.7) + message("================") include(CMakeLists-Project57.txt) else() + message("================") include(${PARAVIEW_USE_FILE}) include(CMakeLists-Project.txt) endif() diff --git a/applications/utilities/postProcessing/graphics/PVReaders/foamReader/library/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/foamReader/library/Make/options index 7315fd9d1f..0e6f37d864 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/foamReader/library/Make/options +++ b/applications/utilities/postProcessing/graphics/PVReaders/foamReader/library/Make/options @@ -9,7 +9,7 @@ EXE_INC = \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(PARAVIEW_INC_DIR) \ -I$(PARAVIEW_INC_DIR)/vtkkwiml \ - -I../../foamPv \ + -I../../common \ -I../plugin/reader LIB_LIBS = \ @@ -21,5 +21,5 @@ LIB_LIBS = \ -ldynamicMesh \ -lgenericPatchFields \ -llagrangian \ - -L$(FOAM_LIBBIN) -lfoamPv-pv${PARAVIEW_API} \ + -L$(FOAM_LIBBIN) -lvtkPVFoamCommon-pv${PARAVIEW_API} \ $(GLIBS)