Skip to content

Commit fc7b38c

Browse files
committed
Add dependency constraints and definitions
1 parent 1b758c3 commit fc7b38c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ endif()
483483

484484
# Find this first in case we need to use pnetcdf's netCDF
485485
# Priority is given to pnetcdf due to performance
486-
find_package( PnetCDF QUIET )
486+
if ( ${USE_MPI} )
487+
find_package( PnetCDF QUIET )
488+
endif()
487489

488490
# Included is a lightweight finder, but we really should switch to using UniData's netCDF cmake config
489491
# The reason these are two separate and not COMPONENTS of one larger package is because that is the way UniData
@@ -723,6 +725,13 @@ else()
723725
list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS WRF_USE_CLM )
724726
endif()
725727

728+
if ( ${PnetCDF_FOUND} )
729+
list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS PNETCDF )
730+
endif()
731+
if ( ${ENABLE_PNETCDF_QUILT} )
732+
list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS PNETCDF_QUILT=1 )
733+
endif()
734+
726735
# If force classic or no nc-4 support enable classic
727736
if ( ${FORCE_NETCDF_CLASSIC} OR ( NOT ${netCDF_HAS_NC4} ) )
728737
list( APPEND PROJECT_COMPILE_DEFINITIONS_OPTIONS NETCDF_classic=1 )

cmake/modules/FindPnetCDF.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ find_package_handle_standard_args(
105105

106106
if ( PnetCDF_FOUND AND NOT TARGET PnetCDF::pnetcdf )
107107
if ( ${PnetCDF_HAS_NETCDF4} )
108-
message( STATUS "Will try to find netCDF from PnetCDF ldflags..." )
109108
list( APPEND CMAKE_MESSAGE_INDENT " " )
110109
if ( NOT "${PnetCDF_LDFLAGS}" STREQUAL "" )
111110
# Find prefix

0 commit comments

Comments
 (0)