From 832b20750a362a236c4a1b76e88c24dada513f5d Mon Sep 17 00:00:00 2001
From: netcdf Upstream <kwrobot@kitware.com>
Date: Fri, 22 Nov 2024 15:25:03 -0500
Subject: [PATCH] netcdf 2024-11-22 (5ebf5132)

Code extracted from:

    https://gitlab.kitware.com/third-party/netcdf.git

at commit 5ebf5132707659fb83c8d0df730a7c6538abc15a (for/vtk-20241123-4.9.2).
---
 CMakeLists.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d772e6905d7..9f9302b7ec6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,6 +134,25 @@ set(USE_PARALLEL_POSIX 0)
 set(USE_PNETCDF 0)
 set(USE_ZLIB 0)
 
+set(ENABLE_CDF5 ON)
+check_type_size("size_t" SIZEOF_SIZE_T)
+if (SIZEOF_SIZE_T EQUAL 4)
+  if (ENABLE_CDF5) # enable or auto
+    string(TOUPPER ${ENABLE_CDF5} ENABLE_CDF5)
+    if (ENABLE_CDF5 AND NOT ENABLE_CDF5 STREQUAL "AUTO") # explicitly enabled
+      message(STATUS "Unable to support CDF5 feature because size_t is less than 8 bytes")
+    endif ()
+    set(ENABLE_CDF5 OFF) # cannot support CDF5
+    set(USE_CDF5 OFF) # cannot support CDF5
+  endif ()
+else ()
+  if (ENABLE_CDF5) # explicitly set by user or not set
+    set(USE_CDF5 ON)
+  else () # explicitly disabled by user
+    set(USE_CDF5 OFF)
+  endif ()
+endif ()
+
 if (REGEDIT)
   list(APPEND sources
     libdispatch/dreg.c)
-- 
GitLab