Blob Blame History Raw
diff -rupN gmsh-3.0.6-source/CMakeLists.txt gmsh-3.0.6-source-new/CMakeLists.txt
--- gmsh-3.0.6-source/CMakeLists.txt	2017-10-17 21:13:18.000000000 +0200
+++ gmsh-3.0.6-source-new/CMakeLists.txt	2017-11-05 16:49:19.023094241 +0100
@@ -162,8 +162,7 @@ set(GMSH_API
   contrib/MeshOptimizer/MeshOptObjectiveFunction.h contrib/MeshOptimizer/MeshOptVertexCoord.h
   contrib/MeshQualityOptimizer/MeshQualityObjContribIdealJac.h
   contrib/MeshQualityOptimizer/MeshQualityObjContribInvCond.h
-  contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
-  contrib/MathEx/mathex.h)
+  contrib/MeshQualityOptimizer/MeshQualityOptimizer.h)
 
 get_property(IAMCHILD DIRECTORY  PROPERTY PARENT_DIRECTORY)
 if(IAMCHILD)
@@ -665,7 +664,7 @@ endif(HAVE_FLTK OR HAVE_QT OR ENABLE_GRA
 
 if(HAVE_MESH OR HAVE_PLUGINS)
   if(ENABLE_ANN)
-    find_library(ANN_LIB ann PATH_SUFFIXES lib)
+    find_library(ANN_LIB ANN PATH_SUFFIXES lib)
     find_path(ANN_INC "ANN.h" PATH_SUFFIXES src include ANN)
     if(ANN_LIB AND ANN_INC)
       list(APPEND EXTERNAL_LIBRARIES ${ANN_LIB})
@@ -680,8 +679,16 @@ if(HAVE_MESH OR HAVE_PLUGINS)
 endif(HAVE_MESH OR HAVE_PLUGINS)
 
 if(ENABLE_BFGS)
-  add_subdirectory(contrib/lbfgs)
-  include_directories(contrib/lbfgs)
+  find_library(BFGS_LIB lbfgs PATH_SUFFIXES lib)
+  find_path(BFGS_INC "lbfgs.h" PATH_SUFFIXES include)
+  if(BFGS_LIB AND BFGS_INC)
+    list(APPEND EXTERNAL_LIBRARIES ${BFGS_LIB} -lalglib)
+    list(APPEND EXTERNAL_INCLUDES ${BFGS_INC})
+  else(BFGS_LIB AND BFGS_INC)
+    message(STATUS "System libbfgs not found: using contrib/lbfgs instead")
+    add_subdirectory(contrib/lbfgs)
+    include_directories(contrib/lbfgs)
+  endif(BFGS_LIB AND BFGS_INC)
   set_config_option(HAVE_BFGS "Bfgs")
 endif(ENABLE_BFGS)
 
@@ -730,8 +737,16 @@ if(ENABLE_KBIPACK)
 endif(ENABLE_KBIPACK)
 
 if(ENABLE_MATHEX)
-  add_subdirectory(contrib/MathEx)
-  include_directories(contrib/MathEx)
+  find_library(MATHEX_LIB mathex PATH_SUFFIXES lib)
+  find_path(MATHEX_INC "mathex.h" PATH_SUFFIXES src include)
+  if(MATHEX_LIB AND MATHEX_INC)
+     list(APPEND EXTERNAL_LIBRARIES ${MATHEX_LIB})
+     list(APPEND EXTERNAL_INCLUDES ${MATHEX_INC})
+  else(MATHEX_LIB AND MATHEX_INC)
+     message(STATUS "System MATHEX not found: using contrib/MathEx instead")
+    add_subdirectory(contrib/MathEx)
+    include_directories(contrib/MathEx)
+  endif(MATHEX_LIB AND MATHEX_INC)
   set_config_option(HAVE_MATHEX "MathEx")
 endif(ENABLE_MATHEX)
 
@@ -782,8 +797,16 @@ if(HAVE_MESH)
   set_config_option(HAVE_TETGENBR "TetGen/BR")
 
   if(ENABLE_VORO3D)
-    add_subdirectory(contrib/voro++)
-    include_directories(contrib/voro++/src)
+    find_library(VORO3D_LIB voro++ PATH_SUFFIXES lib)
+    find_path(VORO3D_INC "voro++.hh" PATH_SUFFIXES include/voro++)
+    if(VORO3D_LIB AND VORO3D_INC)
+      list(APPEND EXTERNAL_LIBRARIES ${VORO3D_LIB})
+      list(APPEND EXTERNAL_INCLUDES ${VORO3D_INC})
+    else(VORO3D_LIB AND VORO3D_INC)
+      message(STATUS "System voro++ not found: using contrib/voro++ instead")
+      add_subdirectory(contrib/voro++)
+      include_directories(contrib/voro++)
+    endif(VORO3D_LIB AND VORO3D_INC)
     set_config_option(HAVE_VORO3D "Voro3D")
   endif(ENABLE_VORO3D)
 
@@ -795,9 +818,22 @@ if(HAVE_MESH)
   endif(ENABLE_BLOSSOM)
 
   if(ENABLE_NETGEN)
-    add_subdirectory(contrib/Netgen)
-    include_directories(contrib/Netgen contrib/Netgen/libsrc/include
-                        contrib/Netgen/nglib)
+    find_library(NETGEN_LIB nglib PATH_SUFFIXES lib)
+    find_path(NETGEN_INC "nglib.h" PATH_SUFFIXES include/netgen-mesher)
+    if(NETGEN_LIB AND NETGEN_INC)
+      list(APPEND EXTERNAL_LIBRARIES ${NETGEN_LIB})
+      list(APPEND EXTERNAL_INCLUDES ${NETGEN_INC})
+      # Netgen private headers contain what contrib/Salome does
+      list(APPEND EXTERNAL_LIBRARIES -lngocc -lngcsg -lngmesh -lnginterface)
+      list(APPEND EXTERNAL_INCLUDES ${NETGEN_INC}/private ${NETGEN_INC} ${NETGEN_INC}/private/include)
+      add_definitions(-DOCCGEOMETRY)
+      set_config_option(HAVE_SALOME "Salome")
+    else(NETGEN_LIB AND NETGEN_INC)
+      message(STATUS "System netgen not found: using contrib/Netgen instead")
+      add_subdirectory(contrib/Netgen)
+      include_directories(contrib/Netgen contrib/Netgen/libsrc/include
+                          contrib/Netgen/nglib)
+    endif(NETGEN_LIB AND NETGEN_INC)
     set_config_option(HAVE_NETGEN "Netgen")
     add_definitions(-DNO_PARALLEL_THREADS -DNOTCL)
   endif(ENABLE_NETGEN)
@@ -809,8 +845,8 @@ if(HAVE_MESH)
   endif(ENABLE_BAMG)
 
   if(ENABLE_MMG3D)
-    find_library(MMG3D_LIB mmg3dlib4.0 PATH_SUFFIXES lib)
-    find_path(MMG3D_INC "libmmg3d.h" PATH_SUFFIXES src include)
+    find_library(MMG3D_LIB mmg3d4 PATH_SUFFIXES lib)
+    find_path(MMG3D_INC "libmmg3d4.h" PATH_SUFFIXES src include)
     if(MMG3D_LIB AND MMG3D_INC)
        list(APPEND EXTERNAL_LIBRARIES ${MMG3D_LIB})
        list(APPEND EXTERNAL_INCLUDES ${MMG3D_INC})
diff -rupN gmsh-3.0.6-source/Mesh/CMakeLists.txt gmsh-3.0.6-source-new/Mesh/CMakeLists.txt
--- gmsh-3.0.6-source/Mesh/CMakeLists.txt	2017-10-03 22:01:51.000000000 +0200
+++ gmsh-3.0.6-source-new/Mesh/CMakeLists.txt	2017-11-05 16:49:19.024094240 +0100
@@ -47,6 +47,7 @@ set(SRC
     yamakawa.cpp
     Field.cpp
     surfaceFiller.cpp
+    nglib_gmsh.cpp
 )
 
 file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h) 
diff -rupN gmsh-3.0.6-source/Mesh/meshGRegionMMG3D.cpp gmsh-3.0.6-source-new/Mesh/meshGRegionMMG3D.cpp
--- gmsh-3.0.6-source/Mesh/meshGRegionMMG3D.cpp	2017-10-03 22:01:51.000000000 +0200
+++ gmsh-3.0.6-source-new/Mesh/meshGRegionMMG3D.cpp	2017-11-05 16:49:19.024094240 +0100
@@ -19,7 +19,7 @@
 #include "Context.h"
 
 extern "C" {
-#include <libmmg3d.h>
+#include <libmmg3d4.h>
 #define M_UNUSED    (1 << 0)
 }