diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 888722191db..57b24fce8a7 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -524,7 +524,10 @@ set_special_prefix(Coin3D COIN3D) # some libraries are essential (stl and Boost.Thread are treated in another way) if("$ENV{CGAL_DISABLE_GMP}" OR CGAL_DISABLE_GMP) - list(REMOVE_ITEM CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) + list(LENGTH CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES CGAL_ESSENTIAL_LENGTH) + if(NOT CGAL_ESSENTIAL_LENGTH EQUAL 0) + list(REMOVE_ITEM CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) + endif() unset(CGAL_CONFIGURED_LIBRARIES) unset(CGAL_CONFIGURED_LIBRARIES CACHE) unset(GMP_FOUND)