From 7a1ec07da58d41dee04a7a126d21e27ec4b68f2f Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Fri, 1 Mar 2024 15:04:21 -0700 Subject: [PATCH] hydro: fixing nudging in the CMake files so flags get passed and dependencies are set up correctly --- hydro/CMakeLists.txt | 14 ++++++++------ hydro/OrchestratorLayer/CMakeLists.txt | 12 ++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/hydro/CMakeLists.txt b/hydro/CMakeLists.txt index 5394ed616f..ee756e71ac 100644 --- a/hydro/CMakeLists.txt +++ b/hydro/CMakeLists.txt @@ -19,6 +19,12 @@ add_subdirectory("Routing") add_subdirectory("HYDRO_drv") add_subdirectory("CPL/WRF_cpl") +if (WRF_HYDRO_NUDGING STREQUAL "1") + add_subdirectory("nudging") + add_dependencies(hydro_routing hydro_nudging) + add_dependencies(hydro_driver hydro_nudging) +endif() + # add module dependencies add_dependencies(hydro_debug_utils hydro_mpp) add_dependencies(hydro_utils hydro_mpp) @@ -37,11 +43,6 @@ add_dependencies(hydro_routing add_dependencies(hydro_routing_reservoirs_hybrid hydro_routing_reservoirs_levelpool) add_dependencies(hydro_routing_overland hydro_mpp) -if (WRF_HYDRO_NUDGING STREQUAL "1") - add_dependencies(hydro_driver hydro_nudging) - add_subdirectory("nudging") -endif() - # currently unused Routing/Groundwater directory # add_subdirectory("Routing/Groundwater") # add_dependencies(hydro_routing @@ -66,7 +67,8 @@ add_dependencies(hydro_driver hydro_debug_utils ) -add_dependencies(hydro_data_rec hydro_routing_overland +add_dependencies(hydro_data_rec + hydro_routing_overland hydro_routing_subsurface hydro_routing_reservoirs ) diff --git a/hydro/OrchestratorLayer/CMakeLists.txt b/hydro/OrchestratorLayer/CMakeLists.txt index ac4dccd4b4..c0e1f4ad9d 100644 --- a/hydro/OrchestratorLayer/CMakeLists.txt +++ b/hydro/OrchestratorLayer/CMakeLists.txt @@ -5,8 +5,12 @@ add_library(hydro_orchestrator STATIC orchestrator.F90 ) -add_dependencies(hydro_orchestrator hydro_netcdf_layer) -add_dependencies(hydro_orchestrator hydro_utils) +add_dependencies(hydro_orchestrator + hydro_netcdf_layer + hydro_utils +) -target_link_libraries(hydro_orchestrator PUBLIC hydro_netcdf_layer) -target_link_libraries(hydro_orchestrator PUBLIC hydro_utils) +target_link_libraries(hydro_orchestrator PRIVATE + hydro_netcdf_layer + hydro_utils +)