Commit 181cb4cc authored by Michael Turner's avatar Michael Turner

tetgen added to cmake

parent 92fc5ea3
......@@ -96,16 +96,20 @@ MARK_AS_ADVANCED(NEKTAR_BUILD_PACKAGES)
OPTION(NEKTAR_TEST_ALL "Include full set of regression tests to this build." OFF)
# meshing and cad options
OPTION(NEKTAR_USE_OCC "Use opencascade for geometry interface." OFF)
OPTION(NEKTAR_USE_MESH "Build meshing utilities." OFF)
# Build options
OPTION(NEKTAR_FULL_DEBUG "Enable Full Debugging." OFF)
MARK_AS_ADVANCED(NEKTAR_FULL_DEBUG)
IF (${CMAKE_COMPILER_IS_GNUCXX})
IF (${CMAKE_COMPILER_IS_GNUCXX})
OPTION(NEKTAR_ENABLE_PROFILE "Uses -pg compiler flag" OFF)
MARK_AS_ADVANCED(NEKTAR_ENABLE_PROFILE)
ENDIF (${CMAKE_COMPILER_IS_GNUCXX})
ENDIF (${CMAKE_COMPILER_IS_GNUCXX})
OPTION(NEKTAR_USE_EXPRESSION_TEMPLATES
OPTION(NEKTAR_USE_EXPRESSION_TEMPLATES
"Use Expression templates." OFF)
MARK_AS_ADVANCED(NEKTAR_USE_EXPRESSION_TEMPLATES)
......@@ -141,7 +145,7 @@ MARK_AS_ADVANCED(NEKTAR_USE_MEMORY_POOLS)
IF (MSVC)
# Needed for M_PI to be visible in visual studio.
ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
# Removes the warnings about unsafe methods such as strcpy, std::copy,
# memcmp, etc.
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE)
......@@ -179,6 +183,7 @@ INCLUDE (ThirdPartyVTK)
INCLUDE (ThirdPartyQT4)
INCLUDE (ThirdPartySMV)
INCLUDE (ThirdPartyTriangle)
INCLUDE (ThirdPartyTetGen)
INCLUDE (ThirdPartyCCM)
INCLUDE (Doxygen)
......@@ -198,7 +203,7 @@ ENDIF( NEKTAR_USE_OPENBLAS )
IF( NEKTAR_USE_SMV )
INCLUDE (FindSMV)
SET(NEKTAR_USING_SMV TRUE)
ADD_DEFINITIONS(-DNEKTAR_USING_SMV)
ADD_DEFINITIONS(-DNEKTAR_USING_SMV)
ENDIF( NEKTAR_USE_SMV )
IF( NEKTAR_USE_ACCELERATE_FRAMEWORK )
......@@ -233,7 +238,7 @@ IF( NEKTAR_USE_TINYXML_STL )
ADD_DEFINITIONS( -DTIXML_USE_STL)
ENDIF( NEKTAR_USE_TINYXML_STL )
IF( NEKTAR_USE_DIRECT_BLAS_CALLS )
IF( NEKTAR_USE_DIRECT_BLAS_CALLS )
ADD_DEFINITIONS(-DNEKTAR_USING_DIRECT_BLAS_CALLS)
ENDIF( NEKTAR_USE_DIRECT_BLAS_CALLS )
......@@ -260,8 +265,8 @@ ENDIF( )
# Set up include directories. Include work-around for -isystem for CMake (see
# bug 0010837) to avoid unnecessary compiler warnings for third-party libs.
IF (APPLE)
SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
ENDIF (APPLE)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
......
OPTION(NEKTAR_USE_OCC "Use opencascade for geometry interface." OFF)
IF(NEKTAR_USE_OCC)
......
########################################################################
#
# ThirdParty configuration for Nektar++
#
# TETGEN
#
########################################################################
IF(NEKTAR_USE_MESH)
SET(BUILD_TETGEN ON)
OPTION(THIRDPARTY_BUILD_TETGEN
"Build Triangle library from ThirdParty." ${BUILD_TETGEN})
IF (THIRDPARTY_BUILD_TETGEN)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
tetgen-1.5
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/tetgen.zip
URL_MD5 09218b66cdc256ffd2b3c54fc5a19e16
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
)
SET(TETGEN_LIBRARY triangle CACHE FILEPATH
"TetGen library" FORCE)
SET(TETGEN_INCLUDE_DIR ${TPDIST}/include CACHE FILEPATH
"TetGen include" FORCE)
LINK_DIRECTORIES(${TPDIST}/lib)
IF (WIN32)
MESSAGE(STATUS
"Build TetGen: ${TPDIST}/${LIB_DIR}/${TETGEN_LIBRARY}.dll")
ELSE ()
MESSAGE(STATUS
"Build TetGen: ${TPDIST}/${LIB_DIR}/lib${TETGEN_LIBRARY}.a")
ENDIF ()
SET(TETGEN_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
ADD_CUSTOM_TARGET(tetgen-1.5 ALL)
MESSAGE(STATUS "Found Tetgen: ${TETGEN_LIBRARY}")
SET(TRIANGLE_CONFIG_INCLUDE_DIR ${TETGEN_INCLUDE_DIR})
ENDIF (THIRDPARTY_BUILD_TETGEN)
INCLUDE_DIRECTORIES(SYSTEM ${TETGEN_INCLUDE_DIR})
ENDIF(NEKTAR_USE_MESH)
......@@ -6,20 +6,13 @@
#
########################################################################
OPTION(NEKTAR_USE_MESH "Build meshing utilities." OFF)
IF(NEKTAR_USE_MESH)
# First search for system Triangle installs. Hint /opt/local for MacPorts.
FIND_PATH (TRIANGLE_INCLUDE_DIR triangle.h PATHS /opt/local/include)
FIND_LIBRARY(TRIANGLE_LIBRARY NAMES "triangle" PATHS /opt/local/lib)
# If we have our library then don't build Triangle
IF (TRIANGLE_INCLUDE_DIR AND TRIANGLE_LIBRARY)
SET(BUILD_TRIANGLE OFF)
ELSE()
SET(BUILD_TRIANGLE ON)
ENDIF ()
SET(BUILD_TRIANGLE ON)
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