From 9d4e6f28ceeb362c9d751cbac730a13d1b5d61c7 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 19 Jun 2019 08:56:56 +0200 Subject: CGAL 4.11 as minimal version --- src/GudhUI/CMakeLists.txt | 2 +- src/Simplex_tree/example/CMakeLists.txt | 4 ++-- .../modules/GUDHI_third_party_libraries.cmake | 2 ++ src/common/example/CMakeLists.txt | 24 ++++++++-------------- src/cython/CMakeLists.txt | 2 +- 5 files changed, 15 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt index ab29097b..9b73dcaa 100644 --- a/src/GudhUI/CMakeLists.txt +++ b/src/GudhUI/CMakeLists.txt @@ -9,7 +9,7 @@ if (OPENGL_FOUND) find_package(QGLViewer QUIET) if ( QGLVIEWER_FOUND) - if ( CGAL_FOUND AND NOT CGAL_VERSION VERSION_LESS 4.11.0) + if (NOT CGAL_VERSION VERSION_LESS 4.11.0) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt index 1a6de60a..f99b164c 100644 --- a/src/Simplex_tree/example/CMakeLists.txt +++ b/src/Simplex_tree/example/CMakeLists.txt @@ -19,7 +19,7 @@ add_executable ( Simplex_tree_example_mini_simplex_tree mini_simplex_tree.cpp ) add_test(NAME Simplex_tree_example_mini_simplex_tree COMMAND $) # An example with Simplex-tree using CGAL alpha_shapes_3 -if(GMP_FOUND AND CGAL_FOUND) +if(GMP_FOUND AND NOT CGAL_VERSION VERSION_LESS 4.11.0) add_executable ( Simplex_tree_example_alpha_shapes_3_from_off example_alpha_shapes_3_simplex_tree_from_off_file.cpp ) target_link_libraries(Simplex_tree_example_alpha_shapes_3_from_off ${GMP_LIBRARIES} ${CGAL_LIBRARY}) if (TBB_FOUND) @@ -38,7 +38,7 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) endif() add_test(NAME Simplex_tree_example_cech_complex_cgal_mini_sphere_3d COMMAND $ "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" -r 0.3 -d 3) -endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) +endif () add_executable ( Simplex_tree_example_graph_expansion_with_blocker graph_expansion_with_blocker.cpp ) if (TBB_FOUND) diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake index 477900ae..1dbddfd9 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.cmake +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -27,7 +27,9 @@ find_package(CGAL QUIET) if (CGAL_FOUND AND CGAL_VERSION VERSION_LESS 4.11.0) message("++ CGAL version ${CGAL_VERSION} is considered too old to be used by Gudhi.") unset(CGAL_FOUND) + unset(CGAL_VERSION) endif() + if(CGAL_FOUND) message(STATUS "CGAL version: ${CGAL_VERSION}.") include( ${CGAL_USE_FILE} ) diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index b9263cc9..583a0027 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -6,8 +6,6 @@ file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CM add_test(NAME Common_example_vector_double_off_reader COMMAND $ "alphacomplexdoc.off") -install(TARGETS vector_double_off_reader DESTINATION bin) - if (DIFF_PATH) # Do not forget to copy test results files in current binary dir file(COPY "vectordoubleoffreader_result.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) @@ -16,21 +14,17 @@ if (DIFF_PATH) ${CMAKE_CURRENT_BINARY_DIR}/vectordoubleoffreader_result.txt ${CMAKE_CURRENT_BINARY_DIR}/alphacomplexdoc.off.txt) endif() -if(CGAL_FOUND) +if(NOT CGAL_VERSION VERSION_LESS 4.11.0) add_executable ( cgal_3D_off_reader example_CGAL_3D_points_off_reader.cpp ) target_link_libraries(cgal_3D_off_reader ${CGAL_LIBRARY}) add_test(NAME Common_example_vector_cgal_3D_off_reader COMMAND $ "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off") - - install(TARGETS cgal_3D_off_reader DESTINATION bin) - - # need CGAL 4.7 and Eigen3 - if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) - add_executable ( cgal_off_reader example_CGAL_points_off_reader.cpp ) - target_link_libraries(cgal_off_reader ${CGAL_LIBRARY}) - add_test(NAME Common_example_vector_cgal_off_reader COMMAND $ - "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off") - install(TARGETS cgal_off_reader DESTINATION bin) - endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) - endif() + +# requires CGAL and Eigen3 +if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) + add_executable ( cgal_off_reader example_CGAL_points_off_reader.cpp ) + target_link_libraries(cgal_off_reader ${CGAL_LIBRARY}) + add_test(NAME Common_example_vector_cgal_off_reader COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off") +endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt index af71bb3b..509a122e 100644 --- a/src/cython/CMakeLists.txt +++ b/src/cython/CMakeLists.txt @@ -412,7 +412,7 @@ if(PYTHONINTERP_FOUND) # Set missing or not modules set(GUDHI_MODULES ${GUDHI_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MODULES") else(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) - message("++ Python documentation module will not be compiled because it requires a CGAL with Eigen3 version greater or equal than 4.8.1") + message("++ Python documentation module will not be compiled because it requires a Eigen3 and CGAL version >= 4.11.0") set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MISSING_MODULES") endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) else(SCIPY_FOUND) -- cgit v1.2.3