Skip to content
Snippets Groups Projects
Commit 93084a3f authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

look for system installations of ANN, MMG3D, TETGEN and GMM before using contrib/ versions

(modified patch from Christophe Trophime for Debian)
parent 6296b271
No related branches found
No related tags found
No related merge requests found
......@@ -451,8 +451,16 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
endif(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
if(ENABLE_ANN)
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})
list(APPEND EXTERNAL_INCLUDES ${ANN_INC})
else(ANN_LIB AND ANN_INC)
message(STATUS "System ANN not found - using contrib/ANN instead")
add_subdirectory(contrib/ANN)
include_directories(contrib/ANN/include)
endif(ANN_LIB AND ANN_INC)
set_config_option(HAVE_ANN "Ann")
endif(ENABLE_ANN)
......@@ -482,7 +490,13 @@ if(ENABLE_DINTEGRATION)
endif(ENABLE_DINTEGRATION)
if(ENABLE_GMM)
find_path(GMM_INC "gmm.h" PATH_SUFFIXES src include include/gmm)
if(GMM_INC)
list(APPEND EXTERNAL_INCLUDES ${GMM_INC})
else(GMM_INC)
message(STATUS "System GMM not found - using contrib/gmm instead")
include_directories(contrib/gmm)
endif(GMM_INC)
set_config_option(HAVE_GMM "Gmm")
endif(ENABLE_GMM)
......@@ -548,8 +562,16 @@ 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)
if(MMG3D_LIB AND MMG3D_INC)
list(APPEND EXTERNAL_LIBRARIES ${MMG3D_LIB})
list(APPEND EXTERNAL_INCLUDES ${MMG3D_INC})
else(MMG3D_LIB AND MMG3D_INC)
message(STATUS "System MMG3D not found - using contrib/mmg3d instead")
add_subdirectory(contrib/mmg3d)
include_directories(contrib/mmg3d/build/sources)
endif(MMG3D_LIB AND MMG3D_INC)
set_config_option(HAVE_MMG3D "Mmg3d")
endif(ENABLE_MMG3D)
......@@ -565,9 +587,19 @@ if(HAVE_MESH)
include_directories(contrib/Tetgen)
set_config_option(HAVE_TETGEN "Tetgen")
add_definitions(-DTETLIBRARY)
elseif(ENABLE_TETGEN)
find_library(TETGEN_LIB tet PATH_SUFFIXES lib)
find_path(TETGEN_INC "tetgen.h" PATH_SUFFIXES src include tetgen)
if(TETGEN_LIB AND TETGEN_INC)
list(APPEND EXTERNAL_LIBRARIES ${TETGEN_LIB})
list(APPEND EXTERNAL_INCLUDES ${TETGEN_INC})
set_config_option(HAVE_TETGEN "Tetgen")
endif(TETGEN_LIB AND TETGEN_INC)
endif(ENABLE_TETGEN_NEW AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/TetgenNew/tetgen.h)
if(HAVE_TETGEN)
message("WARNING: By including Tetgen you have to comply with Tetgen's "
"special licensing requirements stated in contrib/Tetgen/LICENSE.")
endif(ENABLE_TETGEN_NEW AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/TetgenNew/tetgen.h)
endif(HAVE_TETGEN)
endif(HAVE_MESH)
if(ENABLE_FOURIER_MODEL)
......
......@@ -20,13 +20,12 @@
typedef struct {
int Num;
// t is the local coordinate of the point
// lc is x'(t)/h((x(t))
// lc is x'(t)/h(x(t))
// p is the value of the primitive
// xp is the norm of the tangent vector
double t, lc, p, xp;
} IntPoint;
static double smoothPrimitive(GEdge *ge, double alpha,
std::vector<IntPoint> &Points)
{
......@@ -119,7 +118,7 @@ static double F_Transfinite(GEdge *ge, double t_)
{
double length = ge->length();
if(length == 0.0){
Msg::Error("Zero-length curve in transfinite mesh");
Msg::Error("Zero-length curve %d in transfinite mesh", ge->tag());
return 1.;
}
......@@ -352,8 +351,8 @@ void meshGEdge::operator() (GEdge *ge)
double a;
int N;
if(length == 0. && CTX::instance()->mesh.toleranceEdgeLength == 0.){
Msg::Error("Curve %d has a zero length", ge->tag());
a = 0;
Msg::Warning("Curve %d has a zero length", ge->tag());
a = 0.;
N = 1;
}
else if(ge->degenerate(0)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment