diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index feff2060e0e..da2b92f5bad 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -56,6 +56,11 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) SOVERSION "${CGAL_SONAME_VERSION}") endif() else() + if(${LIBRARY_NAME}_LIB_DEPENDS) + # Fix a bug when CGAL is configured first without `CGAL_HEADER_ONLY` + # and then `CGAL_HEADER_ONLY` is set without cleaning the cache. + unset(${LIBRARY_NAME}_LIB_DEPENDS CACHE) + endif() add_library(${LIBRARY_NAME} INTERFACE) endif()