#! /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: 2007/01/06 00:01:14 $
#    $Revision: 1.3 $
#
# Copyright (C) 2002-2007,
# The General Hospital Corporation (Boston, MA).
# All rights reserved.
#
# Distribution, usage and copying of this software is covered under the
# terms found in the License Agreement file named 'COPYING' found in the
# FreeSurfer source code root directory, and duplicated here:
# https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferOpenSourceLicense
#
# General inquiries: freesurfer@nmr.mgh.harvard.edu
# Bug reports: analysis-bugs@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

