Repository: Unidata/netcdf-c
Pull request #2895 (2024-03-18 21:04:45)

Prefix all options with NETCDF_
Essentially I found all options that cmake defines:

`grep -r "option(" . | sed -n -e 's/.*option(\([^ ]*\).*/\1/p'` > variables.txt

Also replaced

- `NC_USE_STATIC_CRT` -> `NETCDF_USE_STATIC_CRT`
- `NC_FIND_SHARED_LIBS` -> `NETCDF_FIND_SHARED_LIBS`

Then removed some that shouldn't be modified, or needed to be modified different from others.

Then ran this script

```
#!/bin/bash

while IFS= read -r -u 3 var
do
    prefixed_var="NETCDF_$var"
    echo "Replacing $var with $prefixed_var..."
    grep --exclude=variables.txt -rl "$var" . | xargs sed -i '' "s/$var/$prefixed_var/g"
    echo "Press enter to continue to the next variable..."
    read
    git add .
    git commit -m "Replace $var with $prefixed_var"
done 3< variables.txt
```

In general it worked, but I had to go through each commit by hand to remove the script file from git.


Patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c7eac9c3..89c6fd9b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,8 @@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake/mo
 set(PACKAGE "netCDF" CACHE STRING "")
 
 include(netcdf_functions_macros)
+include(deprecated)
+
 
 # Backport of built-in `PROJECT_IS_TOP_LEVEL` from CMake 3.21
 if (NOT DEFINED NETCDF_IS_TOP_LEVEL)
@@ -223,21 +225,21 @@ include(GenerateExportHeader)
 # Compiler and Linker Configuration
 ################################
 
-option(NC_FIND_SHARED_LIBS "Find dynamically-built versions of dependent libraries" ${BUILD_SHARED_LIBS})
+option(NETCDF_FIND_SHARED_LIBS "Find dynamically-built versions of dependent libraries" ${BUILD_SHARED_LIBS})
 
 ##
 # We've had a request to allow for non-versioned shared libraries.
 # This seems reasonable enough to accommodate.  See
 # https://github.com/Unidata/netcdf-c/issues/228 for more info.
 ##
-option(ENABLE_SHARED_LIBRARY_VERSION "Encode the library SO version in the file name of the generated library file." ON)
+option(NETCDF_ENABLE_SHARED_LIBRARY_VERSION "Encode the library SO version in the file name of the generated library file." ON)
 
 # Set some default linux gcc & apple compiler options for
 # debug builds.
 if(CMAKE_COMPILER_IS_GNUCC OR APPLE)
-  option(ENABLE_COVERAGE_TESTS "Enable compiler flags needed to perform coverage tests." OFF)
-  option(ENABLE_CONVERSION_WARNINGS "Enable warnings for implicit conversion from 64 to 32-bit datatypes." ON)
-  option(ENABLE_LARGE_FILE_TESTS "Enable large file tests." OFF)
+  option(NETCDF_ENABLE_COVERAGE_TESTS "Enable compiler flags needed to perform coverage tests." OFF)
+  option(NETCDF_ENABLE_CONVERSION_WARNINGS "Enable warnings for implicit conversion from 64 to 32-bit datatypes." ON)
+  option(NETCDF_ENABLE_LARGE_FILE_TESTS "Enable large file tests." OFF)
 
   # Debugging flags
   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
@@ -251,7 +253,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR APPLE)
   set(CMAKE_REQUIRED_FLAGS "${TMP_CMAKE_REQUIRED_FLAGS}")
 
   # Coverage tests need to have optimization turned off.
-  if(ENABLE_COVERAGE_TESTS)
+  if(NETCDF_ENABLE_COVERAGE_TESTS)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -coverage -fprofile-arcs -ftest-coverage")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -coverage -fprofile-arcs -ftest-coverage")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
@@ -259,7 +261,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR APPLE)
   endif()
 
   # Warnings for 64-to-32 bit conversions.
-  if(ENABLE_CONVERSION_WARNINGS)
+  if(NETCDF_ENABLE_CONVERSION_WARNINGS)
     CHECK_C_COMPILER_FLAG(-Wconversion CC_HAS_WCONVERSION)
     CHECK_C_COMPILER_FLAG(-Wshorten-64-to-32 CC_HAS_SHORTEN_64_32)
 
@@ -270,7 +272,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR APPLE)
       set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wconversion")
     endif()
 
-  endif(ENABLE_CONVERSION_WARNINGS)
+  endif(NETCDF_ENABLE_CONVERSION_WARNINGS)
 
 endif(CMAKE_COMPILER_IS_GNUCC OR APPLE)
 
@@ -372,8 +374,8 @@ endif(${CMAKE_SYSTEM_NAME} EQUAL "Darwin")
 
 # Option to use Static Runtimes in MSVC
 if(MSVC)
-  option(NC_USE_STATIC_CRT "Use static CRT Libraries ('\\MT')." OFF)
-  if(NC_USE_STATIC_CRT)
+  option(NETCDF_USE_STATIC_CRT "Use static CRT Libraries ('\\MT')." OFF)
+  if(NETCDF_USE_STATIC_CRT)
     set(USE_STATIC_CRT ON)
     specify_static_crt_flag()
   endif()
@@ -389,13 +391,13 @@ else(NOT ENABLE_V2_API)
 endif(NOT ENABLE_V2_API)
 
 # Option to build utilities
-option(BUILD_UTILITIES "Build ncgen, ncgen3, ncdump." ON)
+option(NETCDF_BUILD_UTILITIES "Build ncgen, ncgen3, ncdump." ON)
 
 # Option to use MMAP
-option(ENABLE_MMAP "Use MMAP." ON)
+option(NETCDF_ENABLE_MMAP "Use MMAP." ON)
 
 # Option to use examples.
-option(ENABLE_EXAMPLES "Build Examples" ON)
+option(NETCDF_ENABLE_EXAMPLES "Build Examples" ON)
 
 ###
 # Allow the user to specify libraries
@@ -431,42 +433,46 @@ endif()
 # but for back compatability, we need to treat enable-netcdf4
 # as equivalent to enable-hdf5.
 # We detect this using these rules:
-# 1. if ENABLE_HDF5 is off then disable hdf5
-# 2. if ENABLE_NETCDF4 is off then disable hdf5
+# 1. if NETCDF_ENABLE_HDF5 is off then disable hdf5
+# 2. if NETCDF_ENABLE_NETCDF_4 is off then disable hdf5
 # 3. else enable hdf5
-option(ENABLE_NETCDF_4 "Use HDF5." ON)
-option(ENABLE_NETCDF4 "Use HDF5." ON)
-option(ENABLE_HDF5 "Use HDF5." ON)
-if(NOT ENABLE_HDF5 OR NOT ENABLE_NETCDF4 OR NOT ENABLE_NETCDF_4)
-  set(ENABLE_HDF5 OFF CACHE BOOL "Use HDF5" FORCE)
-endif()
-option(ENABLE_HDF4 "Build netCDF-4 with HDF4 read capability(HDF4, HDF5 and Zlib required)." OFF)
-option(ENABLE_DAP "Enable DAP2 and DAP4 Client." ON)
-option(ENABLE_NCZARR "Enable NCZarr Client." ON)
-option(ENABLE_PNETCDF "Build with parallel I/O for CDF-1, 2, and 5 files using PnetCDF." OFF)
-set(ENABLE_CDF5 AUTO CACHE STRING "AUTO")
-option(ENABLE_CDF5 "Enable CDF5 support" ON)
+option(NETCDF_ENABLE_NETCDF_4 "Use HDF5." ON)
+option(NETCDF_ENABLE_HDF5 "Use HDF5." ON)
+if(NOT NETCDF_ENABLE_HDF5 OR NOT NETCDF_ENABLE_NETCDF_4)
+  set(NETCDF_ENABLE_HDF5 OFF CACHE BOOL "Use HDF5" FORCE)
+endif()
+option(NETCDF_ENABLE_HDF4 "Build netCDF-4 with HDF4 read capability(HDF4, HDF5 and Zlib required)." OFF)
+
+
+option(NETCDF_ENABLE_DAP "Enable DAP2 and DAP4 Client." ON)
+option(NETCDF_ENABLE_NCZARR "Enable NCZarr Client." ON)
+option(NETCDF_ENABLE_PNETCDF "Build with parallel I/O for CDF-1, 2, and 5 files using PnetCDF." OFF)
+set(NETCDF_ENABLE_CDF5 AUTO CACHE STRING "AUTO")
+option(NETCDF_ENABLE_CDF5 "Enable CDF5 support" ON)
+
+if(DEFINED NETCDF_ENABLE_NETCDF4)
+  message(FATAL_ERROR "NETCDF_ENABLE_NETCDF4 is deprecated. Please use NETCDF_ENABLE_NETCDF_4 instead.")
+endif()
 
 # Netcdf-4 support (i.e. libsrc4) is required by more than just HDF5 (e.g. NCZarr)
 # So depending on what above formats are enabled, enable netcdf-4
-if(ENABLE_HDF5 OR ENABLE_HDF4 OR ENABLE_NCZARR)
-  set(ENABLE_NETCDF_4 ON CACHE BOOL "Enable netCDF-4 API" FORCE)
-  set(ENABLE_NETCDF4 ON CACHE BOOL "Enable netCDF4 Alias" FORCE)
+if(NETCDF_ENABLE_HDF5 OR NETCDF_ENABLE_HDF4 OR NETCDF_ENABLE_NCZARR)
+  set(NETCDF_ENABLE_NETCDF_4 ON CACHE BOOL "Enable netCDF-4 API" FORCE)
 endif()
 
 # enable|disable all forms of network access
-option(ENABLE_REMOTE_FUNCTIONALITY "Enable|disable all forms remote data access (DAP, S3, etc)" ON)
-message(">>> ENABLE_REMOTE_FUNCTIONALITY=${ENABLE_REMOTE_FUNCTIONALITY}")
-if(NOT ENABLE_REMOTE_FUNCTIONALITY)
-message(WARNING "ENABLE_REMOTE_FUNCTIONALITY=NO => ENABLE_DAP[4]=NO")
-set(ENABLE_DAP OFF CACHE BOOL "ENABLE_REMOTE_FUNCTIONALITY=NO => ENABLE_DAP=NO" FORCE)
-set(ENABLE_DAP4 OFF CACHE BOOL "ENABLE_REMOTE_FUNCTIONALITY=NO => ENABLE_DAP4=NO" FORCE)
+option(NETCDF_ENABLE_REMOTE_FUNCTIONALITY "Enable|disable all forms remote data access (DAP, S3, etc)" ON)
+message(">>> NETCDF_ENABLE_REMOTE_FUNCTIONALITY=${NETCDF_ENABLE_REMOTE_FUNCTIONALITY}")
+if(NOT NETCDF_ENABLE_REMOTE_FUNCTIONALITY)
+message(WARNING "NETCDF_ENABLE_REMOTE_FUNCTIONALITY=NO => NETCDF_ENABLE_DAP[4]=NO")
+set(NETCDF_ENABLE_DAP OFF CACHE BOOL "NETCDF_ENABLE_REMOTE_FUNCTIONALITY=NO => NETCDF_ENABLE_DAP=NO" FORCE)
+set(NETCDF_ENABLE_DAP4 OFF CACHE BOOL "NETCDF_ENABLE_REMOTE_FUNCTIONALITY=NO => NETCDF_ENABLE_DAP4=NO" FORCE)
 endif()
 
 # Option to Build DLL
 if(WIN32)
-  option(ENABLE_DLL "Build a Windows DLL." ${BUILD_SHARED_LIBS})
-  if(ENABLE_DLL)
+  option(NETCDF_ENABLE_DLL "Build a Windows DLL." ${BUILD_SHARED_LIBS})
+  if(NETCDF_ENABLE_DLL)
     set(BUILD_DLL ON CACHE BOOL "")
     target_compile_definitions(netcdf PRIVATE DLL_EXPORT)
     target_compile_definitions(netcdf PUBLIC DLL_NETCDF)
@@ -475,40 +481,39 @@ endif()
 # Did the user specify a default minimum blocksize for posixio?
 set(NCIO_MINBLOCKSIZE 256 CACHE STRING "Minimum I/O Blocksize for netCDF classic and 64-bit offset format files.")
 
-if(ENABLE_NETCDF_4)
+if(NETCDF_ENABLE_NETCDF_4)
   set(USE_NETCDF4 ON CACHE BOOL "")
-  set(ENABLE_NETCDF_4 ON CACHE BOOL "")
-  set(ENABLE_NETCDF4 ON CACHE BOOL "")
+  set(NETCDF_ENABLE_NETCDF_4 ON CACHE BOOL "")
 else()
   set(USE_HDF4_FILE_TESTS OFF)
   set(USE_HDF4 OFF)
-  set(ENABLE_HDF4_FILE_TESTS OFF)
-  set(ENABLE_HDF4 OFF)
+  set(NETCDF_ENABLE_HDF4_FILE_TESTS OFF)
+  set(NETCDF_ENABLE_HDF4 OFF)
 endif()
 
 # Option Logging, only valid for netcdf4.
-option(ENABLE_LOGGING "Enable Logging." OFF)
-if(NOT ENABLE_NETCDF_4)
-set(ENABLE_LOGGING OFF)
+option(NETCDF_ENABLE_LOGGING "Enable Logging." OFF)
+if(NOT NETCDF_ENABLE_NETCDF_4)
+set(NETCDF_ENABLE_LOGGING OFF)
 endif()
-if(ENABLE_LOGGING)
+if(NETCDF_ENABLE_LOGGING)
   target_compile_definitions(netcdf PRIVATE LOGGING ENABLE_SET_LOG_LEVEL)
   set(LOGGING ON)
   set(ENABLE_SET_LOG_LEVEL ON)
 endif()
-option(ENABLE_SET_LOG_LEVEL_FUNC "Enable definition of nc_set_log_level()." ON)
-if(ENABLE_NETCDF_4 AND NOT ENABLE_LOGGING AND ENABLE_SET_LOG_LEVEL_FUNC)
+option(NETCDF_ENABLE_SET_LOG_LEVEL_FUNC "Enable definition of nc_set_log_level()." ON)
+if(NETCDF_ENABLE_NETCDF_4 AND NOT NETCDF_ENABLE_LOGGING AND NETCDF_ENABLE_SET_LOG_LEVEL_FUNC)
   target_compile_definitions(netcdf PRIVATE -DENABLE_SET_LOG_LEVEL)
   set(ENABLE_SET_LOG_LEVEL ON)
 endif()
 
 # Option to allow for strict null file padding.
 # See https://github.com/Unidata/netcdf-c/issues/657 for more information
-option(ENABLE_STRICT_NULL_BYTE_HEADER_PADDING "Enable strict null byte header padding." OFF)
+option(NETCDF_ENABLE_STRICT_NULL_BYTE_HEADER_PADDING "Enable strict null byte header padding." OFF)
 
-if(ENABLE_STRICT_NULL_BYTE_HEADER_PADDING)
+if(NETCDF_ENABLE_STRICT_NULL_BYTE_HEADER_PADDING)
   set(USE_STRICT_NULL_BYTE_HEADER_PADDING ON CACHE BOOL "")
-endif(ENABLE_STRICT_NULL_BYTE_HEADER_PADDING)
+endif(NETCDF_ENABLE_STRICT_NULL_BYTE_HEADER_PADDING)
 
 # Note that szip management is tricky.
 # This is because we have three things to consider:
@@ -517,51 +522,51 @@ endif(ENABLE_STRICT_NULL_BYTE_HEADER_PADDING)
 # 3. is nczarr enabled?
 # We need separate flags for cases 1 and 2
 
-set(USE_HDF5 ${ENABLE_HDF5})
+set(USE_HDF5 ${NETCDF_ENABLE_HDF5})
 
-if(ENABLE_DAP)
+if(NETCDF_ENABLE_DAP)
   set(USE_DAP ON CACHE BOOL "")
-  set(ENABLE_DAP2 ON CACHE BOOL "")
+  set(NETCDF_ENABLE_DAP2 ON CACHE BOOL "")
 
-  if(ENABLE_HDF5)
+  if(NETCDF_ENABLE_HDF5)
     message(STATUS "Enabling DAP4")
-    set(ENABLE_DAP4 ON CACHE BOOL "")
+    set(NETCDF_ENABLE_DAP4 ON CACHE BOOL "")
   else()
     message(STATUS "Disabling DAP4")
-    set(ENABLE_DAP4 OFF CACHE BOOL "")
-  endif(ENABLE_HDF5)
+    set(NETCDF_ENABLE_DAP4 OFF CACHE BOOL "")
+  endif(NETCDF_ENABLE_HDF5)
 
 else()
-  set(ENABLE_DAP2 OFF CACHE BOOL "")
-  set(ENABLE_DAP4 OFF CACHE BOOL "")
+  set(NETCDF_ENABLE_DAP2 OFF CACHE BOOL "")
+  set(NETCDF_ENABLE_DAP4 OFF CACHE BOOL "")
 endif()
 
 # Option to support byte-range reading of remote datasets
-option(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." ON)
-if(NOT ENABLE_REMOTE_FUNCTIONALITY)
-message(WARNING "ENABLE_REMOTE_FUNCTIONALITY=NO => ENABLE_BYTERANGE=NO")
-set(ENABLE_BYTERANGE OFF CACHE BOOL "ENABLE_REMOTE_FUNCTIONALITY=NO => ENABLE_BYTERANGE=NO" FORCE)
+option(NETCDF_ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." ON)
+if(NOT NETCDF_ENABLE_REMOTE_FUNCTIONALITY)
+message(WARNING "NETCDF_ENABLE_REMOTE_FUNCTIONALITY=NO => NETCDF_ENABLE_BYTERANGE=NO")
+set(NETCDF_ENABLE_BYTERANGE OFF CACHE BOOL "NETCDF_ENABLE_REMOTE_FUNCTIONALITY=NO => NETCDF_ENABLE_BYTERANGE=NO" FORCE)
 endif()
 
 # Option to Enable DAP long tests, remote tests.
-option(ENABLE_DAP_REMOTE_TESTS "Enable DAP remote tests." ON)
-option(ENABLE_EXTERNAL_SERVER_TESTS "Enable external Server remote tests." OFF)
-option(ENABLE_DAP_LONG_TESTS "Enable DAP long tests." OFF)
+option(NETCDF_ENABLE_DAP_REMOTE_TESTS "Enable DAP remote tests." ON)
+option(NETCDF_ENABLE_EXTERNAL_SERVER_TESTS "Enable external Server remote tests." OFF)
+option(NETCDF_ENABLE_DAP_LONG_TESTS "Enable DAP long tests." OFF)
 
-if(NOT ENABLE_DAP)
-set(ENABLE_DAP_REMOTE_TESTS OFF CACHE BOOL "" FORCE)
-set(ENABLE_EXTERNAL_SERVER_TESTS OFF CACHE BOOL "" FORCE)
-set(ENABLE_DAP_LONG_TESTS OFF CACHE BOOL "" FORCE)
+if(NOT NETCDF_ENABLE_DAP)
+set(NETCDF_ENABLE_DAP_REMOTE_TESTS OFF CACHE BOOL "" FORCE)
+set(NETCDF_ENABLE_EXTERNAL_SERVER_TESTS OFF CACHE BOOL "" FORCE)
+set(NETCDF_ENABLE_DAP_LONG_TESTS OFF CACHE BOOL "" FORCE)
 endif()
 
 set(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test")
 set(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test")
 
 # Locate some compressors
-option(ENABLE_FILTER_SZIP  "Enable use of Szip compression library if it is available. Required if ENABLE_NCZARR is true." ON)
-option(ENABLE_FILTER_BZ2   "Enable use of Bz2 compression library if it is available." ON)
-option(ENABLE_FILTER_BLOSC "Enable use of blosc compression library if it is available." ON)
-option(ENABLE_FILTER_ZSTD  "Enable use of Zstd compression library if it is available." ON)
+option(NETCDF_ENABLE_FILTER_SZIP  "Enable use of Szip compression library if it is available. Required if NETCDF_ENABLE_NCZARR is true." ON)
+option(NETCDF_ENABLE_FILTER_BZ2   "Enable use of Bz2 compression library if it is available." ON)
+option(NETCDF_ENABLE_FILTER_BLOSC "Enable use of blosc compression library if it is available." ON)
+option(NETCDF_ENABLE_FILTER_ZSTD  "Enable use of Zstd compression library if it is available." ON)
 
 # If user wants, then install selected plugins (default on)
 set(PLUGIN_INSTALL_DIR "NO" CACHE STRING "Whether and where we should install plugins; defaults to yes")
@@ -626,17 +631,17 @@ else() # No option specified
 endif()
 
 # Try to enable NCZarr zip support
-option(ENABLE_NCZARR_ZIP "Enable NCZarr ZIP support." OFF)
+option(NETCDF_ENABLE_NCZARR_ZIP "Enable NCZarr ZIP support." OFF)
 
 include(CMakeDependentOption)
 
 # libdl is always available; built-in in Windows and OSX
-cmake_dependent_option(ENABLE_PLUGINS "Enable dynamically loaded plugins (default on)."
+cmake_dependent_option(NETCDF_ENABLE_PLUGINS "Enable dynamically loaded plugins (default on)."
   ON "BUILD_SHARED_LIBS" OFF)
-MESSAGE(STATUS "ENABLE_PLUGINS: ${ENABLE_PLUGINS}")
+MESSAGE(STATUS "NETCDF_ENABLE_PLUGINS: ${NETCDF_ENABLE_PLUGINS}")
 if(MINGW)
     message(STATUS "MINGW Detected, disabling plugins.")
-    set(ENABLE_PLUGINS OFF CACHE BOOL "Disable plugins" FORCE)
+    set(NETCDF_ENABLE_PLUGINS OFF CACHE BOOL "Disable plugins" FORCE)
 else()
   if(NOT WIN32)
     if(HAVE_DLFCN_H)
@@ -645,13 +650,13 @@ else()
   endif()
 endif()
 
-if(ENABLE_PLUGINS)
+if(NETCDF_ENABLE_PLUGINS)
   set(USEPLUGINS yes)
 endif()
 
 # Enable some developer-only tests
-option(ENABLE_EXTRA_TESTS "Enable Extra tests. Some may not work because of known issues. Developers only." OFF)
-if(ENABLE_EXTRA_TESTS)
+option(NETCDF_ENABLE_EXTRA_TESTS "Enable Extra tests. Some may not work because of known issues. Developers only." OFF)
+if(NETCDF_ENABLE_EXTRA_TESTS)
   set(EXTRA_TESTS ON)
 endif()
 
@@ -659,8 +664,8 @@ endif()
 # for MSVC builds. If not building utilities or some tests,
 # getopt() isn't required at all.
 if(MSVC)
-  option(ENABLE_XGETOPT "Enable bundled XGetOpt instead of external getopt()." ON)
-  if(ENABLE_XGETOPT)
+  option(NETCDF_ENABLE_XGETOPT "Enable bundled XGetOpt instead of external getopt()." ON)
+  if(NETCDF_ENABLE_XGETOPT)
     set(USE_X_GETOPT ON CACHE BOOL "")
   endif()
 endif()
@@ -669,27 +674,27 @@ set(MATH "")
 if(NOT WIN32)
 
   # STDIO instead of posixio.
-  option(ENABLE_STDIO "If true, use stdio instead of posixio (ex. on the Cray)" OFF)
-  if(ENABLE_STDIO)
+  option(NETCDF_ENABLE_STDIO "If true, use stdio instead of posixio (ex. on the Cray)" OFF)
+  if(NETCDF_ENABLE_STDIO)
     set(USE_STDIO ON CACHE BOOL "")
   endif()
 
   # FFIO insteaad of PosixIO
-  option(ENABLE_FFIO "If true, use ffio instead of posixio" OFF)
-  if(ENABLE_FFIO)
+  option(NETCDF_ENABLE_FFIO "If true, use ffio instead of posixio" OFF)
+  if(NETCDF_ENABLE_FFIO)
     set(USE_FFIO ON CACHE BOOL "")
   endif()
 endif()
 
 # Options for S3 Support
-option(ENABLE_S3 "Enable S3 support." OFF)
-option(ENABLE_S3_INTERNAL "Enable S3 Internal support." OFF)
-option(ENABLE_NCZARR_S3 "Enable NCZarr S3 support; Deprecated in favor of ENABLE_S3" OFF)
+option(NETCDF_ENABLE_S3 "Enable S3 support." OFF)
+option(NETCDF_ENABLE_S3_INTERNAL "Enable S3 Internal support." OFF)
+option(NETCDF_ENABLE_NCZARR_S3 "Enable NCZarr S3 support; Deprecated in favor of NETCDF_ENABLE_S3" OFF)
 
-if(NOT ENABLE_REMOTE_FUNCTIONALITY)
-  set(ENABLE_S3 OFF CACHE BOOL "" FORCE)
-  set(ENABLE_S3_INTERNAL OFF CACHE BOOL "" FORCE)
-  set(ENABLE_NCZARR_S3 OFF CACHE BOOL "" FORCE)
+if(NOT NETCDF_ENABLE_REMOTE_FUNCTIONALITY)
+  set(NETCDF_ENABLE_S3 OFF CACHE BOOL "" FORCE)
+  set(NETCDF_ENABLE_S3_INTERNAL OFF CACHE BOOL "" FORCE)
+  set(NETCDF_ENABLE_NCZARR_S3 OFF CACHE BOOL "" FORCE)
 endif()
 
 # Control S3 Testing: Multi-valued option
@@ -703,53 +708,53 @@ if(WITH_S3_TESTING)
 message(WARNING "**** DO NOT USE WITH_S3_TESTING=ON UNLESS YOU HAVE ACCESS TO THE UNIDATA S3 BUCKET! ***")
 endif()
 
-# ENABLE_NCZARR_S3 is now an alias for ENABLE_S3 (but...)
-if (NOT ENABLE_S3 AND ENABLE_NCZARR_S3)
-  set(ENABLE_S3 ON CACHE BOOL "NCARR S3" FORCE) # For back compatibility
+# NETCDF_ENABLE_NCZARR_S3 is now an alias for NETCDF_ENABLE_S3 (but...)
+if (NOT NETCDF_ENABLE_S3 AND NETCDF_ENABLE_NCZARR_S3)
+  set(NETCDF_ENABLE_S3 ON CACHE BOOL "NCARR S3" FORCE) # For back compatibility
 endif()
-unset(ENABLE_NCZARR_S3)
+unset(NETCDF_ENABLE_NCZARR_S3)
 
-if(NOT ENABLE_REMOTE_FUNCTIONALITY)
-  message(WARNING "ENABLE_REMOTE_FUNCTIONALITY=NO => disable all s3 functionality")
-  set(ENABLE_S3 OFF CACHE BOOL "" FORCE)
-  set(ENABLE_S3_INTERNAL OFF CACHE BOOL "" FORCE)
-  set(ENABLE_NCZARR_S3 OFF CACHE BOOL "" FORCE)
-  set(ENABLE_HDF5_ROS3 OFF CACHE BOOL "Use ROS3" FORCE)
+if(NOT NETCDF_ENABLE_REMOTE_FUNCTIONALITY)
+  message(WARNING "NETCDF_ENABLE_REMOTE_FUNCTIONALITY=NO => disable all s3 functionality")
+  set(NETCDF_ENABLE_S3 OFF CACHE BOOL "" FORCE)
+  set(NETCDF_ENABLE_S3_INTERNAL OFF CACHE BOOL "" FORCE)
+  set(NETCDF_ENABLE_NCZARR_S3 OFF CACHE BOOL "" FORCE)
+  set(NETCDF_ENABLE_HDF5_ROS3 OFF CACHE BOOL "Use ROS3" FORCE)
   set(WITH_S3_TESTING OFF CACHE STRING "" FORCE)
 endif()
 
 
-if(ENABLE_S3)
-  if(NOT ENABLE_S3_AWS AND NOT ENABLE_S3_INTERNAL)
-    message(FATAL_ERROR "S3 support library not found; please specify option -DENABLE_S3=NO")
-    set(ENABLE_S3 OFF CACHE BOOL "S3 support" FORCE)        
+if(NETCDF_ENABLE_S3)
+  if(NOT NETCDF_ENABLE_S3_AWS AND NOT NETCDF_ENABLE_S3_INTERNAL)
+    message(FATAL_ERROR "S3 support library not found; please specify option -DNETCDF_ENABLE_S3=NO")
+    set(NETCDF_ENABLE_S3 OFF CACHE BOOL "S3 support" FORCE)        
   endif()
-  if(ENABLE_S3_AWS AND ENABLE_S3_INTERNAL)
+  if(NETCDF_ENABLE_S3_AWS AND NETCDF_ENABLE_S3_INTERNAL)
     message(WARNING "Both aws-sdk-cpp and s3-internal enabled => use s3-internal")
-    set(ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE)        
+    set(NETCDF_ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE)        
   endif()
 endif()
 
-if(NOT ENABLE_S3)
+if(NOT NETCDF_ENABLE_S3)
   if(WITH_S3_TESTING STREQUAL "PUBLIC" OR WITH_S3_TESTING)
     message(WARNING "S3 support is disabled => WITH_S3_TESTING=OFF")
     set(WITH_S3_TESTING OFF CACHE STRING "" FORCE)
   endif()
 endif()
 
-option(ENABLE_LIBXML2 "Link against libxml2 if it is available, use the packaged tinyxml2 parser otherwise." ON)
+option(NETCDF_ENABLE_LIBXML2 "Link against libxml2 if it is available, use the packaged tinyxml2 parser otherwise." ON)
 set(XMLPARSER "tinyxml2 (bundled)")
 
-if(NOT ENABLE_BYTERANGE AND ENABLE_HDF5_ROS3)
-    message(WARNING "ROS3 support requires ENABLE_BYTERANGE=TRUE; disabling ROS3 support")
-    set(ENABLE_HDF5_ROS3 OFF CACHE BOOL "ROS3 support" FORCE)
+if(NOT NETCDF_ENABLE_BYTERANGE AND NETCDF_ENABLE_HDF5_ROS3)
+    message(WARNING "ROS3 support requires NETCDF_ENABLE_BYTERANGE=TRUE; disabling ROS3 support")
+    set(NETCDF_ENABLE_HDF5_ROS3 OFF CACHE BOOL "ROS3 support" FORCE)
 endif()
 
 ##
 # Enable Tests
 ##
-option(ENABLE_TESTS "Enable basic tests, run with 'make test'." ON)
-if(ENABLE_TESTS)
+option(NETCDF_ENABLE_TESTS "Enable basic tests, run with 'make test'." ON)
+if(NETCDF_ENABLE_TESTS)
   set(BUILD_TESTSETS ON CACHE BOOL "")
   # Options for CTest-based tests, dashboards.
   set(NC_CTEST_PROJECT_NAME "netcdf-c" CACHE STRING "Project Name for CTest-based testing purposes.")
@@ -784,50 +789,50 @@ if(ENABLE_TESTS)
   # which are known to fail.
   ###
 
-  option(ENABLE_FAILING_TESTS "Run tests which are known to fail, check to see if any have been fixed." OFF)
+  option(NETCDF_ENABLE_FAILING_TESTS "Run tests which are known to fail, check to see if any have been fixed." OFF)
 
   ###
   # Option to turn on unit testing. See
   # https://github.com/Unidata/netcdf-c/pull/1472 for more information.
   ###
-  option(ENABLE_UNIT_TESTS "Run Unit Tests." ON)
+  option(NETCDF_ENABLE_UNIT_TESTS "Run Unit Tests." ON)
 
   ###
   # Option to turn on performance testing.
   # See https://github.com/Unidata/netcdf-c/issues/2627 for more information.
   ###
-  option(ENABLE_BENCHMARKS "Run benchmark Tests." OFF)
+  option(NETCDF_ENABLE_BENCHMARKS "Run benchmark Tests." OFF)
 
 
   ###
   # End known-failures.
   ###
-  MARK_AS_ADVANCED(ENABLE_FAILING_TESTS)
+  MARK_AS_ADVANCED(NETCDF_ENABLE_FAILING_TESTS)
 endif()
 
 ###
 # Option to enable extreme numbers during testing.
 ###
-option(ENABLE_EXTREME_NUMBERS "Enable extreme numbers during testing, such as MAX_INT-1" ON)
-if(ENABLE_EXTREME_NUMBERS)
+option(NETCDF_ENABLE_EXTREME_NUMBERS "Enable extreme numbers during testing, such as MAX_INT-1" ON)
+if(NETCDF_ENABLE_EXTREME_NUMBERS)
   set(USE_EXTREME_NUMBERS ON)
 endif()
 
 # Enable Large file tests
-if(ENABLE_LARGE_FILE_TESTS)
+if(NETCDF_ENABLE_LARGE_FILE_TESTS)
   set(LARGE_FILE_TESTS ON)
 endif()
 
-option(ENABLE_METADATA_PERF_TESTS "Enable test of metadata performance." OFF)
-if(ENABLE_METADATA_PERF_TESTS)
+option(NETCDF_ENABLE_METADATA_PERF_TESTS "Enable test of metadata performance." OFF)
+if(NETCDF_ENABLE_METADATA_PERF_TESTS)
   set(ENABLE_METADATA_PERF ON)
 endif()
 
 # Location for large file tests.
 set(TEMP_LARGE "." CACHE STRING "Location to store large file tests.")
 
-option(ENABLE_FSYNC "Enable experimental fsync code." OFF)
-if(ENABLE_FSYNC)
+option(NETCDF_ENABLE_FSYNC "Enable experimental fsync code." OFF)
+if(NETCDF_ENABLE_FSYNC)
   set(USE_FSYNC ON)
 endif()
 
@@ -839,8 +844,8 @@ endif()
 
 # Linux specific large file support flags.
 # Modelled after check in CMakeLists.txt for hdf5.
-option(ENABLE_LARGE_FILE_SUPPORT "Enable large file support." ON)
-if(ENABLE_LARGE_FILE_SUPPORT)
+option(NETCDF_ENABLE_LARGE_FILE_SUPPORT "Enable large file support." ON)
+if(NETCDF_ENABLE_LARGE_FILE_SUPPORT)
   if(MSVC)
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE")
@@ -850,9 +855,9 @@ if(ENABLE_LARGE_FILE_SUPPORT)
   endif()
 endif()
 
-option(ENABLE_EXAMPLE_TESTS "Run extra example tests.  Requires GNU Sed. Ignored if HDF5 is not Enabled" OFF)
-if(NOT ENABLE_HDF5 AND ENABLE_EXAMPLE_TESTS)
-  set(ENABLE_EXAMPLE_TESTS OFF)
+option(NETCDF_ENABLE_EXAMPLE_TESTS "Run extra example tests.  Requires GNU Sed. Ignored if HDF5 is not Enabled" OFF)
+if(NOT NETCDF_ENABLE_HDF5 AND NETCDF_ENABLE_EXAMPLE_TESTS)
+  set(NETCDF_ENABLE_EXAMPLE_TESTS OFF)
 endif()
 
 ##################################
@@ -868,8 +873,8 @@ include(cmake/dependencies.cmake)
 # Enable Parallel IO with netCDF-4/HDF5 files using HDF5 parallel I/O.
 set(STATUS_PARALLEL "OFF")
 set(IMPORT_MPI "")
-option(ENABLE_PARALLEL4 "Build netCDF-4 with parallel IO" "${HDF5_PARALLEL}")
-if(ENABLE_PARALLEL4 AND ENABLE_HDF5)
+option(NETCDF_ENABLE_PARALLEL4 "Build netCDF-4 with parallel IO" "${HDF5_PARALLEL}")
+if(NETCDF_ENABLE_PARALLEL4 AND NETCDF_ENABLE_HDF5)
   if(NOT HDF5_PARALLEL)
     set(USE_PARALLEL OFF CACHE BOOL "")
     message(STATUS "Cannot find HDF5 library built with parallel support. Disabling parallel build.")
@@ -893,9 +898,9 @@ if(ENABLE_PARALLEL4 AND ENABLE_HDF5)
 endif()
 
 # Options to enable parallel IO for classic formats with PnetCDF library.
-set(STATUS_PNETCDF ${ENABLE_PNETCDF})
-set(USE_PNETCDF ${ENABLE_PNETCDF})
-if(ENABLE_PNETCDF)
+set(STATUS_PNETCDF ${NETCDF_ENABLE_PNETCDF})
+set(USE_PNETCDF ${NETCDF_ENABLE_PNETCDF})
+if(NETCDF_ENABLE_PNETCDF)
   set(STATUS_PARALLEL ON)
   set(USE_PARALLEL ON CACHE BOOL "")
   ### 
@@ -906,32 +911,32 @@ if(ENABLE_PNETCDF)
 endif()
 
 # Options to enable use of fill values for elements causing NC_ERANGE
-set(ENABLE_ERANGE_FILL AUTO CACHE STRING "AUTO")
-option(ENABLE_ERANGE_FILL "Enable use of fill value when out-of-range type conversion causes NC_ERANGE error." OFF)
-if(ENABLE_ERANGE_FILL) # enable or auto
-   string(TOUPPER ${ENABLE_ERANGE_FILL} ENABLE_ERANGE_FILL)
-   if(ENABLE_ERANGE_FILL AND NOT ENABLE_ERANGE_FILL STREQUAL "AUTO")
+set(NETCDF_ENABLE_ERANGE_FILL AUTO CACHE STRING "AUTO")
+option(NETCDF_ENABLE_ERANGE_FILL "Enable use of fill value when out-of-range type conversion causes NC_ERANGE error." OFF)
+if(NETCDF_ENABLE_ERANGE_FILL) # enable or auto
+   string(TOUPPER ${NETCDF_ENABLE_ERANGE_FILL} NETCDF_ENABLE_ERANGE_FILL)
+   if(NETCDF_ENABLE_ERANGE_FILL AND NOT NETCDF_ENABLE_ERANGE_FILL STREQUAL "AUTO")
       # explicitly enabled
-      set(ENABLE_ERANGE_FILL ON)
+      set(NETCDF_ENABLE_ERANGE_FILL ON)
    else()
-      if(NOT ENABLE_ERANGE_FILL STREQUAL "AUTO")
-         set(ENABLE_ERANGE_FILL OFF)
+      if(NOT NETCDF_ENABLE_ERANGE_FILL STREQUAL "AUTO")
+         set(NETCDF_ENABLE_ERANGE_FILL OFF)
       endif()
    endif()
-endif(ENABLE_ERANGE_FILL)
-# Now ENABLE_ERANGE_FILL is either AUTO, ON, or OFF
+endif(NETCDF_ENABLE_ERANGE_FILL)
+# Now NETCDF_ENABLE_ERANGE_FILL is either AUTO, ON, or OFF
 
 # More relaxed coordinate check is now mandatory for all builds.
 set(ENABLE_ZERO_LENGTH_COORD_BOUND ON)
 
 # check and conform with PnetCDF settings on ERANGE_FILL and RELAX_COORD_BOUND
 if(USE_PNETCDF)
-  if(ENABLE_ERANGE_FILL STREQUAL "AUTO") # not set on command line
-     set(ENABLE_ERANGE_FILL "${PNETCDF_HAS_ERANGE_FILL}")
+  if(NETCDF_ENABLE_ERANGE_FILL STREQUAL "AUTO") # not set on command line
+     set(NETCDF_ENABLE_ERANGE_FILL "${PNETCDF_HAS_ERANGE_FILL}")
   else()
      # user explicitly set this option on command line
-     if(NOT ENABLE_ERANGE_FILL STREQUAL "${PNETCDF_HAS_ERANGE_FILL}")
-        if(ENABLE_ERANGE_FILL)
+     if(NOT NETCDF_ENABLE_ERANGE_FILL STREQUAL "${PNETCDF_HAS_ERANGE_FILL}")
+        if(NETCDF_ENABLE_ERANGE_FILL)
            message(FATAL_ERROR "Enabling erange-fill conflicts with PnetCDF setting")
         else()
            message(FATAL_ERROR "Disabling erange-fill conflicts with PnetCDF setting")
@@ -940,7 +945,7 @@ if(USE_PNETCDF)
   endif()
 endif()
 
-if(ENABLE_ERANGE_FILL)
+if(NETCDF_ENABLE_ERANGE_FILL)
   message(STATUS "Enabling use of fill value when NC_ERANGE")
   set(M4FLAGS "-DERANGE_FILL" CACHE STRING "")
 endif()
@@ -951,59 +956,59 @@ if(ENABLE_ZERO_LENGTH_COORD_BOUND)
 endif()
 
 # Enable Parallel Tests.
-option(ENABLE_PARALLEL_TESTS "Enable Parallel IO Tests. Requires HDF5/NetCDF4 with parallel I/O Support." "${HDF5_PARALLEL}")
-if(ENABLE_PARALLEL_TESTS AND USE_PARALLEL)
+option(NETCDF_ENABLE_PARALLEL_TESTS "Enable Parallel IO Tests. Requires HDF5/NetCDF4 with parallel I/O Support." "${HDF5_PARALLEL}")
+if(NETCDF_ENABLE_PARALLEL_TESTS AND USE_PARALLEL)
   set(TEST_PARALLEL ON CACHE BOOL "")
   if(USE_NETCDF4)
     set(TEST_PARALLEL4 ON CACHE BOOL "")
   endif()
 endif()
 
-IF (ENABLE_PARALLEL_TESTS AND NOT USE_PARALLEL)
+IF (NETCDF_ENABLE_PARALLEL_TESTS AND NOT USE_PARALLEL)
   message(FATAL_ERROR "Parallel tests requested, but no parallel HDF5 installation detected.")
 endif()
 
 # Enable special filter test; experimental when using cmake.
-option(ENABLE_FILTER_TESTING "Enable filter testing. Ignored if shared libraries or netCDF4 are not enabled" ${ENABLE_PLUGINS})
+option(NETCDF_ENABLE_FILTER_TESTING "Enable filter testing. Ignored if shared libraries or netCDF4 are not enabled" ${NETCDF_ENABLE_PLUGINS})
 
-if(ENABLE_FILTER_TESTING)
-  if(NOT ENABLE_HDF5 AND NOT ENABLE_NCZARR)
-    message(WARNING "ENABLE_FILTER_TESTING requires HDF5 and/or NCZarr. Disabling.")
-    set(ENABLE_FILTER_TESTING OFF CACHE BOOL "Enable Filter Testing" FORCE)
+if(NETCDF_ENABLE_FILTER_TESTING)
+  if(NOT NETCDF_ENABLE_HDF5 AND NOT NETCDF_ENABLE_NCZARR)
+    message(WARNING "NETCDF_ENABLE_FILTER_TESTING requires HDF5 and/or NCZarr. Disabling.")
+    set(NETCDF_ENABLE_FILTER_TESTING OFF CACHE BOOL "Enable Filter Testing" FORCE)
   endif()
 endif()
 
 if(NOT BUILD_SHARED_LIBS)
-  message(WARNING "ENABLE_FILTER_TESTING requires shared libraries. Disabling.")
-  set(ENABLE_FILTER_TESTING OFF)
+  message(WARNING "NETCDF_ENABLE_FILTER_TESTING requires shared libraries. Disabling.")
+  set(NETCDF_ENABLE_FILTER_TESTING OFF)
 endif()
 
-option(ENABLE_NCZARR_FILTERS "Enable NCZarr filters" ${ENABLE_PLUGINS})
-option(ENABLE_NCZARR_FILTERS_TESTING "Enable NCZarr filter testing." ${ENABLE_NCZARR_FILTERS})
+option(NETCDF_ENABLE_NCZARR_FILTERS "Enable NCZarr filters" ${NETCDF_ENABLE_PLUGINS})
+option(NETCDF_ENABLE_NCZARR_FILTERS_TESTING "Enable NCZarr filter testing." ${NETCDF_ENABLE_NCZARR_FILTERS})
 
 # Constraints
-if (NOT ENABLE_PLUGINS AND ENABLE_NCZARR_FILTERS)
-  message(WARNING "ENABLE_NCZARR_FILTERS requires ENABLE_PLUGINS. Disabling.")
-  set(ENABLE_NCZARR_FILTERS OFF CACHE BOOL "Enable NCZarr Filters." FORCE)
+if (NOT NETCDF_ENABLE_PLUGINS AND NETCDF_ENABLE_NCZARR_FILTERS)
+  message(WARNING "NETCDF_ENABLE_NCZARR_FILTERS requires NETCDF_ENABLE_PLUGINS. Disabling.")
+  set(NETCDF_ENABLE_NCZARR_FILTERS OFF CACHE BOOL "Enable NCZarr Filters." FORCE)
 endif()
 
-IF (NOT ENABLE_NCZARR)
-  message(WARNING "ENABLE_NCZARR==NO => ENABLE_NCZARR_FILTERS==NO AND ENABLE_NCZARR_FILTER_TESTING==NO")
-  set(ENABLE_NCZARR_FILTERS OFF CACHE BOOL "Disable NCZARR_FILTERS" FORCE)
+IF (NOT NETCDF_ENABLE_NCZARR)
+  message(WARNING "NETCDF_ENABLE_NCZARR==NO => NETCDF_ENABLE_NCZARR_FILTERS==NO AND NETCDF_ENABLE_NCZARR_FILTER_TESTING==NO")
+  set(NETCDF_ENABLE_NCZARR_FILTERS OFF CACHE BOOL "Disable NCZARR_FILTERS" FORCE)
 endif()
 
-IF (NOT ENABLE_NCZARR_FILTERS)
-    set(ENABLE_NCZARR_FILTER_TESTING OFF CACHE BOOL "Enable NCZarr Filter Testing" FORCE)
+IF (NOT NETCDF_ENABLE_NCZARR_FILTERS)
+    set(NETCDF_ENABLE_NCZARR_FILTER_TESTING OFF CACHE BOOL "Enable NCZarr Filter Testing" FORCE)
 endif()
 
 set(ENABLE_CLIENTSIDE_FILTERS OFF)
 
 # Determine whether or not to generate documentation.
-option(ENABLE_DOXYGEN "Enable generation of doxygen-based documentation." OFF)
-if(ENABLE_DOXYGEN)
+option(NETCDF_ENABLE_DOXYGEN "Enable generation of doxygen-based documentation." OFF)
+if(NETCDF_ENABLE_DOXYGEN)
   # Offer the option to build internal documentation.
-  option(ENABLE_INTERNAL_DOCS "Build internal documentation. This is of interest to developers only." OFF)
-  if(ENABLE_INTERNAL_DOCS)
+  option(NETCDF_ENABLE_INTERNAL_DOCS "Build internal documentation. This is of interest to developers only." OFF)
+  if(NETCDF_ENABLE_INTERNAL_DOCS)
     set(BUILD_INTERNAL_DOCS yes CACHE STRING "")
   else()
     set(BUILD_INTERNAL_DOCS no CACHE STRING "")
@@ -1014,12 +1019,12 @@ if(ENABLE_DOXYGEN)
   # If we are building release documentation, we need to set some
   # variables that will be used in the Doxygen.in template.
   ###
-  option(ENABLE_DOXYGEN_BUILD_RELEASE_DOCS "Build release documentation.  This is of interest only to the netCDF developers." OFF)
-  if(ENABLE_DOXYGEN_BUILD_RELEASE_DOCS)
+  option(NETCDF_ENABLE_DOXYGEN_BUILD_RELEASE_DOCS "Build release documentation.  This is of interest only to the netCDF developers." OFF)
+  if(NETCDF_ENABLE_DOXYGEN_BUILD_RELEASE_DOCS)
     set(DOXYGEN_CSS_FILE "${CMAKE_SOURCE_DIR}/docs/release.css" CACHE STRING "")
     set(DOXYGEN_HEADER_FILE "${CMAKE_SOURCE_DIR}/docs/release_header.html" CACHE STRING "")
     set(DOXYGEN_SEARCHENGINE "NO" CACHE STRING "")
-    set(ENABLE_DOXYGEN_SERVER_BASED_SEARCH NO CACHE STRING "")
+    set(NETCDF_ENABLE_DOXYGEN_SERVER_BASED_SEARCH NO CACHE STRING "")
   else()
     set(DOXYGEN_CSS_FILE "" CACHE STRING "")
     set(DOXYGEN_HEADER_FILE "" CACHE STRING "")
@@ -1027,29 +1032,29 @@ if(ENABLE_DOXYGEN)
 
     # If not using release document configuration,
     # provide an option for server-based search.
-    option(ENABLE_DOXYGEN_SERVER_SIDE_SEARCH "Configure Doxygen with server-based search." OFF)
-    if(ENABLE_DOXYGEN_SERVER_SIDE_SEARCH)
+    option(NETCDF_ENABLE_DOXYGEN_SERVER_SIDE_SEARCH "Configure Doxygen with server-based search." OFF)
+    if(NETCDF_ENABLE_DOXYGEN_SERVER_SIDE_SEARCH)
       set(DOXYGEN_SERVER_BASED_SEARCH "YES" CACHE STRING "")
     else()
       set(DOXYGEN_SERVER_BASED_SEARCH "NO" CACHE STRING "")
-    endif(ENABLE_DOXYGEN_SERVER_SIDE_SEARCH)
+    endif(NETCDF_ENABLE_DOXYGEN_SERVER_SIDE_SEARCH)
 
 
-  endif(ENABLE_DOXYGEN_BUILD_RELEASE_DOCS)
+  endif(NETCDF_ENABLE_DOXYGEN_BUILD_RELEASE_DOCS)
   # Option to turn on the TODO list in the doxygen-generated documentation.
-  option(DOXYGEN_ENABLE_TASKS "Turn on test, todo, bug lists in documentation. This is of interest to developers only." OFF)
-  if(DOXYGEN_ENABLE_TASKS)
+  option(NETCDF_DOXYGEN_ENABLE_TASKS "Turn on test, todo, bug lists in documentation. This is of interest to developers only." OFF)
+  if(NETCDF_DOXYGEN_ENABLE_TASKS)
     set(SHOW_DOXYGEN_TAG_LIST YES CACHE STRING "")
-  else(DOXYGEN_ENABLE_TASKS)
+  else(NETCDF_DOXYGEN_ENABLE_TASKS)
     set(SHOW_DOXYGEN_TODO_LIST NO CACHE STRING "")
-  endif(DOXYGEN_ENABLE_TASKS)
+  endif(NETCDF_DOXYGEN_ENABLE_TASKS)
 
-  option(ENABLE_DOXYGEN_PDF_OUTPUT "[EXPERIMENTAL] Turn on PDF output for Doxygen-generated documentation." OFF)
+  option(NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT "[EXPERIMENTAL] Turn on PDF output for Doxygen-generated documentation." OFF)
 
-  if(ENABLE_DOXYGEN_PDF_OUTPUT)
-    set(NC_ENABLE_DOXYGEN_PDF_OUTPUT "YES" CACHE STRING "")
+  if(NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT)
+    set(NC_NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT "YES" CACHE STRING "")
   else()
-    set(NC_ENABLE_DOXYGEN_PDF_OUTPUT "NO" CACHE STRING "")
+    set(NC_NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT "NO" CACHE STRING "")
   endif()
 
   find_program(NC_DOT NAMES dot)
@@ -1062,10 +1067,10 @@ if(ENABLE_DOXYGEN)
 endif()
 
 # Always enable DISKLESS
-option(ENABLE_DISKLESS "Enable in-memory files" ON)
+option(NETCDF_ENABLE_DISKLESS "Enable in-memory files" ON)
 
 # Always enable quantization.
-option(ENABLE_QUANTIZE "Enable variable quantization" ON)
+option(NETCDF_ENABLE_QUANTIZE "Enable variable quantization" ON)
 
 # By default, MSVC has a stack size of 1000000.
 # Allow a user to override this.
@@ -1081,10 +1086,10 @@ if(MSVC)
 endif()
 
 # Set some of the options as advanced.
-MARK_AS_ADVANCED(ENABLE_INTERNAL_DOCS VALGRIND_TESTS ENABLE_COVERAGE_TESTS )
-MARK_AS_ADVANCED(ENABLE_DAP_REMOTE_TESTS ENABLE_DAP_LONG_TESTS USE_REMOTE_CDASH ENABLE_EXTERNAL_SERVER_TESTS)
-MARK_AS_ADVANCED(ENABLE_DOXYGEN_BUILD_RELEASE_DOCS DOXYGEN_ENABLE_TASKS ENABLE_DOXYGEN_SERVER_SIDE_SEARCH)
-MARK_AS_ADVANCED(ENABLE_SHARED_LIBRARY_VERSION)
+MARK_AS_ADVANCED(NETCDF_ENABLE_INTERNAL_DOCS VALGRIND_TESTS NETCDF_ENABLE_COVERAGE_TESTS )
+MARK_AS_ADVANCED(NETCDF_ENABLE_DAP_REMOTE_TESTS NETCDF_ENABLE_DAP_LONG_TESTS USE_REMOTE_CDASH NETCDF_ENABLE_EXTERNAL_SERVER_TESTS)
+MARK_AS_ADVANCED(NETCDF_ENABLE_DOXYGEN_BUILD_RELEASE_DOCS NETCDF_DOXYGEN_ENABLE_TASKS NETCDF_ENABLE_DOXYGEN_SERVER_SIDE_SEARCH)
+MARK_AS_ADVANCED(NETCDF_ENABLE_SHARED_LIBRARY_VERSION)
 
 ################################
 # Option checks
@@ -1183,20 +1188,20 @@ CHECK_TYPE_SIZE("size_t"    SIZEOF_SIZE_T)
 
 # Check whether to turn on or off CDF5 support.
 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
+   if(NETCDF_ENABLE_CDF5) # enable or auto
+      string(TOUPPER ${NETCDF_ENABLE_CDF5} NETCDF_ENABLE_CDF5)
+      if(NETCDF_ENABLE_CDF5 AND NOT NETCDF_ENABLE_CDF5 STREQUAL "AUTO") # explicitly enabled
          message(FATAL_ERROR "Unable to support CDF5 feature because size_t is less than 8 bytes")
-      endif(ENABLE_CDF5 AND NOT ENABLE_CDF5 STREQUAL "AUTO")
-      set(ENABLE_CDF5 OFF) # cannot support CDF5
+      endif(NETCDF_ENABLE_CDF5 AND NOT NETCDF_ENABLE_CDF5 STREQUAL "AUTO")
+      set(NETCDF_ENABLE_CDF5 OFF) # cannot support CDF5
       set(USE_CDF5 OFF CACHE BOOL "") # cannot support CDF5
-   endif(ENABLE_CDF5)
+   endif(NETCDF_ENABLE_CDF5)
 else(SIZEOF_SIZE_T EQUAL 4)
-   if(ENABLE_CDF5) # explicitly set by user or not set
+   if(NETCDF_ENABLE_CDF5) # explicitly set by user or not set
       set(USE_CDF5 ON CACHE BOOL "")
-   else(ENABLE_CDF5) # explicitly disabled by user
+   else(NETCDF_ENABLE_CDF5) # explicitly disabled by user
       set(USE_CDF5 OFF CACHE BOOL "")
-   endif(ENABLE_CDF5)
+   endif(NETCDF_ENABLE_CDF5)
 endif(SIZEOF_SIZE_T EQUAL 4)
 
 CHECK_TYPE_SIZE("ssize_t"   SIZEOF_SSIZE_T)
@@ -1267,33 +1272,33 @@ CHECK_SYMBOL_EXISTS("struct timespec" "time.h" HAVE_STRUCT_TIMESPEC)
 CHECK_FUNCTION_EXISTS(atexit HAVE_ATEXIT)
 
 # Control invoking nc_finalize at exit
-option(ENABLE_ATEXIT_FINALIZE "Invoke nc_finalize at exit." ON)
+option(NETCDF_ENABLE_ATEXIT_FINALIZE "Invoke nc_finalize at exit." ON)
 if(NOT HAVE_ATEXIT)
-if(ENABLE_ATEXIT_FINALIZE AND NOT HAVE_ATEXIT)
-  set(ENABLE_ATEXIT_FINALIZE OFF CACHE BOOL "Enable ATEXIT" FORCE)
-  message(WARNING "ENABLE_ATEXIT_FINALIZE set but atexit() function not defined")
+if(NETCDF_ENABLE_ATEXIT_FINALIZE AND NOT HAVE_ATEXIT)
+  set(NETCDF_ENABLE_ATEXIT_FINALIZE OFF CACHE BOOL "Enable ATEXIT" FORCE)
+  message(WARNING "NETCDF_ENABLE_ATEXIT_FINALIZE set but atexit() function not defined")
 endif()
 endif()
 
 # Check to see if MAP_ANONYMOUS is defined.
 if(MSVC)
   message(WARNING "mmap not supported under visual studio: disabling MMAP support.")
-  set(ENABLE_MMAP OFF)
+  set(NETCDF_ENABLE_MMAP OFF)
 else()
   CHECK_C_SOURCE_COMPILES("
   #include <sys/mman.h>
   int main() {int x = MAP_ANONYMOUS;}" HAVE_MAPANON)
   if(NOT HAVE_MMAP OR NOT HAVE_MAPANON)
     message(WARNING "mmap or MAP_ANONYMOUS not found: disabling MMAP support.")
-    set(ENABLE_MMAP OFF)
+    set(NETCDF_ENABLE_MMAP OFF)
   endif()
 endif()
 
-if(ENABLE_MMAP)
+if(NETCDF_ENABLE_MMAP)
   # Aliases
   set(BUILD_MMAP ON)
   set(USE_MMAP ON)
-endif(ENABLE_MMAP)
+endif(NETCDF_ENABLE_MMAP)
 
 #CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
 
@@ -1337,9 +1342,9 @@ endif()
 # Determine if 'bash' is on the system.
 ##
 
-option(ENABLE_BASH_SCRIPT_TESTING "Detection is typically automatic, but this option can be used to force enable/disable bash-script based tests." ON)
+option(NETCDF_ENABLE_BASH_SCRIPT_TESTING "Detection is typically automatic, but this option can be used to force enable/disable bash-script based tests." ON)
 
-if(ENABLE_BASH_SCRIPT_TESTING)
+if(NETCDF_ENABLE_BASH_SCRIPT_TESTING)
   find_program(HAVE_BASH bash)
   if(HAVE_BASH)
     string(COMPARE EQUAL "${HAVE_BASH}" "C:/Windows/System32/bash.exe" IS_BASH_EXE)
@@ -1352,9 +1357,9 @@ if(ENABLE_BASH_SCRIPT_TESTING)
   else()
     message(STATUS "Bash shell not found; disabling shell script tests.")
   endif()
-else(ENABLE_BASH_SCRIPT_TESTING)
+else(NETCDF_ENABLE_BASH_SCRIPT_TESTING)
   set(HAVE_BASH "")
-endif(ENABLE_BASH_SCRIPT_TESTING)
+endif(NETCDF_ENABLE_BASH_SCRIPT_TESTING)
 
 # Create config.h file.
 configure_file("${netCDF_SOURCE_DIR}/config.h.cmake.in"
@@ -1390,25 +1395,25 @@ if(USE_HDF4)
   add_subdirectory(hdf4_test)
 endif(USE_HDF4)
 
-if(ENABLE_DAP2)
+if(NETCDF_ENABLE_DAP2)
   add_subdirectory(oc2)
   add_subdirectory(libdap2)
 endif()
 
-if(ENABLE_DAP4)
+if(NETCDF_ENABLE_DAP4)
   add_subdirectory(libdap4)
   add_subdirectory(libncxml)
 else()
-  if(ENABLE_S3_INTERNAL)
+  if(NETCDF_ENABLE_S3_INTERNAL)
     add_subdirectory(libncxml)
   endif()
 endif()
 
-if(ENABLE_PLUGINS)
+if(NETCDF_ENABLE_PLUGINS)
   add_subdirectory(libncpoco)
 endif()
 
-if(ENABLE_NCZARR)
+if(NETCDF_ENABLE_NCZARR)
   add_subdirectory(libnczarr)
   file(COPY ${netCDF_SOURCE_DIR}/unit_test/timer_utils.h
        DESTINATION ${netCDF_BINARY_DIR}/nczarr_test/)
@@ -1428,12 +1433,12 @@ endif()
 
 add_subdirectory(liblib)
 
-if(ENABLE_PLUGINS)
+if(NETCDF_ENABLE_PLUGINS)
   add_subdirectory(plugins)
 endif()
 
 # Enable Utilities.
-if(BUILD_UTILITIES)
+if(NETCDF_BUILD_UTILITIES)
   include_directories(ncdump)
   add_subdirectory(ncgen)
   add_subdirectory(ncgen3)
@@ -1441,7 +1446,7 @@ if(BUILD_UTILITIES)
 endif()
 
 # Enable tests
-if(ENABLE_TESTS)
+if(NETCDF_ENABLE_TESTS)
   if(ENABLE_V2_API)
     add_subdirectory(nctest)
   endif()
@@ -1451,22 +1456,22 @@ if(ENABLE_TESTS)
     add_subdirectory(nc_test4)
     add_subdirectory(h5_test)
   endif()
-  if(ENABLE_DAP2)
+  if(NETCDF_ENABLE_DAP2)
     add_subdirectory(ncdap_test)
   endif()
-  if(ENABLE_DAP4)
+  if(NETCDF_ENABLE_DAP4)
     add_subdirectory(dap4_test)
   endif()
-  if(ENABLE_EXAMPLES)
+  if(NETCDF_ENABLE_EXAMPLES)
     add_subdirectory(examples)
   endif()
-  if(ENABLE_BENCHMARKS)
+  if(NETCDF_ENABLE_BENCHMARKS)
     add_subdirectory(nc_perf)
-  endif(ENABLE_BENCHMARKS)
-  if(ENABLE_UNIT_TESTS)
+  endif(NETCDF_ENABLE_BENCHMARKS)
+  if(NETCDF_ENABLE_UNIT_TESTS)
     add_subdirectory(unit_test)
-  endif(ENABLE_UNIT_TESTS)
-  if(ENABLE_NCZARR)
+  endif(NETCDF_ENABLE_UNIT_TESTS)
+  if(NETCDF_ENABLE_NCZARR)
     add_subdirectory(nczarr_test)
   endif()
 endif()
@@ -1621,45 +1626,45 @@ is_disabled(BUILD_SHARED_LIBS enable_static)
 is_enabled(BUILD_SHARED_LIBS enable_shared)
 
 is_enabled(ENABLE_V2_API HAS_NC2)
-is_enabled(ENABLE_NETCDF_4 HAS_NC4)
-is_enabled(ENABLE_HDF4 HAS_HDF4)
+is_enabled(NETCDF_ENABLE_NETCDF_4 HAS_NC4)
+is_enabled(NETCDF_ENABLE_HDF4 HAS_HDF4)
 is_enabled(USE_HDF5 HAS_HDF5)
 is_enabled(OFF HAS_BENCHMARKS)
 is_enabled(STATUS_PNETCDF HAS_PNETCDF)
 is_enabled(STATUS_PARALLEL HAS_PARALLEL)
-is_enabled(ENABLE_PARALLEL4 HAS_PARALLEL4)
-is_enabled(ENABLE_DAP HAS_DAP)
-is_enabled(ENABLE_DAP2 HAS_DAP2)
-is_enabled(ENABLE_DAP4 HAS_DAP4)
-is_enabled(ENABLE_BYTERANGE HAS_BYTERANGE)
-is_enabled(ENABLE_DISKLESS HAS_DISKLESS)
+is_enabled(NETCDF_ENABLE_PARALLEL4 HAS_PARALLEL4)
+is_enabled(NETCDF_ENABLE_DAP HAS_DAP)
+is_enabled(NETCDF_ENABLE_DAP2 HAS_DAP2)
+is_enabled(NETCDF_ENABLE_DAP4 HAS_DAP4)
+is_enabled(NETCDF_ENABLE_BYTERANGE HAS_BYTERANGE)
+is_enabled(NETCDF_ENABLE_DISKLESS HAS_DISKLESS)
 is_enabled(USE_MMAP HAS_MMAP)
 is_enabled(JNA HAS_JNA)
 is_enabled(ENABLE_ZERO_LENGTH_COORD_BOUND RELAX_COORD_BOUND)
 is_enabled(USE_CDF5 HAS_CDF5)
-is_enabled(ENABLE_ERANGE_FILL HAS_ERANGE_FILL)
+is_enabled(NETCDF_ENABLE_ERANGE_FILL HAS_ERANGE_FILL)
 is_enabled(HDF5_HAS_PAR_FILTERS HAS_PAR_FILTERS)
-is_enabled(ENABLE_S3 HAS_S3)
-is_enabled(ENABLE_S3_AWS HAS_S3_AWS)
-is_enabled(ENABLE_S3_INTERNAL HAS_S3_INTERNAL)
+is_enabled(NETCDF_ENABLE_S3 HAS_S3)
+is_enabled(NETCDF_ENABLE_S3_AWS HAS_S3_AWS)
+is_enabled(NETCDF_ENABLE_S3_INTERNAL HAS_S3_INTERNAL)
 is_enabled(HAS_HDF5_ROS3 HAS_HDF5_ROS3)
-is_enabled(ENABLE_NCZARR HAS_NCZARR)
-is_enabled(ENABLE_NCZARR_ZIP HAS_NCZARR_ZIP)
-is_enabled(ENABLE_NCZARR_ZIP DO_NCZARR_ZIP_TESTS)
-is_enabled(ENABLE_QUANTIZE HAS_QUANTIZE)
-is_enabled(ENABLE_LOGGING HAS_LOGGING)
-is_enabled(ENABLE_FILTER_TESTING DO_FILTER_TESTS)
+is_enabled(NETCDF_ENABLE_NCZARR HAS_NCZARR)
+is_enabled(NETCDF_ENABLE_NCZARR_ZIP HAS_NCZARR_ZIP)
+is_enabled(NETCDF_ENABLE_NCZARR_ZIP DO_NCZARR_ZIP_TESTS)
+is_enabled(NETCDF_ENABLE_QUANTIZE HAS_QUANTIZE)
+is_enabled(NETCDF_ENABLE_LOGGING HAS_LOGGING)
+is_enabled(NETCDF_ENABLE_FILTER_TESTING DO_FILTER_TESTS)
 is_enabled(HAVE_SZ HAS_SZIP)
 is_enabled(HAVE_SZ HAS_SZLIB_WRITE)
 is_enabled(HAVE_ZSTD HAS_ZSTD)
 is_enabled(HAVE_BLOSC HAS_BLOSC)
 is_enabled(HAVE_BZ2 HAS_BZ2)
-is_enabled(ENABLE_REMOTE_FUNCTIONALITY DO_REMOTE_FUNCTIONALITY)
+is_enabled(NETCDF_ENABLE_REMOTE_FUNCTIONALITY DO_REMOTE_FUNCTIONALITY)
 
-if(ENABLE_S3_INTERNAL)
+if(NETCDF_ENABLE_S3_INTERNAL)
   set(WHICH_S3_SDK "internal")
   set(NC_WHICH_S3_SDK "internal")
-elseif(ENABLE_S3_AWS)
+elseif(NETCDF_ENABLE_S3_AWS)
   set(WHICH_S3_SDK "aws-sdk-cpp")
   set(NC_WHICH_S3_SDK "aws-sdk-cpp")
 else()
@@ -1668,14 +1673,14 @@ else()
 endif()
 
 if(WITH_S3_TESTING STREQUAL PUBLIC)
-  set(ENABLE_S3_TESTING "public")
+  set(NETCDF_ENABLE_S3_TESTING "public")
 elseif(WITH_S3_TESTING)
-  set(ENABLE_S3_TESTING "yes")
-  set(ENABLE_S3_TESTALL "yes")
+  set(NETCDF_ENABLE_S3_TESTING "yes")
+  set(NETCDF_ENABLE_S3_TESTALL "yes")
 elseif(NOT WITH_S3_TESTING)
-  set(ENABLE_S3_TESTING "no")
+  set(NETCDF_ENABLE_S3_TESTING "no")
 else()
-  set(ENABLE_S3_TESTING "no")
+  set(NETCDF_ENABLE_S3_TESTING "no")
 endif()
 
 # The Unidata testing S3 bucket
@@ -1687,7 +1692,7 @@ set(S3TESTBUCKET "unidata-zarr-test-data" CACHE STRING "S3 test bucket")
 set(S3TESTSUBTREE "netcdf-c" CACHE STRING "Working S3 path.")
 # Build a unique id based on the date
 string(TIMESTAMP TESTUID "%s")
-if(ENABLE_S3_TESTING)
+if(NETCDF_ENABLE_S3_TESTING)
 file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/s3cleanup_${PLATFORMUID}.uids" "${TESTUID}\n")
 endif()
 
@@ -1706,7 +1711,16 @@ file(READ "${CMAKE_CURRENT_BINARY_DIR}/libnetcdf.settings"
   LIBNETCDF_SETTINGS)
 message(STATUS ${LIBNETCDF_SETTINGS})
 
-# Install libnetcdf.settings file into same location
+### 
+# Report deprecated options detected by
+# cmake/deprecated.cmake. Added in support of
+# https://github.com/Unidata/netcdf-c/pull/2895
+###
+
+if(DEFINED DEPR_OPT)
+  message(WARNING "Warning! Deprecated Options used. Please migrate your build system as follows:\n${DEPR_OPT}" )
+endif()
+  # Install libnetcdf.settings file into same location
 # as the libraries.
 install(FILES "${netCDF_BINARY_DIR}/libnetcdf.settings"
   DESTINATION "${CMAKE_INSTALL_LIBDIR}"
@@ -1755,14 +1769,14 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURREN
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/plugins/findplugin.sh @ONLY NEWLINE_STYLE LF)
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_test4/findplugin.in ${CMAKE_CURRENT_BINARY_DIR}/examples/C/findplugin.sh @ONLY NEWLINE_STYLE LF)
 
-if(ENABLE_BENCHMARKS)
-  if(ENABLE_PARALLEL4)
+if(NETCDF_ENABLE_BENCHMARKS)
+  if(NETCDF_ENABLE_PARALLEL4)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_perf/run_par_bm_test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/nc_perf/run_par_bm_test.sh @ONLY NEWLINE_STYLE LF)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nc_perf/run_gfs_test.sh.in ${CMAKE_CURRENT_BINARY_DIR}/nc_perf/run_gfs_test.sh @ONLY NEWLINE_STYLE LF)
-  endif(ENABLE_PARALLEL4)
-endif(ENABLE_BENCHMARKS)
+  endif(NETCDF_ENABLE_PARALLEL4)
+endif(NETCDF_ENABLE_BENCHMARKS)
 
-if(ENABLE_TESTS)
+if(NETCDF_ENABLE_TESTS)
     #####
     # Build ncdap_test|dap4_test/findtestserver[4].c
     #####
diff --git a/COMPILE.cmake.txt b/COMPILE.cmake.txt
index a8b395244..d237f8c1e 100644
--- a/COMPILE.cmake.txt
+++ b/COMPILE.cmake.txt
@@ -69,11 +69,11 @@ would specify it with the '-G' flag.
 Common NetCDF/CMake Options
 *********************
 
-- ENABLE_NETCDF_4 (On by Default)
-- ENABLE_DAP (On by Default)
+- NETCDF_ENABLE_NETCDF_4 (On by Default)
+- NETCDF_ENABLE_DAP (On by Default)
 - BUILD_SHARED_LIBS (Off by Default for Windows, 
                      On by Default for Unix/Linux) 
-- ENABLE_DLL (Windows Only, Off by Default)
+- NETCDF_ENABLE_DLL (Windows Only, Off by Default)
 - CMAKE_PREFIX_PATH (Specify list of 
 
 This is just a partial list of options available. To see a full list
@@ -81,7 +81,7 @@ of options, run 'cmake -L' from the command line, or use a CMake GUI.
 
 To specify an option with CMake, you would use the following syntax:
 
-developer@dummy-machine:/netcdf/build_dir$ cmake .. -D"ENABLE_NETCDF_4=ON" 
+developer@dummy-machine:/netcdf/build_dir$ cmake .. -D"NETCDF_ENABLE_NETCDF_4=ON" 
 				 -D"BUILD_SHARED_LIBS=ON" -D"USE_HDF5=OFF"
 
 Additional References
diff --git a/Makefile.am b/Makefile.am
index 619254b17..5bba56998 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,7 +49,7 @@ V2_TEST = nctest
 endif
 
 # Does the user want to build ncgen/ncdump?
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 NCGEN3 = ncgen3
 NCGEN = ncgen
 NCDUMP = ncdump
@@ -76,21 +76,21 @@ endif
 endif
 
 # Build the dap2 client
-if ENABLE_DAP
+if NETCDF_ENABLE_DAP
 OCLIB = oc2
 DAP2 = libdap2
 NCDAP2TESTDIR = ncdap_test
 endif
 
-if ENABLE_DAP4
+if NETCDF_ENABLE_DAP4
 DAP4 = libdap4
 NCDAP4TESTDIR = dap4_test
 XML = libncxml
 endif #DAP4
 
-if ENABLE_S3_INTERNAL
+if NETCDF_ENABLE_S3_INTERNAL
 XML = libncxml # Internal S3 requires XML
-endif #ENABLE_S3_INTERNAL
+endif #NETCDF_ENABLE_S3_INTERNAL
 
 # Build PnetCDF
 if USE_PNETCDF
@@ -104,18 +104,18 @@ LIBHDF4 = libhdf4
 endif
 
 # Build Plugin support
-if ENABLE_PLUGINS
+if NETCDF_ENABLE_PLUGINS
 NCPOCO = libncpoco
 endif
 
 # Build Cloud Storage if desired.
-if ENABLE_NCZARR
+if NETCDF_ENABLE_NCZARR
 ZARR_TEST_DIR = nczarr_test
 ZARR = libnczarr
 endif
 
 # Optionally build test plugins
-if ENABLE_PLUGINS
+if NETCDF_ENABLE_PLUGINS
 PLUGIN_DIR = plugins
 endif
 
@@ -210,7 +210,7 @@ install-data-hook:
 # Also track the S3 cleanup id
 all-local: liblib/libnetcdf.la
 	echo ${PACKAGE_VERSION} > VERSION
-if ENABLE_S3_TESTALL
+if NETCDF_ENABLE_S3_TESTALL
 	rm -f ${abs_top_builddir}/tmp_@PLATFORMUID@.uids
 	echo "@TESTUID@" >> ${abs_top_builddir}/s3cleanup_@PLATFORMUID@.uids
 	cat ${abs_top_builddir}/s3cleanup_@PLATFORMUID@.uids | sort | uniq > ${abs_top_builddir}/tmp_@PLATFORMUID@.uids
@@ -218,7 +218,7 @@ if ENABLE_S3_TESTALL
 	mv ${abs_top_builddir}/tmp_@PLATFORMUID@.uids ${abs_top_builddir}/s3cleanup_@PLATFORMUID@.uids
 endif
 
-if ENABLE_S3_TESTALL
+if NETCDF_ENABLE_S3_TESTALL
 distclean-local:
 	rm -f ${abs_top_builddir}/s3cleanup_@PLATFORMUID@.uids
 endif
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index b16fe6b0e..35f4de9be 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release
 
 ## 4.9.3 - TBD
 
+* Changed `cmake` build options to be prefaced with `NETCDF`, to bring things in to line with best practices.  This will permit a number of overall quality of life improvements to netCDF, in terms of allowing it to be more easily integrated with upstream projects via `FetchContent()`, `subdirectory()`, etc. Currently, the naming convention in use thus far will still work, but will result in warning messages about deprecation, and instructions on how to update your workflow. See [Github #2895](https://github.com/Unidata/netcdf-c/pull/2895) for more information.
 * Fix some problems in handling S3 urls with missing regions. See [Github #2819](https://github.com/Unidata/netcdf-c/pull/2819).
 * Incorporate a more modern look and feel to user documentation generated by Doxygen.  See [Doxygen Awesome CSS](https://github.com/jothepro/doxygen-awesome-css) and [Github #2864](https://github.com/Unidata/netcdf-c/pull/2864) for more information.
 * Added infrastructure to allow for `CMAKE_UNITY_BUILD`, (thanks \@jschueller).  See [Github #2839](https://github.com/Unidata/netcdf-c/pull/2839) for more information.
diff --git a/appveyor.yml b/appveyor.yml
index 970be33af..ed3ca77a0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -36,7 +36,7 @@ build: off
 build_script:
   - cmd: mkdir build
   - cmd: cd build
-  - cmd: cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%INSTALL_LOC% -DENABLE_BASH_SCRIPT_TESTING=OFF -DENABLE_FILTER_TESTING=OFF -DENABLE_BYTERANGE=ON
+  - cmd: cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%INSTALL_LOC% -DNETCDF_ENABLE_BASH_SCRIPT_TESTING=OFF -DNETCDF_ENABLE_FILTER_TESTING=OFF -DNETCDF_ENABLE_BYTERANGE=ON
   - cmd: if errorlevel 1 exit 1
   - cmd: cmake --build . --config Release -- /maxcpucount:4
 
diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
index df2f30ca5..d74a6ecd5 100644
--- a/cmake/dependencies.cmake
+++ b/cmake/dependencies.cmake
@@ -14,7 +14,7 @@ find_package(MakeDist)
 ################################
 # HDF4
 ################################
-if(ENABLE_HDF4)
+if(NETCDF_ENABLE_HDF4)
   set(USE_HDF4 ON )
   # Check for include files, libraries.
 
@@ -69,8 +69,8 @@ if(ENABLE_HDF4)
   message(STATUS "Found JPEG libraries: ${JPEG_LIB}")
 
   # Option to enable HDF4 file tests.
-  option(ENABLE_HDF4_FILE_TESTS "Run HDF4 file tests.  This fetches sample HDF4 files from the Unidata ftp site to test with (requires curl)." ON)
-  if(ENABLE_HDF4_FILE_TESTS)
+  option(NETCDF_ENABLE_HDF4_FILE_TESTS "Run HDF4 file tests.  This fetches sample HDF4 files from the Unidata ftp site to test with (requires curl)." ON)
+  if(NETCDF_ENABLE_HDF4_FILE_TESTS)
     find_program(PROG_CURL NAMES curl)
     if(PROG_CURL)
       set(USE_HDF4_FILE_TESTS ON )
@@ -114,10 +114,10 @@ if(USE_HDF5)
   # as a shared library, we will use hdf5 as a shared
   # library. If we are building netcdf statically,
   # we will use a static library.  This can be toggled
-  # by explicitly modifying NC_FIND_SHARED_LIBS.
+  # by explicitly modifying NETCDF_FIND_SHARED_LIBS.
   ##
   #if (MSVC)
-  #  if(NC_FIND_SHARED_LIBS)
+  #  if(NETCDF_FIND_SHARED_LIBS)
   #    set(HDF5_USE_STATIC_LIBRARIES OFF)
   #  else()
   #    set(HDF5_USE_STATIC_LIBRARIES ON)
@@ -201,7 +201,7 @@ if(USE_HDF5)
 
   # Record if ROS3 Driver is available
   if(HAS_HDF5_ROS3)
-    set(ENABLE_HDF5_ROS3 ON )
+    set(NETCDF_ENABLE_HDF5_ROS3 ON )
   endif()
 
   IF (HDF5_SUPPORTS_PAR_FILTERS)
@@ -240,8 +240,8 @@ set(FOUND_CURL ${FOUND_CURL} TRUE )
 
 # Start disabling if curl not found
 if(NOT FOUND_CURL)
-  message(WARNING "ENABLE_REMOTE_FUNCTIONALITY requires libcurl; disabling")
-  set(ENABLE_REMOTE_FUNCTIONALITY OFF CACHE BOOL "ENABLE_REMOTE_FUNCTIONALITY requires libcurl; disabling" FORCE )
+  message(WARNING "NETCDF_ENABLE_REMOTE_FUNCTIONALITY requires libcurl; disabling")
+  set(NETCDF_ENABLE_REMOTE_FUNCTIONALITY OFF CACHE BOOL "NETCDF_ENABLE_REMOTE_FUNCTIONALITY requires libcurl; disabling" FORCE )
 endif()
 
 set (CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
@@ -346,18 +346,18 @@ endif()
 ################################
 # Zips
 ################################
-IF (ENABLE_FILTER_SZIP)
+IF (NETCDF_ENABLE_FILTER_SZIP)
   find_package(Szip)
-elseif(ENABLE_NCZARR)
+elseif(NETCDF_ENABLE_NCZARR)
   find_package(Szip)
 endif()
-IF (ENABLE_FILTER_BZ2)
+IF (NETCDF_ENABLE_FILTER_BZ2)
   find_package(Bz2)
 endif()
-IF (ENABLE_FILTER_BLOSC)
+IF (NETCDF_ENABLE_FILTER_BLOSC)
   find_package(Blosc)
 endif()
-IF (ENABLE_FILTER_ZSTD)
+IF (NETCDF_ENABLE_FILTER_ZSTD)
   find_package(Zstd)
 endif()
 
@@ -381,7 +381,7 @@ else()
   set(STD_FILTERS "${STD_FILTERS} bz2")
 endif()
 
-IF (ENABLE_NCZARR_ZIP)
+IF (NETCDF_ENABLE_NCZARR_ZIP)
   find_package(Zip REQUIRED)
   target_include_directories(netcdf
     PRIVATE
@@ -395,20 +395,20 @@ endif ()
 # Note we check for the library after checking for enable_s3
 # because for some reason this screws up if we unconditionally test for sdk
 # and it is not available. Fix someday
-if(ENABLE_S3)
-  if(NOT ENABLE_S3_INTERNAL)
+if(NETCDF_ENABLE_S3)
+  if(NOT NETCDF_ENABLE_S3_INTERNAL)
     # See if aws-s3-sdk is available
     find_package(AWSSDK REQUIRED COMPONENTS s3;transfer)
     if(AWSSDK_FOUND)
-      set(ENABLE_S3_AWS ON CACHE BOOL "S3 AWS" FORCE)
+      set(NETCDF_ENABLE_S3_AWS ON CACHE BOOL "S3 AWS" FORCE)
       target_include_directories(netcdf
         PRIVATE
           ${AWSSDK_INCLUDE_DIR}
       )
     else(AWSSDK_FOUND)
-      set(ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE)
+      set(NETCDF_ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE)
     endif(AWSSDK_FOUND)
-  else(NOT ENABLE_S3_INTERNAL)
+  else(NOT NETCDF_ENABLE_S3_INTERNAL)
     # Find crypto libraries required with testing with the internal s3 api.
     #find_library(SSL_LIB NAMES ssl openssl)
     find_package(OpenSSL REQUIRED)
@@ -421,16 +421,16 @@ if(ENABLE_S3)
     #  message(FATAL_ERROR "Can't find a crypto library, required by S3_INTERNAL")
     #endif(NOT CRYPTO_LIB)
 
-  endif(NOT ENABLE_S3_INTERNAL)
+  endif(NOT NETCDF_ENABLE_S3_INTERNAL)
 else()
-  set(ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE)
+  set(NETCDF_ENABLE_S3_AWS OFF CACHE BOOL "S3 AWS" FORCE)
 endif()
 
 ################################
 # LibXML
 ################################
 # see if we have libxml2
-if(ENABLE_LIBXML2)
+if(NETCDF_ENABLE_LIBXML2)
   find_package(LibXml2)
   if(LibXml2_FOUND)
     set(HAVE_LIBXML2 TRUE)
@@ -442,19 +442,19 @@ if(ENABLE_LIBXML2)
   else()
     set(HAVE_LIBXML2 FALSE)
   endif()
-endif(ENABLE_LIBXML2)
+endif(NETCDF_ENABLE_LIBXML2)
 
 ################################
 # MPI
 ################################
-if(ENABLE_PARALLEL4 OR HDF5_PARALLEL)
+if(NETCDF_ENABLE_PARALLEL4 OR HDF5_PARALLEL)
   find_package(MPI REQUIRED)
 endif()
 
 ################################
 # Parallel IO
 ################################ 
-if(ENABLE_PNETCDF)
+if(NETCDF_ENABLE_PNETCDF)
   find_package(PNETCDF 1.6.0 REQUIRED)
   if(NOT PNETCDF_HAS_RELAXED_COORD_BOUND)
     message(FATAL_ERROR "Pnetcdf must be built with relax-coord-bound enabled")
@@ -465,7 +465,7 @@ endif()
 # Doxygen
 ################################ 
 
-if(ENABLE_DOXYGEN)
+if(NETCDF_ENABLE_DOXYGEN)
   find_package(Doxygen REQUIRED)
 endif()
 
diff --git a/cmake/deprecated.cmake b/cmake/deprecated.cmake
new file mode 100644
index 000000000..caa4c61c7
--- /dev/null
+++ b/cmake/deprecated.cmake
@@ -0,0 +1,39 @@
+#######
+# Check for deprecated arguments, provide warning, and set the
+# corresponding option.
+#
+# This file is being added in support of https://github.com/Unidata/netcdf-c/pull/2895 and may eventually
+# no longer be necessary and removed in the future. 
+# 
+#######
+
+
+
+function(check_depr_opt arg)
+
+    if(DEFINED ${arg})
+
+        set(val ${${arg}})
+        message(WARNING "${arg} is deprecated and will be removed. Please use NETCDF_${arg} in the future")
+        set(NETCDF_${arg} ${val} PARENT_SCOPE)
+        set(DEPR_OPT "${DEPR_OPT}\n\to ${arg} --> NETCDF_${arg}" PARENT_SCOPE)
+    endif() 
+
+endfunction()
+
+message(STATUS "Checking for Deprecated Options")
+list(APPEND opts BUILD_UTILITIES ENABLE_BENCHMARKS ENABLE_BYTERANGE ENABLE_CDF5 ENABLE_CONVERSION_WARNINGS)
+list(APPEND opts ENABLE_DAP ENABLE_DAP2 ENABLE_DAP4 ENABLE_DISKLESS ENABLE_DOXYGEN ENABLE_ERANGE_FILL)
+list(APPEND opts ENABLE_EXAMPLES ENABLE_EXAMPLES_TESTS ENABLE_EXTREME_NUMBERS ENABLE_FFIO ENABLE_FILTER_BLOSC)
+list(APPEND opts ENABLEFILTER_BZ2 ENABLE_FILTER_SZIP ENABLE_FILTER_TESTING ENABLE_FILTER_ZSTD ENABLE_FSYNC)
+list(APPEND opts ENABLE_HDF4 ENABLE_HDF5 ENABLE_LARGE_FILE_SUPPORT ENABLE_LARGE_FILE_TESTS ENABLE_LIBXML2)
+list(APPEND opts ENABLE_LOGGING ENABLE_METADATA_PERF_TESTS ENABLE_MMAP ENABLE_NCZARR ENABLE_NCZARR_FILTERS)
+list(APPEND opts ENABLE_NCZARR_S3 ENABLE_NCZARR_ZIP ENABLE_NETCDF_4 ENABLE_PARALLEL4 ENABLE_PARALLEL_TESTS)
+list(APPEND opts ENABLE_PLUGINS ENABLE_PNETCDF ENABLE_QUANTIZE ENABLE_REMOTE_FUNCTIONALITY ENABLE_S3 ENABLE_S3_AWS)
+list(APPEND opts ENABLE_S3_INTERNAL ENABLE_STDIO ENABLE_STRICT_NULL_BYTE_HEADER_PADDING ENABLE_TESTS ENABLE_UNIT_TESTS)
+list(APPEND opts FIND_SHARED_LIBS LIB_NAME)
+
+foreach(opt ${opts})
+    #MESSAGE(STATUS "Option: ${opt}")
+    check_depr_opt(${opt})
+endforeach()
diff --git a/cmake/netcdf_functions_macros.cmake b/cmake/netcdf_functions_macros.cmake
index 3d47c7fa6..5a43c2194 100644
--- a/cmake/netcdf_functions_macros.cmake
+++ b/cmake/netcdf_functions_macros.cmake
@@ -219,11 +219,11 @@ macro(print_conf_summary)
   message("Configuration Summary:")
   message("")
   message(STATUS "Building Shared Libraries:     ${BUILD_SHARED_LIBS}")
-  message(STATUS "Building netCDF-4:             ${ENABLE_NETCDF_4}")
-  message(STATUS "Building DAP2 Support:         ${ENABLE_DAP2}")
-  message(STATUS "Building DAP4 Support:         ${ENABLE_DAP4}")
-  message(STATUS "Building Byte-range Support:   ${ENABLE_BYTERANGE}")
-  message(STATUS "Building Utilities:            ${BUILD_UTILITIES}")
+  message(STATUS "Building netCDF-4:             ${NETCDF_ENABLE_NETCDF_4}")
+  message(STATUS "Building DAP2 Support:         ${NETCDF_ENABLE_DAP2}")
+  message(STATUS "Building DAP4 Support:         ${NETCDF_ENABLE_DAP4}")
+  message(STATUS "Building Byte-range Support:   ${NETCDF_ENABLE_BYTERANGE}")
+  message(STATUS "Building Utilities:            ${NETCDF_BUILD_UTILITIES}")
   if(CMAKE_PREFIX_PATH)
     message(STATUS "CMake Prefix Path:             ${CMAKE_PREFIX_PATH}")
   endif()
@@ -236,15 +236,15 @@ macro(print_conf_summary)
     message("")
   endif()
 
-  message("Tests Enabled:              ${ENABLE_TESTS}")
-  if(ENABLE_TESTS)
-    message(STATUS "DAP Remote Tests:  ${ENABLE_DAP_REMOTE_TESTS}")
-    message(STATUS "Extra Tests:       ${ENABLE_EXTRA_TESTS}")
-    message(STATUS "Coverage Tests:    ${ENABLE_COVERAGE_TESTS}")
-    message(STATUS "Parallel Tests:    ${ENABLE_PARALLEL_TESTS}")
-    message(STATUS "Large File Tests:  ${ENABLE_LARGE_FILE_TESTS}")
-    message(STATUS "Extreme Numbers:   ${ENABLE_EXTREME_NUMBERS}")
-    message(STATUS "Unit Tests:        ${ENABLE_UNIT_TESTS}")
+  message("Tests Enabled:              ${NETCDF_ENABLE_TESTS}")
+  if(NETCDF_ENABLE_TESTS)
+    message(STATUS "DAP Remote Tests:  ${NETCDF_ENABLE_DAP_REMOTE_TESTS}")
+    message(STATUS "Extra Tests:       ${NETCDF_ENABLE_EXTRA_TESTS}")
+    message(STATUS "Coverage Tests:    ${NETCDF_ENABLE_COVERAGE_TESTS}")
+    message(STATUS "Parallel Tests:    ${NETCDF_ENABLE_PARALLEL_TESTS}")
+    message(STATUS "Large File Tests:  ${NETCDF_ENABLE_LARGE_FILE_TESTS}")
+    message(STATUS "Extreme Numbers:   ${NETCDF_ENABLE_EXTREME_NUMBERS}")
+    message(STATUS "Unit Tests:        ${NETCDF_ENABLE_UNIT_TESTS}")
   endif()
 
   message("")
diff --git a/conda.recipe/bld.bat b/conda.recipe/bld.bat
index 848cf95d8..c791c7257 100644
--- a/conda.recipe/bld.bat
+++ b/conda.recipe/bld.bat
@@ -7,7 +7,7 @@ cmake -G "Visual Studio 15 Win64" ^
       -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
       -D BUILD_SHARED_LIBS=ON ^
       -D ENABLE_TESTS=ON ^
-      -D ENABLE_HDF4=ON ^
+      -D NETCDF_ENABLE_HDF4=ON ^
       -D CMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
       -D ZLIB_LIBRARY=%LIBRARY_LIB%\zlib.lib ^
       -D ZLIB_INCLUDE_DIR=%LIBRARY_INC% ^
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 2a53cecb5..4a404781c 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -113,22 +113,22 @@ are set when opening a binary file on Windows. */
 #cmakedefine DLL_NETCDF 1
 
 /* if true, use atexist */
-#cmakedefine ENABLE_ATEXIT_FINALIZE 1
+#cmakedefine NETCDF_ENABLE_ATEXIT_FINALIZE 1
 
 /* if true, build byte-range Client */
-#cmakedefine ENABLE_BYTERANGE 1
+#cmakedefine NETCDF_ENABLE_BYTERANGE 1
 
 /* if true, enable ERANGE fill */
-#cmakedefine ENABLE_ERANGE_FILL 1
-#ifdef ENABLE_ERANGE_FILL
+#cmakedefine NETCDF_ENABLE_ERANGE_FILL 1
+#ifdef NETCDF_ENABLE_ERANGE_FILL
 #define ERANGE_FILL 1
 #endif
 
 /* if true, use hdf5 S3 virtual file reader */
-#cmakedefine ENABLE_HDF5_ROS3 1
+#cmakedefine NETCDF_ENABLE_HDF5_ROS3 1
 
 /* if true, enable CDF5 Support */
-#cmakedefine ENABLE_CDF5 1
+#cmakedefine NETCDF_ENABLE_CDF5 1
 
 /* if true, enable client side filters */
 #cmakedefine ENABLE_CLIENT_FILTERS 1
@@ -137,34 +137,34 @@ are set when opening a binary file on Windows. */
 #cmakedefine USE_STRICT_NULL_BYTE_HEADER_PADDING 1
 
 /* if true, build DAP2 and DAP4 Client */
-#cmakedefine ENABLE_DAP 1
+#cmakedefine NETCDF_ENABLE_DAP 1
 
 /* if true, build DAP4 Client */
-#cmakedefine ENABLE_DAP4 1
+#cmakedefine NETCDF_ENABLE_DAP4 1
 
 /* if true, do remote tests */
-#cmakedefine ENABLE_DAP_REMOTE_TESTS 1
+#cmakedefine NETCDF_ENABLE_DAP_REMOTE_TESTS 1
 
 /* if true, enable NCZARR */
-#cmakedefine ENABLE_NCZARR 1
+#cmakedefine NETCDF_ENABLE_NCZARR 1
 
 /* if true, enable nczarr filter support */
-#cmakedefine ENABLE_NCZARR_FILTERS 1
+#cmakedefine NETCDF_ENABLE_NCZARR_FILTERS 1
 
 /* if true, enable nczarr zip support */
-#cmakedefine ENABLE_NCZARR_ZIP 1
+#cmakedefine NETCDF_ENABLE_NCZARR_ZIP 1
 
 /* if true, Allow dynamically loaded plugins */
-#cmakedefine ENABLE_PLUGINS 1
+#cmakedefine NETCDF_ENABLE_PLUGINS 1
 
 /* if true, enable S3 support */
-#cmakedefine ENABLE_S3 1
+#cmakedefine NETCDF_ENABLE_S3 1
 
 /* if true, AWS S3 SDK is available */
-#cmakedefine ENABLE_S3_AWS 1
+#cmakedefine NETCDF_ENABLE_S3_AWS 1
 
 /* if true, Force use of S3 internal library */
-#cmakedefine ENABLE_S3_INTERNAL 1
+#cmakedefine NETCDF_ENABLE_S3_INTERNAL 1
 
 /* if true, enable S3 testing*/
 #cmakedefine WITH_S3_TESTING "PUBLIC"
@@ -302,7 +302,7 @@ are set when opening a binary file on Windows. */
 #cmakedefine HAVE_LIBMFHDF 1
 
 /* Define to 1 if you have the libxml2 library. */
-#cmakedefine ENABLE_LIBXML2 1
+#cmakedefine NETCDF_ENABLE_LIBXML2 1
 
 /* Define to 1 if you have the <locale.h> header file. */
 #cmakedefine HAVE_LOCALE_H 1
@@ -484,8 +484,8 @@ with zip */
 #cmakedefine NO_IEEE_FLOAT 1
 
 #cmakedefine BUILD_V2 1
-#cmakedefine ENABLE_DOXYGEN 1
-#cmakedefine ENABLE_INTERNAL_DOCS 1
+#cmakedefine NETCDF_ENABLE_DOXYGEN 1
+#cmakedefine NETCDF_ENABLE_INTERNAL_DOCS 1
 #cmakedefine VALGRIND_TESTS 1
 #cmakedefine ENABLE_CDMREMOTE 1
 #cmakedefine USE_HDF5 1
@@ -493,7 +493,7 @@ with zip */
 #cmakedefine TEST_PARALLEL ${TEST_PARALLEL}
 #cmakedefine BUILD_RPC 1
 #cmakedefine USE_X_GETOPT 1
-#cmakedefine ENABLE_EXTREME_NUMBERS 1
+#cmakedefine NETCDF_ENABLE_EXTREME_NUMBERS 1
 
 /* do not build the netCDF version 2 API */
 #cmakedefine NO_NETCDF_2 1
diff --git a/config.h.cmake.in.old-works b/config.h.cmake.in.old-works
index be1bbe264..fe30be321 100644
--- a/config.h.cmake.in.old-works
+++ b/config.h.cmake.in.old-works
@@ -82,14 +82,14 @@ are set when opening a binary file on Windows. */
 #cmakedefine NO_NETCDF_2 1
 #cmakedefine USE_FSYNC 1
 #cmakedefine JNA 1
-#cmakedefine ENABLE_DOXYGEN 1
-#cmakedefine ENABLE_INTERNAL_DOCS 1
+#cmakedefine NETCDF_ENABLE_DOXYGEN 1
+#cmakedefine NETCDF_ENABLE_INTERNAL_DOCS 1
 #cmakedefine VALGRIND_TESTS 1
 #cmakedefine ENABLE_CDMREMOTE 1
 #cmakedefine USE_DAP 1
-#cmakedefine ENABLE_DAP 1
-#cmakedefine ENABLE_DAP_GROUPS 1
-#cmakedefine ENABLE_DAP_REMOTE_TESTS 1
+#cmakedefine NETCDF_ENABLE_DAP 1
+#cmakedefine NETCDF_ENABLE_DAP_GROUPS 1
+#cmakedefine NETCDF_ENABLE_DAP_REMOTE_TESTS 1
 #cmakedefine EXTRA_TESTS
 #cmakedefine USE_NETCDF4 1
 #cmakedefine USE_HDF4 1
@@ -110,7 +110,7 @@ are set when opening a binary file on Windows. */
 #cmakedefine USE_DISKLESS 1
 #cmakedefine USE_SZIP 1
 #cmakedefine USE_X_GETOPT 1
-#cmakedefine ENABLE_EXTREME_NUMBERS
+#cmakedefine NETCDF_ENABLE_EXTREME_NUMBERS
 #cmakedefine LARGE_FILE_TESTS 1
 #cmakedefine HAVE_DECL_ISFINITE 1
 #cmakedefine HAVE_DECL_ISNAN 1
diff --git a/configure.ac b/configure.ac
index 740ba7fce..da3b33626 100644
--- a/configure.ac
+++ b/configure.ac
@@ -280,8 +280,8 @@ AC_SUBST([DOXYGEN_SERVER_BASED_SEARCH], ["NO"])
 AC_ARG_ENABLE([doxygen-pdf-output],
     [AS_HELP_STRING([--enable-doxygen-pdf-output],
         [Build netCDF library documentation in PDF format. Experimental.])])
-               AM_CONDITIONAL([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [test "x$enable_doxygen_pdf_output" = xyes])
-AC_SUBST([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [$enable_doxygen_pdf_output])
+               AM_CONDITIONAL([NC_NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT], [test "x$enable_doxygen_pdf_output" = xyes])
+AC_SUBST([NC_NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT], [$enable_doxygen_pdf_output])
 
 AC_ARG_ENABLE([dot],
 	[AS_HELP_STRING([--enable-dot],
@@ -596,7 +596,7 @@ XMLPARSER="tinyxml2 (bundled)"
 fi
 
 # Need a condition and subst for this
-AM_CONDITIONAL(ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_LIBXML2, [test "x$enable_libxml2" = xyes])
 AC_SUBST([XMLPARSER],[${XMLPARSER}])
 
 ###
@@ -616,9 +616,9 @@ test "x$enable_quantize" = xno || enable_quantize=yes
 
 AC_MSG_RESULT($enable_quantize)                               
 if test "x${enable_quantize}" = xyes; then
-   AC_DEFINE([ENABLE_QUANTIZE], [1], [if true, enable quantize support])
+   AC_DEFINE([NETCDF_ENABLE_QUANTIZE], [1], [if true, enable quantize support])
 fi
-AM_CONDITIONAL(ENABLE_QUANTIZE, [test x$enable_quantize = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_QUANTIZE, [test x$enable_quantize = xyes])
 
 # --enable-dap => enable-dap4
 enable_dap4=$enable_dap
@@ -682,14 +682,14 @@ AC_DEFINE_UNQUOTED([REMOTETESTSERVERS], ["$REMOTETESTSERVERS"], [the testservers
 # Set the config.h flags
 if test "x$enable_dap" = xyes; then
    AC_DEFINE([USE_DAP], [1], [if true, build DAP Client])
-   AC_DEFINE([ENABLE_DAP], [1], [if true, build DAP Client])
+   AC_DEFINE([NETCDF_ENABLE_DAP], [1], [if true, build DAP Client])
 fi
 
 if test "x$enable_dap_remote_tests" = xyes; then
-   AC_DEFINE([ENABLE_DAP_REMOTE_TESTS], [1], [if true, do remote tests])
+   AC_DEFINE([NETCDF_ENABLE_DAP_REMOTE_TESTS], [1], [if true, do remote tests])
 fi
 if test "x$enable_external_server_tests" = xyes; then
-   AC_DEFINE([ENABLE_EXTERNAL_SERVER_TESTS], [1], [if true, do remote external tests])
+   AC_DEFINE([NETCDF_ENABLE_EXTERNAL_SERVER_TESTS], [1], [if true, do remote external tests])
 fi
 
 AC_MSG_CHECKING([whether the time-consuming dap tests should be enabled (default off)])
@@ -712,10 +712,10 @@ if test "x$enable_nczarr" = xyes ; then
 fi
 
 if test "x$enable_nczarr" = xyes; then
-   AC_DEFINE([ENABLE_NCZARR], [1], [if true, build NCZarr Client])
-   AC_SUBST(ENABLE_NCZARR)
+   AC_DEFINE([NETCDF_ENABLE_NCZARR], [1], [if true, build NCZarr Client])
+   AC_SUBST(NETCDF_ENABLE_NCZARR)
 fi
-AM_CONDITIONAL(ENABLE_NCZARR, [test x$enable_nczarr = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_NCZARR, [test x$enable_nczarr = xyes])
 
 ##########
 # Look for Standardized libraries
@@ -877,7 +877,7 @@ else
    AC_MSG_RESULT([${enable_nczarr_zip}])
 
    if test "x$enable_nczarr_zip" = xyes ; then
-   AC_DEFINE([ENABLE_NCZARR_ZIP], [1], [If true, then libzip found])
+   AC_DEFINE([NETCDF_ENABLE_NCZARR_ZIP], [1], [If true, then libzip found])
    fi
 
    # Check for enabling of S3 support
@@ -969,23 +969,23 @@ else
    fi
 
    if test "x$enable_s3" = xyes ; then
-   AC_DEFINE([ENABLE_S3], [1], [if true, build netcdf-c with S3 support enabled])
+   AC_DEFINE([NETCDF_ENABLE_S3], [1], [if true, build netcdf-c with S3 support enabled])
    fi
 
    if test "x$enable_s3_aws" = xyes ; then
       LIBS="$LIBS$S3LIBS"
-      AC_DEFINE([ENABLE_S3_AWS], [1], [If true, then use aws S3 library])
+      AC_DEFINE([NETCDF_ENABLE_S3_AWS], [1], [If true, then use aws S3 library])
    fi
 
    if test "x$enable_s3_internal" = xyes ; then
-      AC_DEFINE([ENABLE_S3_INTERNAL], [1], [If true, then use internal S3 library])
+      AC_DEFINE([NETCDF_ENABLE_S3_INTERNAL], [1], [If true, then use internal S3 library])
    fi
 
    AC_DEFINE_UNQUOTED([WITH_S3_TESTING], [$with_s3_testing], [control S3 testing.])
 
    if test "x$with_s3_testing" = xyes ; then
    AC_MSG_WARN([*** DO NOT SPECIFY WITH_S3_TESTING=YES UNLESS YOU HAVE ACCESS TO THE UNIDATA S3 BUCKET! ***])
-   AC_DEFINE([ENABLE_S3_TESTALL], [yes], [control S3 testing.])
+   AC_DEFINE([NETCDF_ENABLE_S3_TESTALL], [yes], [control S3 testing.])
    fi
 fi
 
@@ -1066,7 +1066,7 @@ AC_ARG_ENABLE([utilities],
 test "x$nc_build_c" = xno && enable_utilities=no
 test "x$enable_utilities" = xno && nc_build_utilities=no
 AC_MSG_RESULT($nc_build_utilities)
-AM_CONDITIONAL(BUILD_UTILITIES, [test x$nc_build_utilities = xyes])
+AM_CONDITIONAL(NETCDF_BUILD_UTILITIES, [test x$nc_build_utilities = xyes])
 
 # Does the user want to disable all tests?
 AC_MSG_CHECKING([whether test should be built and run])
@@ -1330,7 +1330,7 @@ if test "x$enable_hdf5" = "xno" ; then
 fi
 
 if test "x$enable_dap4" = xyes; then
-   AC_DEFINE([ENABLE_DAP4], [1], [if true, build DAP4 Client])
+   AC_DEFINE([NETCDF_ENABLE_DAP4], [1], [if true, build DAP4 Client])
 fi
 
 # check for useful, but not essential, memio support
@@ -1399,7 +1399,7 @@ if test "x$found_curl" = xno && test "x$enable_byterange" = xyes ; then
 fi
 
 if test "x$enable_byterange" = xyes; then
-    AC_DEFINE([ENABLE_BYTERANGE], [1], [if true, support byte-range read of remote datasets.])
+    AC_DEFINE([NETCDF_ENABLE_BYTERANGE], [1], [if true, support byte-range read of remote datasets.])
 fi
 
 # Does the user want to disable atexit?
@@ -1422,7 +1422,7 @@ if test "x$enable_atexit_finalize" = xyes ; then
 fi
 
 if test "x$enable_atexit_finalize" = xyes ; then
-  AC_DEFINE([ENABLE_ATEXIT_FINALIZE], [1], [If true, enable nc_finalize via atexit()])
+  AC_DEFINE([NETCDF_ENABLE_ATEXIT_FINALIZE], [1], [If true, enable nc_finalize via atexit()])
 fi
 
 # Need libdl(d) for plugins
@@ -1448,9 +1448,9 @@ if test "x$enable_plugins" = xyes && test "x$enable_shared" = xno; then
 fi
 
 if test "x$enable_plugins" = xyes; then
-    AC_DEFINE([ENABLE_PLUGINS], [1], [if true, support dynamically loaded plugins])
+    AC_DEFINE([NETCDF_ENABLE_PLUGINS], [1], [if true, support dynamically loaded plugins])
 fi
-AM_CONDITIONAL(ENABLE_PLUGINS, [test "x$enable_plugins" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_PLUGINS, [test "x$enable_plugins" = xyes])
 AC_SUBST(USEPLUGINS, [${enable_plugins}])
 
 AC_FUNC_ALLOCA
@@ -1530,9 +1530,9 @@ else
 fi
 
 if test "x${enable_cdf5}" = xyes; then
-   AC_DEFINE([ENABLE_CDF5], [1], [if true, enable CDF5 Support])
+   AC_DEFINE([NETCDF_ENABLE_CDF5], [1], [if true, enable CDF5 Support])
 fi
-AM_CONDITIONAL(ENABLE_CDF5, [test x$enable_cdf5 = xyes ])
+AM_CONDITIONAL(NETCDF_ENABLE_CDF5, [test x$enable_cdf5 = xyes ])
 
 $SLEEPCMD
 if test "$ac_cv_type_uchar" = yes ; then
@@ -1639,7 +1639,7 @@ if test "x$enable_hdf5" = xyes; then
    # See if hdf5 library supports Read-Only S3 (byte-range) driver
    AC_SEARCH_LIBS([H5Pset_fapl_ros3],[hdf5_hldll hdf5_hl], [has_hdf5_ros3=yes], [has_hdf5_ros3=no])
    if test "x$has_hdf5_ros3" = xyes && test "x$enable_byterange" = xyes; then
-    AC_DEFINE([ENABLE_HDF5_ROS3], [1], [if true, support byte-range using hdf5 virtual file driver.])
+    AC_DEFINE([NETCDF_ENABLE_HDF5_ROS3], [1], [if true, support byte-range using hdf5 virtual file driver.])
    fi
 
    # Check to see if HDF5 library is 1.10.3 or greater. If so, allows
@@ -1887,15 +1887,15 @@ enable_nczarr_filter_testing=no
 fi
 
 if test "x$enable_nczarr_filters" = xyes; then
-   AC_DEFINE([ENABLE_NCZARR_FILTERS], [1], [if true, enable NCZarr filters])
+   AC_DEFINE([NETCDF_ENABLE_NCZARR_FILTERS], [1], [if true, enable NCZarr filters])
 fi
 
 # Client side filter registration is permanently disabled
 enable_clientside_filters=no
 
 AM_CONDITIONAL(ENABLE_CLIENTSIDE_FILTERS, [test x$enable_clientside_filters = xyes])
-AM_CONDITIONAL(ENABLE_FILTER_TESTING, [test x$enable_filter_testing = xyes])
-AM_CONDITIONAL(ENABLE_NCZARR_FILTERS, [test x$enable_nczarr_filters = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_FILTER_TESTING, [test x$enable_filter_testing = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_NCZARR_FILTERS, [test x$enable_nczarr_filters = xyes])
 
 # Automake conditionals need to be called, whether the answer is yes
 # or no.
@@ -1904,14 +1904,14 @@ AM_CONDITIONAL(TEST_PARALLEL4, [test "x$enable_parallel4" = xyes -a "x$enable_pa
 AM_CONDITIONAL(BUILD_DAP, [test "x$enable_dap" = xyes])
 AM_CONDITIONAL(USE_DAP, [test "x$enable_dap" = xyes]) # Alias
 # Provide protocol specific flags
-AM_CONDITIONAL(ENABLE_DAP, [test "x$enable_dap" = xyes])
-AM_CONDITIONAL(ENABLE_DAP4, [test "x$enable_dap4" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_DAP, [test "x$enable_dap" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_DAP4, [test "x$enable_dap4" = xyes])
 AM_CONDITIONAL(USE_STRICT_NULL_BYTE_HEADER_PADDING, [test x$enable_strict_null_byte_header_padding = xyes])
-AM_CONDITIONAL(ENABLE_CDF5, [test "x$enable_cdf5" = xyes])
-AM_CONDITIONAL(ENABLE_DAP_REMOTE_TESTS, [test "x$enable_dap_remote_tests" = xyes])
-AM_CONDITIONAL(ENABLE_EXTERNAL_SERVER_TESTS, [test "x$enable_external_server_tests" = xyes])
-AM_CONDITIONAL(ENABLE_DAP_AUTH_TESTS, [test "x$enable_dap_auth_tests" = xyes])
-AM_CONDITIONAL(ENABLE_DAP_LONG_TESTS, [test "x$enable_dap_long_tests" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_CDF5, [test "x$enable_cdf5" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_DAP_REMOTE_TESTS, [test "x$enable_dap_remote_tests" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_EXTERNAL_SERVER_TESTS, [test "x$enable_external_server_tests" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_DAP_AUTH_TESTS, [test "x$enable_dap_auth_tests" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_DAP_LONG_TESTS, [test "x$enable_dap_long_tests" = xyes])
 AM_CONDITIONAL(USE_PNETCDF_DIR, [test ! "x$PNETCDFDIR" = x])
 AM_CONDITIONAL(USE_LOGGING, [test "x$enable_logging" = xyes])
 AM_CONDITIONAL(CROSS_COMPILING, [test "x$cross_compiling" = xyes])
@@ -1926,17 +1926,17 @@ AM_CONDITIONAL(BUILD_MMAP, [test x$enable_mmap = xyes])
 AM_CONDITIONAL(BUILD_DOCS, [test x$enable_doxygen = xyes])
 AM_CONDITIONAL(SHOW_DOXYGEN_TAG_LIST, [test x$enable_doxygen_tasks = xyes])
 AM_CONDITIONAL(ENABLE_METADATA_PERF, [test x$enable_metadata_perf = xyes])
-AM_CONDITIONAL(ENABLE_BYTERANGE, [test "x$enable_byterange" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_BYTERANGE, [test "x$enable_byterange" = xyes])
 AM_CONDITIONAL(RELAX_COORD_BOUND, [test "xyes" = xyes])
 AM_CONDITIONAL(HAS_PAR_FILTERS, [test x$hdf5_supports_par_filters = xyes ])
 # We need to simplify the set of S3 and Zarr flag combinations
-AM_CONDITIONAL(ENABLE_S3, [test "x$enable_s3" = xyes])
-AM_CONDITIONAL(ENABLE_S3_AWS, [test "x$enable_s3_aws" = xyes])
-AM_CONDITIONAL(ENABLE_S3_INTERNAL, [test "x$enable_s3_internal" = xyes])
-AM_CONDITIONAL(ENABLE_NCZARR, [test "x$enable_nczarr" = xyes])
-AM_CONDITIONAL(ENABLE_S3_TESTPUB, [test "x$with_s3_testing" != xno]) # all => public
-AM_CONDITIONAL(ENABLE_S3_TESTALL, [test "x$with_s3_testing" = xyes])
-AM_CONDITIONAL(ENABLE_NCZARR_ZIP, [test "x$enable_nczarr_zip" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_S3, [test "x$enable_s3" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_S3_AWS, [test "x$enable_s3_aws" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_S3_INTERNAL, [test "x$enable_s3_internal" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_NCZARR, [test "x$enable_nczarr" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_S3_TESTPUB, [test "x$with_s3_testing" != xno]) # all => public
+AM_CONDITIONAL(NETCDF_ENABLE_S3_TESTALL, [test "x$with_s3_testing" = xyes])
+AM_CONDITIONAL(NETCDF_ENABLE_NCZARR_ZIP, [test "x$enable_nczarr_zip" = xyes])
 AM_CONDITIONAL(HAVE_DEFLATE, [test "x$have_deflate" = xyes])
 AM_CONDITIONAL(HAVE_SZ, [test "x$have_sz" = xyes])
 AM_CONDITIONAL(HAVE_H5Z_SZIP, [test "x$enable_hdf5_szip" = xyes])
@@ -2045,7 +2045,7 @@ AC_SUBST(HAS_S3_AWS,[$enable_s3_aws])
 AC_SUBST(HAS_S3_INTERNAL,[$enable_s3_internal])
 AC_SUBST(HAS_HDF5_ROS3,[$has_hdf5_ros3])
 AC_SUBST(HAS_NCZARR,[$enable_nczarr])
-AC_SUBST(ENABLE_S3_TESTING,[$with_s3_testing])
+AC_SUBST(NETCDF_ENABLE_S3_TESTING,[$with_s3_testing])
 AC_SUBST(HAS_NCZARR_ZIP,[$enable_nczarr_zip])
 AC_SUBST(DO_NCZARR_ZIP_TESTS,[$enable_nczarr_zip])
 AC_SUBST(HAS_QUANTIZE,[$enable_quantize])
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index b9521ad75..50f9285c1 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -8,7 +8,7 @@
 #####
 # Build doxygen documentation, if need be.
 #####
-IF(ENABLE_DOXYGEN)
+IF(NETCDF_ENABLE_DOXYGEN)
   # The following is redundant but does not hurt anything.
 
   FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.html ${CMAKE_CURRENT_SOURCE_DIR}/images ${CMAKE_CURRENT_SOURCE_DIR}/*.doc ${CMAKE_CURRENT_SOURCE_DIR}/*.xml ${CMAKE_CURRENT_SOURCE_DIR}/*.m4 ${CMAKE_CURRENT_SOURCE_DIR}/*.texi ${CMAKE_SOURCE_DIR}/oc2/auth.html.in)
@@ -43,9 +43,9 @@ IF(ENABLE_DOXYGEN)
 
 
 
-  # If ENABLE_DOXYGEN_LATEX_OUTPUT is true, automatically build
+  # If NETCDF_ENABLE_DOXYGEN_LATEX_OUTPUT is true, automatically build
   # the PDF files.
-  IF(ENABLE_DOXYGEN_PDF_OUTPUT)
+  IF(NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT)
     # Process 'main' netcdf documentation.
     FIND_PROGRAM(NC_MAKE NAMES make)
     FIND_PROGRAM(NC_PDFLATEX NAMES pdflatex)
@@ -82,7 +82,7 @@ IF(ENABLE_DOXYGEN)
     DESTINATION "${CMAKE_INSTALL_DOCDIR}/html"
     COMPONENT documentation)
 
-ENDIF(ENABLE_DOXYGEN)
+ENDIF(NETCDF_ENABLE_DOXYGEN)
 
 # Should match list in Makefile.am
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST}
diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in
index 6ddfcd72d..c93fe1a9c 100644
--- a/docs/Doxyfile.in
+++ b/docs/Doxyfile.in
@@ -1986,7 +1986,7 @@ EXTRA_SEARCH_MAPPINGS  =
 # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
 # The default value is: YES.
 
-GENERATE_LATEX         = @NC_ENABLE_DOXYGEN_PDF_OUTPUT@
+GENERATE_LATEX         = @NC_NETCDF_ENABLE_DOXYGEN_PDF_OUTPUT@
 
 # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
diff --git a/docs/byterange.md b/docs/byterange.md
index 352cafdaf..dacd93e97 100644
--- a/docs/byterange.md
+++ b/docs/byterange.md
@@ -32,7 +32,7 @@ currently do any sort of optimization or caching.
 
 This capability is enabled using the option *--enable-byterange* option
 to the *./configure* command for Automake. For Cmake, the option flag is
-*-DENABLE_BYTERANGE=true*.
+*-DNETCDF_ENABLE_BYTERANGE=true*.
 
 This capability requires access to *libcurl*, and an error will occur
 if byterange is enabled, but *libcurl* could not be located.
diff --git a/docs/cloud.md b/docs/cloud.md
index 22e73c57c..31eb25e43 100644
--- a/docs/cloud.md
+++ b/docs/cloud.md
@@ -119,8 +119,8 @@ Note also that if S3 support is enabled, then you need to have a C++ compiler in
 
 The necessary CMake flags are as follows (with defaults)
 
-1. *-DENABLE_S3* -- Controll S3 support
-2. *-DENABLE_S3_INTERNAL* -- Force use of the *nch5s3comms* SDK instead of the *aws-cpp-sdk*.
+1. *-DNETCDF_ENABLE_S3* -- Controll S3 support
+2. *-DNETCDF_ENABLE_S3_INTERNAL* -- Force use of the *nch5s3comms* SDK instead of the *aws-cpp-sdk*.
 3. *-DWITH-S3-TESTING_=ON|OFF|PUBLIC -- "ON" means do all S3 tests, "OFF" means do no S3 testing, "PUBLIC" means do only those tests that involve publically accessible S3 data.
 
 Note that unlike Automake, CMake can properly locate C++ libraries, so it should not be necessary to specify _-laws-cpp-sdk-s3_ assuming that the aws s3 libraries are installed in the default location.
@@ -267,7 +267,7 @@ This is an experimental SDK provided internally in the netcdf-c library.
 
 ### Build Options
 
-In order to enable this SDK, the Automake option *--enable-s3-internal* or the CMake option *-DENABLE_S3_INTERNAL=ON* must be specified.
+In order to enable this SDK, the Automake option *--enable-s3-internal* or the CMake option *-DNETCDF_ENABLE_S3_INTERNAL=ON* must be specified.
 
 ### Testing S3 Support {#nccloud_testing_S3_support}
 
diff --git a/docs/internal.md b/docs/internal.md
index 7d7ce2fe5..02ec903fc 100644
--- a/docs/internal.md
+++ b/docs/internal.md
@@ -711,7 +711,7 @@ and specific script files.
 The actual cleanup requires different approaches for cmake and for automake.
 In cmake, the CTestCustom.cmake mechanism is used and contains the following command:
 ````
- IF(ENABLE_S3_TESTING)
+ IF(NETCDF_ENABLE_S3_TESTING)
  # Assume run in top-level CMAKE_BINARY_DIR
  set(CTEST_CUSTOM_POST_TEST "bash -x ${CMAKE_BINARY_DIR}/s3cleanup.sh")
  ENDIF()
@@ -722,7 +722,7 @@ because it is invoked after all tests are run in the nczarr_test
 directory. So nczarr_test/Makefile.am contains the following
 equivalent code:
 ````
- if ENABLE_S3_TESTALL
+ if NETCDF_ENABLE_S3_TESTALL
  check-local:
  	bash -x ${top_srcdir}/s3cleanup.sh
  endif
diff --git a/docs/logging.md b/docs/logging.md
index 6282b8e37..adc0a9d52 100644
--- a/docs/logging.md
+++ b/docs/logging.md
@@ -45,9 +45,9 @@ To build netcdf-c with logging using autotools, add the
 
 ## Building netcdf-c with Logging using the CMake Build
 
-To build netcdf-c with logging using CMake, set the ENABLE_LOGGING option to ON:
+To build netcdf-c with logging using CMake, set the NETCDF_ENABLE_LOGGING option to ON:
 
-`cmake -DENABLE_LOGGING=ON -DCMAKE_PREFIX_PATH=/usr/local/hdf5-1.14.0 ..`
+`cmake -DNETCDF_ENABLE_LOGGING=ON -DCMAKE_PREFIX_PATH=/usr/local/hdf5-1.14.0 ..`
 
 ## Checking that Logging was Enabled
 
diff --git a/docs/nczarr.md b/docs/nczarr.md
index 6fafa1ee2..4b3f25825 100644
--- a/docs/nczarr.md
+++ b/docs/nczarr.md
@@ -503,7 +503,7 @@ The relevant ./configure options are as follows.
 
 The relevant CMake flags are as follows.
 
-1. *-DENABLE_NCZARR=off* -- equivalent to the Automake *--disable-nczarr* option.
+1. *-DNETCDF_ENABLE_NCZARR=off* -- equivalent to the Automake *--disable-nczarr* option.
 ## Testing NCZarr S3 Support {#nczarr_testing_S3_support}
 
 The relevant tests for S3 support are in the _nczarr_test_ directory.
@@ -527,7 +527,7 @@ also test S3 support with this option.
 
 Enabling S3 support is controlled by this cmake option:
 ````
--DENABLE_S3=ON
+-DNETCDF_ENABLE_S3=ON
 ````
 However, to find the aws sdk libraries,
 the following environment variables must be set:
diff --git a/examples/C/Makefile.am b/examples/C/Makefile.am
index 34dbfbec4..d0c060fee 100644
--- a/examples/C/Makefile.am
+++ b/examples/C/Makefile.am
@@ -35,8 +35,8 @@ check_PROGRAMS += simple_nc4_wr simple_nc4_rd simple_xy_nc4_wr	\
 simple_xy_nc4_rd
 TESTS += run_examples4.sh
 
-if BUILD_UTILITIES
-if ENABLE_FILTER_TESTING
+if NETCDF_BUILD_UTILITIES
+if NETCDF_ENABLE_FILTER_TESTING
 # filter_example.c should be same as nc_test4/test_filter.c
 check_PROGRAMS += filter_example
 TESTS += run_filter.sh
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 4200674d7..9f82b1f0c 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -6,6 +6,6 @@
 # See netcdf-c/COPYRIGHT file for more info.
 ADD_SUBDIRECTORY(C)
 
-IF(BUILD_UTILITIES)
+IF(NETCDF_BUILD_UTILITIES)
   ADD_SUBDIRECTORY(CDL)
 ENDIF()
diff --git a/examples/Makefile.am b/examples/Makefile.am
index cd93e33a2..27d60bde7 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -8,7 +8,7 @@
 # See netcdf-c/COPYRIGHT file for more info.
 
 # Build ncgen/ncdump.
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 CDL_DIR = CDL
 endif
 
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 224bd2bb3..aa865f854 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -35,7 +35,7 @@ INSTALL(FILES ${netCDF_BINARY_DIR}/include/netcdf_dispatch.h
     DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
     COMPONENT headers)
 
-IF(ENABLE_PNETCDF OR ENABLE_PARALLEL4)
+IF(NETCDF_ENABLE_PNETCDF OR NETCDF_ENABLE_PARALLEL4)
   INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_par.h
     DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
     COMPONENT headers)
diff --git a/include/Makefile.am b/include/Makefile.am
index 3b7e13839..69d64efef 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -26,7 +26,7 @@ if USE_DAP
 noinst_HEADERS += ncdap.h
 endif
 
-if ENABLE_BYTERANGE
+if NETCDF_ENABLE_BYTERANGE
 noinst_HEADERS += nchttp.h
 endif
 
diff --git a/include/hdf5internal.h b/include/hdf5internal.h
index a83edad32..b69311282 100644
--- a/include/hdf5internal.h
+++ b/include/hdf5internal.h
@@ -62,10 +62,10 @@ typedef struct NC_HDF5_FILE_INFO {
    hid_t hdfid;
    unsigned transientid; /* counter for transient ids */
    NCURI* uri; /* Parse of the incoming path, if url */
-#if defined(ENABLE_BYTERANGE)
+#if defined(NETCDF_ENABLE_BYTERANGE)
    int byterange;
 #endif
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
    struct NCauth* auth;
 #endif
 } NC_HDF5_FILE_INFO_T;
diff --git a/include/ncdispatch.h b/include/ncdispatch.h
index 262603673..cee5802b4 100644
--- a/include/ncdispatch.h
+++ b/include/ncdispatch.h
@@ -104,12 +104,12 @@ extern const NC_Dispatch* NC3_dispatch_table;
 extern int NC3_initialize(void);
 extern int NC3_finalize(void);
 
-#ifdef ENABLE_DAP
+#ifdef NETCDF_ENABLE_DAP
 extern const NC_Dispatch* NCD2_dispatch_table;
 extern int NCD2_initialize(void);
 extern int NCD2_finalize(void);
 #endif
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
 extern const NC_Dispatch* NCD4_dispatch_table;
 extern int NCD4_initialize(void);
 extern int NCD4_finalize(void);
@@ -138,7 +138,7 @@ extern int HDF4_initialize(void);
 extern int HDF4_finalize(void);
 #endif
 
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 extern const NC_Dispatch* NCZ_dispatch_table;
 extern int NCZ_initialize(void);
 extern int NCZ_finalize(void);
diff --git a/include/nchttp.h b/include/nchttp.h
index 872534dcb..fbb3903a6 100644
--- a/include/nchttp.h
+++ b/include/nchttp.h
@@ -26,7 +26,7 @@ typedef struct NC_HTTP_STATE {
     struct NCURI* url; /* parsed url */
     long httpcode;
     char* errmsg; /* do not free if format is HTTPCURL */
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     struct NC_HTTP_S3 {
         void* s3client;
 	struct NCS3INFO* info;
diff --git a/lib_flags.am b/lib_flags.am
index a54e32c5e..33f9c3364 100644
--- a/lib_flags.am
+++ b/lib_flags.am
@@ -13,15 +13,15 @@ if USE_DAP
 AM_CPPFLAGS += -I${top_srcdir}/oc2
 endif
 
-if ENABLE_NCZARR
+if NETCDF_ENABLE_NCZARR
 AM_CPPFLAGS += -I${top_srcdir}/libnczarr
 endif
 
-if ENABLE_S3_AWS
+if NETCDF_ENABLE_S3_AWS
 AM_LDFLAGS += -lstdc++
 endif
 
-if ! ENABLE_LIBXML2
+if ! NETCDF_ENABLE_LIBXML2
 # => tinyxml2
 AM_LDFLAGS += -lstdc++
 endif
diff --git a/libdap2/CMakeLists.txt b/libdap2/CMakeLists.txt
index 45161a6e2..ed59fc1cd 100644
--- a/libdap2/CMakeLists.txt
+++ b/libdap2/CMakeLists.txt
@@ -34,7 +34,7 @@ target_compile_options(dap2
     -DCURL_STATICLIB=1
 )
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(dap2 PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/libdap2/Makefile.am b/libdap2/Makefile.am
index 135390339..35abca961 100644
--- a/libdap2/Makefile.am
+++ b/libdap2/Makefile.am
@@ -24,7 +24,7 @@ HDRS= nccommon.h constraints.h ncd2dispatch.h dapincludes.h 	\
 dapodom.h getvara.h dapnc.h daputil.h dapdebug.h dapdump.h		\
 dceconstraints.h dcetab.h dceparselex.h
 
-if ENABLE_DAP
+if NETCDF_ENABLE_DAP
 
 if USE_NETCDF4
 AM_CPPFLAGS += -I$(top_srcdir)/libsrc4
@@ -44,7 +44,7 @@ libdap2_la_LIBADD =
 #	 ${top_builddir}/oc2/liboc.la			\
 #	 ${top_builddir}/libdispatch/libdispatch.la
 #
-endif # ENABLE_DAP
+endif # NETCDF_ENABLE_DAP
 
 # These rule are used if someone wants to rebuild the grammar files.
 # Otherwise never invoked, but records how to do it.
diff --git a/libdap4/CMakeLists.txt b/libdap4/CMakeLists.txt
index 11aa67a59..4b21a642b 100644
--- a/libdap4/CMakeLists.txt
+++ b/libdap4/CMakeLists.txt
@@ -27,7 +27,7 @@ target_compile_options(dap4
     -DCURL_STATICLIB=1
 )
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(dap4 PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/libdap4/Makefile.am b/libdap4/Makefile.am
index f16cfd4e5..496dd864a 100644
--- a/libdap4/Makefile.am
+++ b/libdap4/Makefile.am
@@ -53,7 +53,7 @@ d4odom.h \
 d4bytes.h \
 d4includes.h
 
-if ENABLE_DAP4
+if NETCDF_ENABLE_DAP4
 if USE_NETCDF4
 AM_CPPFLAGS += -I$(top_srcdir)/libsrc4
 endif
@@ -64,4 +64,4 @@ libdap4_la_SOURCES = $(SRC) $(HDRS)
 libdap4_la_CPPFLAGS += $(AM_CPPFLAGS)
 libdap4_la_LIBADD =
 
-endif # ENABLE_DAP4
+endif # NETCDF_ENABLE_DAP4
diff --git a/libdispatch/CMakeLists.txt b/libdispatch/CMakeLists.txt
index 67307b1b3..079d00914 100644
--- a/libdispatch/CMakeLists.txt
+++ b/libdispatch/CMakeLists.txt
@@ -13,7 +13,7 @@ target_sources(dispatch
     dcrc32.c dcrc32.h dcrc64.c ncexhash.c ncxcache.c ncjson.c ds3util.c dparallel.c dmissing.c
 )
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(dispatch PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
@@ -43,15 +43,15 @@ if(BUILD_V2)
   )
 endif(BUILD_V2)
 
-if(ENABLE_BYTERANGE)
+if(NETCDF_ENABLE_BYTERANGE)
   target_sources(dispatch
     PRIVATE
       dhttp.c
   )
-ENDIF(ENABLE_BYTERANGE)
+ENDIF(NETCDF_ENABLE_BYTERANGE)
 
-IF(ENABLE_S3)
-  if(ENABLE_S3_INTERNAL)
+IF(NETCDF_ENABLE_S3)
+  if(NETCDF_ENABLE_S3_INTERNAL)
     target_sources(dispatch
       PRIVATE
         ncs3sdk_h5.c nch5s3comms.c nch5s3comms.h nccurl_sha256.c nccurl_sha256.h nccurl_hmac.c nccurl_hmac.h nccurl_setup.h
@@ -80,16 +80,16 @@ if(STATUS_PARALLEL)
     target_link_libraries(dispatch PUBLIC MPI::MPI_C)
 endif(STATUS_PARALLEL)
 
-if (ENABLE_PNETCDF)
+if (NETCDF_ENABLE_PNETCDF)
     target_link_libraries(dispatch PUBLIC PNETCDF::PNETCDF)
 endif()
 
-IF(ENABLE_NCZARR)
+IF(NETCDF_ENABLE_NCZARR)
     target_include_directories(dispatch PUBLIC ../libnczarr)
-endif(ENABLE_NCZARR)
+endif(NETCDF_ENABLE_NCZARR)
 
-if(ENABLE_S3)
-  if(ENABLE_S3_AWS)
+if(NETCDF_ENABLE_S3)
+  if(NETCDF_ENABLE_S3_AWS)
     target_include_directories(dispatch PUBLIC ${AWSSDK_INCLUDE_DIRS})
     if(NOT MSVC)
       target_compile_features(dispatch PUBLIC cxx_std_11)
@@ -99,7 +99,7 @@ if(ENABLE_S3)
   endif()
 endif()
 
-if(ENABLE_TESTS)
+if(NETCDF_ENABLE_TESTS)
     BUILD_BIN_TEST(ncrandom)
 endif()
 
diff --git a/libdispatch/Makefile.am b/libdispatch/Makefile.am
index b49d4f615..9aae84ba0 100644
--- a/libdispatch/Makefile.am
+++ b/libdispatch/Makefile.am
@@ -43,12 +43,12 @@ libnetcdf2_la_SOURCES = dv2i.c
 libnetcdf2_la_CPPFLAGS = ${AM_CPPFLAGS} -DDLL_EXPORT
 endif # BUILD_V2
 
-if ENABLE_BYTERANGE
+if NETCDF_ENABLE_BYTERANGE
 libdispatch_la_SOURCES += dhttp.c
-endif # ENABLE_BYTERANGE
+endif # NETCDF_ENABLE_BYTERANGE
 
-if ENABLE_S3
-if ENABLE_S3_INTERNAL
+if NETCDF_ENABLE_S3
+if NETCDF_ENABLE_S3_INTERNAL
 # Renamed to avoid conflicts with the HDF5 files
 libdispatch_la_SOURCES += ncs3sdk_h5.c nch5s3comms.c nch5s3comms.h ncutil.h nccurl_setup.h \
 			  nccurl_sha256.c nccurl_sha256.h nccurl_hmac.c nccurl_hmac.h
diff --git a/libdispatch/ddispatch.c b/libdispatch/ddispatch.c
index 793dccdbb..1a541ab0a 100644
--- a/libdispatch/ddispatch.c
+++ b/libdispatch/ddispatch.c
@@ -24,11 +24,11 @@ See LICENSE.txt for license information.
 #include <direct.h>
 #endif
 
-#if defined(ENABLE_BYTERANGE) || defined(ENABLE_DAP) || defined(ENABLE_DAP4)
+#if defined(NETCDF_ENABLE_BYTERANGE) || defined(NETCDF_ENABLE_DAP) || defined(NETCDF_ENABLE_DAP4)
 #include <curl/curl.h>
 #endif
 
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
 #include "ncs3sdk.h"
 #endif
 
@@ -118,7 +118,7 @@ NCDISPATCH_initialize(void)
     /* Compute type alignments */
     NC_compute_alignments();
 
-#if defined(ENABLE_BYTERANGE) || defined(ENABLE_DAP) || defined(ENABLE_DAP4)
+#if defined(NETCDF_ENABLE_BYTERANGE) || defined(NETCDF_ENABLE_DAP) || defined(NETCDF_ENABLE_DAP4)
     /* Initialize curl if it is being used */
     {
         CURLcode cstat = curl_global_init(CURL_GLOBAL_ALL);
@@ -134,10 +134,10 @@ int
 NCDISPATCH_finalize(void)
 {
     int status = NC_NOERR;
-#if defined(ENABLE_BYTERANGE) || defined(ENABLE_DAP) || defined(ENABLE_DAP4)
+#if defined(NETCDF_ENABLE_BYTERANGE) || defined(NETCDF_ENABLE_DAP) || defined(NETCDF_ENABLE_DAP4)
     curl_global_cleanup();
 #endif
-#if defined(ENABLE_DAP4)
+#if defined(NETCDF_ENABLE_DAP4)
    ncxml_finalize();
 #endif
     NC_freeglobalstate(); /* should be one of the last things done */
diff --git a/libdispatch/dfile.c b/libdispatch/dfile.c
index 7447db351..5a52e28f5 100644
--- a/libdispatch/dfile.c
+++ b/libdispatch/dfile.c
@@ -1884,7 +1884,7 @@ NC_create(const char *path0, int cmode, size_t initialsz,
     if (model.impl == NC_FORMATX_PNETCDF)
     {stat = NC_ENOTBUILT; goto done;}
 #endif
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
     if (model.impl == NC_FORMATX_NC3 && (cmode & NC_64BIT_DATA))
     {stat = NC_ENOTBUILT; goto done;}
 #endif
@@ -1909,7 +1909,7 @@ NC_create(const char *path0, int cmode, size_t initialsz,
         dispatcher = UDF1_dispatch_table;
         break;
 #endif /* USE_NETCDF4 */
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
     case NC_FORMATX_NCZARR:
         dispatcher = NCZ_dispatch_table;
 	break;
@@ -2047,10 +2047,10 @@ NC_open(const char *path0, int omode, int basepe, size_t *chunksizehintp,
 #ifdef USE_HDF4
         hdf4built = 1;
 #endif
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
         cdf5built = 1;
 #endif
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 	nczarrbuilt = 1;
 #endif
         if(UDF0_dispatch_table != NULL)
@@ -2081,13 +2081,13 @@ NC_open(const char *path0, int omode, int basepe, size_t *chunksizehintp,
 #ifdef USE_HDF4
 		| (1<<NC_FORMATX_NC_HDF4)
 #endif
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 		| (1<<NC_FORMATX_NCZARR)
 #endif
-#ifdef ENABLE_DAP
+#ifdef NETCDF_ENABLE_DAP
 		| (1<<NC_FORMATX_DAP2)
 #endif
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
 		| (1<<NC_FORMATX_DAP4)
 #endif
 #ifdef USE_PNETCDF
@@ -2101,7 +2101,7 @@ NC_open(const char *path0, int omode, int basepe, size_t *chunksizehintp,
 	/* Verify */
 	if((built & (1 << model.impl)) == 0)
             {stat = NC_ENOTBUILT; goto done;}
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
 	/* Special case because there is no separate CDF5 dispatcher */
         if(model.impl == NC_FORMATX_NC3 && (omode & NC_64BIT_DATA))
             {stat = NC_ENOTBUILT; goto done;}
@@ -2111,17 +2111,17 @@ NC_open(const char *path0, int omode, int basepe, size_t *chunksizehintp,
     /* Figure out what dispatcher to use */
     if (!dispatcher) {
         switch (model.impl) {
-#ifdef ENABLE_DAP
+#ifdef NETCDF_ENABLE_DAP
         case NC_FORMATX_DAP2:
             dispatcher = NCD2_dispatch_table;
             break;
 #endif
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
         case NC_FORMATX_DAP4:
             dispatcher = NCD4_dispatch_table;
             break;
 #endif
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 	case NC_FORMATX_NCZARR:
 	    dispatcher = NCZ_dispatch_table;
 	    break;
diff --git a/libdispatch/dfilter.c b/libdispatch/dfilter.c
index d3b590dcd..760815270 100644
--- a/libdispatch/dfilter.c
+++ b/libdispatch/dfilter.c
@@ -25,7 +25,7 @@
 #include "hdf5internal.h"
 #endif
 
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 #include "zdispatch.h"
 #endif
 
diff --git a/libdispatch/dhttp.c b/libdispatch/dhttp.c
index e443bf0e5..48ea3de14 100644
--- a/libdispatch/dhttp.c
+++ b/libdispatch/dhttp.c
@@ -26,7 +26,7 @@
 #include "ncuri.h"
 #include "ncauth.h"
 
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
 #include "ncs3sdk.h"
 #endif
 #include "nchttp.h"
@@ -100,7 +100,7 @@ nc_http_open_verbose(const char* path, int verbose, NC_HTTP_STATE** statep)
         {stat = NCTHROW(NC_ENOMEM); goto done;}
     state->path = strdup(path);
     state->url = uri; uri = NULL;    
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     state->format = (NC_iss3(state->url,NULL)?HTTPS3:HTTPCURL);
 #else
     state->format = HTTPCURL;
@@ -122,7 +122,7 @@ nc_http_open_verbose(const char* path, int verbose, NC_HTTP_STATE** statep)
             if(cstat != CURLE_OK) {stat = NCTHROW(NC_ECURL); goto done;}
         }
         } break;
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case HTTPS3: {
 	if((state->s3.info = (NCS3INFO*)calloc(1,sizeof(NCS3INFO)))==NULL)
 	    {stat = NCTHROW(NC_ENOMEM); goto done;}
@@ -158,7 +158,7 @@ nc_http_close(NC_HTTP_STATE* state)
         ncbytesfree(state->curl.response.buf);
         nclistfreeall(state->curl.request.headers); state->curl.request.headers = NULL;
         break;
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case HTTPS3: {
 	if(state->s3.s3client)
             NC_s3sdkclose(state->s3.s3client, state->s3.info, 0, NULL);
@@ -203,7 +203,7 @@ nc_http_reset(NC_HTTP_STATE* state)
         (void)CURLERR(curl_easy_setopt(state->curl.curl, CURLOPT_READDATA, NULL));
         headersoff(state);
         break;
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case HTTPS3:
         break; /* Done automatically */
 #endif
@@ -250,7 +250,7 @@ nc_http_read(NC_HTTP_STATE* state, size64_t start, size64_t count, NCbytes* buf)
         if((stat = execute(state)))
             goto done;
 	break;
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case HTTPS3: {
 	/* Make sure buf has enough space allocated */
         ncbytessetalloc(buf,count);
@@ -301,7 +301,7 @@ nc_http_write(NC_HTTP_STATE* state, NCbytes* payload)
         if((stat = execute(state)))
             goto done;
 	break;
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case HTTPS3:
         if((stat = NC_s3sdkwriteobject(state->s3.s3client,
                                 state->s3.info->bucket,
@@ -357,7 +357,7 @@ nc_http_size(NC_HTTP_STATE* state, long long* sizep)
         if((stat = lookupheader(state,"content-length",&hdr))==NC_NOERR)
                 sscanf(hdr,"%llu",sizep);
         break;
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case HTTPS3: {
 	size64_t len = 0;
 	if((stat = NC_s3sdkinfo(state->s3.s3client,state->s3.info->bucket,state->s3.info->rootkey,&len,&state->errmsg))) goto done;
diff --git a/libdispatch/dinfermodel.c b/libdispatch/dinfermodel.c
index 83dad0b75..ebd2d3ef8 100644
--- a/libdispatch/dinfermodel.c
+++ b/libdispatch/dinfermodel.c
@@ -27,7 +27,7 @@
 #include "nclog.h"
 #include "ncrc.h"
 #include "nchttp.h"
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
 #include "ncs3sdk.h"
 #endif
 
@@ -61,7 +61,7 @@ struct MagicFile {
 #endif
     char* curlurl; /* url to use with CURLOPT_SET_URL */
     NC_HTTP_STATE* state;
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     NCS3INFO s3;
     void* s3client;
     char* errmsg;
@@ -902,7 +902,7 @@ NC_infermodel(const char* path, int* omodep, int iscreate, int useparallel, void
         ncurisetfragments(uri,sfrag);
         nullfree(sfrag); sfrag = NULL;
 
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
 	/* If s3, then rebuild the url */
 	if(NC_iss3(uri,NULL)) {
 	    NCURI* newuri = NULL;
@@ -1323,7 +1323,7 @@ openmagic(struct MagicFile* file)
 	goto done;
     }
     if(file->uri != NULL) {
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 	/* Construct a URL minus any fragment */
         file->curlurl = ncuribuild(file->uri,NULL,NULL,NCURISVC);
 	/* Open the curl handle */
@@ -1411,7 +1411,7 @@ readmagic(struct MagicFile* file, long pos, char* magic)
 	printmagic("XXX: readmagic",magic,file);
 #endif
     } else if(file->uri != NULL) {
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 	fileoffset_t start = (size_t)pos;
 	fileoffset_t count = MAGIC_NUMBER_LEN;
         status = nc_http_read(file->state, start, count, buf);
@@ -1466,7 +1466,7 @@ closemagic(struct MagicFile* file)
     if(fIsSet(file->omode,NC_INMEMORY)) {
 	/* noop */
     } else if(file->uri != NULL) {
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 	    status = nc_http_close(file->state);
 #endif
 	    nullfree(file->curlurl);
diff --git a/libdispatch/dinstance.c b/libdispatch/dinstance.c
index d2a66079b..89f8f4523 100644
--- a/libdispatch/dinstance.c
+++ b/libdispatch/dinstance.c
@@ -30,7 +30,7 @@ Currently two operations are defined:
    necessary in order to get to the right NC* instance.
 */
 
-#if defined(ENABLE_DAP4) || defined(ENABLE_DAP2)
+#if defined(NETCDF_ENABLE_DAP4) || defined(NETCDF_ENABLE_DAP2)
 EXTERNL NC* NCD4_get_substrate(NC* nc);
 EXTERNL NC* NCD2_get_substrate(NC* nc);
 static NC*
diff --git a/libdispatch/nc.c b/libdispatch/nc.c
index 425b03d35..01207a90b 100644
--- a/libdispatch/nc.c
+++ b/libdispatch/nc.c
@@ -124,7 +124,7 @@ nc_set_default_format(int format, int *old_formatp)
         *old_formatp = default_create_format;
 
     /* Make sure only valid format is set. */
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
     if (format == NC_FORMAT_CDF5)
         return NC_ENOTBUILT;
 #endif
diff --git a/libhdf4/CMakeLists.txt b/libhdf4/CMakeLists.txt
index 05b3b9a07..cbb350771 100644
--- a/libhdf4/CMakeLists.txt
+++ b/libhdf4/CMakeLists.txt
@@ -18,7 +18,7 @@ target_sources(netcdfhdf4
         hdf4var.c
 )
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
     target_compile_definitions(netcdfhdf4 PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/libhdf5/CMakeLists.txt b/libhdf5/CMakeLists.txt
index 12904b131..4f5d88342 100644
--- a/libhdf5/CMakeLists.txt
+++ b/libhdf5/CMakeLists.txt
@@ -17,11 +17,11 @@ target_sources(netcdfhdf5 PRIVATE
     hdf5set_format_compatibility.c hdf5debug.c
 )
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
     target_compile_definitions(netcdfhdf5 PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
-if(ENABLE_BYTERANGE)
+if(NETCDF_ENABLE_BYTERANGE)
     target_sources(netcdfhdf5 PRIVATE 
         H5FDhttp.c
     )
diff --git a/libhdf5/Makefile.am b/libhdf5/Makefile.am
index e7aa2164f..10794a07a 100644
--- a/libhdf5/Makefile.am
+++ b/libhdf5/Makefile.am
@@ -18,7 +18,7 @@ hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c hdf5create.c hdf5open.c	\
 hdf5var.c nc4mem.c nc4memcb.c hdf5dispatch.c hdf5filter.c   \
 hdf5set_format_compatibility.c hdf5debug.c hdf5debug.h hdf5err.h
 
-if ENABLE_BYTERANGE
+if NETCDF_ENABLE_BYTERANGE
 libnchdf5_la_SOURCES += H5FDhttp.c H5FDhttp.h
 endif
 
diff --git a/libhdf5/hdf5dispatch.c b/libhdf5/hdf5dispatch.c
index 1e8f980da..439b6134b 100644
--- a/libhdf5/hdf5dispatch.c
+++ b/libhdf5/hdf5dispatch.c
@@ -11,7 +11,7 @@
 #include "config.h"
 #include "hdf5internal.h"
 
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 #include "H5FDhttp.h"
 #endif
 
@@ -127,7 +127,7 @@ NC_HDF5_initialize(void)
     if (!nc4_hdf5_initialized)
         nc4_hdf5_initialize();
 
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
     (void)H5FD_http_init();
 #endif
     return NC4_provenance_init();
@@ -142,7 +142,7 @@ NC_HDF5_initialize(void)
 int
 NC_HDF5_finalize(void)
 {
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
     (void)H5FD_http_finalize();
 #endif
     (void)nc4_hdf5_finalize();
diff --git a/libhdf5/hdf5file.c b/libhdf5/hdf5file.c
index 8fab07a6c..bdb3a7f27 100644
--- a/libhdf5/hdf5file.c
+++ b/libhdf5/hdf5file.c
@@ -221,7 +221,7 @@ nc4_close_netcdf4_file(NC_FILE_INFO_T *h5, int abort, NC_memio *memio)
     NC4_clear_provenance(&h5->provenance);
 
     ncurifree(hdf5_info->uri);
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     /* Free the http info */
     NC_authfree(hdf5_info->auth);
 #endif
diff --git a/libhdf5/hdf5open.c b/libhdf5/hdf5open.c
index b40cdc2b3..9fafc074e 100644
--- a/libhdf5/hdf5open.c
+++ b/libhdf5/hdf5open.c
@@ -20,11 +20,11 @@
 #include "ncpathmgr.h"
 #include <stddef.h>
 
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 #include "H5FDhttp.h"
 #endif
 
-#ifdef ENABLE_HDF5_ROS3
+#ifdef NETCDF_ENABLE_HDF5_ROS3
 #include <H5FDros3.h>
 #include "ncs3sdk.h"
 #endif
@@ -743,7 +743,7 @@ nc4_open_file(const char *path, int mode, void* parameters, int ncid)
 
     h5 = (NC_HDF5_FILE_INFO_T*)nc4_info->format_file_info;
 
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
     /* Do path as URL processing */
     ncuriparse(path,&h5->uri);
     if(h5->uri != NULL) {
@@ -755,7 +755,7 @@ nc4_open_file(const char *path, int mode, void* parameters, int ncid)
             parameters = NULL; /* kill off parallel */
 	}
     }
-#endif /*ENABLE_BYTERANGE*/
+#endif /*NETCDF_ENABLE_BYTERANGE*/
 
     nc4_info->mem.inmemory = ((mode & NC_INMEMORY) == NC_INMEMORY);
     nc4_info->mem.diskless = ((mode & NC_DISKLESS) == NC_DISKLESS);
@@ -882,10 +882,10 @@ nc4_open_file(const char *path, int mode, void* parameters, int ncid)
             if ((h5->hdfid = nc4_H5Fopen(path, flags, fapl_id)) < 0)
                 BAIL(NC_EHDFERR);
         }
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 	else if(h5->byterange) {   /* Arrange to use the byte-range drivers */
 	    char* newpath = NULL;
-#ifdef ENABLE_HDF5_ROS3
+#ifdef NETCDF_ENABLE_HDF5_ROS3
 	    H5FD_ros3_fapl_t fa;
 	    const char* awsaccessid0 = NULL;
 	    const char* awssecretkey0 = NULL;
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
index e63e1fb83..36a709f65 100644
--- a/liblib/CMakeLists.txt
+++ b/liblib/CMakeLists.txt
@@ -42,7 +42,7 @@ if(USE_HDF4)
   )
 endif()
 
-if(ENABLE_DAP2)
+if(NETCDF_ENABLE_DAP2)
   target_sources(netcdf
     PRIVATE
       $<TARGET_OBJECTS:oc2>
@@ -50,7 +50,7 @@ if(ENABLE_DAP2)
   )
 endif()
 
-if(ENABLE_DAP4)
+if(NETCDF_ENABLE_DAP4)
   target_sources(netcdf
     PRIVATE
       $<TARGET_OBJECTS:dap4>
@@ -58,21 +58,21 @@ if(ENABLE_DAP4)
   )
 endif()
 
-if(ENABLE_NCZARR)
+if(NETCDF_ENABLE_NCZARR)
   target_sources(netcdf
     PRIVATE
       $<TARGET_OBJECTS:nczarr>
   )
 endif()
 
-if(ENABLE_S3_INTERNAL)
+if(NETCDF_ENABLE_S3_INTERNAL)
   target_sources(netcdf
     PRIVATE
       $<TARGET_OBJECTS:ncxml>
   )
 endif()
 
-if(ENABLE_PLUGINS)
+if(NETCDF_ENABLE_PLUGINS)
   target_sources(netcdf
     PRIVATE
       $<TARGET_OBJECTS:ncpoco>
@@ -114,7 +114,7 @@ set(TLL_LIBS ${TLL_LIBS} ${HAVE_LIBM} ${ZLIB_LIBRARY})
 # Add extra dependencies specified via NC_EXTRA_DEPS
 set(TLL_LIBS ${TLL_LIBS} ${EXTRA_DEPS})
 
-if(ENABLE_NCZARR_ZIP)
+if(NETCDF_ENABLE_NCZARR_ZIP)
   set(TLL_LIBS ${TLL_LIBS} ${Zip_LIBRARIES})
 endif()
 
@@ -135,7 +135,7 @@ if(HAVE_LIBDL)
   set(TLL_LIBS ${LIBDL} ${TLL_LIBS})
 endif()
 
-if(ENABLE_NCZARR_ZIP)
+if(NETCDF_ENABLE_NCZARR_ZIP)
   set(TLL_LIBS ${TLL_LIBS} ${Zip_LIBRARIES})
 endif()
 
@@ -151,21 +151,21 @@ if(USE_HDF4)
   set(TLL_LIBS ${HDF4_LIBRARIES} ${TLL_LIBS})
 endif()
 
-if(ENABLE_PNETCDF)
+if(NETCDF_ENABLE_PNETCDF)
   SET(TLL_LIBS ${TLL_LIBS} PNETCDF::PNETCDF)
 endif()
 
 
-if(ENABLE_S3)
-  if(ENABLE_S3_AWS)
+if(NETCDF_ENABLE_S3)
+  if(NETCDF_ENABLE_S3_AWS)
     target_link_directories(netcdf PUBLIC ${AWSSDK_LIB_DIR})
     set(TLL_LIBS ${AWSSDK_LINK_LIBRARIES} ${TLL_LIBS})
-  elseif(ENABLE_S3_INTERNAL)
+  elseif(NETCDF_ENABLE_S3_INTERNAL)
     if(OPENSSL_FOUND)
       set(TLL_LIBS ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES} ${TLL_LIBS})
     endif(OPENSSL_FOUND)
-  endif(ENABLE_S3_AWS)  
-endif(ENABLE_S3)
+  endif(NETCDF_ENABLE_S3_AWS)  
+endif(NETCDF_ENABLE_S3)
 
 if(HAVE_LIBXML2)
   set(TLL_LIBS ${TLL_LIBS} ${LIBXML2_LIBRARIES})
@@ -193,12 +193,12 @@ if(MSVC)
     )
 endif()
 
-if(ENABLE_SHARED_LIBRARY_VERSION)
+if(NETCDF_ENABLE_SHARED_LIBRARY_VERSION)
   set_target_properties(netcdf PROPERTIES
     VERSION ${netCDF_LIB_VERSION}
     SOVERSION ${netCDF_SO_VERSION}
     )
-endif(ENABLE_SHARED_LIBRARY_VERSION)
+endif(NETCDF_ENABLE_SHARED_LIBRARY_VERSION)
 
 install(
   TARGETS netcdf EXPORT netCDFTargets
diff --git a/liblib/Makefile.am b/liblib/Makefile.am
index f719ff473..2b7f39ef0 100644
--- a/liblib/Makefile.am
+++ b/liblib/Makefile.am
@@ -53,25 +53,25 @@ libnetcdf_la_LIBADD += ${top_builddir}/libhdf4/libnchdf4.la
 endif # USE_HDF4
 
 # + dap
-if ENABLE_DAP
+if NETCDF_ENABLE_DAP
 AM_CPPFLAGS += -I${top_srcdir}/libdap2 -I${top_srcdir}/oc
 libnetcdf_la_LIBADD += ${top_builddir}/libdap2/libdap2.la
 libnetcdf_la_LIBADD += ${top_builddir}/oc2/liboc.la
-endif # ENABLE_DAP
+endif # NETCDF_ENABLE_DAP
 
-if ENABLE_DAP4
+if NETCDF_ENABLE_DAP4
 AM_CPPFLAGS += -I${top_srcdir}/libdap4
 libnetcdf_la_LIBADD += ${top_builddir}/libdap4/libdap4.la
-endif # ENABLE_DAP4
+endif # NETCDF_ENABLE_DAP4
 
 AM_CPPFLAGS += -I${top_srcdir}/libncxml
-if ENABLE_DAP4
+if NETCDF_ENABLE_DAP4
 libnetcdf_la_LIBADD += ${top_builddir}/libncxml/libncxml.la
 else
-if ENABLE_S3_INTERNAL
+if NETCDF_ENABLE_S3_INTERNAL
 libnetcdf_la_LIBADD += ${top_builddir}/libncxml/libncxml.la
 endif
-endif # ENABLE_S3_INTERNAL || ENABLE_DAP4
+endif # NETCDF_ENABLE_S3_INTERNAL || NETCDF_ENABLE_DAP4
 
 # NetCDF-4 ...
 if USE_NETCDF4
@@ -79,18 +79,18 @@ AM_CPPFLAGS += -I${top_srcdir}/libsrc4
 libnetcdf_la_LIBADD += ${top_builddir}/libsrc4/libnetcdf4.la
 endif #USE_NETCDF4
 
-if ENABLE_NCZARR
+if NETCDF_ENABLE_NCZARR
 AM_CPPFLAGS += -I${top_srcdir}/libnczarr
 libnetcdf_la_LIBADD += ${top_builddir}/libnczarr/libnczarr.la
-if ENABLE_S3_AWS
+if NETCDF_ENABLE_S3_AWS
 libnetcdf_la_LIBADD += ${aws_cpp_sdk_core_LIBS} ${aws_cpp_sdk_s3_LIBS}
 endif
-endif #ENABLE_NCZARR
+endif #NETCDF_ENABLE_NCZARR
 
-if ENABLE_PLUGINS
+if NETCDF_ENABLE_PLUGINS
 AM_CPPFLAGS += -I${top_srcdir}/libncpoco
 libnetcdf_la_LIBADD += ${top_builddir}/libncpoco/libncpoco.la
-endif #ENABLE_PLUGINS
+endif #NETCDF_ENABLE_PLUGINS
 
 if ISCYGWIN
 # Force binary mode for file read/write
diff --git a/liblib/nc_initialize.c b/liblib/nc_initialize.c
index e98a5bc1e..321d16c42 100644
--- a/liblib/nc_initialize.c
+++ b/liblib/nc_initialize.c
@@ -26,12 +26,12 @@ extern int NC_HDF5_initialize(void);
 extern int NC_HDF5_finalize(void);
 #endif
 
-#ifdef ENABLE_DAP2
+#ifdef NETCDF_ENABLE_DAP2
 extern int NCD2_initialize(void);
 extern int NCD2_finalize(void);
 #endif
 
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
 extern int NCD4_initialize(void);
 extern int NCD4_finalize(void);
 #endif
@@ -59,7 +59,7 @@ EXTERNL int NC_s3sdkfinalize(void);
 int NC_initialized = 0;
 int NC_finalized = 1;
 
-#ifdef ENABLE_ATEXIT_FINALIZE
+#ifdef NETCDF_ENABLE_ATEXIT_FINALIZE
 /* Provide the void function to give to atexit() */
 static void
 finalize_atexit(void)
@@ -91,10 +91,10 @@ nc_initialize()
 
     /* Initialize each active protocol */
     if((stat = NC3_initialize())) goto done;
-#ifdef ENABLE_DAP
+#ifdef NETCDF_ENABLE_DAP
     if((stat = NCD2_initialize())) goto done;
 #endif
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
     if((stat = NCD4_initialize())) goto done;
 #endif
 #ifdef USE_PNETCDF
@@ -112,11 +112,11 @@ nc_initialize()
 #ifdef ENABLE_S3
     if((stat = NC_s3sdkinitialize())) goto done;
 #endif
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
     if((stat = NCZ_initialize())) goto done;
 #endif
 
-#ifdef ENABLE_ATEXIT_FINALIZE
+#ifdef NETCDF_ENABLE_ATEXIT_FINALIZE
     /* Use atexit() to invoke nc_finalize */
     if(atexit(finalize_atexit))
 	fprintf(stderr,"atexit failed\n");
@@ -147,10 +147,10 @@ nc_finalize(void)
 
     /* Finalize each active protocol */
 
-#ifdef ENABLE_DAP2
+#ifdef NETCDF_ENABLE_DAP2
     if((stat = NCD2_finalize())) failed = stat;
 #endif
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
     if((stat = NCD4_finalize())) failed = stat;
 #endif
 
@@ -170,7 +170,7 @@ nc_finalize(void)
     if((stat = NC_HDF5_finalize())) failed = stat;
 #endif
 
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
     if((stat = NCZ_finalize())) failed = stat;
 #endif
 
diff --git a/libncpoco/CMakeLists.txt b/libncpoco/CMakeLists.txt
index aaf77b586..fb879fb5e 100644
--- a/libncpoco/CMakeLists.txt
+++ b/libncpoco/CMakeLists.txt
@@ -8,7 +8,7 @@ endif()
 
 add_library(ncpoco OBJECT ${libncpoco_SOURCES})
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(ncpoco PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/libncxml/CMakeLists.txt b/libncxml/CMakeLists.txt
index 6d0c0d750..b8fa4b25f 100644
--- a/libncxml/CMakeLists.txt
+++ b/libncxml/CMakeLists.txt
@@ -19,7 +19,7 @@ else()
 )
 endif(HAVE_LIBXML2)
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(ncxml PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/libncxml/Makefile.am b/libncxml/Makefile.am
index f5fab3b10..3cc7af75d 100644
--- a/libncxml/Makefile.am
+++ b/libncxml/Makefile.am
@@ -11,7 +11,7 @@
 
 include $(top_srcdir)/lib_flags.am
 
-if ENABLE_LIBXML2
+if NETCDF_ENABLE_LIBXML2
 AM_CPPFLAGS += ${XML2FLAGS}
 endif
 
@@ -20,7 +20,7 @@ noinst_LTLIBRARIES = libncxml.la
 libncxml_la_LIBADD =
 libncxml_la_LDFLAGS =
 
-if ENABLE_LIBXML2
+if NETCDF_ENABLE_LIBXML2
 libncxml_la_SOURCES = ncxml_xml2.c
 else
 AM_CXXFLAGS = -std=c++11
diff --git a/libnczarr/CMakeLists.txt b/libnczarr/CMakeLists.txt
index 5d70e6bab..820a142e6 100644
--- a/libnczarr/CMakeLists.txt
+++ b/libnczarr/CMakeLists.txt
@@ -46,11 +46,11 @@ zfilter.h
 zdebug.h
 )
 
-if(ENABLE_NCZARR_ZIP)
+if(NETCDF_ENABLE_NCZARR_ZIP)
     set(libnczarr_SOURCES ${libnczarr_SOURCES} zmap_zip.c)
 endif()
 
-if(ENABLE_S3) 
+if(NETCDF_ENABLE_S3) 
     set(libnczarr_SOURCES ${libnczarr_SOURCES} zmap_s3sdk.c)
 endif()
 
@@ -69,7 +69,7 @@ if(STATUS_PARALLEL)
     target_link_libraries(nczarr PUBLIC MPI::MPI_C)
 endif(STATUS_PARALLEL)
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
     target_compile_definitions(nczarr PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/libnczarr/Makefile.am b/libnczarr/Makefile.am
index d7c2b3cf5..13d9a2383 100644
--- a/libnczarr/Makefile.am
+++ b/libnczarr/Makefile.am
@@ -15,7 +15,7 @@ AM_CXXFLAGS =
 libnczarr_la_LIBADD =
 libnczarr_la_LDFLAGS =
 
-# Remember ENABLE_NCZARR implies USE_NETCDF4
+# Remember NETCDF_ENABLE_NCZARR implies USE_NETCDF4
 
 # We may have to add to these later.
 DISTCLEANFILES =
@@ -64,17 +64,17 @@ zprovenance.h \
 zfilter.h \
 zdebug.h
 
-if ENABLE_NCZARR_ZIP
+if NETCDF_ENABLE_NCZARR_ZIP
 libnczarr_la_SOURCES += zmap_zip.c 
 endif
 
-if ENABLE_NCZARR_FILTERS
+if NETCDF_ENABLE_NCZARR_FILTERS
 libnczarr_la_SOURCES += zfilter.c
 endif
 
-if ENABLE_S3
+if NETCDF_ENABLE_S3
 libnczarr_la_SOURCES += zmap_s3sdk.c
-if ENABLE_S3_AWS
+if NETCDF_ENABLE_S3_AWS
 AM_CXXFLAGS += -std=c++11
 endif
 endif
diff --git a/libnczarr/zattr.c b/libnczarr/zattr.c
index 5b7cfb2b2..23fbb0428 100644
--- a/libnczarr/zattr.c
+++ b/libnczarr/zattr.c
@@ -102,7 +102,7 @@ ncz_get_att_special(NC_FILE_INFO_T* h5, NC_VAR_INFO_T* var, const char* name,
 
     /* Handle the per-var case(s) first */
     if(var != NULL) {
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
         if(strcmp(name,NC_ATT_CODECS)==0) {	
             NClist* filters = (NClist*)var->filters;
 
diff --git a/libnczarr/zclose.c b/libnczarr/zclose.c
index a84f08048..7515bfcce 100644
--- a/libnczarr/zclose.c
+++ b/libnczarr/zclose.c
@@ -161,7 +161,7 @@ NCZ_zclose_var1(NC_VAR_INFO_T* var)
 	nullfree(zatt);
 	att->format_att_info = NULL; /* avoid memory errors */
     }
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     /* Reclaim filters */
     if(var->filters != NULL) {
 	(void)NCZ_filter_freelists(var);
diff --git a/libnczarr/zdispatch.c b/libnczarr/zdispatch.c
index cdf80af05..f37942198 100644
--- a/libnczarr/zdispatch.c
+++ b/libnczarr/zdispatch.c
@@ -157,7 +157,7 @@ NCZ_show_metadata(int ncid)
     return NC_NOERR;
 }
 
-#ifndef ENABLE_NCZARR_FILTERS
+#ifndef NETCDF_ENABLE_NCZARR_FILTERS
 int 
 NCZ_def_var_filter(int ncid, int varid, unsigned int id , size_t n , const unsigned int *params)
 {
@@ -199,7 +199,7 @@ NCZ_inq_filter_avail(int ncid, unsigned id)
 }
 
 
-#endif /*ENABLE_NCZARR_FILTERS*/
+#endif /*NETCDF_ENABLE_NCZARR_FILTERS*/
 
 /**************************************************/
 /* Following functions call into libsrc4 */
diff --git a/libnczarr/zfilter.c b/libnczarr/zfilter.c
index 07e6d7d3b..bf1eb8542 100644
--- a/libnczarr/zfilter.c
+++ b/libnczarr/zfilter.c
@@ -523,7 +523,7 @@ nc_var_filter_remove(int ncid, int varid, unsigned int filterid)
 }
 #endif
 
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
 int
 NCZ_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams,
                    const unsigned int* params)
@@ -743,7 +743,7 @@ done:
     return ZUNTRACE(stat);
 }
 
-#endif /*ENABLE_NCZARR_FILTERS*/
+#endif /*NETCDF_ENABLE_NCZARR_FILTERS*/
 
 /**************************************************/
 /* Filter application functions */
@@ -760,7 +760,7 @@ NCZ_filter_initialize(void)
     codec_defaults = nclistnew();
     NCZ_filter_initialized = 1;
     memset(loaded_plugins,0,sizeof(loaded_plugins));
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     if((stat = NCZ_load_all_plugins())) goto done;
 #endif
 
@@ -775,7 +775,7 @@ NCZ_filter_finalize(void)
     int i;
     ZTRACE(6,"");
     if(!NCZ_filter_initialized) goto done;
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     /* Reclaim all loaded filters */
 #ifdef DEBUGL
     fprintf(stderr,">>>  DEBUGL: finalize reclaim:\n");
diff --git a/libnczarr/zinternal.c b/libnczarr/zinternal.c
index 9e4bfcb62..81c6fe0ee 100644
--- a/libnczarr/zinternal.c
+++ b/libnczarr/zinternal.c
@@ -82,10 +82,10 @@ NCZ_finalize_internal(void)
 {
     /* Reclaim global resources */
     ncz_initialized = 0;
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     NCZ_filter_finalize();
 #endif
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     NCZ_s3finalize();
 #endif
     return NC_NOERR;
diff --git a/libnczarr/zmap.c b/libnczarr/zmap.c
index 5b1c42c96..47285cc89 100644
--- a/libnczarr/zmap.c
+++ b/libnczarr/zmap.c
@@ -19,10 +19,10 @@ nczmap_features(NCZM_IMPL impl)
 {
     switch (impl) {
     case NCZM_FILE: return zmap_file.features;
-#ifdef ENABLE_NCZARR_ZIP
+#ifdef NETCDF_ENABLE_NCZARR_ZIP
     case NCZM_ZIP: return zmap_zip.features;
 #endif
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case NCZM_S3: return zmap_s3sdk.features;
 #endif
     default: break;
@@ -52,13 +52,13 @@ nczmap_create(NCZM_IMPL impl, const char *path, int mode, size64_t flags, void*
         stat = zmap_file.create(path, mode, flags, parameters, &map);
 	if(stat) goto done;
 	break;
-#ifdef ENABLE_NCZARR_ZIP
+#ifdef NETCDF_ENABLE_NCZARR_ZIP
     case NCZM_ZIP:
         stat = zmap_zip.create(path, mode, flags, parameters, &map);
 	if(stat) goto done;
 	break;
 #endif
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case NCZM_S3:
         stat = zmap_s3sdk.create(path, mode, flags, parameters, &map);
 	if(stat) goto done;
@@ -90,13 +90,13 @@ nczmap_open(NCZM_IMPL impl, const char *path, int mode, size64_t flags, void* pa
         stat = zmap_file.open(path, mode, flags, parameters, &map);
 	if(stat) goto done;
 	break;
-#ifdef ENABLE_NCZARR_ZIP
+#ifdef NETCDF_ENABLE_NCZARR_ZIP
     case NCZM_ZIP:
         stat = zmap_zip.open(path, mode, flags, parameters, &map);
 	if(stat) goto done;
 	break;
 #endif
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case NCZM_S3:
         stat = zmap_s3sdk.open(path, mode, flags, parameters, &map);
 	if(stat) goto done;
@@ -122,12 +122,12 @@ nczmap_truncate(NCZM_IMPL impl, const char *path)
     case NCZM_FILE:
         if((stat = zmap_file.truncate(path))) goto done;
 	break;
-#ifdef ENABLE_NCZARR_ZIP
+#ifdef NETCDF_ENABLE_NCZARR_ZIP
     case NCZM_ZIP:
         if((stat = zmap_zip.truncate(path))) goto done;
 	break;
 #endif
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     case NCZM_S3:
         if((stat = zmap_s3sdk.truncate(path))) goto done;
 	break;
diff --git a/libnczarr/zmap.h b/libnczarr/zmap.h
index c8e022c31..6d7935d1a 100644
--- a/libnczarr/zmap.h
+++ b/libnczarr/zmap.h
@@ -217,10 +217,10 @@ extern NCZMAP_DS_API zmap_file;
 #ifdef USE_HDF5
 extern NCZMAP_DS_API zmap_nz4;
 #endif
-#ifdef ENABLE_NCZARR_ZIP
+#ifdef NETCDF_ENABLE_NCZARR_ZIP
 extern NCZMAP_DS_API zmap_zip;
 #endif
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
 extern NCZMAP_DS_API zmap_s3sdk;
 #endif
 
@@ -323,7 +323,7 @@ EXTERNL int nczmap_close(NCZMAP* map, int deleteit);
 EXTERNL int nczmap_create(NCZM_IMPL impl, const char *path, int mode, size64_t constraints, void* parameters, NCZMAP** mapp);
 EXTERNL int nczmap_open(NCZM_IMPL impl, const char *path, int mode, size64_t constraints, void* parameters, NCZMAP** mapp);
 
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
 EXTERNL void NCZ_s3finalize(void);
 #endif
 
diff --git a/libnczarr/zsync.c b/libnczarr/zsync.c
index f2be0f570..59f1502b7 100644
--- a/libnczarr/zsync.c
+++ b/libnczarr/zsync.c
@@ -296,7 +296,7 @@ ncz_sync_var_meta(NC_FILE_INFO_T* file, NC_VAR_INFO_T* var, int isclose)
     int purezarr = 0;
     size64_t shape[NC_MAX_VAR_DIMS];
     NCZ_VAR_INFO_T* zvar = var->format_var_info;
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     NClist* filterchain = NULL;
     NCjson* jfilter = NULL;
 #endif
@@ -316,7 +316,7 @@ ncz_sync_var_meta(NC_FILE_INFO_T* file, NC_VAR_INFO_T* var, int isclose)
     if((stat = NCZ_adjust_var_cache(var))) goto done;
     /* rebuild the fill chunk */
     if((stat = NCZ_ensure_fill_chunk(zvar->cache))) goto done;
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     /* Build the filter working parameters for any filters */
     if((stat = NCZ_filter_setup(var))) goto done;
 #endif
@@ -413,7 +413,7 @@ ncz_sync_var_meta(NC_FILE_INFO_T* file, NC_VAR_INFO_T* var, int isclose)
     /* From V2 Spec: A JSON object identifying the primary compression codec and providing
        configuration parameters, or ``null`` if no compressor is to be used. */
     if((stat = NCJaddstring(jvar,NCJ_STRING,"compressor"))) goto done;
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     filterchain = (NClist*)var->filters;
     if(nclistlength(filterchain) > 0) {
 	struct NCZ_Filter* filter = (struct NCZ_Filter*)nclistget(filterchain,nclistlength(filterchain)-1);
@@ -435,7 +435,7 @@ ncz_sync_var_meta(NC_FILE_INFO_T* file, NC_VAR_INFO_T* var, int isclose)
     /* A list of JSON objects providing codec configurations, or ``null``
        if no filters are to be applied. */
     if((stat = NCJaddstring(jvar,NCJ_STRING,"filters"))) goto done;
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     if(nclistlength(filterchain) > 1) {
 	size_t k;
 	/* jtmp holds the array of filters */
@@ -1486,7 +1486,7 @@ define_vars(NC_FILE_INFO_T* file, NC_GRP_INFO_T* grp, NClist* varnames)
         int vtypelen = 0;
         int rank = 0;
         int zarr_rank = 0; /* Need to watch out for scalars */
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
         NCjson* jfilter = NULL;
         int chainindex = 0;
 #endif
@@ -1736,7 +1736,7 @@ define_vars(NC_FILE_INFO_T* file, NC_GRP_INFO_T* grp, NClist* varnames)
            object MUST contain a "id" key identifying the codec to be used. */
 	/* Do filters key before compressor key so final filter chain is in correct order */
 	{
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
 	    if(var->filters == NULL) var->filters = (void*)nclistnew();
    	    if(zvar->incompletefilters == NULL) zvar->incompletefilters = (void*)nclistnew();
 	    chainindex = 0; /* track location of filter in the chain */
@@ -1759,7 +1759,7 @@ define_vars(NC_FILE_INFO_T* file, NC_GRP_INFO_T* grp, NClist* varnames)
         /* compressor key */
         /* From V2 Spec: A JSON object identifying the primary compression codec and providing
            configuration parameters, or ``null`` if no compressor is to be used. */
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
 	{ 
 	    if(var->filters == NULL) var->filters = (void*)nclistnew();
 	    if((stat = NCZ_filter_initialize())) goto done;
@@ -1783,7 +1783,7 @@ define_vars(NC_FILE_INFO_T* file, NC_GRP_INFO_T* grp, NClist* varnames)
 	    }
 	}
 
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
 	if(!suppress) {
     	    /* At this point, we can finalize the filters */
             if((stat = NCZ_filter_setup(var))) goto done;
diff --git a/libnczarr/zvar.c b/libnczarr/zvar.c
index 607a35185..b10df70c0 100644
--- a/libnczarr/zvar.c
+++ b/libnczarr/zvar.c
@@ -389,7 +389,7 @@ NCZ_def_var(int ncid, const char *name, nc_type xtype, int ndims,
     var->meta_read = NC_TRUE;
     var->atts_read = NC_TRUE;
 
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     /* Set the filter list */
     assert(var->filters == NULL);
     var->filters = (void*)nclistnew();
@@ -558,7 +558,7 @@ ncz_def_var_extra(int ncid, int varid, int *shuffle, int *unused1,
     
     /* Can't turn on parallel and deflate/fletcher32/szip/shuffle
      * before HDF5 1.10.3. */
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
 #ifndef HDF5_SUPPORTS_PAR_FILTERS
     if (h5->parallel == NC_TRUE)
 	if (nclistlength(((NClist*)var->filters)) > 0  || fletcher32 || shuffle)
diff --git a/libnczarr/zxcache.c b/libnczarr/zxcache.c
index f50ec99a7..957ed1525 100644
--- a/libnczarr/zxcache.c
+++ b/libnczarr/zxcache.c
@@ -675,7 +675,7 @@ put_chunk(NCZChunkCache* cache, NCZCacheEntry* entry)
     }
 
 
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     /* Make sure the entry is in filtered state */
     if(!entry->isfiltered) {
         NC_VAR_INFO_T* var = cache->var;
@@ -792,7 +792,7 @@ get_chunk(NCZChunkCache* cache, NCZCacheEntry* entry)
 	if((stat = NCZ_copy_data(file,cache->var,cache->fillchunk,cache->chunkcount,ZREADING,entry->data))) goto done;
 	stat = NC_NOERR;
     }
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
     /* Make sure the entry is in unfiltered state */
     if(!empty && entry->isfiltered) {
         NC_VAR_INFO_T* var = cache->var;
diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt
index 04c9ad9b0..a3ea899c9 100644
--- a/libsrc/CMakeLists.txt
+++ b/libsrc/CMakeLists.txt
@@ -40,26 +40,26 @@ else (USE_FFIO)
   list(APPEND libsrc_SOURCES posixio.c)
 ENDif (USE_FFIO)
 
-if (ENABLE_BYTERANGE)
+if (NETCDF_ENABLE_BYTERANGE)
   list(APPEND libsrc_SOURCES httpio.c)
-if (ENABLE_S3)
+if (NETCDF_ENABLE_S3)
   list(APPEND libsrc_SOURCES s3io.c)
-endif(ENABLE_S3)
-endif(ENABLE_BYTERANGE)
+endif(NETCDF_ENABLE_S3)
+endif(NETCDF_ENABLE_BYTERANGE)
 
 add_library(netcdf3 OBJECT ${libsrc_SOURCES})
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(netcdf3 PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
-if (ENABLE_BYTERANGE)
+if (NETCDF_ENABLE_BYTERANGE)
   target_include_directories(netcdf3 PUBLIC ${CURL_INCLUDE_DIRS})
   target_compile_options(netcdf3
     PRIVATE
       -DCURL_STATICLIB=1
   )
-endif (ENABLE_BYTERANGE)
+endif (NETCDF_ENABLE_BYTERANGE)
 
 if(STATUS_PARALLEL)
   target_link_libraries(netcdf3 PUBLIC MPI::MPI_C)
diff --git a/libsrc/Makefile.am b/libsrc/Makefile.am
index ca5333c6b..3a52f83b4 100644
--- a/libsrc/Makefile.am
+++ b/libsrc/Makefile.am
@@ -29,14 +29,14 @@ libnetcdf3_la_SOURCES += posixio.c
 endif !USE_STDIO
 endif !USE_FFIO
 
-if ENABLE_BYTERANGE
+if NETCDF_ENABLE_BYTERANGE
   libnetcdf3_la_SOURCES += httpio.c
 
-if ENABLE_S3
+if NETCDF_ENABLE_S3
    libnetcdf3_la_SOURCES += s3io.c
 endif
 
-endif ENABLE_BYTERANGE
+endif NETCDF_ENABLE_BYTERANGE
 
 noinst_LTLIBRARIES = libnetcdf3.la
 
diff --git a/libsrc/nc3internal.c b/libsrc/nc3internal.c
index 0916cc950..b5d68677f 100644
--- a/libsrc/nc3internal.c
+++ b/libsrc/nc3internal.c
@@ -92,7 +92,7 @@ err:
 int
 nc3_cktype(int mode, nc_type type)
 {
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
     if (mode & NC_CDF5) { /* CDF-5 format */
         if (type >= NC_BYTE && type < NC_STRING) return NC_NOERR;
     } else
@@ -1134,7 +1134,7 @@ nc_set_default_format(int format, int *old_formatp)
       return NC_EINVAL;
 #else
     if (format != NC_FORMAT_CLASSIC && format != NC_FORMAT_64BIT_OFFSET
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
         && format != NC_FORMAT_CDF5
 #endif
         )
@@ -1563,7 +1563,7 @@ NC3_inq_format(int ncid, int *formatp)
       return NC_NOERR;
 
    /* only need to check for netCDF-3 variants, since this is never called for netCDF-4 files */
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
    if (fIsSet(nc3->flags, NC_64BIT_DATA))
       *formatp = NC_FORMAT_CDF5;
    else
diff --git a/libsrc/ncio.c b/libsrc/ncio.c
index b9095b2f0..86750961c 100644
--- a/libsrc/ncio.c
+++ b/libsrc/ncio.c
@@ -37,11 +37,11 @@ extern int ffio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** co
      extern int mmapio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 #  endif
 
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
     extern int httpio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 #endif
 
-#ifdef ENABLE_S3
+#ifdef NETCDF_ENABLE_S3
     extern int s3io_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 #endif
 
@@ -49,7 +49,7 @@ extern int ffio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** co
      extern int memio_open(const char*,int,off_t,size_t,size_t*,void*,ncio**,void** const);
 
 /* Forward */
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 static int urlmodetest(const char* path);
 #endif
 
@@ -85,7 +85,7 @@ ncio_open(const char *path, int ioflags,
 		     void* parameters,
                      ncio** iopp, void** const mempp)
 {
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
     int modetest = urlmodetest(path);
 #endif
 
@@ -103,16 +103,16 @@ ncio_open(const char *path, int ioflags,
         return mmapio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
     }
 #  endif /*USE_MMAP*/
-#  ifdef ENABLE_BYTERANGE
+#  ifdef NETCDF_ENABLE_BYTERANGE
    if(modetest == NC_HTTP) {
         return httpio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
    }
-#  ifdef ENABLE_S3
+#  ifdef NETCDF_ENABLE_S3
    if(modetest == NC_S3SDK) {
        return s3io_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
    }
 #  endif
-#  endif /*ENABLE_BYTERANGE*/
+#  endif /*NETCDF_ENABLE_BYTERANGE*/
 
 #ifdef USE_STDIO
     return stdio_open(path,ioflags,igeto,igetsz,sizehintp,parameters,iopp,mempp);
@@ -181,7 +181,7 @@ NC_HTTP => byterange
 NC_S3SDK => s3
 0 => Not URL
 */
-#ifdef ENABLE_BYTERANGE
+#ifdef NETCDF_ENABLE_BYTERANGE
 static int
 urlmodetest(const char* path)
 {
diff --git a/libsrc4/CMakeLists.txt b/libsrc4/CMakeLists.txt
index 5674d3779..09227318e 100644
--- a/libsrc4/CMakeLists.txt
+++ b/libsrc4/CMakeLists.txt
@@ -11,7 +11,7 @@ nc4internal.c nc4type.c nc4var.c ncfunc.c ncindex.c nc4cache.c)
 
 add_library(netcdf4 OBJECT ${libsrc4_SOURCES})
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(netcdf4 PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/libsrc4/nc4type.c b/libsrc4/nc4type.c
index b0361a55a..5a37b9896 100644
--- a/libsrc4/nc4type.c
+++ b/libsrc4/nc4type.c
@@ -16,7 +16,7 @@
 #include <stddef.h>
 
 #if 0
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
 EXTERNL NC* NCD4_get_substrate_nc(int ncid);
 #endif
 #endif
diff --git a/libsrcp/CMakeLists.txt b/libsrcp/CMakeLists.txt
index cadda81da..01b185d95 100644
--- a/libsrcp/CMakeLists.txt
+++ b/libsrcp/CMakeLists.txt
@@ -10,7 +10,7 @@ target_link_libraries(netcdfp PUBLIC PNETCDF::PNETCDF)
 
 target_sources(netcdfp PRIVATE ncpdispatch.c)
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
     target_compile_definitions(netcdfp PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/nc-config.cmake.in b/nc-config.cmake.in
index 15ea967d4..0c4582702 100644
--- a/nc-config.cmake.in
+++ b/nc-config.cmake.in
@@ -16,14 +16,14 @@ libs="-L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ @NC_LIBS@"
 libsprivate="@LIBS@"
 HAS_STATIC=""
 
-has_dap2="@ENABLE_DAP2@"
+has_dap2="@NETCDF_ENABLE_DAP2@"
 if [ -z $has_dap2 -o "$has_dap2" = "OFF" ]; then
     has_dap2="no"
 else
     has_dap2="yes"
 fi
 
-has_dap4="@ENABLE_DAP4@"
+has_dap4="@NETCDF_ENABLE_DAP4@"
 if [ -z $has_dap4 -o "$has_dap4" = "OFF" ]; then
     has_dap4="no"
 else
@@ -46,7 +46,7 @@ else
     has_nc4="yes"
 fi
 
-has_logging="@ENABLE_LOGGING@"
+has_logging="@NETCDF_ENABLE_LOGGING@"
 if [ -z "$has_logging" -o "$has_logging" = "OFF" ]; then
     has_logging="no"
 else
@@ -81,7 +81,7 @@ else
     has_szlib="yes"
 fi
 
-has_cdf5="@ENABLE_CDF5@"
+has_cdf5="@NETCDF_ENABLE_CDF5@"
 if [ -z "$has_cdf5" -o "$has_cdf5" = "OFF" -o "$has_cdf5" = "FALSE" ]; then
     has_cdf5="no"
 else
@@ -102,7 +102,7 @@ else
     has_parallel="yes"
 fi
 
-has_nczarr="@ENABLE_NCZARR@"
+has_nczarr="@NETCDF_ENABLE_NCZARR@"
 if [ -z "$has_nczarr" -o "$has_nczarr" = "OFF" -o "$has_nczarr" = "FALSE" ]; then
     has_nczarr="no"
 else
diff --git a/nc_perf/CMakeLists.txt b/nc_perf/CMakeLists.txt
index 6f6ef0ec2..a33365f7e 100644
--- a/nc_perf/CMakeLists.txt
+++ b/nc_perf/CMakeLists.txt
@@ -32,7 +32,7 @@ add_sh_test(nc_perf perftest)
 add_sh_test(nc_perf run_tst_chunks)
 add_sh_test(nc_perf run_bm_elena)
 
-IF(BUILD_UTILITIES)
+IF(NETCDF_BUILD_UTILITIES)
 add_sh_test(nc_perf run_bm_test1)
 add_sh_test(nc_perf run_bm_test2)
 
@@ -41,7 +41,7 @@ IF(TEST_PARALLEL4)
 add_bin_test(nc_perf tst_compress_par tst_utils.c)
 add_sh_test(nc_perf run_par_bm_test)
 ENDIF(TEST_PARALLEL4)
-ENDIF(BUILD_UTILITIES)
+ENDIF(NETCDF_BUILD_UTILITIES)
 
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
 FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
diff --git a/nc_perf/Makefile.am b/nc_perf/Makefile.am
index 8e29197be..c99003a00 100644
--- a/nc_perf/Makefile.am
+++ b/nc_perf/Makefile.am
@@ -54,7 +54,7 @@ tst_bm_rando tst_compress
 
 run_bm_elena.log: tst_create_files.log
 
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 TESTS += run_bm_test1.sh run_bm_test2.sh
 
 # tst_create_files creates files for other tests.
@@ -68,7 +68,7 @@ tst_compress_par_LDFLAGS = -no-install
 TESTS += run_par_bm_test.sh run_gfs_test.sh
 run_par_bm_test.log: tst_create_files.log run_bm_test1.log
 endif # TEST_PARALLEL4
-endif # BUILD_UTILITIES
+endif # NETCDF_BUILD_UTILITIES
 
 # Extra files for the dist. Note that parallel tests end in .in,
 # because configure substitute in the launcher (usually mpiexec).
diff --git a/ncdump/CMakeLists.txt b/ncdump/CMakeLists.txt
index 6d43f1b37..64fdfe9c7 100644
--- a/ncdump/CMakeLists.txt
+++ b/ncdump/CMakeLists.txt
@@ -54,9 +54,9 @@ if(USE_HDF5)
   target_link_libraries(nchdf5version netcdf ${ALL_TLL_LIBS})
 endif(USE_HDF5)
 
-if(ENABLE_DAP)
+if(NETCDF_ENABLE_DAP)
   add_executable(ocprint ${ocprint_FILES})
-endif(ENABLE_DAP)
+endif(NETCDF_ENABLE_DAP)
 
 target_link_libraries(ncdump netcdf ${ALL_TLL_LIBS})
 target_link_libraries(nccopy netcdf ${ALL_TLL_LIBS})
@@ -64,9 +64,9 @@ target_link_libraries(ncvalidator netcdf ${ALL_TLL_LIBS})
 target_link_libraries(ncpathcvt netcdf ${ALL_TLL_LIBS})
 target_link_libraries(ncfilteravail netcdf ${ALL_TLL_LIBS})
 
-if(ENABLE_DAP)
+if(NETCDF_ENABLE_DAP)
   target_link_libraries(ocprint netcdf ${ALL_TLL_LIBS})
-endif(ENABLE_DAP)
+endif(NETCDF_ENABLE_DAP)
 
 ####
 # We have to do a little tweaking
@@ -96,14 +96,14 @@ if(MSVC)
     setbinprops(nchdf5version)
   endif(USE_HDF5)
 
-  if(ENABLE_DAP)
+  if(NETCDF_ENABLE_DAP)
     setbinprops(ocprint)
-  endif(ENABLE_DAP)
+  endif(NETCDF_ENABLE_DAP)
 
 
 endif()
 
-if(ENABLE_TESTS)
+if(NETCDF_ENABLE_TESTS)
 
   add_executable(rewrite-scalar rewrite-scalar.c)
   add_executable(bom bom.c)
@@ -281,9 +281,9 @@ endif()
   # The following test script invokes
   # gcc directly.
   if(CMAKE_COMPILER_IS_GNUCC OR APPLE)
-    if(ENABLE_LARGE_FILE_TESTS)
+    if(NETCDF_ENABLE_LARGE_FILE_TESTS)
       add_sh_test(ncdump tst_iter)
-    endif(ENABLE_LARGE_FILE_TESTS)
+    endif(NETCDF_ENABLE_LARGE_FILE_TESTS)
   endif(CMAKE_COMPILER_IS_GNUCC OR APPLE)
 
   ###
@@ -319,7 +319,7 @@ endif()
 
 endif(HAVE_BASH)
 
-endif(ENABLE_TESTS)
+endif(NETCDF_ENABLE_TESTS)
 
 #IF(MSVC)
 #  set_target_properties(ncdump
@@ -331,11 +331,11 @@ endif(ENABLE_TESTS)
 #  set_target_properties(ncvalidator
 #    PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
 #    )
-#  IF(ENABLE_DAP)
+#  IF(NETCDF_ENABLE_DAP)
 #    set_target_properties(ocprint
 #      PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
 #      )
-#  ENDIF(ENABLE_DAP)
+#  ENDIF(NETCDF_ENABLE_DAP)
 #ENDIF()
 
 install(TARGETS ncdump RUNTIME DESTINATION bin COMPONENT utilities)
diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am
index 04a3e0f7f..0a68220d1 100644
--- a/ncdump/Makefile.am
+++ b/ncdump/Makefile.am
@@ -67,7 +67,7 @@ nchdf5version_SOURCES = nchdf5version.c
 endif
 
 # Conditionally build the ocprint program, but do not install
-if ENABLE_DAP
+if NETCDF_ENABLE_DAP
 bin_PROGRAMS += ocprint
 noinst_PROGRAMS += ocprint
 ocprint_SOURCES = ocprint.c
@@ -140,7 +140,7 @@ if USE_HDF5
 TESTS += tst_ctests.sh
 endif
 
-if ENABLE_CDF5
+if NETCDF_ENABLE_CDF5
 # Test for keywords as identifiers
 TESTS += test_keywords.sh
 endif
diff --git a/ncdump/nccopy.c b/ncdump/nccopy.c
index a369f3bdf..9e5dc995b 100644
--- a/ncdump/nccopy.c
+++ b/ncdump/nccopy.c
@@ -2070,7 +2070,7 @@ copy(char* infile, char* outfile)
 	create_mode |= NC_64BIT_OFFSET;
 	break;
     case NC_FORMAT_CDF5:
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
       create_mode |= NC_64BIT_DATA;
       break;
 #else
diff --git a/ncdump/ncfilteravail.c b/ncdump/ncfilteravail.c
index 5c5ae366c..aae8d2c5a 100644
--- a/ncdump/ncfilteravail.c
+++ b/ncdump/ncfilteravail.c
@@ -84,7 +84,7 @@ getformat(const char* sformat)
 #ifdef USE_HDF5
     return NC_FORMATX_NC4;
 #else
-#  ifdef ENABLE_NCZARR
+#  ifdef NETCDF_ENABLE_NCZARR
     return NC_FORMATX_NCZARR;
 #  endif
 #endif
diff --git a/ncdump/tst_64bit.sh b/ncdump/tst_64bit.sh
index 861b01998..63183c20f 100755
--- a/ncdump/tst_64bit.sh
+++ b/ncdump/tst_64bit.sh
@@ -8,7 +8,7 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
 # This shell script runs the ncdump tests.
 # get some config.h parameters
 if test -f ${top_builddir}/config.h ; then
-  if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
+  if fgrep -e '#define NETCDF_ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
     CDF5=1
   else
     CDF5=0
diff --git a/ncdump/tst_dimsizes.c b/ncdump/tst_dimsizes.c
index bc2ca0d72..24141f979 100644
--- a/ncdump/tst_dimsizes.c
+++ b/ncdump/tst_dimsizes.c
@@ -23,7 +23,7 @@ See \ref copyright file for more info.
 #define DIMMAXCLASSIC (NC_MAX_INT - 3)
 #define DIMMAX64OFFSET (NC_MAX_UINT - 3)
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
 #define DIMMAX64DATA (NC_MAX_UINT64 - 3)
 #endif
 
@@ -76,7 +76,7 @@ main(int argc, char **argv)
     if(dimsize != DIMMAX64OFFSET) ERR;
     if ((stat=nc_close(ncid))) ERRSTAT(stat);
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
     if(sizeof(size_t) == 8) {
       printf("\n*** Writing Max Dimension Size (%llu) For NC_64BIT_DATA\n",DIMMAX64DATA);
         if ((stat=nc_create(FILE64DATA, NC_CLOBBER | NC_64BIT_DATA, &ncid))) ERRSTAT(stat);
@@ -91,7 +91,7 @@ main(int argc, char **argv)
 	if(dimsize != DIMMAX64DATA) ERR;
 	if ((stat=nc_close(ncid))) ERRSTAT(stat);
     }
-#endif /* ENABLE_CDF5 */
+#endif /* NETCDF_ENABLE_CDF5 */
 
     SUMMARIZE_ERR;
     FINAL_RESULTS;
diff --git a/ncdump/tst_formatx3.sh b/ncdump/tst_formatx3.sh
index ea395e400..7e255624a 100755
--- a/ncdump/tst_formatx3.sh
+++ b/ncdump/tst_formatx3.sh
@@ -6,10 +6,10 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
 # This shell script runs the ncdump tests.
 # get some config.h parameters
 if test -f ${top_builddir}/config.h ; then
-  if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
-    ENABLE_CDF5=1
+  if fgrep -e '#define NETCDF_ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
+    NETCDF_ENABLE_CDF5=1
   else
-    ENABLE_CDF5=0
+    NETCDF_ENABLE_CDF5=0
   fi
 else
   echo "Cannot locate config.h"
@@ -42,9 +42,9 @@ ECODE=1
 fi
 
 
-# Only do following test if ENABLE_CDF5 is true.
+# Only do following test if NETCDF_ENABLE_CDF5 is true.
 
-if test "x$ENABLE_CDF5" = x1 ; then
+if test "x$NETCDF_ENABLE_CDF5" = x1 ; then
     echo "Test extended format output for a 64-bit CDF-5 classic file"
     rm -f tmp_tst_formatx3
     ${NCGEN} -k5 -b -o ./tst_formatx3.nc $srcdir/ref_tst_small.cdl
diff --git a/ncdump/tst_lengths.sh b/ncdump/tst_lengths.sh
index a21f6a404..94acc8097 100755
--- a/ncdump/tst_lengths.sh
+++ b/ncdump/tst_lengths.sh
@@ -5,7 +5,7 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
 
 # get some config.h parameters
 if test -f ${top_builddir}/config.h ; then
-  if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
+  if fgrep -e '#define NETCDF_ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
     HAVE_CDF5=1
   else
     HAVE_CDF5=0
diff --git a/ncdump/tst_nccopy3.sh b/ncdump/tst_nccopy3.sh
index 30b53bb8b..f7667c530 100755
--- a/ncdump/tst_nccopy3.sh
+++ b/ncdump/tst_nccopy3.sh
@@ -14,7 +14,7 @@ echo ""
 
 # get some config.h parameters
 if test -f ${top_builddir}/config.h ; then
-  if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
+  if fgrep -e '#define NETCDF_ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
     HAVE_CDF5=1
   else
     HAVE_CDF5=0
diff --git a/ncgen/main.c b/ncgen/main.c
index 78f5422b9..9027bbcb9 100644
--- a/ncgen/main.c
+++ b/ncgen/main.c
@@ -474,7 +474,7 @@ main(
 
     /* Compute the k_flag (1st pass) using rules in the man page (ncgen.1).*/
 
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
     if(k_flag == NC_FORMAT_CDF5) {
       derror("Output format CDF5 requested, but netcdf was built without cdf5 support.");
       return 0;
diff --git a/oc2/CMakeLists.txt b/oc2/CMakeLists.txt
index c97457a05..36a675c76 100644
--- a/oc2/CMakeLists.txt
+++ b/oc2/CMakeLists.txt
@@ -8,7 +8,7 @@ set(oc_SOURCES oc.c daplex.c dapparse.c dapy.c occompile.c occurlfunctions.c ocd
 
 add_library(oc2 OBJECT ${oc_SOURCES})
 
-if (ENABLE_DLL)
+if (NETCDF_ENABLE_DLL)
   target_compile_definitions(oc2 PRIVATE DLL_NETCDF DLL_EXPORT)
 endif()
 
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 332024552..fb6ce198e 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -40,7 +40,7 @@ set(nczmisc_SOURCES NCZmisc.c)
 set(nczhdf5filters_SOURCES NCZhdf5filters.c)
 set(nczstdfilters_SOURCES NCZstdfilters.c)
 
-if(ENABLE_PLUGINS)
+if(NETCDF_ENABLE_PLUGINS)
 # LDFLAGS = -module -avoid-version -shared -export-dynamic -no-undefined
 
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
@@ -133,7 +133,7 @@ endif()
 if(Blosc_FOUND)
   installplugin(h5blosc)
 endif()
-if(ENABLE_NCZARR)
+if(NETCDF_ENABLE_NCZARR)
   installplugin(h5fletcher32)
   installplugin(h5shuffle)
   installplugin(h5deflate)
@@ -146,7 +146,7 @@ endif()
 
 endif(ENABLE_PLUGIN_INSTALL)
 
-endif(ENABLE_PLUGINS)
+endif(NETCDF_ENABLE_PLUGINS)
 
 # Copy some test files from current source dir to out-of-tree build dir.
 file(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index fc7a98408..9c4072e13 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -76,7 +76,7 @@ lib__nch5zstd_la_SOURCES = H5Zzstd.c H5Zzstd.h
 plugins_to_install += lib__nch5zstd.la
 endif
 
-if ENABLE_NCZARR_FILTERS
+if NETCDF_ENABLE_NCZARR_FILTERS
 # The NCZarr codec libraries (they need libnetcdf)
 lib__nczstdfilters_la_SOURCES = NCZstdfilters.c
 lib__nczstdfilters_la_LIBADD = $(LIBADD)  $(top_builddir)/liblib/libnetcdf.la
@@ -94,7 +94,7 @@ lib__nch5noop1_la_SOURCES = H5Znoop1.c H5Zutil.c h5noop.h
 lib__nch5noop_la_LDFLAGS = $(AM_LDFLAGS) ${RPATH}
 lib__nch5noop1_la_LDFLAGS = $(AM_LDFLAGS) ${RPATH}
 
-if ENABLE_FILTER_TESTING
+if NETCDF_ENABLE_FILTER_TESTING
 # The misc filter is to allow testing of filter arguments
 lib__nch5misc_la_SOURCES = H5Zmisc.c H5Zutil.c h5misc.h
 lib__nch5misc_la_LDFLAGS = ${top_builddir}/liblib/libnetcdf.la $(AM_LDFLAGS) ${RPATH}
diff --git a/wjna b/wjna
index 82e3aa3de..160b5d09e 100644
--- a/wjna
+++ b/wjna
@@ -18,9 +18,9 @@ FLAGS="-DCMAKE_PREFIX_PATH=${CPP} ${FLAGS}"
 
 FLAGS="-DHDF5_DIR=${CPP}/cmake/hdf5 ${FLAGS}"
 
-FLAGS="-DENABLE_CONVERSION_WARNINGS=OFF ${FLAGS}"
-FLAGS="-DBUILD_UTILITIES=OFF ${FLAGS}"
-FLAGS="-DENABLE_EXAMPLES=OFF ${FLAGS}"
+FLAGS="-DNETCDF_ENABLE_CONVERSION_WARNINGS=OFF ${FLAGS}"
+FLAGS="-DNETCDF_BUILD_UTILITIES=OFF ${FLAGS}"
+FLAGS="-DNETCDF_ENABLE_EXAMPLES=OFF ${FLAGS}"
 FLAGS="-DENABLE_V2_API=OFF ${FLAGS}"
 FLAGS="-DENABLE_JNA=ON ${FLAGS}"
 


Test patch:
diff --git a/.github/workflows/run_tests_osx.yml b/.github/workflows/run_tests_osx.yml
index 042f2f180..04ea6740c 100644
--- a/.github/workflows/run_tests_osx.yml
+++ b/.github/workflows/run_tests_osx.yml
@@ -72,20 +72,20 @@ jobs:
       - run: echo "LDFLAGS=-L${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
       - run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
       - run: |
-          echo "ENABLE_HDF4=--disable-hdf4" >> $GITHUB_ENV
-          echo "ENABLE_HDF5=--disable-hdf5" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF4=--disable-hdf4" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=--disable-hdf5" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc3'
       - run: |
-          echo "ENABLE_HDF4=--enable-hdf4" >> $GITHUB_ENV
-          echo "ENABLE_HDF5=--enable-hdf5" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF4=--enable-hdf4" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=--enable-hdf5" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc4'
-      - run: echo "ENABLE_DAP=--disable-dap" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=--disable-dap" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_off'
-      - run: echo "ENABLE_DAP=--enable-dap" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=--enable-dap" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_on'
-      - run: echo "ENABLE_NCZARR=--disable-nczarr" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=--disable-nczarr" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_off'
-      - run: echo "ENABLE_NCZARR=--enable-nczarr" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=--enable-nczarr" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_on'
 
       ###
@@ -116,7 +116,7 @@ jobs:
 
       - name: Configure
         shell: bash -l {0}
-        run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./configure ${ENABLE_HDF5} ${ENABLE_DAP} ${ENABLE_NCZARR}
+        run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ./configure ${NETCDF_ENABLE_HDF5} ${NETCDF_ENABLE_DAP} ${NETCDF_ENABLE_NCZARR}
         if: ${{ success() }}
 
       - name: Look at config.log if error
@@ -145,7 +145,7 @@ jobs:
 
       # - name: Make Distcheck
       #   shell: bash -l {0}
-      #   run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} DISTCHECK_CONFIGURE_FLAGS="${ENABLE_HDF4} ${ENABLE_HDF5} ${ENABLE_DAP} ${ENABLE_NCZARR}" make distcheck
+      #   run: CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} DISTCHECK_CONFIGURE_FLAGS="${NETCDF_ENABLE_HDF4} ${NETCDF_ENABLE_HDF5} ${NETCDF_ENABLE_DAP} ${NETCDF_ENABLE_NCZARR}" make distcheck
       #  if: ${{ success() }}
 
       #- name: Start SSH Debug
@@ -177,20 +177,20 @@ jobs:
       - run: echo "CMAKE_PREFIX_PATH=${HOME}/environments/${{ matrix.hdf5 }}/" >> $GITHUB_ENV
       - run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
       - run: |
-          echo "ENABLE_HDF4=OFF" >> $GITHUB_ENV
-          echo "ENABLE_HDF5=OFF" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF4=OFF" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=OFF" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc3'
       - run: |
-          echo "ENABLE_HDF4=ON" >> $GITHUB_ENV
-          echo "ENABLE_HDF5=ON" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF4=ON" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=ON" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc4'
-      - run: echo "ENABLE_DAP=OFF" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=OFF" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_off'
-      - run: echo "ENABLE_DAP=ON" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=ON" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_on'
-      - run: echo "ENABLE_NCZARR=OFF" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=OFF" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_off'
-      - run: echo "ENABLE_NCZARR=ON" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=ON" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_on'
       - run: echo "CTEST_OUTPUT_ON_FAILURE=1" >> $GITHUB_ENV
 
@@ -218,7 +218,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=${ENABLE_DAP} -DENABLE_HDF5=${ENABLE_HDF5} -DENABLE_NCZARR=${ENABLE_NCZARR}
+          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=${NETCDF_ENABLE_DAP} -DNETCDF_ENABLE_HDF5=${NETCDF_ENABLE_HDF5} -DNETCDF_ENABLE_NCZARR=${NETCDF_ENABLE_NCZARR}
 
       - name: Print Summary
         shell: bash -l {0}
@@ -375,7 +375,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=TRUE -DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE
+          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DNETCDF_ENABLE_NCZARR=TRUE -D NETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE
 
       - name: Print Summary
         shell: bash -l {0}
@@ -450,7 +450,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=TRUE -DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DNETCDF_ENABLE_NCZARR=TRUE -D NETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
 
       - name: Print Summary
         shell: bash -l {0}
diff --git a/.github/workflows/run_tests_ubuntu.yml b/.github/workflows/run_tests_ubuntu.yml
index a6a17bf8a..186f8da18 100644
--- a/.github/workflows/run_tests_ubuntu.yml
+++ b/.github/workflows/run_tests_ubuntu.yml
@@ -440,7 +440,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=TRUE -DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -DENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE
+          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DNETCDF_ENABLE_NCZARR=TRUE -DNETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE
 
       - name: Print Summary
         shell: bash -l {0}
@@ -521,7 +521,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=TRUE -DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -DENABLE_DAP_LONG_TESTS=TRUE -DENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=FALSE -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DNETCDF_ENABLE_NCZARR=TRUE -DNETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_LIBXML2=FALSE -DBUILD_SHARED_LIBS=FALSE -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
 
       - name: Print Summary
         shell: bash -l {0}
@@ -602,7 +602,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_C_COMPILER=mpicc -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=TRUE -DENABLE_HDF5=TRUE -DENABLE_NCZARR=TRUE -D ENABLE_DAP_LONG_TESTS=TRUE -DENABLE_PNETCDF=TRUE
+          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_C_COMPILER=mpicc -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=TRUE -DNETCDF_ENABLE_HDF5=TRUE -DNETCDF_ENABLE_NCZARR=TRUE -D NETCDF_ENABLE_DAP_LONG_TESTS=TRUE -DNETCDF_ENABLE_PNETCDF=TRUE
 
       - name: Print Summary
         shell: bash -l {0}
@@ -679,18 +679,18 @@ jobs:
       - run: echo "LDFLAGS=-L${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
       - run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
       - run: |
-          echo "ENABLE_HDF5=--disable-hdf5" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=--disable-hdf5" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc3'
       - run: |
-          echo "ENABLE_HDF5=--enable-hdf5" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=--enable-hdf5" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc4'
-      - run: echo "ENABLE_DAP=--disable-dap" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=--disable-dap" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_off'
-      - run: echo "ENABLE_DAP=--enable-dap" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=--enable-dap" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_on'
-      - run: echo "ENABLE_NCZARR=--disable-nczarr" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=--disable-nczarr" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_off'
-      - run: echo "ENABLE_NCZARR=--enable-nczarr" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=--enable-nczarr" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_on'
 
       ###
@@ -738,7 +738,7 @@ jobs:
           done
           current_directory="$(pwd)"
           mkdir ../build
-          cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} "${current_directory}/configure" ${ENABLE_HDF5} ${ENABLE_DAP} ${ENABLE_NCZARR}
+          cd ../build && CFLAGS=${CFLAGS} LDFLAGS=${LDFLAGS} LD_LIBRARY_PATH=${LD_LIBRARY_PATH} "${current_directory}/configure" ${NETCDF_ENABLE_HDF5} ${NETCDF_ENABLE_DAP} ${NETCDF_ENABLE_NCZARR}
         if: ${{ success() }}
 
       - name: Look at config.log if error
@@ -821,18 +821,18 @@ jobs:
       - run: echo "CMAKE_PREFIX_PATH=${HOME}/environments/${{ matrix.hdf5 }}/" >> $GITHUB_ENV
       - run: echo "LD_LIBRARY_PATH=${HOME}/environments/${{ matrix.hdf5 }}/lib" >> $GITHUB_ENV
       - run: |
-          echo "ENABLE_HDF5=OFF" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=OFF" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc3'
       - run: |
-          echo "ENABLE_HDF5=ON" >> $GITHUB_ENV
+          echo "NETCDF_ENABLE_HDF5=ON" >> $GITHUB_ENV
         if: matrix.use_nc4 == 'nc4'
-      - run: echo "ENABLE_DAP=OFF" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=OFF" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_off'
-      - run: echo "ENABLE_DAP=ON" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_DAP=ON" >> $GITHUB_ENV
         if: matrix.use_dap == 'dap_on'
-      - run: echo "ENABLE_NCZARR=OFF" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=OFF" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_off'
-      - run: echo "ENABLE_NCZARR=ON" >> $GITHUB_ENV
+      - run: echo "NETCDF_ENABLE_NCZARR=ON" >> $GITHUB_ENV
         if: matrix.use_nczarr == 'nczarr_on'
       - run: echo "CTEST_OUTPUT_ON_FAILURE=1" >> $GITHUB_ENV
 
@@ -860,7 +860,7 @@ jobs:
         run: |
           mkdir build
           cd build
-          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DENABLE_DAP=${ENABLE_DAP} -DENABLE_HDF5=${ENABLE_HDF5} -DENABLE_NCZARR=${ENABLE_NCZARR}
+          LD_LIBRARY_PATH=${LD_LIBRARY_PATH} cmake .. -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DNETCDF_ENABLE_DAP=${NETCDF_ENABLE_DAP} -DNETCDF_ENABLE_HDF5=${NETCDF_ENABLE_HDF5} -DNETCDF_ENABLE_NCZARR=${NETCDF_ENABLE_NCZARR}
 
       - name: Print Summary
         shell: bash -l {0}
diff --git a/ctest_scripts/ctest_mpicc.ctest b/ctest_scripts/ctest_mpicc.ctest
index 617ea49a2..794297a16 100644
--- a/ctest_scripts/ctest_mpicc.ctest
+++ b/ctest_scripts/ctest_mpicc.ctest
@@ -34,7 +34,7 @@ find_program(CTEST_GIT_COMMAND NAMES git)
 find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
 find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
 
-set(CTEST_BUILD_OPTIONS "-DENABLE_COVERAGE_TESTS=TRUE -DENABLE_ERANGE_FILL=TRUE -DENABLE_LOGGING=TRUE -DENABLE_BYTERANGE=TRUE -DENABLE_LARGE_FILE_TESTS=FALSE -DCMAKE_C_COMPILER=${CTEST_COMPILER}")
+set(CTEST_BUILD_OPTIONS "-DNETCDF_ENABLE_COVERAGE_TESTS=TRUE -DNETCDF_ENABLE_ERANGE_FILL=TRUE -DNETCDF_ENABLE_LOGGING=TRUE -DNETCDF_ENABLE_BYTERANGE=TRUE -DNETCDF_ENABLE_LARGE_FILE_TESTS=FALSE -DCMAKE_C_COMPILER=${CTEST_COMPILER}")
 
 
 set(CTEST_DROP_METHOD https)
diff --git a/ctest_scripts/ctest_serial.ctest b/ctest_scripts/ctest_serial.ctest
index 71a6eb696..0c77627f3 100644
--- a/ctest_scripts/ctest_serial.ctest
+++ b/ctest_scripts/ctest_serial.ctest
@@ -33,7 +33,7 @@ find_program(CTEST_GIT_COMMAND NAMES git)
 find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
 find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
 
-set(CTEST_BUILD_OPTIONS "-DENABLE_COVERAGE_TESTS=FALSE -DENABLE_ERANGE_FILL=TRUE -DENABLE_LOGGING=TRUE -DENABLE_BYTERANGE=TRUE -DENABLE_LARGE_FILE_TESTS=FALSE")
+set(CTEST_BUILD_OPTIONS "-DNETCDF_ENABLE_COVERAGE_TESTS=FALSE -DNETCDF_ENABLE_ERANGE_FILL=TRUE -DNETCDF_ENABLE_LOGGING=TRUE -DNETCDF_ENABLE_BYTERANGE=TRUE -DNETCDF_ENABLE_LARGE_FILE_TESTS=FALSE")
 
 
 set(CTEST_DROP_METHOD https)
diff --git a/ctest_scripts/ctest_serial_coverage.ctest b/ctest_scripts/ctest_serial_coverage.ctest
index 9b8f90a20..73247bc4b 100644
--- a/ctest_scripts/ctest_serial_coverage.ctest
+++ b/ctest_scripts/ctest_serial_coverage.ctest
@@ -33,7 +33,7 @@ find_program(CTEST_GIT_COMMAND NAMES git)
 find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
 find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
 
-set(CTEST_BUILD_OPTIONS "-DENABLE_COVERAGE_TESTS=TRUE -DENABLE_ERANGE_FILL=TRUE -DENABLE_LOGGING=TRUE -DENABLE_BYTERANGE=TRUE -DENABLE_LARGE_FILE_TESTS=FALSE")
+set(CTEST_BUILD_OPTIONS "-DNETCDF_ENABLE_COVERAGE_TESTS=TRUE -DNETCDF_ENABLE_ERANGE_FILL=TRUE -DNETCDF_ENABLE_LOGGING=TRUE -DNETCDF_ENABLE_BYTERANGE=TRUE -DNETCDF_ENABLE_LARGE_FILE_TESTS=FALSE")
 
 
 set(CTEST_DROP_METHOD https)
diff --git a/ctest_scripts/ctest_serial_dap.ctest b/ctest_scripts/ctest_serial_dap.ctest
index 80fe31264..2b73b5750 100644
--- a/ctest_scripts/ctest_serial_dap.ctest
+++ b/ctest_scripts/ctest_serial_dap.ctest
@@ -33,7 +33,7 @@ find_program(CTEST_GIT_COMMAND NAMES git)
 find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
 find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
 
-set(CTEST_BUILD_OPTIONS "-DENABLE_COVERAGE_TESTS=TRUE -DENABLE_ERANGE_FILL=TRUE -DENABLE_LOGGING=TRUE -DENABLE_BYTERANGE=TRUE -DENABLE_LARGE_FILE_TESTS=FALSE -DENABLE_DAP_REMOTE_TESTS=TRUE")
+set(CTEST_BUILD_OPTIONS "-DNETCDF_ENABLE_COVERAGE_TESTS=TRUE -DNETCDF_ENABLE_ERANGE_FILL=TRUE -DNETCDF_ENABLE_LOGGING=TRUE -DNETCDF_ENABLE_BYTERANGE=TRUE -DNETCDF_ENABLE_LARGE_FILE_TESTS=FALSE -DNETCDF_ENABLE_DAP_REMOTE_TESTS=TRUE")
 
 
 set(CTEST_DROP_METHOD https)
diff --git a/dap4_test/CMakeLists.txt b/dap4_test/CMakeLists.txt
index ab16df629..cd9be513c 100644
--- a/dap4_test/CMakeLists.txt
+++ b/dap4_test/CMakeLists.txt
@@ -21,21 +21,21 @@ FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
 
 FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
 
-IF(ENABLE_DAP_REMOTE_TESTS)
+IF(NETCDF_ENABLE_DAP_REMOTE_TESTS)
     # Change name (add '4') to avoid cmake
     # complaint about duplicate targets.
     BUILD_BIN_TEST(findtestserver4)
     BUILD_BIN_TEST(pingurl4)
 ENDIF()
 
-IF(ENABLE_TESTS)
+IF(NETCDF_ENABLE_TESTS)
 
   # Base tests
   # The tests are set up as a combination of shell scripts and executables that
   # must be run in a particular order. It is painful but will use macros to help
   # keep it from being too bad.
 
-  IF(BUILD_UTILITIES)
+  IF(NETCDF_BUILD_UTILITIES)
       INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libdap4)
       build_bin_test(test_parse)
       build_bin_test(test_meta)
@@ -48,9 +48,9 @@ ENDIF()
       add_sh_test(dap4_test test_raw)
       add_sh_test(dap4_test test_meta)
       add_sh_test(dap4_test test_data)
-  ENDIF(BUILD_UTILITIES)
+  ENDIF(NETCDF_BUILD_UTILITIES)
 
-  IF(ENABLE_DAP_REMOTE_TESTS)
+  IF(NETCDF_ENABLE_DAP_REMOTE_TESTS)
       add_sh_test(dap4_test test_remote)
       add_sh_test(dap4_test test_hyrax)
       add_sh_test(dap4_test test_dap4url)
@@ -66,9 +66,9 @@ ENDIF()
     IF(RUN_IGNORED_TESTS)
       add_sh_test(dap4_test test_thredds)
     ENDIF()
-  ENDIF(ENABLE_DAP_REMOTE_TESTS)
+  ENDIF(NETCDF_ENABLE_DAP_REMOTE_TESTS)
 
-ENDIF(ENABLE_TESTS)
+ENDIF(NETCDF_ENABLE_TESTS)
 
 #FILE(COPY ./baseline DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})
 #FILE(COPY ./baselineraw DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/dap4_test/Makefile.am b/dap4_test/Makefile.am
index 19fb0606f..36d74d373 100644
--- a/dap4_test/Makefile.am
+++ b/dap4_test/Makefile.am
@@ -42,8 +42,8 @@ pingurl4_SOURCES = pingurl4.c
 dump_SOURCES = dump.c
 
 # Disable Dap4 Remote Tests until the test server is working
-if BUILD_UTILITIES
-if ENABLE_DAP_REMOTE_TESTS
+if NETCDF_BUILD_UTILITIES
+if NETCDF_ENABLE_DAP_REMOTE_TESTS
 
 TESTS += test_remote.sh
 TESTS += test_constraints.sh
diff --git a/hdf4_test/Makefile.am b/hdf4_test/Makefile.am
index d18db182e..a75d729b9 100644
--- a/hdf4_test/Makefile.am
+++ b/hdf4_test/Makefile.am
@@ -21,10 +21,10 @@ check_PROGRAMS = tst_chunk_hdf4 tst_h4_lendian tst_hdf4_extra
 TESTS = tst_chunk_hdf4 tst_h4_lendian tst_hdf4_extra
 
 # This test script depends on ncdump and tst_interops2.c.
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 check_PROGRAMS += tst_interops2
 TESTS += run_formatx_hdf4.sh
-endif # BUILD_UTILITIES
+endif # NETCDF_BUILD_UTILITIES
 
 # This test script fetches HDF4 files from an FTP server and uses
 # program tst_interops3.c to read them.
diff --git a/nc_test/CMakeLists.txt b/nc_test/CMakeLists.txt
index f24d791a8..2bfb8ea62 100644
--- a/nc_test/CMakeLists.txt
+++ b/nc_test/CMakeLists.txt
@@ -101,7 +101,7 @@ ENDFOREACH()
 
 ADD_TEST(nc_test ${EXECUTABLE_OUTPUT_PATH}/nc_test)
 
-IF(BUILD_UTILITIES)
+IF(NETCDF_BUILD_UTILITIES)
 
     add_sh_test(nc_test run_diskless)
     IF(BUILD_MMAP)
@@ -118,8 +118,8 @@ IF(BUILD_UTILITIES)
       ENDIF()
     ENDIF()
 
-    IF(ENABLE_BYTERANGE)
-      IF(ENABLE_EXTERNAL_SERVER_TESTS)
+    IF(NETCDF_ENABLE_BYTERANGE)
+      IF(NETCDF_ENABLE_EXTERNAL_SERVER_TESTS)
         build_bin_test_no_prefix(tst_byterange)
         add_sh_test(nc_test test_byterange)
       ENDIF()
@@ -129,7 +129,7 @@ IF(BUILD_UTILITIES)
     add_sh_test(nc_test run_mmap)
   ENDIF()
 
-ENDIF(BUILD_UTILITIES)
+ENDIF(NETCDF_BUILD_UTILITIES)
 
 # Copy some test files from current source dir to out-of-tree build dir.
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am
index 73424066c..903e74351 100644
--- a/nc_test/Makefile.am
+++ b/nc_test/Makefile.am
@@ -39,7 +39,7 @@ tst_formatx_pnetcdf tst_default_format_pnetcdf
 endif
 
 if USE_PNETCDF
-if ENABLE_CDF5
+if NETCDF_ENABLE_CDF5
 check_PROGRAMS += tst_cdf5format
 endif
 endif
@@ -75,10 +75,10 @@ endif
 
 TESTS = $(TESTPROGRAMS)
 
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 
-if ENABLE_BYTERANGE
-if ENABLE_EXTERNAL_SERVER_TESTS
+if NETCDF_ENABLE_BYTERANGE
+if NETCDF_ENABLE_EXTERNAL_SERVER_TESTS
 tst_byterange_SOURCES = tst_byterange.c
 check_PROGRAMS += tst_byterange
 TESTS += test_byterange.sh
@@ -105,7 +105,7 @@ else
 TESTS += t_nc tst_atts3 tst_nofill nc_test tst_small
 endif
 
-endif # BUILD_UTILITIES
+endif # NETCDF_BUILD_UTILITIES
 
 # The .c files that are generated with m4 are already distributed, but
 # we also include the original m4 files, plus test scripts data.
@@ -125,7 +125,7 @@ tst_diskless4.cdl ref_tst_diskless4.cdl benchmark.nc                    \
 tst_http_nc3.cdl tst_http_nc4?.cdl tmp*.cdl tmp*.nc
 
 EXTRA_DIST += bad_cdf5_begin.nc run_cdf5.sh nc_enddef.cdl
-if ENABLE_CDF5
+if NETCDF_ENABLE_CDF5
    # bad_cdf5_begin.nc is a corrupted CDF-5 file with bad variable starting
    # file offsets. It is to be used by tst_open_cdf5.c to check if it can
    # detect and report error code NC_ENOTNC.
diff --git a/nc_test/nc_test.c b/nc_test/nc_test.c
index 5525b52dd..8fdf39b8a 100644
--- a/nc_test/nc_test.c
+++ b/nc_test/nc_test.c
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
 	     break;
 
 	  case NC_FORMAT_CDF5:
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
         nc_set_default_format(NC_FORMAT_CDF5, NULL);
 	     fprintf(stderr, "\n\nSwitching to 64-bit data format.\n");
 	     strcpy(testfile, "nc_test_cdf5.nc");
diff --git a/nc_test/t_nc.c b/nc_test/t_nc.c
index 7fdc28520..b88b63dea 100644
--- a/nc_test/t_nc.c
+++ b/nc_test/t_nc.c
@@ -358,7 +358,7 @@ main(int argc, char *argv[])
 #ifdef USE_PNETCDF
 	MPI_Init(&argc, &argv);
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
 	cmode |= (NC_64BIT_DATA);
 #endif
 	ret = nc_create_par(fname,cmode, MPI_COMM_WORLD, MPI_INFO_NULL, &id);
diff --git a/nc_test/test_write.m4 b/nc_test/test_write.m4
index 4ea4e52b5..7d04430a2 100644
--- a/nc_test/test_write.m4
+++ b/nc_test/test_write.m4
@@ -2440,7 +2440,7 @@ APIFunc(get_file_version)(char *path, int *version)
    if (strncmp(magic, "CDF", MAGIC_NUM_LEN-1)==0) {
       if (magic[MAGIC_NUM_LEN-1] == NC_FORMAT_CLASSIC ||
           magic[MAGIC_NUM_LEN-1] == NC_FORMAT_64BIT_OFFSET
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
           || magic[MAGIC_NUM_LEN-1] == NC_FORMAT_CDF5
 #endif
 )
diff --git a/nc_test/tst_def_var_fill.c b/nc_test/tst_def_var_fill.c
index 425d563c8..4be3dd9b1 100644
--- a/nc_test/tst_def_var_fill.c
+++ b/nc_test/tst_def_var_fill.c
@@ -55,7 +55,7 @@ int main(int argc, char** argv) {
     buf = (int*) malloc(NY*NX * sizeof(int));
 
     for (k=0; k<5; k++) {
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
         if (formats[k] == NC_FORMAT_CDF5) continue;
 #endif
 #ifndef USE_HDF5
diff --git a/nc_test/tst_default_format.c b/nc_test/tst_default_format.c
index 8940500be..617af4225 100644
--- a/nc_test/tst_default_format.c
+++ b/nc_test/tst_default_format.c
@@ -52,7 +52,7 @@ create_check(char *fname, int cmode, int exp_format)
     if (cmode & NC_NETCDF4)
         exp_err = NC_ENOTBUILT;
 #endif
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
     if (cmode & NC_64BIT_DATA)
         exp_err = NC_ENOTBUILT;
 #endif
@@ -155,7 +155,7 @@ int main(int argc, char *argv[])
     cmode = NC_64BIT_DATA;
     nerrs += create_check(fname, cmode, NC_FORMAT_64BIT_DATA);
 
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
     err = nc_set_default_format(NC_FORMAT_64BIT_DATA, NULL); EXP_ERR(NC_ENOTBUILT)
 #else
     /* set default file format to NC_FORMAT_64BIT_DATA --------------------*/
diff --git a/nc_test/tst_default_format_pnetcdf.c b/nc_test/tst_default_format_pnetcdf.c
index e96653112..fe13249d5 100644
--- a/nc_test/tst_default_format_pnetcdf.c
+++ b/nc_test/tst_default_format_pnetcdf.c
@@ -54,7 +54,7 @@ create_check_pnetcdf(char *fname, int cmode, int exp_format)
 
     exp_str = formatstr(exp_format);
 
-#ifndef ENABLE_CDF5
+#ifndef NETCDF_ENABLE_CDF5
     if (cmode & NC_64BIT_DATA) exp_err = NC_ENOTBUILT;
 #endif
 
@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
     cmode = NC_64BIT_OFFSET;
     nerrs += create_check_pnetcdf(fname, cmode, NC_FORMAT_64BIT_OFFSET);
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
     /* create a file in CDF5 format */
     cmode = NC_64BIT_DATA;
     nerrs += create_check_pnetcdf(fname, cmode, NC_FORMAT_64BIT_DATA);
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
     cmode = 0;
     nerrs += create_check_pnetcdf(fname, cmode, NC_FORMAT_64BIT_OFFSET);
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
     /* create a file in CDF5 format (this should ignore default) */
     cmode = NC_64BIT_DATA;
     nerrs += create_check_pnetcdf(fname, cmode, NC_FORMAT_64BIT_DATA);
diff --git a/nc_test/tst_formats.c b/nc_test/tst_formats.c
index 898a12b2a..10d8719bf 100644
--- a/nc_test/tst_formats.c
+++ b/nc_test/tst_formats.c
@@ -44,10 +44,10 @@ determine_test_formats(int *num_formats, int *format)
 #endif /* USE_HDF5 */
 
     /* Do we have CDF5? */
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
     num++;
     format[ind++] = NC_FORMAT_CDF5;
-#endif /* ENABLE_CDF5 */
+#endif /* NETCDF_ENABLE_CDF5 */
 
     *num_formats = num;
 }
diff --git a/nc_test/tst_global_fillval.c b/nc_test/tst_global_fillval.c
index 38e4e60f6..0d8c6ca15 100644
--- a/nc_test/tst_global_fillval.c
+++ b/nc_test/tst_global_fillval.c
@@ -38,7 +38,7 @@ main(int argc, char **argv)
     num_formats += 2;
 #endif
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
     num_formats++;
 #endif
 
@@ -47,7 +47,7 @@ main(int argc, char **argv)
 
 	formats[n++] = 0;
 	formats[n++] = NC_64BIT_OFFSET;
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
 	formats[n++] = NC_64BIT_DATA;
 #endif
 #ifdef USE_HDF5
diff --git a/nc_test/tst_inq_type.c b/nc_test/tst_inq_type.c
index 5354d2655..7c3314228 100644
--- a/nc_test/tst_inq_type.c
+++ b/nc_test/tst_inq_type.c
@@ -81,7 +81,7 @@ int main(int argc, char **argv) {
    }
    SUMMARIZE_ERR;
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
    printf("\n* Testing nc_inq_type with CDF5\n");
    {
       if(nc_create(FILE_NAME,NC_CLOBBER|NC_CDF5,&ncid)) ERR;
@@ -111,7 +111,7 @@ int main(int argc, char **argv) {
       if (nc_close(ncid)) ERR;
    }
    SUMMARIZE_ERR;
-#endif /* ENABLE_CDF5 */
+#endif /* NETCDF_ENABLE_CDF5 */
 
 #ifdef USE_HDF5
    printf("\n* Testing nc_inq_type with netcdf-4 + Classic Model\n");
diff --git a/nc_test/tst_names.c b/nc_test/tst_names.c
index 49c31a409..fc89b1885 100644
--- a/nc_test/tst_names.c
+++ b/nc_test/tst_names.c
@@ -225,7 +225,7 @@ main(int argc, char **argv)
        NC_FORMAT_CLASSIC
        ,
        NC_FORMAT_64BIT_OFFSET
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
        ,
        NC_FORMAT_CDF5
 #endif
diff --git a/nc_test/tst_small.c b/nc_test/tst_small.c
index 1f4d7e3c2..56acdce55 100644
--- a/nc_test/tst_small.c
+++ b/nc_test/tst_small.c
@@ -55,7 +55,7 @@ static int file_create(const char *filename, int cmode, int *ncid)
 #ifdef USE_PNETCDF
     if (default_format == NC_FORMAT_CLASSIC ||
         default_format == NC_FORMAT_64BIT_OFFSET
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
         || default_format == NC_FORMAT_64BIT_DATA
 #endif
         )
@@ -523,7 +523,7 @@ main(int argc, char **argv)
 	    printf("Switching to 64-bit offset format.\n");
 	    strcpy(testfile, "tst_small_64bit.nc");
 	    break;
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
 	 case NC_FORMAT_CDF5:
 	    nc_set_default_format(NC_FORMAT_CDF5, NULL);
 	    printf("Switching to 64-bit data format.\n");
diff --git a/nc_test4/CMakeLists.txt b/nc_test4/CMakeLists.txt
index 117277e6c..d3fae92b0 100644
--- a/nc_test4/CMakeLists.txt
+++ b/nc_test4/CMakeLists.txt
@@ -31,7 +31,7 @@ ENDIF()
 
 # Note, renamegroup needs to be compiled before run_grp_rename
 
-IF(BUILD_UTILITIES)
+IF(NETCDF_BUILD_UTILITIES)
   SET(NC4_TESTS ${NC4_TESTS} tst_xplatform)
   build_bin_test(renamegroup)
   add_sh_test(nc_test4 run_grp_rename)
@@ -41,7 +41,7 @@ IF(BUILD_UTILITIES)
   build_bin_test(tst_fillonly)
   ADD_SH_TEST(nc_test4 test_fillonly)
   ADD_SH_TEST(nc_test4 tst_fixedstring)
-IF(USE_HDF5 AND ENABLE_FILTER_TESTING)
+IF(USE_HDF5 AND NETCDF_ENABLE_FILTER_TESTING)
   build_bin_test(tst_filterparser)
   build_bin_test(test_filter)
   build_bin_test(test_filter_misc)
@@ -63,9 +63,9 @@ IF(USE_HDF5 AND ENABLE_FILTER_TESTING)
     # manually invoked if desired
     ADD_SH_TEST(nc_test4 tst_filterinstall)
   ENDIF(FALSE)
-ENDIF(USE_HDF5 AND ENABLE_FILTER_TESTING)
+ENDIF(USE_HDF5 AND NETCDF_ENABLE_FILTER_TESTING)
 
-ENDIF(BUILD_UTILITIES)
+ENDIF(NETCDF_BUILD_UTILITIES)
 
 IF(${HDF5_VERSION} VERSION_GREATER "1.10.0")
   SET(NC4_TESTS ${NC4_TESTS} tst_virtual_datasets)
@@ -95,7 +95,7 @@ ENDIF()
 IF(HAVE_H5Z_SZIP)
   BUILD_BIN_TEST(test_szip)
   BUILD_BIN_TEST(h5testszip)
-  IF(BUILD_UTILITIES)
+  IF(NETCDF_BUILD_UTILITIES)
     add_sh_test(nc_test4 tst_szip)
   ENDIF()
 ENDIF()
diff --git a/nc_test4/Makefile.am b/nc_test4/Makefile.am
index b02056af3..22ac5f394 100644
--- a/nc_test4/Makefile.am
+++ b/nc_test4/Makefile.am
@@ -61,7 +61,7 @@ TESTS += tst_v2
 endif # BUILD_V2
 
 # The rest of the tests require ncgen/ncdump.
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 check_PROGRAMS += renamegroup
 TESTS += run_grp_rename.sh tst_misc.sh
 
@@ -79,7 +79,7 @@ endif
 
 # Filter Tests (requires ncdump and ncgen and HDF5)
 if USE_HDF5
-if ENABLE_FILTER_TESTING
+if NETCDF_ENABLE_FILTER_TESTING
 extradir =
 check_PROGRAMS += test_filter test_filter_misc test_filter_order test_filter_repeat
 check_PROGRAMS += tst_multifilter tst_filter_vlen
@@ -107,9 +107,9 @@ if AX_MANUAL
 TESTS += tst_filterinstall.sh
 endif
 
-endif # ENABLE_FILTER_TESTING
+endif # NETCDF_ENABLE_FILTER_TESTING
 endif # USE_HDF5
-endif # BUILD_UTILITIES
+endif # NETCDF_BUILD_UTILITIES
 
 # This are extra tests that will only be run if netcdf-4 is configured
 # with --enable-parallel-tests.
diff --git a/nc_test4/tst_converts.c b/nc_test4/tst_converts.c
index 15a230d2b..c3434bddd 100644
--- a/nc_test4/tst_converts.c
+++ b/nc_test4/tst_converts.c
@@ -51,10 +51,10 @@ determine_test_formats(int *num_formats, int *format)
 #endif /* USE_HDF5 */
 
    /* Do we have CDF5? */
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
    num++;
    format[ind++] = NC_FORMAT_CDF5;
-#endif /* ENABLE_CDF5 */
+#endif /* NETCDF_ENABLE_CDF5 */
 
    *num_formats = num;
 }
diff --git a/nc_test4/tst_files.c b/nc_test4/tst_files.c
index 2a8417166..85f71c655 100644
--- a/nc_test4/tst_files.c
+++ b/nc_test4/tst_files.c
@@ -262,11 +262,11 @@ main(int argc, char **argv)
    test_redef(NC_FORMAT_NETCDF4_CLASSIC);
    SUMMARIZE_ERR;
 
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
    printf("*** testing redef for CDF5...");
    test_redef(NC_FORMAT_CDF5);
    SUMMARIZE_ERR;
-#endif /* ENABLE_CDF5 */
+#endif /* NETCDF_ENABLE_CDF5 */
 
    printf("*** testing different formats...");
    {
diff --git a/nc_test4/tst_quantize.c b/nc_test4/tst_quantize.c
index c2694e7a9..dd083bd55 100644
--- a/nc_test4/tst_quantize.c
+++ b/nc_test4/tst_quantize.c
@@ -1333,7 +1333,7 @@ main(int argc, char **argv)
 	    if (nc_def_var_quantize(ncid, varid2, NC_QUANTIZE_BITGROOM, NSD_3)) ERR;
 
 #ifdef TESTNCZARR
-#ifdef ENABLE_NCZARR_FILTERS
+#ifdef NETCDF_ENABLE_NCZARR_FILTERS
 	    /* Set up zlib compression. This will work better because the
 	     * data are quantized, yielding a smaller output file. We will
 	     * set compression level to 1, which is usually the best
diff --git a/ncdap_test/CMakeLists.txt b/ncdap_test/CMakeLists.txt
index 0ac0da75b..d1178ff9f 100644
--- a/ncdap_test/CMakeLists.txt
+++ b/ncdap_test/CMakeLists.txt
@@ -13,9 +13,9 @@ remove_definitions(-DDLL_EXPORT)
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
 FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
 
-IF(ENABLE_TESTS)
+IF(NETCDF_ENABLE_TESTS)
 
-  IF(ENABLE_DAP_REMOTE_TESTS)
+  IF(NETCDF_ENABLE_DAP_REMOTE_TESTS)
     BUILD_BIN_TEST(findtestserver)
     BUILD_BIN_TEST(pingurl)
   ENDIF()
@@ -26,7 +26,7 @@ IF(ENABLE_TESTS)
   # keep it from being too bad.
   # Binary Test Macro
 
-  IF(BUILD_UTILITIES)
+  IF(NETCDF_BUILD_UTILITIES)
     add_sh_test(ncdap tst_ncdap3)
     IF(HAVE_BASH)
       SET_TESTS_PROPERTIES(ncdap_tst_ncdap3 PROPERTIES RUN_SERIAL TRUE)
@@ -39,9 +39,9 @@ IF(ENABLE_TESTS)
     add_bin_env_test(ncdap test_vara)
   ENDIF()
 
-  IF(ENABLE_DAP_REMOTE_TESTS)
+  IF(NETCDF_ENABLE_DAP_REMOTE_TESTS)
 
-    IF(BUILD_UTILITIES)
+    IF(NETCDF_BUILD_UTILITIES)
       add_sh_test(ncdap tst_ber)
       add_sh_test(ncdap tst_remote3)
       IF(HAVE_BASH)
@@ -49,23 +49,23 @@ IF(ENABLE_TESTS)
       ENDIF(HAVE_BASH)
       add_sh_test(ncdap tst_zero_len_var)
       add_sh_test(ncdap tst_fillmismatch)
-      IF(ENABLE_DAP_LONG_TESTS)
+      IF(NETCDF_ENABLE_DAP_LONG_TESTS)
         add_sh_test(ncdap tst_longremote3)	
         SET_TESTS_PROPERTIES(ncdap_tst_longremote3 PROPERTIES RUN_SERIAL TRUE)
-      ENDIF(ENABLE_DAP_LONG_TESTS)
+      ENDIF(NETCDF_ENABLE_DAP_LONG_TESTS)
       IF(TRUE)
         # Apparently iridl.ldeo.columbia.edu is down for now
         add_sh_test(ncdap tst_encode)
         # not yet fixed
         add_sh_test(ncdap tst_hyrax)
       ENDIF()
-    ENDIF(BUILD_UTILITIES)
-    IF(ENABLE_EXTERNAL_SERVER_TESTS)
+    ENDIF(NETCDF_BUILD_UTILITIES)
+    IF(NETCDF_ENABLE_EXTERNAL_SERVER_TESTS)
           add_bin_test(ncdap test_manyurls)
           SET_TESTS_PROPERTIES(ncdap_test_manyurls PROPERTIES RUN_SERIAL TRUE)
     ENDIF()
 
-    IF(ENABLE_DAP_AUTH_TESTS)
+    IF(NETCDF_ENABLE_DAP_AUTH_TESTS)
 ##obsolete      add_bin_test(ncdap t_auth)
       add_sh_test(ncdap testauth)
     ENDIF()
diff --git a/ncdap_test/Makefile.am b/ncdap_test/Makefile.am
index a9983842b..d7576677a 100644
--- a/ncdap_test/Makefile.am
+++ b/ncdap_test/Makefile.am
@@ -28,22 +28,22 @@ t_dap3a_SOURCES = t_dap3a.c t_srcdir.h
 test_cvt3_SOURCES = test_cvt.c t_srcdir.h
 test_vara_SOURCES = test_vara.c t_srcdir.h
 
-if ENABLE_DAP
+if NETCDF_ENABLE_DAP
 check_PROGRAMS += t_dap3a test_cvt3 test_vara
 TESTS += t_dap3a test_cvt3 test_vara
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 TESTS += tst_ncdap3.sh
 endif
 
 # remote tests are optional
 # because the server may be down or inaccessible
 
-if ENABLE_DAP_REMOTE_TESTS
+if NETCDF_ENABLE_DAP_REMOTE_TESTS
 noinst_PROGRAMS = findtestserver pingurl
 findtestserver_SOURCES = findtestserver.c
 pingurl_SOURCES = pingurl.c
 
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 TESTS += tst_ber.sh tst_remote3.sh tst_formatx.sh testurl.sh tst_fillmismatch.sh tst_zero_len_var.sh
 endif
 
@@ -55,10 +55,10 @@ TESTS += tst_hyrax.sh
 
 TESTS += test_partvar
 
-if ENABLE_DAP_LONG_TESTS
+if NETCDF_ENABLE_DAP_LONG_TESTS
  TESTS += tst_longremote3.sh
  tst_longremote3.log: tst_remote3.log
-if ENABLE_EXTERNAL_SERVER_TESTS
+if NETCDF_ENABLE_EXTERNAL_SERVER_TESTS
  test_manyurls_SOURCES = test_manyurls.c manyurls.h
  check_PROGRAMS += test_manyurls
  test_manyurls.log: tst_longremote3.log
@@ -84,13 +84,13 @@ check_PROGRAMS += test_partvar
 check_PROGRAMS += t_misc
 check_PROGRAMS += t_ncf330
 
-if ENABLE_DAP_AUTH_TESTS
+if NETCDF_ENABLE_DAP_AUTH_TESTS
 TESTS += testauth.sh
 endif
 
-endif #ENABLE_DAP_REMOTE_TESTS
+endif #NETCDF_ENABLE_DAP_REMOTE_TESTS
 
-endif #ENABLE_DAP
+endif #NETCDF_ENABLE_DAP
 
 # Need to add subdirs
 SUBDIRS = testdata3 expected3 expectremote3 expectedhyrax
diff --git a/ncdap_test/findtestserver.c.in b/ncdap_test/findtestserver.c.in
index 5a2c0c4b3..9b62cf811 100644
--- a/ncdap_test/findtestserver.c.in
+++ b/ncdap_test/findtestserver.c.in
@@ -61,7 +61,7 @@ main(int argc, char** argv)
     if(argc >= 3)
 	serverlist = strdup(argv[2]);
 
-#ifdef ENABLE_DAP
+#ifdef NETCDF_ENABLE_DAP
     if(strcasecmp(proto,"thredds")==0)
 	kind = THREDDSKIND;
     else
@@ -69,7 +69,7 @@ main(int argc, char** argv)
 	kind = DAP2KIND;
     else
 #endif
-#ifdef ENABLE_DAP4
+#ifdef NETCDF_ENABLE_DAP4
     if(strcasecmp(proto,"dap4")==0)
 	kind = DAP4KIND;
     else
diff --git a/ncdump/run_ncgen_tests.sh b/ncdump/run_ncgen_tests.sh
index 752072ae3..728a3a73c 100755
--- a/ncdump/run_ncgen_tests.sh
+++ b/ncdump/run_ncgen_tests.sh
@@ -11,7 +11,7 @@ set -e
 # This shell script runs the ncdump tests.
 # get some config.h parameters
 if test -f ${top_builddir}/config.h ; then
-  if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
+  if fgrep -e '#define NETCDF_ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
     CDF5=1
   else
     CDF5=0
@@ -51,7 +51,7 @@ echo "*** creating 64-bit offset file c0_64_run_ncgen_tests.nc from c0.cdl..."
 
 validateNC c0 "c0_64" -k 64-bit-offset -b
 
-if test "x$ENABLE_CDF5" = x1 ; then
+if test "x$NETCDF_ENABLE_CDF5" = x1 ; then
 
     echo "*** creating 64-bit data file c5.nc from c5.cdl..."
     ${NCGEN} -k 64-bit-data -b -o tst_c5_run_ncgen_tests.nc $top_srcdir/ncgen/c5.cdl
diff --git a/nctest/CMakeLists.txt b/nctest/CMakeLists.txt
index 434716d3c..5dc119475 100644
--- a/nctest/CMakeLists.txt
+++ b/nctest/CMakeLists.txt
@@ -29,9 +29,9 @@ ADD_TEST(nctest ${EXECUTABLE_OUTPUT_PATH}/nctest)
 set_property(TARGET nctest PROPERTY UNITY_BUILD OFF)
 
 add_bin_test_no_prefix(tst_rename)
-IF(BUILD_UTILITIES)
+IF(NETCDF_BUILD_UTILITIES)
   add_sh_test(nctest compare_test_files)
   IF(HAVE_BASH)
     SET_TESTS_PROPERTIES(nctest_compare_test_files PROPERTIES DEPENDS nctest)
   ENDIF(HAVE_BASH)
-ENDIF(BUILD_UTILITIES)
+ENDIF(NETCDF_BUILD_UTILITIES)
diff --git a/nctest/Makefile.am b/nctest/Makefile.am
index 47b9281c4..649f751a2 100644
--- a/nctest/Makefile.am
+++ b/nctest/Makefile.am
@@ -32,7 +32,7 @@ TESTPROGRAMS = nctest tst_rename
 check_PROGRAMS = $(TESTPROGRAMS)
 
 # This test requires that the utilites also be built.
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 TESTS = $(TESTPROGRAMS) compare_test_files.sh
 # compare_test_files depends on nctest executing first.
 compare_test_files.log: nctest.log
diff --git a/nctest/driver.c b/nctest/driver.c
index 20c68b103..817f5bc08 100644
--- a/nctest/driver.c
+++ b/nctest/driver.c
@@ -51,10 +51,10 @@ determine_test_formats(int *num_formats, int *format)
 #endif /* USE_HDF5 */
 
    /* Do we have CDF5? */
-#ifdef ENABLE_CDF5
+#ifdef NETCDF_ENABLE_CDF5
    num++;
    format[ind++] = NC_FORMAT_CDF5;
-#endif /* ENABLE_CDF5 */
+#endif /* NETCDF_ENABLE_CDF5 */
 
    *num_formats = num;
 }
diff --git a/nczarr_test/CMakeLists.txt b/nczarr_test/CMakeLists.txt
index 6483f4644..d9e7920fd 100644
--- a/nczarr_test/CMakeLists.txt
+++ b/nczarr_test/CMakeLists.txt
@@ -54,19 +54,19 @@ IF(USE_X_GETOPT)
 SET(XGETOPTSRC "${CMAKE_CURRENT_SOURCE_DIR}/../libdispatch/XGetopt.c")
 ENDIF()
 
-IF(ENABLE_TESTS)
+IF(NETCDF_ENABLE_TESTS)
 
   add_library(ut_util STATIC ut_util.c ut_test.c ut_includes.h ut_test.h ${XGETOPTSRC})
-  IF(ENABLE_DLL)
+  IF(NETCDF_ENABLE_DLL)
     target_compile_definitions(ut_util PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
-  ENDIF(ENABLE_DLL)
+  ENDIF(NETCDF_ENABLE_DLL)
   target_include_directories(ut_util PUBLIC ../libnczarr ../plugins ${CMAKE_CURRENT_LIST_DIR})
   target_link_libraries(ut_util PUBLIC netcdf ${ALL_TLL_LIBS})
 
   add_library(test_utils STATIC test_utils.c test_utils.h ${XGETOPTSRC})
-  IF(ENABLE_DLL)
+  IF(NETCDF_ENABLE_DLL)
     target_compile_definitions(test_utils PUBLIC -DDLL_EXPORT -DDLL_NETCDF)
-  ENDIF(ENABLE_DLL)
+  ENDIF(NETCDF_ENABLE_DLL)
   target_include_directories(test_utils PUBLIC ../libnczarr ../plugins ${CMAKE_CURRENT_LIST_DIR})
   target_link_libraries(test_utils PUBLIC netcdf ${ALL_TLL_LIBS})
 
@@ -78,17 +78,17 @@ IF(ENABLE_TESTS)
 
   macro(build_bin_test_with_util_lib F UTIL_LIB)
     build_bin_test(${F})
-    IF(ENABLE_DLL)
+    IF(NETCDF_ENABLE_DLL)
       target_compile_definitions(${F} PUBLIC -DDLL_NETCDF)
-    ENDIF(ENABLE_DLL)
+    ENDIF(NETCDF_ENABLE_DLL)
     target_link_libraries(${F} ${UTIL_LIB} ${ALL_TLL_LIBS})
   endmacro()
 
   macro(add_bin_test_with_util_lib PREFIX F UTIL_LIB)
     add_bin_test(${PREFIX} ${F})
-    IF(ENABLE_DLL)
+    IF(NETCDF_ENABLE_DLL)
       target_compile_definitions(${PREFIX}_${F} PUBLIC -DDLL_NETCDF)
-    ENDIF(ENABLE_DLL)
+    ENDIF(NETCDF_ENABLE_DLL)
     target_link_libraries(${PREFIX}_${F} ${UTIL_LIB} ${ALL_TLL_LIBS})
 
   endmacro()
@@ -137,11 +137,11 @@ IF(ENABLE_TESTS)
   TARGET_INCLUDE_DIRECTORIES(zs3parse PUBLIC ../libnczarr)
   build_bin_test_with_util_lib(zmapio ut_util)
 
-  IF(ENABLE_S3 AND NOT WITH_S3_TESTING STREQUAL "NO")
+  IF(NETCDF_ENABLE_S3 AND NOT WITH_S3_TESTING STREQUAL "NO")
   # Helper programs for testing
     BUILD_BIN_TEST(s3util ${COMMONSRC})
   # Pure AWS Test
-    IF(ENABLE_S3_AWS)
+    IF(NETCDF_ENABLE_S3_AWS)
       SET(TMP_CMAKE_CXX_STANDARD ${MAKE_CXX_STANDARD})
       SET(CMAKE_CXX_STANDARD 11)
       ADD_EXECUTABLE(tst_pure_awssdk tst_pure_awssdk.cpp)
@@ -159,7 +159,7 @@ IF(ENABLE_TESTS)
       ENDIF(MSVC)      
 
       SET(CMAKE_CXX_STANDARD ${TMP_CMAKE_CXX_STANDARD})
-    ENDIF(ENABLE_S3_AWS)
+    ENDIF(NETCDF_ENABLE_S3_AWS)
     TARGET_INCLUDE_DIRECTORIES(s3util PUBLIC ../libnczarr)
   endif()
   
@@ -167,7 +167,7 @@ IF(ENABLE_TESTS)
     build_bin_test_with_util_lib(ncdumpchunks ut_util)
   endif()
 
-  IF(BUILD_UTILITIES)
+  IF(NETCDF_BUILD_UTILITIES)
     add_sh_test(nczarr_test run_ut_map)
     add_sh_test(nczarr_test run_ut_mapapi)
     add_sh_test(nczarr_test run_ut_misc)
@@ -200,8 +200,8 @@ IF(ENABLE_TESTS)
     add_sh_test(nczarr_test run_fillonlyz)
     ENDIF()
 
-  IF(ENABLE_NCZARR_FILTERS)
-  IF(ENABLE_FILTER_TESTING)
+  IF(NETCDF_ENABLE_NCZARR_FILTERS)
+  IF(NETCDF_ENABLE_FILTER_TESTING)
 	  build_bin_test(test_nczfilter)
   	  build_bin_test(test_filter_vlen)
 	  build_bin_test(testfilter)
@@ -218,10 +218,10 @@ IF(ENABLE_TESTS)
             # It causes race conditions. So suppress and only test by hand.
             ADD_SH_TEST(nczarr_test run_unknown)
 	  ENDIF(FALSE)
-  ENDIF(ENABLE_FILTER_TESTING)
-  ENDIF(ENABLE_NCZARR_FILTERS)
+  ENDIF(NETCDF_ENABLE_FILTER_TESTING)
+  ENDIF(NETCDF_ENABLE_NCZARR_FILTERS)
 
-  if(ENABLE_NCZARR_ZIP)
+  if(NETCDF_ENABLE_NCZARR_ZIP)
       add_sh_test(nczarr_test run_newformat)
       # Test various corrupted files
       ADD_SH_TEST(nczarr_test run_corrupt.sh)
@@ -231,9 +231,9 @@ IF(ENABLE_TESTS)
       add_sh_test(nczarr_test run_ut_chunk)
   ENDIF()
 
-  ENDIF(BUILD_UTILITIES)
+  ENDIF(NETCDF_BUILD_UTILITIES)
 
-ENDIF(ENABLE_TESTS)
+ENDIF(NETCDF_ENABLE_TESTS)
 
 ## Specify files to be distributed by 'make dist'
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl)
diff --git a/nczarr_test/Makefile.am b/nczarr_test/Makefile.am
index 3df945179..166516c2e 100644
--- a/nczarr_test/Makefile.am
+++ b/nczarr_test/Makefile.am
@@ -54,7 +54,7 @@ test_unlim_io_SOURCES = test_unlim_io.c ${testcommonsrc}
 TESTS += test_put_vars_two_unlim_dim
 endif
 
-if BUILD_UTILITIES
+if NETCDF_BUILD_UTILITIES
 
 TESTS += run_ut_misc.sh
 TESTS += run_ut_map.sh
@@ -77,7 +77,7 @@ TESTS += run_scalar.sh
 TESTS += run_nulls.sh
 TESTS += run_notzarr.sh
 
-if ENABLE_EXTERNAL_SERVER_TESTS
+if NETCDF_ENABLE_EXTERNAL_SERVER_TESTS
 TESTS += run_external.sh
 endif
 
@@ -100,11 +100,11 @@ if LARGE_FILE_TESTS
 	TESTS += run_cachetest.sh
 endif
 
-endif #BUILD_UTILITIES
+endif #NETCDF_BUILD_UTILITIES
 
-if BUILD_UTILITIES 
+if NETCDF_BUILD_UTILITIES 
 
-if ENABLE_NCZARR_ZIP
+if NETCDF_ENABLE_NCZARR_ZIP
 	TESTS += run_newformat.sh
 endif
 
@@ -136,8 +136,8 @@ endif
 
 endif # BUILD_BENCHMARKS
 
-if ENABLE_NCZARR_FILTERS
-if ENABLE_FILTER_TESTING
+if NETCDF_ENABLE_NCZARR_FILTERS
+if NETCDF_ENABLE_FILTER_TESTING
 
 check_PROGRAMS += test_filter_avail test_filter_vlen
 TESTS += run_filter_vlen.sh run_filter_misc.sh
@@ -161,13 +161,13 @@ if ISMINGW
 XFAIL_TESTS = run_filter.sh run_specific_filters.sh run_nczfilter.sh
 endif  # ISMINGW
 
-endif #ENABLE_FILTER_TESTING
-endif #ENABLE_NCZARR_FILTERS
+endif #NETCDF_ENABLE_FILTER_TESTING
+endif #NETCDF_ENABLE_NCZARR_FILTERS
 
 # Test various corrupted files
 TESTS += run_corrupt.sh
 
-endif #BUILD_UTILITIES
+endif #NETCDF_BUILD_UTILITIES
 
 # These programs are used by the test cases
 noinst_PROGRAMS = zhex
@@ -179,11 +179,11 @@ zmapio_SOURCES = zmapio.c
 noinst_PROGRAMS += zs3parse
 zs3parse_SOURCES = zs3parse.c
 
-if ENABLE_S3
+if NETCDF_ENABLE_S3
 noinst_PROGRAMS += s3util 
 s3util_SOURCES = s3util.c
-if ENABLE_S3_TESTALL
-if ENABLE_S3_AWS
+if NETCDF_ENABLE_S3_TESTALL
+if NETCDF_ENABLE_S3_AWS
 check_PROGRAMS += tst_pure_awssdk
 tst_pure_awssdk_SOURCES = tst_pure_awssdk.cpp
 AM_CXXFLAGS += -std=c++11
@@ -344,7 +344,7 @@ clean-local:
 	rm -fr tmp_*.nc tmp_*.zarr tst_quantize*.zarr tmp*.file results.file results.s3 results.zip
 	rm -fr rcmiscdir ref_power_901_constants.file 
 
-if ENABLE_S3_TESTALL
+if NETCDF_ENABLE_S3_TESTALL
 check-local:
 	bash ${abs_top_builddir}/s3cleanup.sh
 endif
diff --git a/nczarr_test/ncdumpchunks.c b/nczarr_test/ncdumpchunks.c
index e4da59f1d..0c93ca8c9 100644
--- a/nczarr_test/ncdumpchunks.c
+++ b/nczarr_test/ncdumpchunks.c
@@ -28,7 +28,7 @@
 #include <H5DSpublic.h>
 #endif
 
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 #include "zincludes.h"
 #endif
 
@@ -38,7 +38,7 @@
 #ifdef USE_HDF5
 #define H5
 #endif
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 #define NZ
 #endif
 
diff --git a/nczarr_test/test_chunkcases.c b/nczarr_test/test_chunkcases.c
index 7241a8cf3..6b5f2db30 100644
--- a/nczarr_test/test_chunkcases.c
+++ b/nczarr_test/test_chunkcases.c
@@ -8,7 +8,7 @@
 #include "ncpathmgr.h"
 #include "nclist.h"
 
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 #include "zincludes.h"
 #endif
 
diff --git a/nczarr_test/test_unlim_io.c b/nczarr_test/test_unlim_io.c
index ed78c6a48..9f06fa685 100644
--- a/nczarr_test/test_unlim_io.c
+++ b/nczarr_test/test_unlim_io.c
@@ -9,7 +9,7 @@
 #include "ncpathmgr.h"
 #include "nclist.h"
 
-#ifdef ENABLE_NCZARR
+#ifdef NETCDF_ENABLE_NCZARR
 #include "zincludes.h"
 #endif
 
diff --git a/nczarr_test/zmapio.c b/nczarr_test/zmapio.c
index c0a285a80..396c88960 100644
--- a/nczarr_test/zmapio.c
+++ b/nczarr_test/zmapio.c
@@ -289,7 +289,7 @@ rootpathfor(const char* path)
     case NCZM_ZIP:
 	rootpath = strdup("/"); /*constant*/
 	break;
-#ifdef ENABLE_S3  
+#ifdef NETCDF_ENABLE_S3  
     case NCZM_S3: {
 	char* p = NULL;
         /* Split the path part */
diff --git a/test_common.in b/test_common.in
index 5f0f066db..38d6e5b34 100644
--- a/test_common.in
+++ b/test_common.in
@@ -40,7 +40,7 @@ FEATURE_S3_AWS=@HAS_S3_AWS@
 FEATURE_S3_INTERNAL=@HAS_S3_INTERNAL@
 FEATURE_S3=@HAS_S3@
 FEATURE_NCZARR=@HAS_NCZARR@
-FEATURE_S3TESTS=@ENABLE_S3_TESTING@
+FEATURE_S3TESTS=@NETCDF_ENABLE_S3_TESTING@
 FEATURE_NCZARR_ZIP=@DO_NCZARR_ZIP_TESTS@
 FEATURE_LARGE_TESTS=@DO_LARGE_TESTS@
 
diff --git a/unit_test/CMakeLists.txt b/unit_test/CMakeLists.txt
index 4110f9149..edfc16cbc 100644
--- a/unit_test/CMakeLists.txt
+++ b/unit_test/CMakeLists.txt
@@ -19,20 +19,20 @@ IF(USE_X_GETOPT)
   SET(XGETOPTSRC "${CMAKE_CURRENT_SOURCE_DIR}/../libdispatch/XGetopt.c")
 ENDIF()
 
-IF(ENABLE_HDF5)
+IF(NETCDF_ENABLE_HDF5)
   IF(NOT MSVC)
     add_bin_test(unit_test tst_nclist)
     add_bin_test(unit_test tst_nc4internal)
   ENDIF(NOT MSVC)
   build_bin_test(tst_reclaim ${XGETOPTSRC})
   add_sh_test(unit_test run_reclaim_tests)
-ENDIF(ENABLE_HDF5)
+ENDIF(NETCDF_ENABLE_HDF5)
 
 # Path convert test(s)
 add_bin_test(unit_test test_pathcvt)
 
-IF(BUILD_UTILITIES)
-  IF(ENABLE_S3 AND WITH_S3_TESTING)
+IF(NETCDF_BUILD_UTILITIES)
+  IF(NETCDF_ENABLE_S3 AND WITH_S3_TESTING)
   # SDK Test
     build_bin_test(test_s3sdk ${XGETOPTSRC})
     add_sh_test(unit_test run_s3sdk)
diff --git a/unit_test/Makefile.am b/unit_test/Makefile.am
index c159af91c..7f29e12cb 100644
--- a/unit_test/Makefile.am
+++ b/unit_test/Makefile.am
@@ -38,8 +38,8 @@ TESTS += tst_nc4internal
 TESTS += run_reclaim_tests.sh
 endif # USE_HDF5
 
-if ENABLE_S3
-if ENABLE_S3_TESTALL
+if NETCDF_ENABLE_S3
+if NETCDF_ENABLE_S3_TESTALL
 check_PROGRAMS += test_s3sdk
 TESTS += run_s3sdk.sh
 endif