File size: 2,364 Bytes
5a600cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh
cd ${0%/*} || exit 1    # Run from this directory

# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments

if [ "$ParaView_TYPE" = "none" ]
then
    exit 0
fi

if [ -z "$PV_PLUGIN_PATH" ]
then
    echo "    Warning: ParaView not found. Not building PVReaders."
    exit 0
fi

# Ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"

# Configure (but no need to build) the dummy project
(
    cd PVdummy
    mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
    cd Make/$WM_OPTIONS
    touch .cpp
    cmake ../..
)

# Use the makefiles from the project to set the definitions and include paths
# for the ParaView and VTK-dependent OpenFOAM libraries
export ParaView_DEFINES="$(
    cd PVdummy/Make/$WM_OPTIONS && \
    make --file=CMakeFiles/PVdummy.dir/build.make --eval="print-variable:
	@echo \$(CXX_DEFINES)")"
export ParaView_INCLUDES="$(
    cd PVdummy/Make/$WM_OPTIONS && \
    make --file=CMakeFiles/PVdummy.dir/build.make --eval="print-variable:
	@echo \$(CXX_INCLUDES)")"

# Test for polyhedron support and set flags accordingly
echo \#include \"vtkPolyhedron.h\" | \
    "$WM_CC" $ParaView_INCLUDES $ParaView_DEFINES -xc++ -E - > /dev/null 2>&1 && \
    export ParaView_DEFINES="$ParaView_DEFINES -DHAS_VTK_POLYHEDRON" || \
    export ParaView_DEFINES="$ParaView_DEFINES -UHAS_VTK_POLYHEDRON"

# Build the ParaView and VTK-dependent OpenFOAM libraries
wmake $targetType vtkPVblockMesh
wmake $targetType vtkPVFoam

# Build the ParaView module libraries
if [ "$targetType" != "objects" ]
then
    if $WM_PROJECT_DIR/bin/tools/foamVersionCompare $ParaView_VERSION ge 5.7.0
    then
        (
            mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
            cd Make/$WM_OPTIONS
            cmake ../..
            make -j $WM_NCOMPPROCS
        )
    else
        (
            cd PVblockMeshReader
            mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
            cd Make/$WM_OPTIONS
            cmake ../..
            make -j $WM_NCOMPPROCS
        )
        (
            cd PVFoamReader
            mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
            cd Make/$WM_OPTIONS
            cmake ../..
            make -j $WM_NCOMPPROCS
        )
    fi
fi

#------------------------------------------------------------------------------