From 17f0aa1db8b2fb2b70456f91269f1ee603f87254 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Tue, 6 Sep 2016 16:17:20 +0200
Subject: [PATCH] STYLE: propogate WM_CC for CMake (fixes #226)

- reported by Bruno
---
 .../utilities/postProcessing/graphics/PV3Readers/Allwmake     | 3 ++-
 .../utilities/postProcessing/graphics/PVReaders/Allwmake      | 3 ++-
 .../postProcessing/graphics/PVReaders/PVFoamReader/Allwmake   | 3 ++-
 .../graphics/PVReaders/PVblockMeshReader/Allwmake             | 3 ++-
 .../functionObjects/graphics/runTimePostProcessing/Allwmake   | 4 ++--
 5 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake
index b34e11bf4b6..9d0fcb58615 100755
--- a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake
@@ -47,7 +47,8 @@ case "$ParaView_VERSION" in
     if canBuildPlugin
     then
     (
-        # C++ compiler for CMake
+        # ensure CMake gets the correct C/C++ compilers
+        [ -n "$WM_CC" ]  && export CC="$WM_CC"
         [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
 
         wmake $targetType vtkPV3Readers
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
index 76a3697c6cd..d678a785ff2 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
@@ -47,7 +47,8 @@ case "$ParaView_VERSION" in
     if canBuildPlugin
     then
     (
-        # C++ compiler for CMake
+        # ensure CMake gets the correct C/C++ compilers
+        [ -n "$WM_CC" ]  && export CC="$WM_CC"
         [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
 
         wmake $targetType vtkPVReaders
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake
index 313fdd2410e..6304c4545f9 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake
@@ -8,7 +8,8 @@ targetType=libso
 # Source the wmake functions
 . $WM_DIR/scripts/wmakeFunctions
 
-# C++ compiler for CMake
+# ensure CMake gets the correct C/C++ compilers
+[ -n "$WM_CC" ]  && export CC="$WM_CC"
 [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
 
 set -x
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake
index 76297f13a28..29b4aa8c5b6 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake
@@ -8,7 +8,8 @@ targetType=libso
 # Source the wmake functions
 . $WM_DIR/scripts/wmakeFunctions
 
-# C++ compiler for CMake
+# ensure CMake gets the correct C/C++ compilers
+[ -n "$WM_CC" ]  && export CC="$WM_CC"
 [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
 
 set -x
diff --git a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake
index 727f9a20aad..277a8c394f6 100755
--- a/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake
+++ b/src/postProcessing/functionObjects/graphics/runTimePostProcessing/Allwmake
@@ -18,9 +18,9 @@ echo
 
 if [ -d "$VTK_DIR" -o -d "$ParaView_DIR" ]
 then
-    # ensure CMake gets the correct C++ compiler
+    # ensure CMake gets the correct C/C++ compilers
+    [ -n "$WM_CC" ]  && export CC="$WM_CC"
     [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
-    [ -n "$WM_CC" ] && export CC="$WM_CC"
 
     if type cmake > /dev/null 2>&1
     then
-- 
GitLab