author Dmitriy Morozov <>
Thu, 18 Dec 2008 16:43:42 -0800
changeset 97 0a9bd3f34419
parent 88 9e00cf44ea5d
child 99 6c0da7931e4d
child 104 2cc1db3b98c6
permissions -rw-r--r--
Intermediate commit while converting to the new architecture * Converted Filtration into StaticPersistence and DynamicPersistenceTrails (both right now work with the underlying std::vector rather than std::list order) * Filtration is now just an auxilliary glue (a map between Complex and Persistence) * Whether chains are vectors or lists can be interchanged * Added PersistenceDiagram with a simple bottleneck_distance() function * Converted triangle, alphashapes3d, and cech-complex examples * Lots of organizational changes (factoring utilities out into containers.h, indirect.h, property-maps.h) * Trying to document along the way with NaturalDocs-type comments

project						(Dionysus)
cmake_minimum_required      (VERSION 2.4)

option						(logging 			"Build Dionysus with logging on" 		OFF)
option						(counters			"Build Dionysus with counters on" 		OFF)
option						(debug				"Build Dionysus with debugging on" 		OFF)
option						(optimize			"Build Dionysus with optimization"		ON)
option						(use_dsrpdb			"Build examples that use DSR-PDB"		OFF)
option						(use_synaps			"Build examples that use SYNAPS"		OFF)

# Find everything that's always required
find_package				(Boost REQUIRED COMPONENTS program_options serialization signals)
find_package				(Doxygen)
if                          (use_dsrpdb)
    find_library			(dsrpdb_LIBRARY 			NAMES dsrpdb)
    find_path				(dsrpdb_INCLUDE_DIR 		dsrpdb/Protein.h)
endif                       (use_dsrpdb)

execute_process				(COMMAND ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_SOURCE_DIR}/FindCGAL.Makefile libpaths
							 OUTPUT_VARIABLE cgal_libpaths)
execute_process				(COMMAND ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_SOURCE_DIR}/FindCGAL.Makefile ldflags
							 OUTPUT_VARIABLE cgal_ldflags)
execute_process				(COMMAND ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_SOURCE_DIR}/FindCGAL.Makefile cxxflags
							 OUTPUT_VARIABLE cgal_cxxflags)
execute_process				(COMMAND ${CMAKE_MAKE_PROGRAM} -f ${CMAKE_CURRENT_SOURCE_DIR}/FindCGAL.Makefile libpath
							 OUTPUT_VARIABLE cgal_libpath)
#string						(REPLACE "\n" "" cgal_libpaths	${cgal_libpaths})
#string						(REPLACE "\n" "" cgal_ldflags 	${cgal_ldflags})
string						(REPLACE "\n" "" cgal_cxxflags 	${cgal_cxxflags})
string						(REPLACE "\n" "" cgal_libpath 	${cgal_libpath})
find_library				(cgal_LIBRARY				NAMES CGAL
														PATHS ${cgal_libpath})
find_library				(core_LIBRARY				NAMES CGALcore++
														PATHS ${cgal_libpath})
find_library				(mpfr_LIBRARY				NAMES mpfr)
find_library				(gmp_LIBRARY				NAMES gmp)
find_library				(gmpxx_LIBRARY				NAMES gmpxx)
find_library				(m_LIBRARY					NAMES m)

set							(cgal_libraries 			${cgal_LIBRARY} 
add_definitions             (-DCGAL_NO_ASSERTIONS -DCGAL_NO_PRECONDITIONS)

if                          (use_synaps)
    add_definitions			(-DBOOST_UBLAS_TYPE_CHECK=0)
    find_library			(synaps_LIBRARY				NAMES synaps)
    set						(synaps_libraries			${synaps_LIBRARY}
endif                       (use_synaps)

# Debugging
if							(debug)
	if 						(optimize)
			set				(cxx_flags					${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
	else					(optimize)
			set				(cxx_flags					${CMAKE_CXX_FLAGS_DEBUG})
	endif					(optimize)
else						(debug)
	if 						(optimize)
			set				(cxx_flags					${CMAKE_CXX_FLAGS_RELEASE})
	else					(optimize)
			set				(cxx_flags					${CMAKE_CXX_FLAGS})
	endif					(optimize)
endif						(debug)
add_definitions				(${cxx_flags})

# Logging
if 							(logging)
	find_library			(rlog_LIBRARY				NAMES rlog)
	find_path				(rlog_INCLUDE_DIR			rlog/rlog.h)
	set						(rlog_INCLUDE_DIR			${rlog_INCLUDE_DIR})
	add_definitions			(-DLOGGING -DRLOG_COMPONENT=dionysus)
	set						(libraries					${libraries} ${rlog_LIBRARY})
endif						(logging)

# Counters
if							(counters)
	add_definitions			(-DCOUNTERS)
endif						(counters)

# Set includes
include_directories			(${CMAKE_CURRENT_BINARY_DIR}

# Doxygen (FIXME)
if							(DOXYGEN_FOUND)
#	add_custom_target 		(docs ALL 
#							${DOXYGEN_EXECUTABLE} Doxyfile
#							DEPENDS Doxyfile)
endif						(DOXYGEN_FOUND)

# Process subdirectories
add_subdirectory			(examples)
add_subdirectory			(tests)