# generate tetgen library
add_definitions(-DTETLIBRARY)

# Tricky tuning for tetgen: we need to force the C++ flags, according to the distributed makefile
# see makefile in the same directory
# see also http://tetgen.berlios.de/compile.html
if (UNIX)
    # only possible (needed?) when using gcc
    set_source_files_properties(predicates.cxx PROPERTIES COMPILE_FLAGS "-O0")
    set_source_files_properties(tetgen.cxx tetgen.h PROPERTIES COMPILE_FLAGS "-Wall -DSELF_CHECK -g")
endif()

#-----------
# 64bits
#-----------
# this is needed on 64bits processor to avoid relocation R_X86_64_32 error
if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
  add_definitions(-fPIC)
endif()

add_library (tetgen STATIC predicates.cxx tetgen.cxx tetgen.h )
