4 set(TETGEN_DIR $ENV{TETGEN_DIR})
11 PATHS ${TETGEN_DIR}/lib
13 NO_CMAKE_ENVIRONMENT_PATH
15 NO_SYSTEM_ENVIRONMENT_PATH
17 CMAKE_FIND_ROOT_PATH_BOTH
19 find_path(TETGEN_HEADER
21 PATHS ${TETGEN_DIR}/include
23 message(STATUS ${TETGEN_LIBRARY})
24 message(STATUS ${TETGEN_HEADER})
25 if(TETGEN_LIBRARY AND TETGEN_HEADER)
26 include_directories(${TETGEN_HEADER})
27 add_definitions(-DWITH_TETGEN)
28 endif(TETGEN_LIBRARY AND TETGEN_HEADER)
34 PREFIX ${PROJECT_BINARY_DIR}/external/
35 URL https://bitbucket.org/likask/mofem-joseph/downloads/tetgen-1.5.0.tgz
36 CONFIGURE_COMMAND cmake ${PROJECT_BINARY_DIR}/external/src/tetgen
40 execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${PROJECT_BINARY_DIR}/external/lib/libtet.a)
44 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/external/src/tetgen/include/tetgen.h ${PROJECT_BINARY_DIR}/external/include
45 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/external/src/tetgen-build/libtet* ${PROJECT_BINARY_DIR}/external/lib
46 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/external/src/tetgen-build/tetgen ${PROJECT_BINARY_DIR}/external/bin
49 add_dependencies(install_prerequisites tetgen copy_tetgen_fields)
53 if(NOT TETGEN_LIBRARY)
54 set(TETGEN_DIR ${PROJECT_BINARY_DIR}/external CACHE FILEPATH "path to tetgen dir" FORCE)
55 set(TETGEN_HEADER ${TETGEN_DIR}/include)
56 include_directories(${TETGEN_HEADER})
57 set(TETGEN_LIBRARY ${TETGEN_DIR}/lib/libtet.a)
58 add_definitions(-DWITH_TETGEN)
59 message(STATUS ${TETGEN_LIBRARY})
60 message(STATUS ${TETGEN_HEADER})
61 endif(NOT TETGEN_LIBRARY)