diff options
author | Hind-M <hind.montassif@gmail.com> | 2021-09-30 16:13:39 +0200 |
---|---|---|
committer | Hind-M <hind.montassif@gmail.com> | 2021-09-30 16:13:39 +0200 |
commit | 65b32d167810a107cf807572f84cef082c76067d (patch) | |
tree | b1b526c798717dda22dacfbfbba54708fe808bd2 /src/Cech_complex | |
parent | 767d9fca5da2d3dd9698a5c27e9bedc159271f67 (diff) |
Add Cech tests, examples, utilities and benchmark to the build only if CGAL is present
Diffstat (limited to 'src/Cech_complex')
-rw-r--r-- | src/Cech_complex/benchmark/CMakeLists.txt | 18 | ||||
-rw-r--r-- | src/Cech_complex/example/CMakeLists.txt | 26 | ||||
-rw-r--r-- | src/Cech_complex/test/CMakeLists.txt | 19 | ||||
-rw-r--r-- | src/Cech_complex/utilities/CMakeLists.txt | 24 |
4 files changed, 48 insertions, 39 deletions
diff --git a/src/Cech_complex/benchmark/CMakeLists.txt b/src/Cech_complex/benchmark/CMakeLists.txt index bc54c0f3..ccd1b324 100644 --- a/src/Cech_complex/benchmark/CMakeLists.txt +++ b/src/Cech_complex/benchmark/CMakeLists.txt @@ -1,13 +1,15 @@ project(Cech_complex_benchmark) -# Do not forget to copy test files in current binary dir -file(COPY "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) +if (CGAL_FOUND) + # Do not forget to copy test files in current binary dir + file(COPY "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -if(TARGET Boost::filesystem) - add_executable(cech_complex_benchmark cech_complex_benchmark.cpp) - target_link_libraries(cech_complex_benchmark Boost::filesystem) + if(TARGET Boost::filesystem) + add_executable(cech_complex_benchmark cech_complex_benchmark.cpp) + target_link_libraries(cech_complex_benchmark Boost::filesystem) - if (TBB_FOUND) - target_link_libraries(cech_complex_benchmark ${TBB_LIBRARIES}) + if (TBB_FOUND) + target_link_libraries(cech_complex_benchmark ${TBB_LIBRARIES}) + endif() endif() -endif()
\ No newline at end of file +endif() diff --git a/src/Cech_complex/example/CMakeLists.txt b/src/Cech_complex/example/CMakeLists.txt index 1b08c7cb..52dec63f 100644 --- a/src/Cech_complex/example/CMakeLists.txt +++ b/src/Cech_complex/example/CMakeLists.txt @@ -1,17 +1,19 @@ project(Cech_complex_examples) -if (TARGET Boost::program_options) - add_executable ( Cech_complex_example_step_by_step cech_complex_step_by_step.cpp ) - target_link_libraries(Cech_complex_example_step_by_step Boost::program_options) - if (TBB_FOUND) - target_link_libraries(Cech_complex_example_step_by_step ${TBB_LIBRARIES}) +if (CGAL_FOUND) + if (TARGET Boost::program_options) + add_executable ( Cech_complex_example_step_by_step cech_complex_step_by_step.cpp ) + target_link_libraries(Cech_complex_example_step_by_step Boost::program_options) + if (TBB_FOUND) + target_link_libraries(Cech_complex_example_step_by_step ${TBB_LIBRARIES}) + endif() + add_test(NAME Cech_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:Cech_complex_example_step_by_step> + "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-r" "0.25" "-d" "3") endif() - add_test(NAME Cech_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:Cech_complex_example_step_by_step> - "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-r" "0.25" "-d" "3") -endif() -add_executable ( Cech_complex_example_from_points cech_complex_example_from_points.cpp) -if (TBB_FOUND) - target_link_libraries(Cech_complex_example_from_points ${TBB_LIBRARIES}) + add_executable ( Cech_complex_example_from_points cech_complex_example_from_points.cpp) + if (TBB_FOUND) + target_link_libraries(Cech_complex_example_from_points ${TBB_LIBRARIES}) + endif() + add_test(NAME Cech_complex_example_from_points COMMAND $<TARGET_FILE:Cech_complex_example_from_points>) endif() -add_test(NAME Cech_complex_example_from_points COMMAND $<TARGET_FILE:Cech_complex_example_from_points>) diff --git a/src/Cech_complex/test/CMakeLists.txt b/src/Cech_complex/test/CMakeLists.txt index e6a2a18f..8e725f50 100644 --- a/src/Cech_complex/test/CMakeLists.txt +++ b/src/Cech_complex/test/CMakeLists.txt @@ -1,11 +1,14 @@ -include(GUDHI_boost_test) +if (CGAL_FOUND) + include(GUDHI_boost_test) -add_executable ( Cech_complex_test_unit test_cech_complex.cpp ) -if (TBB_FOUND) - target_link_libraries(Cech_complex_test_unit ${TBB_LIBRARIES}) -endif() + add_executable ( Cech_complex_test_unit test_cech_complex.cpp ) + if (TBB_FOUND) + target_link_libraries(Cech_complex_test_unit ${TBB_LIBRARIES}) + endif() + + # Do not forget to copy test files in current binary dir + file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -# Do not forget to copy test files in current binary dir -file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) + gudhi_add_boost_test(Cech_complex_test_unit) -gudhi_add_boost_test(Cech_complex_test_unit) +endif() diff --git a/src/Cech_complex/utilities/CMakeLists.txt b/src/Cech_complex/utilities/CMakeLists.txt index b183c8d8..efe40e57 100644 --- a/src/Cech_complex/utilities/CMakeLists.txt +++ b/src/Cech_complex/utilities/CMakeLists.txt @@ -1,15 +1,17 @@ -project(Cech_complex_utilities) +if (CGAL_FOUND) + project(Cech_complex_utilities) -if (TARGET Boost::program_options) - add_executable(cech_persistence cech_persistence.cpp) - target_link_libraries(cech_persistence Boost::program_options) + if (TARGET Boost::program_options) + add_executable(cech_persistence cech_persistence.cpp) + target_link_libraries(cech_persistence Boost::program_options) - if (TBB_FOUND) - target_link_libraries(cech_persistence ${TBB_LIBRARIES}) - endif() + if (TBB_FOUND) + target_link_libraries(cech_persistence ${TBB_LIBRARIES}) + endif() - add_test(NAME Cech_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:cech_persistence> - "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3") + add_test(NAME Cech_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:cech_persistence> + "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3") - install(TARGETS cech_persistence DESTINATION bin) -endif()
\ No newline at end of file + install(TARGETS cech_persistence DESTINATION bin) + endif() +endif() |