@set %CSF_VTK = "";
@set %CSF_QT_INCLUDES = "";
@set %CSF_QT = "";
+ @set %CSF_GDCM_INCLUDES = "";
+ @set %CSF_GDCM = "";
@set %CSF_OODBLibs = "";
@set %CSF_STANDARDDB = "StandardTRAN";
@set %ENV_HAVE_TBB = "${HAVE_TBB}";
@set %ENV_HAVE_OPENCL = "${HAVE_OPENCL}";
@set %ENV_HAVE_VTK = "${HAVE_VTK}";
+ @set %ENV_HAVE_GDCM = "${HAVE_GDCM}";
@set %CSF_PRODUCTS_DEFINES = "";
@if (%ENV_HAVE_FREEIMAGE == "true") then
@string %CSF_PRODUCTS_DEFINES = %CSF_PRODUCTS_DEFINES " -DHAVE_FREEIMAGE";
@string %CSF_VTK += "-lvtkRenderingOpenGL-6.1 -lvtkFiltersGeneral-6.1 -lvtkIOCore-6.1 -lvtkIOImage-6.1 -lvtkImagingCore-6.1 -lvtkInteractionStyle-6.1 ";
@endif;
@endif;
+ @if (%ENV_HAVE_GDCM == "true") then
+ @string %CSF_PRODUCTS_DEFINES = %CSF_PRODUCTS_DEFINES " -DHAVE_GDCM";
+ @if (%Station != "wnt") then
+ @set %CSF_GDCM = "-lgdcmcharls -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmexpat -lgdcmIOD -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmMSFF -lgdcmopenjpeg -lgdcmzlib ";
+ @endif;
+ @endif;
-- On UNIX systems default configuration file 'config.h'
-- placed in ${WOKHOME}/lib folder.
return [join $aLibArray " "]
}
+# Returns string of library dependencies for generation of Visual Studio project or make lists.
+proc osutils:gdcmCsf {} {
+ set aLibArray [list gdcmcharls gdcmCommon gdcmDICT gdcmDSED gdcmexpat gdcmIOD gdcmjpeg8 gdcmjpeg12 gdcmjpeg16 gdcmMSFF gdcmopenjpeg gdcmzlib]
+
+ return [join $aLibArray " "]
+}
+
proc osutils:csfList { theOS theCsfMap theTarget} {
upvar $theCsfMap aCsfMap
#-- VTK
set aCsfMap(CSF_VTK) [osutils:vtkCsf ".lib"]
+ #-- GDCM
+ set aCsfMap(CSF_GDCM) [osutils:gdcmCsf ".lib"]
+
} else {
#-- Tcl/Tk configuration
#-- VTK
set aCsfMap(CSF_VTK) [osutils:vtkCsf]
+
+ #-- GDCM
+ set aCsfMap(CSF_GDCM) [osutils:gdcmCsf]
+
}
}
lappend aFileBuff " if(USE_OPENCL)"
lappend aFileBuff " list( APPEND ${theToolKit}_USED_LIBS ${anUsedMacLib} )"
lappend aFileBuff " endif()"
+ } elseif { $anUsedMacLib == "GDCM" } {
+ lappend aFileBuff " if(USE_GDCM)"
+ lappend aFileBuff " list( APPEND ${theToolKit}_USED_LIBS ${anUsedMacLib} )"
+ lappend aFileBuff " endif()"
} elseif { $anUsedMacLib != "" } {
lappend aFileBuff " list( APPEND ${theToolKit}_USED_LIBS ${anUsedMacLib} )"
}
lappend aFileBuff " if(USE_VTK)"
lappend aFileBuff " list( APPEND ${theToolKit}_USED_LIBS ${anUsedUnixLib} )"
lappend aFileBuff " endif()"
+ } elseif { $anUsedUnixLib == "GDCM" } {
+ lappend aFileBuff " if(USE_GDCM)"
+ lappend aFileBuff " list( APPEND ${theToolKit}_USED_LIBS ${anUsedUnixLib} )"
+ lappend aFileBuff " endif()"
} elseif { $anUsedUnixLib != "" } {
lappend aFileBuff " list( APPEND ${theToolKit}_USED_LIBS ${anUsedUnixLib} )"
}
export HAVE_OPENCL=@HAVE_OPENCL@
export HAVE_QT=@HAVE_QT@
export HAVE_VTK=@HAVE_VTK@
+export HAVE_GDCM=@HAVE_GDCM@
#
export CSF_OPT_INC="@CSF_OPT_INC@"
export CSF_OPT_LIB@ARCH@="@CSF_OPT_LIB@"
set "HAVE_GL2PS=false"
set "HAVE_OPENCL=false"
set "HAVE_VTK=false"
+set "HAVE_GDCM=false"
set "CSF_OPT_INC="
set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"
+if ["%HAVE_GDCM%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GDCM"
if ["%HAVE_TBB%"] == ["true"] set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
if ["%HAVE_OPENCL%"] == ["true"] set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
if ["%HAVE_GL2PS%"] == ["true"] set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
if ["%HAVE_VTK%"] == ["true"] set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
+if ["%HAVE_GDCM%"] == ["true"] set "CSF_DEFINES=HAVE_GDCM;%CSF_DEFINES%"
rem Eliminate VS warning
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
export HAVE_FREEIMAGE="false";
export HAVE_GL2PS="false";
export HAVE_VTK="false";
+export HAVE_GDCM="false";
export MACOSX_USE_GLX="false";
export CSF_OPT_INC=""
export CSF_OPT_LIB32=""
if [ "$HAVE_VTK" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
fi
+if [ "$HAVE_GDCM" == "true" ]; then
+ export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GDCM"
+fi
# Option to compile OCCT with X11 libs on Mac OS X
if [ "$MACOSX_USE_GLX" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"
fi
fi
+#---------------------------------------------------------------------
+#
+# Check for GDCM Includes
+#
+#
+#---------------------------------------------------------------------
+AC_ARG_WITH([gdcm-include],
+ [AC_HELP_STRING([--with-gdcm-include=DIR], [Location of GDCM includes])],
+ [gdcm_inc="${withval}"],[gdcm_inc=])
+
+if test "xno$gdcm_inc" = "xno"; then
+ # user --without-gdcm-lib
+ HAVE_GDCM_INC=no
+ DISABLE_GDCM_REASON="(--with-gdcm-include=DIR option was not defined)"
+else
+ CSF_GDCM_INCLUDES=""
+ AC_LANG([C++])
+ HAVE_GDCM_INC=yes
+ if test ! -d $gdcm_inc; then
+ DISABLE_GDCM_REASON="($gdcm_inc directory does not exists)"
+ AC_MSG_ERROR([$gdcm_inc directory does not exists])
+ elif test ! -f $gdcm_inc/gdcmImageReader.h; then
+ DISABLE_GDCM_REASON="(gdcm headers are not found in $gdcm_inc)"
+ AC_MSG_ERROR([gdcm headers are not found in $gdcm_inc])
+ elif test "x$gdcm_inc" != "x"; then
+ CPPFLAGS="-I$gdcm_inc $CPPFLAGS";
+ else
+ HAVE_GDCM_INC=no
+ DISABLE_GDCM_REASON="(--with-gdcm-include=DIR option was not defined)"
+ AC_MSG_NOTICE("--with-gdcm-include=DIR option was not defined")
+ fi
+fi
+
#---------------------------------------------------------------------
#
# Check for TBB Libraries
#CSF_VTK="$CSF_VTK_LIB"
AM_CONDITIONAL( HAVE_VTK, [test "xyes" = "x$HAVE_VTK"] )
+#---------------------------------------------------------------------
+#
+# Check for GDCM Libraries
+#
+#
+#---------------------------------------------------------------------
+AC_ARG_WITH([gdcm-library],
+ [AC_HELP_STRING([--with-gdcm-library=DIR],[Location of GDCM libraries])],
+ [gdcm_lib="${withval}"],[gdcm_lib=])
+
+if test "xno" = "xno$gdcm_lib"; then
+# user specified --without-gdcm
+ HAVE_GDCM=no
+ if test "x$DISABLE_GDCM_REASON" = "x" ; then
+ DISABLE_GDCM_REASON="(--with-gdcm-library=DIR option was not defined)"
+ fi
+else
+ CSF_GDCM_LIB=""
+ HAVE_GDCM=yes
+
+ #CPP_FLAGS="-I$gdcm $CPPFLAGS"
+ #AC_CHECK_HEADER( [gdcmImageReader.h], [HAVE_GDCM_INC=yes], [HAVE_GDCM_INC=no] )
+ if test "x$HAVE_GDCM_INC" = "xyes"; then
+ if test ! -d $gdcm_lib; then
+ DISABLE_GDCM_REASON="($gdcm_lib directory does not exist)"
+ AC_MSG_ERROR([$gdcm_lib directory does not exist])
+ elif test ! -f $gdcm_lib/libgdcmCommon.so; then
+ DISABLE_GDCM_REASON="(gdcm libraries are not found in $gdcm_lib)"
+ AC_MSG_ERROR([gdcm libraries are not found in $gdcm_lib])
+ elif test "x$gdcm_lib" != "x" -a "x$gdcm_inc" != "x"; then
+ CSF_GDCM_LIB="-L$gdcm_lib -lgdcmcharls -lgdcmCommon -lgdcmDICT -lgdcmDSED -lgdcmexpat -lgdcmIOD -lgdcmjpeg8 -lgdcmjpeg12 -lgdcmjpeg16 -lgdcmMSFF -lgdcmopenjpeg -lgdcmzlib "
+ CSF_OPT_INC="$gdcm_inc:${CSF_OPT_INC}"
+ CSF_OPT_LIB="$gdcm_lib:${CSF_OPT_LIB}"
+ CSF_OPT_INCLUDES="${CSF_OPT_INCLUDES} -I$gdcm_inc -DHAVE_GDCM"
+ else
+ HAVE_GDCM=no
+ AC_MSG_NOTICE("--with-gdcm-library=DIR option was not defined")
+ DISABLE_GDCM_REASON="(--with-gdcm-library=DIR option was not defined)"
+ fi
+ else
+ HAVE_GDCM=no
+ fi
+fi
+
+#CSF_GDCM="$CSF_GDCM_LIB"
+AM_CONDITIONAL( HAVE_GDCM, [test "xyes" = "x$HAVE_GDCM"] )
+
+
#----------------------------------------------------------------------
#
# Enalbe/Disable Modules
set HAVE_TBB "false"
set HAVE_OPENCL "false"
set HAVE_VTK "false"
+set HAVE_GDCM "false"
set MACOSX_USE_GLX "false"
set CHECK_QT4 "true"
set CHECK_JDK "true"
if { [info exists ::env(HAVE_VTK)] } {
set HAVE_VTK "$::env(HAVE_VTK)"
}
+if { [info exists ::env(HAVE_GDCM)] } {
+ set HAVE_GDCM "$::env(HAVE_GDCM)"
+}
if { [info exists ::env(MACOSX_USE_GLX)] } {
set MACOSX_USE_GLX "$::env(MACOSX_USE_GLX)"
}
return "$isFound"
}
+# Auxiliary function, gets GDCM version to set default search directory
+proc wokdep:GDCMVersion { thePath } {
+ set aResult "2.4"
+
+ set aRoot [lindex [regexp -all -inline {[0-9.]*} [file tail $thePath]] 0]
+ if { "$aRoot" != "" } {
+ set aRoot [regexp -inline {[0-9]*.[0-9]*} $aRoot]
+ if { "$aRoot" != "" } {
+ set aResult $aRoot
+ }
+ }
+
+ return $aResult
+}
+
+# Search GDCM library placement
+proc wokdep:SearchGDCM {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
+ upvar $theErrInc anErrInc
+ upvar $theErrLib32 anErrLib32
+ upvar $theErrLib64 anErrLib64
+ upvar $theErrBin32 anErrBin32
+ upvar $theErrBin64 anErrBin64
+
+ set isFound "true"
+
+ set aGdcmPath ""
+ set aGdcmIncPath [wokdep:SearchHeader "gdcmConfigure.h"]
+ set aGdcmVer [wokdep:GDCMVersion $aGdcmIncPath]
+ if { "$aGdcmIncPath" == ""} {
+ set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GDCM}*]
+ set aGdcmPath [wokdep:Preferred "$aPathList" "$::VCVER" "$::ARCH" ]
+ if { "$aGdcmPath" != "" && [file exists "$aGdcmPath/include/gdcm-[wokdep:GDCMVersion $aGdcmPath]/gdcmConfigure.h"]} {
+ set aGdcmVer [wokdep:GDCMVersion $aGdcmPath]
+ lappend ::CSF_OPT_INC "$aGdcmPath/include/gdcm-[wokdep:GDCMVersion $aGdcmPath]"
+ } else { # try to search in all found paths
+ set isFound "false"
+ foreach anIt $aPathList {
+ if { [file exists "$anIt/include/gdcm-[wokdep:GDCMVersion $anIt]/gdcmConfigure.h"] } {
+ set aGdcmPath $anIt
+ set aGdcmVer [wokdep:GDCMVersion $aGdcmPath]
+ lappend ::CSF_OPT_INC "$anIt/include/gdcm-[wokdep:GDCMVersion $anIt]"
+ set isFound "true"
+ break
+ }
+ }
+
+ # Bad case: we do not found vtkConfigure.h in all paths.
+ if { "$isFound" == "false"} {
+ lappend anErrInc "Error: 'gdcmConfigure.h' not found (GDCM)"
+ set isFound "false"
+ }
+ }
+ }
+
+ set aGdcmLibPath ""
+ foreach anArchIter {64 32} {
+ set aGdcmLibPath [wokdep:SearchLib "gdcmCommon" "$anArchIter"]
+ if { "$aGdcmLibPath" == "" } {
+ set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GDCM}*]
+ set aPath [wokdep:Preferred $aPathList "$::VCVER" "$anArchIter" ]
+ set aGdcmLibPath [wokdep:SearchLib "gdcmCommon" "$anArchIter" "$aPath/lib/gdcm-$aGdcmVer"]
+ if { "$aGdcmLibPath" != "" } {
+ lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/gdcm-$aGdcmVer"
+ } else {
+ set aPath [wokdep:SearchLib "gdcmCommon" "$anArchIter" "$aGdcmPath/lib/gdcm-$aGdcmVer"]
+ if { "$aPath" != "" } {
+ set aLibPath $aGdcmIncPath
+ lappend ::CSF_OPT_LIB$anArchIter "$aLibPath/lib/gdcm-$aGdcmVer"
+ } else {
+ # The last chance: search /lib directory in all found paths
+ foreach anIt $aPathList {
+ set aGdcmLibPath [wokdep:SearchLib "gdcmCommon" "$anArchIter" "$anIt/lib/gdcm-$aGdcmVer"]
+ if { "$aGdcmLibPath" != ""} {
+ lappend ::CSF_OPT_LIB$anArchIter "$anIt/lib/gdcm-$aGdcmVer"
+ break
+ }
+ }
+ if { "$aGdcmLibPath" == "" } {
+ lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}gdcmCommon\.${::SYS_LIB_SUFFIX}' not found (GDCM)"
+ if { "$::ARCH" == "$anArchIter" } {
+ set isFound "false"
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return "$isFound"
+}
+
# Search Qt4 libraries placement
proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
upvar $theErrInc anErrInc
puts $aFile "set HAVE_TBB=$::HAVE_TBB"
puts $aFile "set HAVE_OPENCL=$::HAVE_OPENCL"
puts $aFile "set HAVE_VTK=$::HAVE_VTK"
+ puts $aFile "set HAVE_GDCM=$::HAVE_GDCM"
puts $aFile "set CHECK_QT4=$::CHECK_QT4"
puts $aFile "set CHECK_JDK=$::CHECK_JDK"
puts $aFile "export HAVE_TBB=$::HAVE_TBB"
puts $aFile "export HAVE_OPENCL=$::HAVE_OPENCL"
puts $aFile "export HAVE_VTK=$::HAVE_VTK"
+ puts $aFile "export HAVE_GDCM=$::HAVE_GDCM"
if { "$::tcl_platform(os)" == "Darwin" } {
puts $aFile "export MACOSX_USE_GLX=$::MACOSX_USE_GLX"
}
if { "$::HAVE_VTK" == "true" } {
wokdep:SearchVTK anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
+ if { "$::HAVE_GDCM" == "true" } {
+ wokdep:SearchGDCM anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
+ }
if { "$::CHECK_QT4" == "true" } {
wokdep:SearchQt4 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
ttk::label .myFrame.myQt4Lbl -text "Search Qt4"
checkbutton .myFrame.myJDKCheck -offvalue "false" -onvalue "true" -variable CHECK_JDK -command wokdep:gui:UpdateList
ttk::label .myFrame.myJDKLbl -text "Search JDK"
+ttk::label .myFrame.myGDCMLbl -text "Use GDCM"
+checkbutton .myFrame.myGDCMCheck -offvalue "false" -onvalue "true" -variable HAVE_GDCM -command wokdep:gui:UpdateList
# Additional headers search paths
ttk::label .myFrame.myIncLbl -text "Additional headers search paths" -relief solid -padding {5 5 80 5}
incr aRowIter
grid .myFrame.myTbbCheck -row $aRowIter -column 0 -sticky e
grid .myFrame.myTbbLbl -row $aRowIter -column 1 -sticky w
+grid .myFrame.myGDCMCheck -row $aRowIter -column 2 -sticky e
+grid .myFrame.myGDCMLbl -row $aRowIter -column 3 -sticky w
incr aRowIter
grid .myFrame.myOpenClCheck -row $aRowIter -column 0 -sticky e
grid .myFrame.myOpenClLbl -row $aRowIter -column 1 -sticky w
set "HAVE_FREEIMAGE=false"
set "HAVE_GL2PS=false"
set "HAVE_VTK=false"
+set "HAVE_GDCM=false"
set "VCVARS="
rem ----- Set local settings (M$ Visual Studio compilers etc.) -----
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"
+if ["%HAVE_GDCM%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GDCM"
rem ----- Setup Environment Variables for M$ Visual Studio compilers -----
if ["%ARCH%"] == ["32"] set VCARCH=x86
export HAVE_FREEIMAGE="false";
export HAVE_GL2PS="false";
export HAVE_VTK="false";
+export HAVE_GDCM="false";
export PRODUCTS_DEFINES="";
# ----- Set local settings -----
if [ "$HAVE_VTK" == "true" ]; then
export PRODUCTS_DEFINES="$PRODUCTS_DEFINES -DHAVE_VTK";
fi
+if [ "$HAVE_GDCM" == "true" ]; then
+ export PRODUCTS_DEFINES="$PRODUCTS_DEFINES -DHAVE_GDCM";
+fi
# ----- Setup Environment Variables -----
anArch=`uname -m`
if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
puts " not found: VTK (Optional, enabled)"
}
}
+if { "$::HAVE_GDCM" == "true" } {
+ if { [wokdep:SearchGDCM anErrs anErrs anErrs anErrs anErrs] == "false"} {
+ puts " not found: GDCM (Optional, enabled)"
+ }
+}
if { "$::CHECK_QT4" == "true" } {
if { [wokdep:SearchQt4 anErrs anErrs anErrs anErrs anErrs] == "false" } {
puts " not found: Qt4 (Optional, set to check)"