From a05493db41869231b2032b5bf2107c5dfb56cc0e Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Mon, 31 Oct 2016 07:00:57 +0100
Subject: [PATCH] CONFIG: csh not unsetting old paraview/cmake environment
 (related to #281)

- On the first call, ParaView_DIR is unset and thus the clean-path
  fails with the warning "ParaView_DIR: Undefined variable."

  This looks messy, but is of no _major_ consequence since paraview
  doesn't need to be removed anyhow. The only slight risk is that the
  path to a third-party cmake might not be cleaned.

- Patch as per Bruno's suggestion.
---
 etc/config.csh/paraview | 1 +
 1 file changed, 1 insertion(+)

diff --git a/etc/config.csh/paraview b/etc/config.csh/paraview
index ba718b0c0ca..ef697365a1b 100644
--- a/etc/config.csh/paraview
+++ b/etc/config.csh/paraview
@@ -59,6 +59,7 @@ set cmake_version=cmake-system
 #------------------------------------------------------------------------------
 
 # Clean the PATH
+if ( ! $?ParaView_DIR ) setenv ParaView_DIR
 set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
 if ( $status == 0 ) setenv PATH $cleaned
 
-- 
GitLab