Commit 8ff04d4f authored by Dave Moxey's avatar Dave Moxey

Merge branch 'feature/thirdparty-deps' into 'master'

Add support for packaged libtet and libtriangle

See merge request !953
parents ea5bc8b6 ae624d79
Pipeline #659 passed with stage
in 0 seconds
......@@ -99,6 +99,7 @@ v5.0.0
- Fix manifold face curvature nodes (!913)
- Fix writing 1D surfaces (!930)
- Fix surface string parsin in BL splitting (!937)
- Enable use of distributed packages for triangle and TetGen (!953)
- Fix issue with MLSC after Scotch conversion (!943)
- Add support for Gmsh 4.0 mesh file format (!964)
- Fix surface extraction, added regression test (!994)
......
......@@ -7,31 +7,50 @@
########################################################################
IF(NEKTAR_USE_MESHGEN)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
tetgen-1.5
PREFIX ${TPSRC}
URL ${TPURL}/tetgen.zip
URL_MD5 6d62e63f9b1e7a8ce53d5bc87e6a0a09
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/tetgen-1.5
BINARY_DIR ${TPBUILD}/tetgen-1.5
TMP_DIR ${TPBUILD}/tetgen-1.5-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
# Search for system-installed Triangle installation
FIND_LIBRARY(TETGEN_LIBRARY NAMES tet)
FIND_PATH(TETGEN_INCLUDE_DIR tetgen.h)
IF(TETGEN_LIBRARY AND TETGEN_INCLUDE_DIR)
SET(BUILD_TETGEN OFF)
ELSE()
SET(BUILD_TETGEN ON)
ENDIF()
OPTION(THIRDPARTY_BUILD_TETGEN
"Build TetGen library from ThirdParty." ${BUILD_TETGEN})
IF (THIRDPARTY_BUILD_TETGEN)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
tetgen-1.5
PREFIX ${TPSRC}
URL ${TPURL}/tetgen.zip
URL_MD5 6d62e63f9b1e7a8ce53d5bc87e6a0a09
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/tetgen-1.5
BINARY_DIR ${TPBUILD}/tetgen-1.5
TMP_DIR ${TPBUILD}/tetgen-1.5-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR}
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX:PATH=${TPDIST}
${TPSRC}/tetgen-1.5
)
THIRDPARTY_LIBRARY(TETGEN_LIBRARY STATIC tetgen
DESCRIPTION "Tetgen library")
SET(TETGEN_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"TetGen include" FORCE)
MESSAGE(STATUS "Build TetGen: ${TETGEN_LIBRARY}")
SET(TETGEN_CONFIG_INCLUDE_DIR ${TPINC})
)
THIRDPARTY_LIBRARY(TETGEN_LIBRARY STATIC tetgen
DESCRIPTION "Tetgen library")
SET(TETGEN_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"TetGen include" FORCE)
MESSAGE(STATUS "Build TetGen: ${TETGEN_LIBRARY}")
SET(TETGEN_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
ADD_CUSTOM_TARGET(tetgen-1.5 ALL)
MESSAGE(STATUS "Found TetGen: ${TETGEN_LIBRARY}")
SET(TETGEN_CONFIG_INCLUDE_DIR ${TETGEN_INCLUDE_DIR})
ENDIF()
MARK_AS_ADVANCED(TETGEN_LIBRARY)
MARK_AS_ADVANCED(TETGEN_INCLUDE_DIR)
......
......@@ -7,7 +7,15 @@
########################################################################
IF(NEKTAR_USE_MESHGEN)
SET(BUILD_TRIANGLE ON)
# Search for system-installed Triangle installation
FIND_LIBRARY(TRIANGLE_LIBRARY NAMES triangle)
FIND_PATH(TRIANGLE_INCLUDE_DIR triangle.h)
IF(TRIANGLE_LIBRARY AND TRIANGLE_INCLUDE_DIR)
SET(BUILD_TRIANGLE OFF)
ELSE()
SET(BUILD_TRIANGLE ON)
ENDIF()
OPTION(THIRDPARTY_BUILD_TRIANGLE
"Build Triangle library from ThirdParty." ${BUILD_TRIANGLE})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment