#! /bin/tcsh -ef

#
# kww_setup
#
# KWWidgets setup for apps using the KWWidgets package included with Freesurfer
#
# Original Author: Nick Schmansky
# CVS Revision Info:
#    $Author: nicks $
#    $Date: 2011/03/02 20:16:39 $
#    $Revision: 1.4 $
#
# Copyright © 2011 The General Hospital Corporation (Boston, MA) "MGH"
#
# Terms and conditions for use, reproduction, distribution and contribution
# are found in the 'FreeSurfer Software License Agreement' contained
# in the file 'LICENSE' found in the FreeSurfer distribution, and here:
#
# https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense
#
# Reporting: freesurfer@nmr.mgh.harvard.edu
#
#

### --  use NMR Center KWWidgets package -- ####

if ( $?FREESURFER_HOME ) then
  if ( -e $FREESURFER_HOME/lib/KWWidgets ) then
    set FS_KWW_HOME=$FREESURFER_HOME/lib/KWWidgets
  else if ( -e /usr/pubsw/packages/KWWidgets/current ) then
    set FS_KWW_HOME=/usr/pubsw/packages/KWWidgets/current
  endif
else if ( -e /usr/pubsw/packages/KWWidgets/current ) then
  set FS_KWW_HOME=/usr/pubsw/packages/KWWidgets/current
endif

if ( $?FS_KWW_HOME ) then

  if ( -e $FS_KWW_HOME/bin ) then
    setenv PATH "$FS_KWW_HOME/bin":"$PATH"
  endif

  if ( -e $FS_KWW_HOME/lib ) then
    setenv KWWLIBPATH $FS_KWW_HOME/lib/KWWidgets
    if(! $?LD_LIBRARY_PATH ) then
      setenv LD_LIBRARY_PATH $KWWLIBPATH
    else
      setenv LD_LIBRARY_PATH "$KWWLIBPATH":"$LD_LIBRARY_PATH"
    endif
    if(! $?DYLD_LIBRARY_PATH ) then
      setenv DYLD_LIBRARY_PATH $KWWLIBPATH
    else
      setenv DYLD_LIBRARY_PATH "$KWWLIBPATH":"$DYLD_LIBRARY_PATH"
    endif
  endif

  # default: assume platform has KWW libs installed somewhere
endif

