From fa44158a219e28c385e02dbc446772f751f41d26 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 4 Mar 2011 15:45:32 +0000
Subject: [PATCH] all contrib/ stuff should be optional -> defined HAVE_BFGS ;
 the Lloyd code must still be #ifdef'ed accordingly

---
 CMakeLists.txt         | 14 +++++++++-----
 Common/GmshConfig.h.in |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78372cafba..411122e610 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,10 @@ endif(DEFINED CMAKE_BUILD_TYPE)
 
 project(gmsh CXX C)
 
+option(ENABLE_ACIS "Enable ACIS geometrical models" ON)
 option(ENABLE_ANN "Enable ANN to compute Approximate Nearest Neighbors" ON)
+option(ENABLE_BAMG "Enable Bamg mesh generator" ON)
+option(ENABLE_BFGS "Enable BFGS" ON)
 option(ENABLE_BLAS_LAPACK "Use BLAS/Lapack for basic linear algebra" ON)
 option(ENABLE_CGNS "Enable CGNS mesh export" OFF)
 option(ENABLE_CHACO "Enable Chaco mesh partitioner" ON)
@@ -38,14 +41,12 @@ option(ENABLE_MPI "Enable MPI parallelization" OFF)
 option(ENABLE_MSVC_STATIC_RUNTIME "Use static Visual C++ runtime" OFF)
 option(ENABLE_NATIVE_FILE_CHOOSER "Enable native file chooser in GUI" ON)
 option(ENABLE_NETGEN "Enable Netgen mesh generator" ON)
-option(ENABLE_BAMG "Enable Bamg mesh generator" ON)
 option(ENABLE_OCC "Enable Open CASCADE geometrical models" ON)
-option(ENABLE_ACIS "Enable ACIS geometrical models" ON)
 option(ENABLE_OSMESA "Use OSMesa for offscreen rendering" OFF)
 option(ENABLE_PARSER "Build the GEO file parser" ON)
 option(ENABLE_PETSC "Enable PETSc linear algebra solvers" OFF)
-option(ENABLE_POST "Build the post-processing module" ON)
 option(ENABLE_PLUGINS "Build the post-processing plugins" ON)
+option(ENABLE_POST "Build the post-processing module" ON)
 option(ENABLE_QT "Build QT GUI" OFF)
 option(ENABLE_READLINE "Enable Readline in Lua prompt" ON)
 option(ENABLE_SLEPC "Enable SLEPc eigensolvers" ON)
@@ -439,8 +440,11 @@ if(ENABLE_CHACO)
   set_config_option(HAVE_CHACO "Chaco")
 endif(ENABLE_CHACO)
 
-add_subdirectory(contrib/lbfgs)
-include_directories(contrib/lbfgs)
+if(ENABLE_BFGS)
+  add_subdirectory(contrib/lbfgs)
+  include_directories(contrib/lbfgs)
+  set_config_option(HAVE_BFGS "Bfgs")
+endif(ENABLE_BFGS)
 
 if(ENABLE_DINTEGRATION)
   add_subdirectory(contrib/DiscreteIntegration)
diff --git a/Common/GmshConfig.h.in b/Common/GmshConfig.h.in
index 48ff64e93e..1823f15985 100644
--- a/Common/GmshConfig.h.in
+++ b/Common/GmshConfig.h.in
@@ -10,6 +10,7 @@
 #cmakedefine HAVE_ACIS
 #cmakedefine HAVE_ANN
 #cmakedefine HAVE_BAMG
+#cmakedefine HAVE_BFGS
 #cmakedefine HAVE_BLAS
 #cmakedefine HAVE_CHACO
 #cmakedefine HAVE_DLOPEN
-- 
GitLab