]> SALOME platform Git repositories - modules/paravis.git/blob - adm_local/unix/config_files/check_ParaView.m4
Salome HOME
EDF: Support for PVSRCHOME and PVINSTALLHOME env. variables added
[modules/paravis.git] / adm_local / unix / config_files / check_ParaView.m4
1 dnl  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 dnl 
4 dnl  This library is free software; you can redistribute it and/or 
5 dnl  modify it under the terms of the GNU Lesser General Public 
6 dnl  License as published by the Free Software Foundation; either 
7 dnl  version 2.1 of the License. 
8 dnl 
9 dnl  This library is distributed in the hope that it will be useful, 
10 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 dnl  Lesser General Public License for more details. 
13 dnl 
14 dnl  You should have received a copy of the GNU Lesser General Public 
15 dnl  License along with this library; if not, write to the Free Software 
16 dnl  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 dnl 
18 dnl  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 dnl
20 dnl
21 dnl
22
23 dnl
24 dnl  OPTIONS_PARAVIEW
25 dnl  ------------------------------------------------------------------------
26 dnl  Adds the --with-paraview=path 
27 dnl
28 AC_DEFUN([OPTIONS_PARAVIEW], [
29   AC_ARG_WITH([paraview],
30               [AC_HELP_STRING([--with-paraview], [The prefix where ParaView is located (default "" means taking from PVHOME environment variable)])],
31               [with_paraview=$withval], [with_paraview=""])
32 ])
33
34 dnl
35 dnl  CHECK_PARAVIEW
36 dnl  ------------------------------------------------------------------------
37 dnl  a simplified check that assumes VTK is a part of ParaView, separate location 
38 dnl  for VTK is not supported
39 dnl
40 AC_DEFUN([CHECK_PARAVIEW], [
41 AC_REQUIRE([AC_PROG_CC])dnl
42 AC_REQUIRE([AC_PROG_CXX])dnl
43 AC_REQUIRE([AC_PROG_CPP])dnl
44 AC_REQUIRE([AC_PROG_CXXCPP])dnl
45 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
46
47 AC_REQUIRE([OPTIONS_PARAVIEW])dnl
48
49 AC_CHECKING(for ParaView)
50
51 AC_LANG_SAVE
52 AC_LANG_CPLUSPLUS
53
54 AC_SUBST(PARAVIEW_INCLUDES)
55 AC_SUBST(PARAVIEW_LIBS)
56 dnl AC_SUBST(VTKPY_MODULES)
57
58 PARAVIEW_INCLUDES=""
59 PARAVIEW_LIBS=""
60 dnl VTKPY_MODULES=""
61
62 paraview_ok=no
63
64 if test "x$OpenGL_ok" != "xyes" ; then
65    AC_MSG_WARN(ParaView needs OpenGL correct configuration, check configure output)
66 fi
67
68
69 if test "x$qt_ok" != "xyes" ; then
70    AC_MSG_WARN(ParaView needs Qt correct configuration, check configure output)
71 fi
72
73 AC_PATH_X
74 if test "x$x_libraries" != "x"
75 then
76    LXLIB="-L$x_libraries"
77 else
78    LXLIB=""
79 fi
80
81 if test "x$x_libraries" = "x/usr/lib"
82 then
83    LXLIB=""
84 fi
85
86 if test "x$x_libraries" = "x/usr/lib${LIB_LOCATION_SUFFIX}"
87 then
88    LXLIB=""
89 fi
90
91 LOCAL_INCLUDES="$OGL_INCLUDES"
92 LOCAL_LIBS="-lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc -lvtkhdf5 -lvtklibxml2 -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lvtkClientServer -lvtkCommonCS -lvtkFilteringCS -lvtkIOCS -lvtkImagingCS -lvtkGraphicsCS -lvtkGenericFiltering -lvtkGenericFilteringCS -lvtkRenderingCS -lvtkHybridCS -lvtkParallelCS -lvtkPVCommandOptions -lKWCommon -lvtkInfovis -lvtkInfovisCS -lvtkPVServerCommon -lvtkPVServerCommonCS -lvtkCommonPythonD -lvtkFilteringPythonD -lvtkIOPythonD -lXdmf -lvtkXdmf -lvtkXdmfCS -lvtkWidgetsCS -lvtkVolumeRendering -lvtkVolumeRenderingCS -lvtkPVFilters -lvtkPVFiltersCS -lvtkViews -lvtkPVServerManagerPythonD -lvtkPVServerCommonPythonD -lvtkPVPythonInterpretor -lvtkPVServerManager -lQVTK -lpqWidgets -lQtTesting -lQtChart -lpqCore -lQtPython -lpqComponents $LXLIB -lX11 -lXt"
93 TRY_LINK_LIBS="$LOCAL_LIBS"
94
95 dnl VTK install dir
96 if test -z $with_paraview ; then
97   with_paraview=""
98 fi
99 if test "x$with_paraview" = "xyes" ; then
100   dnl in case user wrote --with-paraview=yes
101   with_paraview=""
102 fi
103 if test "x$with_paraview" = "xno" ; then
104   dnl in case user wrote --with-paraview=no
105   with_paraview=""
106   AC_MSG_WARN(Value "no", specified for option --with-paraview, is not supported)
107 fi
108
109 if test "x$with_paraview" != "x" ; then
110   PVHOME="$with_paraview"
111 fi
112
113 if test -z $PVSRCHOME ; then
114   if test -z $PVHOME ; then
115     AC_MSG_WARN(undefined PVHOME and PVSRCHOME variables which specify where ParaView is located)
116   else 
117     PVSRCHOME="$PVHOME/src"
118   fi
119 fi
120
121 if test -z $PVINSTALLHOME ; then
122   if test -z $PVHOME ; then
123     AC_MSG_WARN(undefined PVHOME and PVINSTALLHOME variables which specify where ParaView is located)
124   else
125     PVINSTALLHOME="$PVHOME/bin"
126   fi
127 fi
128     
129 LOCAL_INCLUDES="-I$PVSRCHOME/VTK/Common -I$PVSRCHOME/Qt/Core -I$PVSRCHOME/Qt/Components -I$PVSRCHOME/Servers/Filters -I$PVSRCHOME/Servers/Common -I$PVSRCHOME/Servers/Filters -I$PVSRCHOME/Servers/ServerManager -I$PVSRCHOME/Utilities/VTKClientServer -I$PVSRCHOME/VTK/Filtering -I$PVSRCHOME/VTK/GenericFiltering -I$PVSRCHOME/VTK/Graphics -I$PVSRCHOME/VTK/Hybrid -I$PVSRCHOME/VTK/Imaging -I$PVSRCHOME/VTK/Infovis -I$PVSRCHOME/VTK/IO -I$PVSRCHOME/VTK/Parallel -I$PVSRCHOME/VTK/Rendering -I$PVSRCHOME/VTK/Utilities -I$PVSRCHOME/VTK/Views -I$PVSRCHOME/VTK/VolumeRendering -I$PVSRCHOME/VTK/Widgets -I$PVINSTALLHOME/Qt/Core -I$PVINSTALLHOME/Qt/Components -I$PVINSTALLHOME/Utilities/VTKClientServer -I$PVINSTALLHOME/Servers/Common -I$PVINSTALLHOME/Servers/Filters -I$PVINSTALLHOME/Servers/ServerManager -I$PVINSTALLHOME/VTK -I$PVINSTALLHOME/VTK/Common -I$PVINSTALLHOME/VTK/Filtering -I$PVINSTALLHOME/VTK/GenericFiltering -I$PVINSTALLHOME/VTK/Graphics -I$PVINSTALLHOME/VTK/Hybrid -I$PVINSTALLHOME/VTK/Imaging -I$PVINSTALLHOME/VTK/Infovis -I$PVINSTALLHOME/VTK/IO -I$PVINSTALLHOME/VTK/Parallel -I$PVINSTALLHOME/VTK/Rendering -I$PVINSTALLHOME/VTK/Utilities -I$PVINSTALLHOME/VTK/Views -I$PVINSTALLHOME/VTK/VolumeRendering -I$PVINSTALLHOME/VTK/Widgets $LOCAL_INCLUDES"
130
131 #LOCAL_LIBS="-L$PVINSTALLHOME/bin -lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc -licet -licet_mpi -licet_strategies $LOCAL_LIBS"
132
133 TRY_LINK_LIBS="-L$PVINSTALLHOME/bin -lvtksys $TRY_LINK_LIBS"
134
135 dnl vtk headers
136 CPPFLAGS_old="$CPPFLAGS"
137 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES $QT_INCLUDES"
138
139 AC_CHECK_HEADER(pqApplicationCore.h,paraview_ok="yes",paraview_ok="no")
140
141 CPPFLAGS="$CPPFLAGS_old"
142
143 if test "x$paraview_ok" = "xyes"
144 then
145    PARAVIEW_INCLUDES="$LOCAL_INCLUDES"
146
147    dnl vtk libraries
148
149    AC_MSG_CHECKING(linking ParaView component library)
150
151    LIBS_old="$LIBS"
152    LIBS="$LIBS $QT_LIBS $TRY_LINK_LIBS"
153    CPPFLAGS_old="$CPPFLAGS"
154    CPPFLAGS="$CPPFLAGS $QT_INCLUDES $PARAVIEW_INCLUDES"
155
156    dnl VTKPY_MODULES="$VTKHOME/python"
157
158    AC_CACHE_VAL(salome_cv_lib_paraview,[
159      AC_TRY_LINK([#include "pqApplicationCore.h"
160                  ],
161                  [pqApplicationCore::instance()],
162                  [salome_cv_lib_paraview=yes],
163                  [salome_cv_lib_paraview=no])
164    ])
165    paraview_ok="$salome_cv_lib_paraview"
166    LIBS="$LIBS_old"
167    CPPFLAGS="$CPPFLAGS_old"
168 fi
169
170 if  test "x$paraview_ok" = "xno"
171 then
172   AC_MSG_RESULT(no)
173   AC_MSG_WARN(unable to link with ParaView component library)
174 else
175   AC_MSG_RESULT(yes)
176   PARAVIEW_LIBS="$LOCAL_LIBS"
177 fi
178
179 AC_MSG_RESULT(for ParaView: $paraview_ok)
180
181 AC_LANG_RESTORE
182
183 # Save cache
184 AC_CACHE_SAVE
185
186 ])dnl