Skip to content

Commit

Permalink
fixing CMake determination of _NETCDF4
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Aug 27, 2020
1 parent 843f6d9 commit 510e955
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions cmake_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/clib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 510e955

Please sign in to comment.