Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake netCDF Compatibility with WPS #2121

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions cmake/template/WRFConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

@PACKAGE_INIT@

include( "${CMAKE_CURRENT_LIST_DIR}/@[email protected]" )

set( WRF_VERSION @PROJECT_VERSION@ )

# Options WRF was built with
Expand Down Expand Up @@ -37,6 +35,7 @@ set( WRF_BUILD_SBM_FAST @BUILD_SBM_FAST@ )
set( WRF_SHOW_ALL_VARS_USED @SHOW_ALL_VARS_USED@ )
set( WRF_WRFIO_NCD_NO_LARGE_FILE_SUPPORT @WRFIO_NCD_NO_LARGE_FILE_SUPPORT@ )

list( PREPEND CMAKE_MODULE_PATH @CMAKE_INSTALL_PREFIX@/share/ )

if ( ${WRF_USE_MPI} )
find_package( MPI REQUIRED COMPONENTS Fortran C )
Expand All @@ -46,9 +45,14 @@ if ( ${WRF_USE_OPENMP} )
find_package( OpenMP REQUIRED COMPONENTS Fortran C )
endif()

find_package( netCDF REQUIRED )
find_package( netCDF REQUIRED )
find_package( netCDF-Fortran REQUIRED )
# Attempt to find zlib packaged with netcdf first
set( ZLIB_ROOT ${netCDF_PREFIX} )
find_package( ZLIB REQUIRED )

check_required_components( "@EXPORT_NAME@_Core" )
list( POP_FRONT CMAKE_MODULE_PATH )

include( "${CMAKE_CURRENT_LIST_DIR}/@[email protected]" )

check_required_components( "@EXPORT_NAME@_Core" )