bindings/python/CMakeLists.txt
author Christos Mantoulidis <cmad@stanford.edu>
Tue, 04 Aug 2009 13:23:16 -0700
branchdev
changeset 156 f75fb57d2831
parent 131 d9e050258358
child 144 baa53970eb88
permissions -rw-r--r--
Changed implementation of WeightedRips to store simplex values (max distance between simplices' vertices) as an invisible layer on top of each simplex object, so that the data() field of WeightedRips has been freed for use by the users again.

find_package                (PythonLibs)
link_libraries              (${PYTHON_LIBRARIES})
include_directories         (${PYTHON_INCLUDE_PATH})
link_libraries              (${Boost_PYTHON_LIBRARY})

# currently can't build bindings with counters support, eventually FIXME
remove_definitions          (-DCOUNTERS)
set                         (sources
                                                dionysus.cpp 
                                                filtration.cpp
                                                chain.cpp
                                                static-persistence.cpp
                                                simplex.cpp
                                                zigzag-persistence.cpp
                                                rips.cpp
                            )
set                         (bindings_libraries ${libraries})

if                          (CGAL_FOUND)
    set                     (sources            ${sources}
                                                alphashapes3d.cpp
                                                alphashapes2d.cpp)
    add_definitions         (${CGAL_CXX_FLAGS_INIT})
    include_directories     (${CGAL_INCLUDE_DIRS})

    link_libraries          (${CGAL_LIBRARY})                                            
else                            (CGAL_FOUND)
    message(STATUS "CGAL not found, alphashape bindings will not be built")
endif                       (CGAL_FOUND)

add_library                 (_dionysus SHARED   ${sources})
target_link_libraries       (_dionysus          ${libraries})


# Python files and the symlink
add_custom_target           (dionysus ALL
                             ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/dionysus ${CMAKE_CURRENT_BINARY_DIR}/dionysus
                             DEPENDS            dionysus/__init__.py
                                                dionysus/distances.py
                            )

get_target_property         (_dionysus_location _dionysus LOCATION)
add_custom_target           (dionysus-link ALL 
                             ${CMAKE_COMMAND} -E create_symlink ${_dionysus_location} ${CMAKE_CURRENT_BINARY_DIR}/dionysus/_dionysus.so
                             DEPENDS _dionysus)