diff --git a/CMakeLists.txt b/CMakeLists.txt index d0dc010bd1c..7227f87edc6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,9 @@ CHECK_C_SOURCE_COMPILES(" choke me #endif int main() {return 0;}" HAVE_NETCDF_PAR) +if (HAVE_NETCDF_PAR) + set(_NETCDF4 1) +endif () ### # Check to see if szip write capability is present in netcdf-c. diff --git a/cmake_config.h.in b/cmake_config.h.in index b7ed181b372..943da4d0939 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -30,6 +30,9 @@ #define USE_VARD @USE_VARD@ +#cmakedefine HAVE_NETCDF4 +#cmakedefine HAVE_NETCDF_PAR + /* Does netCDF and HDF5 support parallel I/O filters? */ #cmakedefine HAVE_PAR_FILTERS diff --git a/src/clib/CMakeLists.txt b/src/clib/CMakeLists.txt index 8380701c93c..59e0aebc930 100644 --- a/src/clib/CMakeLists.txt +++ b/src/clib/CMakeLists.txt @@ -98,10 +98,10 @@ if (NetCDF_C_FOUND) # PUBLIC _NETCDF) target_link_libraries (pioc PUBLIC ${NetCDF_C_LIBRARIES}) - # if (${NetCDF_C_HAS_PARALLEL}) + if (${NetCDF_C_HAS_PARALLEL}) # target_compile_definitions (pioc # PUBLIC _NETCDF4) - # endif () + endif () if (${NetCDF_C_LOGGING_ENABLED}) target_compile_definitions (pioc PUBLIC NETCDF_C_LOGGING_ENABLED)