Skip to content

Commit

Permalink
Remove upp lib dependency on ip, sp and w3nco (#269)
Browse files Browse the repository at this point in the history
* upp library does not depend on ip, sp and w3nco

* Remove find_dependency for ip, sp and w3nco in cmake/PackageConfig.cmake.in
  • Loading branch information
DusanJovic-NOAA authored Feb 28, 2021
1 parent 1d3d6ff commit 659f401
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
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}/@[email protected]")
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

0 comments on commit 659f401

Please sign in to comment.