]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: do not FATAL_ERROR when ArborX version is out of range 18447/head
authorMatthias Maier <tamiko@43-1.org>
Mon, 12 May 2025 16:15:16 +0000 (11:15 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 12 May 2025 18:53:41 +0000 (13:53 -0500)
cmake/modules/FindDEAL_II_ARBORX.cmake

index bd8c877a964fba2cfd4a2826fbd672e839106d6c..01dd55db869efe90156ef82ebf00ff1f458169b0 100644 (file)
@@ -31,20 +31,25 @@ find_package(ArborX QUIET
   HINTS ${ARBORX_DIR} ${ArborX_DIR} $ENV{ArborX_DIR}
   )
 
+#
+# ArborX's compatibility mode is set to SameMajorVersion. Therefore if we
+# want to support both the 1.X and the 2.X, we cannot set a minimum
+# version in find_package. Instead we need to check the minimum version
+# ourselves.
+#
 if(ArborX_FOUND)
-  get_property(ARBORX_INSTALL_INCLUDE_DIR TARGET ArborX::ArborX PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
-
-  #
-  # ArborX's compatibility mode is set to SameMajorVersion. Therefore if we want to
-  # support both the 1.X and the 2.X, we cannot set a minimum version in
-  # find_package. Instead we need to check the minimum version ourselves.
-  #
   if(ArborX_VERSION VERSION_LESS 1.3)
-    message(FATAL_ERROR "Found ArborX version ${ArborX_VERSION} but the minimum version supported is 1.3")
+    message(STATUS "Found ArborX version ${ArborX_VERSION} but the minimum version supported is 1.3")
+    unset(ArborX_FOUND)
   elseif(ArborX_VERSION VERSION_GREATER_EQUAL 2.0)
-    message(FATAL_ERROR "Found ArborX version ${ArborX_VERSION}. The 2.X series is not currently supported")
+    message(STATUS "Found ArborX version ${ArborX_VERSION}. The 2.X series is not currently supported")
+    unset(ArborX_FOUND)
   endif()
+endif()
+
 
+if(ArborX_FOUND)
+  get_property(ARBORX_INSTALL_INCLUDE_DIR TARGET ArborX::ArborX PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
 
   #
   # Check whether ArborX was compiled with MPI support

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.