diff --git a/applications/utilities/mesh/generation/foamyMesh/Allwmake b/applications/utilities/mesh/generation/foamyMesh/Allwmake
index 69928f35a6..273a56e5f9 100755
--- a/applications/utilities/mesh/generation/foamyMesh/Allwmake
+++ b/applications/utilities/mesh/generation/foamyMesh/Allwmake
@@ -4,6 +4,24 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
+# Get BOOST_ARCH_PATH, CGAL_ARCH_PATH
+if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
+then
+ . $settings
+ if [ -n "$BOOST_ARCH_PATH" ]
+ then
+ echo " using BOOST_ARCH_PATH=$BOOST_ARCH_PATH"
+ fi
+ if [ -n "$CGAL_ARCH_PATH" ]
+ then
+ echo " using CGAL_ARCH_PATH=$CGAL_ARCH_PATH"
+ fi
+else
+ echo
+ echo " Error: no config.sh/CGAL settings"
+ echo
+fi
+
wmake $targetType conformalVoronoiMesh
wmake $targetType conformalVoronoi2DMesh
diff --git a/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options b/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options
index 258f5ccd2d..dbd6d93668 100644
--- a/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options
+++ b/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options
@@ -6,7 +6,6 @@ CGAL_INEXACT = -DCGAL_INEXACT
include $(GENERAL_RULES)/CGAL
-
EXE_INC = \
${ROUNDING_MATH} \
${EXE_NDEBUG} \
diff --git a/etc/bashrc b/etc/bashrc
index 5f5d9d9878..7e74235221 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
-# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
+# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@@ -193,11 +193,6 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
-if [ ! -z "$FOAMY_HEX_MESH" ]
-then
- _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
-fi
-
# Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/etc/config.csh/CGAL b/etc/config.csh/CGAL
deleted file mode 100644
index 7b74f544cf..0000000000
--- a/etc/config.csh/CGAL
+++ /dev/null
@@ -1,62 +0,0 @@
-#----------------------------------*-sh-*--------------------------------------
-# ========= |
-# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
-# \\ / O peration | Website: https://openfoam.org
-# \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
-# \\/ M anipulation |
-#------------------------------------------------------------------------------
-# License
-# This file is part of OpenFOAM.
-#
-# OpenFOAM is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with OpenFOAM. If not, see .
-#
-# File
-# config.csh/CGAL
-#
-# Description
-# Setup file for CGAL (& boost) include/libraries.
-# Sourced from OpenFOAM-/etc/cshrc
-#
-# If using system-wide installations for either one, use the following
-# version settings:
-#
-# boost_version=boost-system
-# cgal_version=cgal-system
-#
-#------------------------------------------------------------------------------
-
-set boost_version=boost-system
-set cgal_version=cgal-system
-#cgal_version=CGAL-4.10
-
-setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
-setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
-
-if ($?FOAM_VERBOSE && $?prompt) then
- echo "Using CGAL and boost"
- echo " $cgal_version at $CGAL_ARCH_PATH"
- echo " $boost_version at $BOOST_ARCH_PATH"
-endif
-
-if ( -d "$BOOST_ARCH_PATH" && "$boost_version" != "boost-system" ) then
- _foamAddLib $BOOST_ARCH_PATH/lib
-endif
-
-if ( -d "$CGAL_ARCH_PATH" && "$cgal_version" != "cgal-system" ) then
- _foamAddLib $CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
-endif
-
-unset boost_version cgal_version
-
-#------------------------------------------------------------------------------
diff --git a/etc/config.sh/CGAL b/etc/config.sh/CGAL
index 82fa5614ea..1850a5daa6 100644
--- a/etc/config.sh/CGAL
+++ b/etc/config.sh/CGAL
@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
-# \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
+# \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@@ -25,51 +25,34 @@
# etc/config.sh/CGAL
#
# Description
-# Configuration file for BOOST and CGAL include/libraries.
-# Sourced from OpenFOAM-/etc/bashrc
+# Setup file for Boost and CGAL include.
+# Sourced during wmake process only.
#
# If using system-wide installations use the following version settings:
#
# boost_version=boost-system
# cgal_version=cgal-system
#
+# Note
+# A csh version is not needed, since the values here are only sourced
+# during the wmake process
+#
#------------------------------------------------------------------------------
boost_version=boost-system
+
cgal_version=cgal-system
#cgal_version=CGAL-4.10
+#cgal_version=CGAL-5.0.2
-thirdPartyPath=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
-
-if [ "$boost_version" != "boost-system" ]
+if [ "$boost_version" != "boost-system" ]
then
- export BOOST_ARCH_PATH=$thirdPartyPath/$boost_version
- if [ -d "$BOOST_ARCH_PATH" ]
- then
- _foamAddLib $BOOST_ARCH_PATH/lib
- fi
-else
- unset BOOST_ARCH_PATH
+ export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/$boost_version
fi
if [ "$cgal_version" != "cgal-system" ]
then
- export CGAL_ARCH_PATH=$thirdPartyPath/$cgal_version
- if [ -d "$CGAL_ARCH_PATH" ]
- then
- _foamAddLib $CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
- fi
-else
- unset CGAL_ARCH_PATH
+ export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/$cgal_version
fi
-if [ "$FOAM_VERBOSE" -a "$PS1" ]
-then
- echo "Using BOOST and CGAL" 1>&2
- echo " $boost_version at $BOOST_ARCH_PATH" 1>&2
- echo " $cgal_version at $CGAL_ARCH_PATH" 1>&2
-fi
-
-unset thirdPartyPath
-
#------------------------------------------------------------------------------
diff --git a/etc/cshrc b/etc/cshrc
index 30c4841fe5..c0ae914926 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
-# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
+# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@@ -217,10 +217,6 @@ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/paraview`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/ensight`
-if ( ($?FOAMY_HEX_MESH) ) then
- _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/CGAL`
-endif
-
# Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/wmake/rules/General/CGAL b/wmake/rules/General/CGAL
index 7844245e42..573f21b53c 100644
--- a/wmake/rules/General/CGAL
+++ b/wmake/rules/General/CGAL
@@ -1,15 +1,14 @@
CGAL_INC = \
+ -std=c++14 \
-DCGAL_NO_DEPRECATED_CODE \
- -I$(CGAL_ARCH_PATH)/include \
- -I$(MPFR_ARCH_PATH)/include \
- -I$(GMP_ARCH_PATH)/include \
- -I$(BOOST_ARCH_PATH)/include \
- -I/usr/include
+ -DCGAL_HEADER_ONLY \
+ $(if $(GMP_ARCH_PATH),-I$(GMP_ARCH_PATH)/include,) \
+ $(if $(MPFR_ARCH_PATH),-I$(MPFR_ARCH_PATH)/include,) \
+ $(if $(BOOST_ARCH_PATH),-I$(BOOST_ARCH_PATH)/include,) \
+ $(if $(CGAL_ARCH_PATH),-I$(CGAL_ARCH_PATH)/include,-I/usr/include)
CGAL_LIBS = \
- -L$(MPFR_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
- -L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
- -L$(BOOST_ARCH_PATH)/lib \
- -L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
- -lCGAL \
+ $(if $(GMP_ARCH_PATH),-L$(GMP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH),) \
+ -lgmp \
+ $(if $(MPFR_ARCH_PATH),-L$(MPFR_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH),) \
-lmpfr