Skip to content

Commit

Permalink
adding support for NETCDF_INTEGRATION option to cmake, also fixing cm…
Browse files Browse the repository at this point in the history
…ake build issue in read-only directories
  • Loading branch information
edwardhartnett committed Aug 10, 2020
1 parent 116cd6e commit 52ac327
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ option (PIO_ENABLE_LOGGING "Enable debug logging (large output possible)" OFF)
option (PIO_ENABLE_DOC "Enable building PIO documentation" ON)
option (PIO_ENABLE_COVERAGE "Enable code coverage" OFF)
option (PIO_ENABLE_EXAMPLES "Enable PIO examples" ON)
option (PIO_ENABLE_NETCDF_INTEGRATION "Enable netCDF integration (netcdf-c-4.7.4 or later required)" ON)
option (PIO_INTERNAL_DOC "Enable PIO developer documentation" OFF)
option (PIO_TEST_BIG_ENDIAN "Enable test to see if machine is big endian" ON)
option (PIO_USE_MPIIO "Enable support for MPI-IO auto detect" ON)
Expand Down Expand Up @@ -106,6 +107,13 @@ else()
set(ENABLE_LOGGING 0)
endif()

# Set a variable that appears in the config.h.in file.
if(PIO_ENABLE_NETCDF_INTEGRATION)
set(NETCDF_INTEGRATION 1)
else()
set(NETCDF_INTEGRATION 0)
endif()

if(PIO_USE_MPISERIAL)
set(USE_MPI_SERIAL 1)
else()
Expand Down Expand Up @@ -416,7 +424,7 @@ INSTALL(FILES "${PIO_BINARY_DIR}/libpio.settings"
#####
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/clib/pio_meta.h.in
${CMAKE_CURRENT_SOURCE_DIR}/src/clib/pio_meta.h @ONLY)
${CMAKE_CURRENT_BINARY_DIR}/src/clib/pio_meta.h @ONLY)

FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/clib/pio_meta.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src/clib/)
# FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/clib/pio_meta.h
# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src/clib/)
2 changes: 2 additions & 0 deletions cmake_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@

#define HAVE_PAR_FILTERS @HAVE_PAR_FILTERS@

#define NETCDF_INTEGRATION @NETCDF_INTEGRATION@

#endif /* _PIO_CONFIG_ */

0 comments on commit 52ac327

Please sign in to comment.