CMake: Require pnetcdf if requested

This commit is contained in:
Peter Hill 2024-01-17 16:19:19 +00:00
parent 20954a7e1b
commit 425d38ac4f
No known key found for this signature in database
GPG Key ID: 0C6B9742E72848EE

View File

@ -631,13 +631,8 @@ ENDIF(ENABLE_LIBXML2)
# parallel IO # parallel IO
################################ ################################
IF(ENABLE_PNETCDF) IF(ENABLE_PNETCDF)
find_package(PNETCDF 1.6.0) find_package(PNETCDF 1.6.0 REQUIRED)
IF(PNETCDF_FOUND) set(USE_PNETCDF ON CACHE BOOL "")
set(USE_PNETCDF ON CACHE BOOL "")
else()
message(STATUS "Cannot find PnetCDF library. Disabling PnetCDF support.")
set(USE_PNETCDF OFF CACHE BOOL "")
ENDIF()
include_directories(${PNETCDF_INCLUDE_DIR}) include_directories(${PNETCDF_INCLUDE_DIR})
ENDIF() ENDIF()