set vpath "VPATH = @srcdir@ ${dir}: "
set make ""
set phony ".PHONY:"
+ set AllVTKToolkits {}
foreach theModule $lesmodules {
set units [osutils:tk:sort [$theModule:toolkits]]
set units [concat $units [OS:executable $theModule]]
append amstring "${theModule}_PKGS ="
append vpath "\\\n"
+ set VTKToolkitsIndexs [lsearch -regexp -nocase -all $units ".*vtk.*"]
+ set VTKToolkits {}
+ if { "$VTKToolkitsIndexs" != "" } {
+ foreach vtktk [lreverse $VTKToolkitsIndexs] {
+ lappend VTKToolkits [lindex $units $vtktk]
+ set units [lreplace $units $vtktk $vtktk]
+ }
+ }
foreach unit $units {
append amstring " ${unit}"
append vpath "${dir}/${unit}: "
}
+ if {[llength $VTKToolkits]} {
+ append amstring "\nif HAVE_VTK\n"
+ append amstring " ${theModule}_PKGS +="
+ foreach vtktk $VTKToolkits {
+ append amstring " $vtktk"
+ lappend AllVTKToolkits $vtktk
+ }
+ append amstring "\nendif"
+ }
set up ${theModule}
if { [info procs ${theModule}:alias] != "" } {
set up [${theModule}:alias]
append phony " ${theModule}"
}
append amstring "$subdirs\n\n"
- append amstring "$vpath\n\n"
+ append amstring "$vpath\n"
+ if {[llength $AllVTKToolkits]} {
+ append amstring "\nif HAVE_VTK\n"
+ append amstring " VPATH +="
+ foreach vtktk $AllVTKToolkits {
+ append amstring " ${dir}/$vtktk:"
+ }
+ append amstring "\nendif\n"
+ }
+ append amstring "\n"
append amstring $make
append amstring $phony
wokUtils:FILES:StringToFile $amstring [set fmam [file join $dir Makefile.am]]
append confstr " fi\n"
}
foreach dep $acdeplist {
- append confstr " if test \"xyes\" = \"x\$ENABLE_${up}\" -a \"xyes\" != \"x\$HAVE_${dep}\"; then\n"
- append confstr " AC_MSG_NOTICE(\[Disabling ${theModule}: ${dep} not found\])\n"
- append confstr " DISABLE_${up}_REASON=\"(${dep} not found)\"\n"
- append confstr " ENABLE_${up}=no\n"
- append confstr " fi\n"
+ if { "${dep}" != "VTK" } {
+ append confstr " if test \"xyes\" = \"x\$ENABLE_${up}\" -a \"xyes\" != \"x\$HAVE_${dep}\"; then\n"
+ append confstr " AC_MSG_NOTICE(\[Disabling ${theModule}: ${dep} not found\])\n"
+ append confstr " DISABLE_${up}_REASON=\"(${dep} not found)\"\n"
+ append confstr " ENABLE_${up}=no\n"
+ append confstr " fi\n"
+ }
}
if { [llength $deplist] > 0 || [llength $acdeplist] > 0 } {
append confstr "else\n"
if test "xno$vtk_inc" = "xno"; then
# user specified --without-vtk-lib
- HAVE_VTK=no
HAVE_VTK_INC=no
- DISABLE_VTK_REASON_INC="(--with-vtk-include=DIR option was not defined)"
+ DISABLE_VTK_REASON="(--with-vtk-include=DIR option was not defined)"
else
CSF_VTK_INCLUDES=""
AC_LANG([C++])
HAVE_VTK_INC=yes
if test ! -d $vtk_inc; then
- DISABLE_VTK_REASON_INC="($vtk_inc directory does not exists)"
+ DISABLE_VTK_REASON="($vtk_inc directory does not exists)"
AC_MSG_ERROR([$vtk_inc directory does not exists])
+ elif test ! -f $vtk_inc/vtkVersion.h; then
+ DISABLE_VTK_REASON="(vtk headers are not found in $vtk_inc)"
+ AC_MSG_ERROR([vtk headers are not found in $vtk_inc])
elif test "x$vtk_inc" != "x"; then
CPPFLAGS="-I$vtk_inc $CPPFLAGS";
else
- AC_MSG_NOTICE("--with-vtk-include key is not defined")
+ HAVE_VTK_INC=no
+ DISABLE_VTK_REASON="(--with-vtk-include=DIR option was not defined)"
+ AC_MSG_NOTICE("--with-vtk-include=DIR option was not defined")
fi
fi
if test "xno" = "xno$vtk_lib"; then
# user specified --without-vtk
HAVE_VTK=no
- DISABLE_VTK_REASON_LIB="(--with-vtk-library=DIR option was not defined)"
+ if test "x$DISABLE_VTK_REASON" = "x" ; then
+ DISABLE_VTK_REASON="(--with-vtk-library=DIR option was not defined)"
+ fi
else
CSF_VTK_LIB=""
HAVE_VTK=yes
#CPP_FLAGS="-I$vtk $CPPFLAGS"
#AC_CHECK_HEADER( [Vtk/vtkConfigure.h], [HAVE_VTK_INC=yes], [HAVE_VTK_INC=no] )
if test "x$HAVE_VTK_INC" = "xyes"; then
- if test ! -d $vtk; then
- DISABLE_VTK_REASON_LIB="($vtk_lib directory does not exist)"
+ if test ! -d $vtk_lib; then
+ DISABLE_VTK_REASON="($vtk_lib directory does not exist)"
AC_MSG_ERROR([$vtk_lib directory does not exist])
- elif test "x$vtk_lib" != "x"; then
- LDFLAGS="-L$vtk_lib $LDFLAGS"
- fi
- else
- HAVE_VTK=no
- fi
-
- if test "x$HAVE_VTK" = "xyes"; then
- if test "x$vtk_inc" != "x"; then
- CSF_VTK_INCLUDES=""
- CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$vtk_inc -DHAVE_VTK"
- else
- HAVE_VTK=no
- fi
- if test "x$vtk_lib" != "x"; then
+ elif test ! -f $vtk_lib/libvtkCommonCore-6.1.so; then
+ DISABLE_VTK_REASON="(vtk libraries are not found in $vtk_lib)"
+ AC_MSG_ERROR([vtk libraries are not found in $vtk_lib])
+ elif test "x$vtk_lib" != "x" -a "x$vtk_inc" != "x"; then
CSF_VTK_LIB="-L$vtk_lib -lvtkCommonCore-6.1 -lvtkCommonDataModel-6.1 -lvtkCommonExecutionModel-6.1 -lvtkCommonMath-6.1 -lvtkCommonTransforms-6.1 "
CSF_VTK_LIB="${CSF_VTK_LIB} -lvtkRenderingCore-6.1 -lvtkRenderingOpenGL-6.1 -lvtkFiltersGeneral-6.1 -lvtkIOCore-6.1 -lvtkIOImage-6.1 -lvtkImagingCore-6.1 -lvtkInteractionStyle-6.1 "
- else
- HAVE_VTK=no
- fi
-
- if test "x$HAVE_VTK" = "xyes"; then
CSF_OPT_INC="$vtk_inc:${CSF_OPT_INC}"
CSF_OPT_LIB="$vtk_lib:${CSF_OPT_LIB}"
+ CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$vtk_inc -DHAVE_VTK"
else
- DISABLE_VTK_REASON="(VTK was not found)"
+ HAVE_VTK=no
+ AC_MSG_NOTICE("--with-vtk-library=DIR option was not defined")
+ DISABLE_VTK_REASON="(--with-vtk-library=DIR option was not defined)"
fi
else
- AC_MSG_NOTICE("Specify --with-vtk-library to enable VTK support")
- DISABLE_VTK_REASON_LIB="(VTK libraries were not found)"
+ HAVE_VTK=no
fi
fi