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

Remove upp lib dependency on ip, sp and w3nco #269

Merged
merged 2 commits into from
Feb 28, 2021
Merged
Show file tree
Hide file tree
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
19 changes: 9 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,19 @@ if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()


find_package(w3nco REQUIRED)
find_package(g2 REQUIRED)
find_package(g2tmpl REQUIRED)
find_package(bacio REQUIRED)
find_package(ip REQUIRED)
find_package(sp REQUIRED)
find_package(crtm REQUIRED)
find_package(g2 REQUIRED)
find_package(g2tmpl REQUIRED)

if(BUILD_POSTEXEC)
find_package(sigio REQUIRED)
find_package(sfcio REQUIRED)
find_package(nemsio REQUIRED)
find_package(gfsio REQUIRED)
find_package(ip REQUIRED)
find_package(nemsio REQUIRED)
find_package(sfcio REQUIRED)
find_package(sigio REQUIRED)
find_package(sp REQUIRED)
find_package(w3nco REQUIRED)
if(BUILD_WITH_WRFIO)
find_package(wrf_io REQUIRED)
endif()
Expand All @@ -62,6 +61,6 @@ add_subdirectory(parm)
# If desired, build the doxygen docs.
if(ENABLE_DOCS)
find_package(Doxygen REQUIRED)
add_subdirectory(docs)
add_subdirectory(docs)
endif()

19 changes: 9 additions & 10 deletions cmake/PackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,26 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-config-version.cmake")
include(CMakeFindDependencyMacro)

find_dependency(MPI)
find_dependency(NetCDF COMPONENTS Fortran)

# ON/OFF implies @PROJECT_NAME@ was compiled with/without OpenMP
if(@OPENMP@)
find_dependency(OpenMP COMPONENTS Fortran)
endif()

find_dependency(NetCDF COMPONENTS Fortran)

find_dependency(w3nco CONFIG)
find_dependency(g2 CONFIG)
find_dependency(g2tmpl CONFIG)
find_dependency(bacio CONFIG)
find_dependency(ip CONFIG)
find_dependency(sp CONFIG)
find_dependency(crtm CONFIG)
find_dependency(g2 CONFIG)
find_dependency(g2tmpl CONFIG)

# nceppost library does not depend on these, the executable does.
#find_dependency(sigio CONFIG)
#find_dependency(sfcio CONFIG)
#find_dependency(nemsio CONFIG)
#find_dependency(gfsio CONFIG)
#find_dependency(ip CONFIG)
#find_dependency(nemsio CONFIG)
#find_dependency(sfcio CONFIG)
#find_dependency(sigio CONFIG)
#find_dependency(sp CONFIG)
#find_dependency(w3nco CONFIG)

# Get the build type from library target
get_target_property(@PROJECT_NAME@_BUILD_TYPES @PROJECT_NAME@::@PROJECT_NAME@ IMPORTED_CONFIGURATIONS)
Expand Down
8 changes: 3 additions & 5 deletions sorc/ncep_post.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,9 @@ target_link_libraries(${LIBNAME} PUBLIC
crtm::crtm
g2::g2_4
g2tmpl::g2tmpl
ip::ip_4
MPI::MPI_Fortran
NetCDF::NetCDF_Fortran)

target_link_libraries(${LIBNAME} PRIVATE
sp::sp_4
w3nco::w3nco_4)

if(OpenMP_Fortran_FOUND)
target_link_libraries(${LIBNAME} PUBLIC OpenMP::OpenMP_Fortran)
endif()
Expand All @@ -221,7 +216,10 @@ if(BUILD_POSTEXEC)
target_link_libraries(${EXENAME} PRIVATE
${LIBNAME}
gfsio::gfsio
w3nco::w3nco_4
nemsio::nemsio
ip::ip_4
sp::sp_4
sfcio::sfcio
sigio::sigio)
if(wrf_io_FOUND)
Expand Down