diff --git a/CMakeLists.txt b/CMakeLists.txt index 5970b2c5a2..7302bf150e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,7 +303,11 @@ endif() # Reconsider this after CGAL 5.4: https://github.com/CGAL/cgal/pull/6029 set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE TRUE) -find_package(CGAL 5.0 REQUIRED COMPONENTS Core) +# Some older versions do not match with CGAL 5.0 REQUIRED, so we check after. +find_package(CGAL REQUIRED COMPONENTS Core) +if (${CGAL_MAJOR_VERSION} LESS 5) + message(FATAL_ERROR "CGAL: ${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION} less than required minimum version 5.0") +endif() message(STATUS "CGAL: ${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") target_compile_definitions(OpenSCAD PRIVATE ENABLE_CGAL) # The macro `CGAL_DEBUG` allows to force CGAL assertions, even if `NDEBUG` is defined,