From 5806b8831ef338c73feb5e3a1e194f37ef841db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 3 Jan 2020 11:07:43 +0100 Subject: [PATCH] Fix bad usage of pragma message The previous error message would show up even if Eigen is not available and the user has passed a solver traits. Reported in https://github.com/CGAL/cgal/issues/4442#issuecomment-570511774 --- .../Surface_mesh_parameterization/ARAP_parameterizer_3.h | 7 ++++++- .../Barycentric_mapping_parameterizer_3.h | 1 - .../Discrete_authalic_parameterizer_3.h | 1 - .../Discrete_conformal_map_parameterizer_3.h | 1 - .../Fixed_border_parameterizer_3.h | 7 ++++++- .../Surface_mesh_parameterization/MVC_post_processor_3.h | 1 - .../Mean_value_coordinates_parameterizer_3.h | 1 - .../Orbifold_Tutte_parameterizer_3.h | 7 ++++++- 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index f42ca4ef1c5..1a179a87e1d 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -93,6 +93,7 @@ #include #include #include +#include #include #include @@ -183,6 +184,11 @@ public: BorderParameterizer_, Two_vertices_parameterizer_3 >::type Border_parameterizer; + #if !defined(CGAL_EIGEN3_ENABLED) + CGAL_static_assertion_msg(!(boost::is_same::value), + "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); + #endif + typedef typename Default::Get< SolverTraits_, #if defined(CGAL_EIGEN3_ENABLED) @@ -194,7 +200,6 @@ public: Eigen::SparseLU::EigenType> > #endif #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library") SolverTraits_ // no parameter provided, and Eigen is not enabled: so don't compile! #endif >::type Solver_traits; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h index c120638bff6..73e42244c7c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Barycentric_mapping_parameterizer_3.h @@ -97,7 +97,6 @@ class Barycentric_mapping_parameterizer_3 Eigen::BiCGSTAB::EigenType, Eigen::IncompleteLUT > > >::type > #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library") SolverTraits_>::type > // no parameter provided, and Eigen is not enabled: so don't compile! #endif { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h index 591acd3ef72..40f3841c40f 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_authalic_parameterizer_3.h @@ -101,7 +101,6 @@ class Discrete_authalic_parameterizer_3 Eigen::BiCGSTAB::EigenType, Eigen::IncompleteLUT > > >::type > #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library") SolverTraits_>::type > // no parameter provided, and Eigen is not enabled: don't compile #endif { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h index ae73354cb9d..f4918bfe25e 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Discrete_conformal_map_parameterizer_3.h @@ -101,7 +101,6 @@ class Discrete_conformal_map_parameterizer_3 Eigen::BiCGSTAB::EigenType, Eigen::IncompleteLUT > > >::type > #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library") SolverTraits_>::type > // no parameter provided, and Eigen is not enabled: so don't compile! #endif { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h index 9cb2304f041..9db50e8877f 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h @@ -44,6 +44,7 @@ #include #include +#include #include /// \file Fixed_border_parameterizer_3.h @@ -114,6 +115,11 @@ public: BorderParameterizer_, Circular_border_arc_length_parameterizer_3 >::type Border_parameterizer; + #if !defined(CGAL_EIGEN3_ENABLED) + CGAL_static_assertion_msg(!(boost::is_same::value), + "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); + #endif + typedef typename Default::Get< SolverTraits_, #if defined(CGAL_EIGEN3_ENABLED) @@ -121,7 +127,6 @@ public: Eigen::BiCGSTAB::EigenType, Eigen::IncompleteLUT > > #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); SolverTraits_ // no parameter provided, and Eigen is not enabled: so don't compile! #endif >::type Solver_traits; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index d632c6f20ed..16ffb52bf87 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -99,7 +99,6 @@ public: Eigen::BiCGSTAB::EigenType, Eigen::IncompleteLUT > > #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library") SolverTraits_ // no parameter provided, and Eigen is not enabled: so don't compile! #endif >::type Solver_traits; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h index fde33c1214c..456d50a096d 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Mean_value_coordinates_parameterizer_3.h @@ -99,7 +99,6 @@ class Mean_value_coordinates_parameterizer_3 Eigen::BiCGSTAB::EigenType, Eigen::IncompleteLUT > > >::type > #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); SolverTraits_>::type > // no parameter provided, and Eigen is not enabled: so don't compile! #endif { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index 383af02b047..ce43e681325 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -393,6 +394,11 @@ class Orbifold_Tutte_parameterizer_3 { public: #ifndef DOXYGEN_RUNNING + #if !defined(CGAL_EIGEN3_ENABLED) + CGAL_static_assertion_msg(!(boost::is_same::value), + "Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library"); + #endif + typedef typename Default::Get< SolverTraits_, #if defined(CGAL_EIGEN3_ENABLED) @@ -404,7 +410,6 @@ public: Eigen::SparseLU::EigenType> > #endif #else - #pragma message("Error: You must either provide 'SolverTraits_' or link CGAL with the Eigen library") SolverTraits_ // no parameter provided, and Eigen is not enabled: so don't compile! #endif >::type Solver_traits;