From 4b859931e6553ee97d92a4eeaebd28224ec92687 Mon Sep 17 00:00:00 2001 From: "Ryan A. Colyer" Date: Sat, 19 Feb 2022 16:27:18 -0500 Subject: [PATCH] Switch to an afterwards check for CGAL version --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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,