From 9bf41340435c7a9cc0dc4df1836fa01a5220c25a Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 9 Oct 2024 13:14:11 +0100 Subject: [PATCH] Only link with Boost::program_options - Supported the minimum required cmake --- Generator/benchmark/Generator/CMakeLists.txt | 9 ++------- Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt | 8 ++------ Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt | 10 ++++------ 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Generator/benchmark/Generator/CMakeLists.txt b/Generator/benchmark/Generator/CMakeLists.txt index a31ce526369..e1daf72a299 100644 --- a/Generator/benchmark/Generator/CMakeLists.txt +++ b/Generator/benchmark/Generator/CMakeLists.txt @@ -10,13 +10,8 @@ find_package(Boost COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) create_single_source_cgal_program("random_grid.cpp") create_single_source_cgal_program("random_disc_2.cpp") - if(TARGET Boost::program_options) - target_link_libraries(random_grid PRIVATE Boost::program_options) - target_link_libraries(random_disc_2 PRIVATE Boost::program_options) - else() - target_link_libraries(random_grid PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) - target_link_libraries(random_disc_2 PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) - endif() + target_link_libraries(random_grid PRIVATE Boost::program_options) + target_link_libraries(random_disc_2 PRIVATE Boost::program_options) else() message("NOTICE: The benchmarks requires Boost Program Options, and will not be compiled.") endif() diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index 4785a6647bc..a8bcc29b90c 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -15,12 +15,8 @@ if(TARGET CGAL::Eigen3_support) find_package(Boost QUIET COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) create_single_source_cgal_program("Mesh_estimation.cpp") - target_link_libraries(Mesh_estimation PRIVATE CGAL::Eigen3_support) - if(TARGET Boost::program_options) - target_link_libraries(Mesh_estimation PRIVATE Boost::program_options) - else() - target_link_libraries(Mesh_estimation PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) - endif() + target_link_libraries(Mesh_estimation PRIVATE CGAL::Eigen3_support + Boost::program_options) else() message(STATUS "NOTICE: The example 'Mesh_estimation' requires Boost Program Options, and will not be compiled.") endif() diff --git a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt index 6898456fc8c..889c647ff9d 100644 --- a/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt +++ b/Lab/demo/Lab/Plugins/Mesh_3/CMakeLists.txt @@ -57,12 +57,10 @@ if(Boost_FILESYSTEM_FOUND) if(VTK_LIBRARIES) target_compile_definitions(io_image_plugin PRIVATE -DCGAL_USE_VTK -DNOMINMAX) endif() - if(TARGET Boost::filesystem) - target_link_libraries(io_image_plugin PUBLIC Boost::filesystem - Boost::system) - else() - target_link_libraries(io_image_plugin PUBLIC ${Boost_LIBRARIES}) - endif() + + target_link_libraries(io_image_plugin PUBLIC Boost::filesystem + Boost::system) + else() message(STATUS "NOTICE: the Io_image_plugin requires boost-filesystem, and will not be compiled") endif()