From 659f4010be1dbc6841c559cda4ba696af5720717 Mon Sep 17 00:00:00 2001 From: Dusan Jovic <48258889+DusanJovic-NOAA@users.noreply.github.com> Date: Sat, 27 Feb 2021 20:02:05 -0500 Subject: [PATCH] Remove upp lib dependency on ip, sp and w3nco (#269) * upp library does not depend on ip, sp and w3nco * Remove find_dependency for ip, sp and w3nco in cmake/PackageConfig.cmake.in --- CMakeLists.txt | 19 +++++++++---------- cmake/PackageConfig.cmake.in | 19 +++++++++---------- sorc/ncep_post.fd/CMakeLists.txt | 8 +++----- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef64017e9..17b5baff9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() @@ -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() diff --git a/cmake/PackageConfig.cmake.in b/cmake/PackageConfig.cmake.in index bf61d352b..a68d8369b 100644 --- a/cmake/PackageConfig.cmake.in +++ b/cmake/PackageConfig.cmake.in @@ -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) diff --git a/sorc/ncep_post.fd/CMakeLists.txt b/sorc/ncep_post.fd/CMakeLists.txt index 61094eb48..8c983e382 100644 --- a/sorc/ncep_post.fd/CMakeLists.txt +++ b/sorc/ncep_post.fd/CMakeLists.txt @@ -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() @@ -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)