diff --git a/CMakeLists.txt b/CMakeLists.txt index 6022f41f0..47dc4d1bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,9 +108,16 @@ target_include_directories(fv3dycore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/atmos_c target_include_directories(fv3dycore INTERFACE $ $) -target_link_libraries(fv3dycore PUBLIC fms - gfsphysics - esmf) +if(32BIT) + target_link_libraries(fv3dycore PUBLIC FMS::fms_r4 + gfsphysics + esmf) +else() + target_link_libraries(fv3dycore PUBLIC FMS::fms_r8 + gfsphysics + esmf) +endif() + if(OpenMP_Fortran_FOUND) target_link_libraries(fv3dycore PUBLIC OpenMP::OpenMP_Fortran) endif() diff --git a/io/CMakeLists.txt b/io/CMakeLists.txt index 88dab6c09..784ff5528 100644 --- a/io/CMakeLists.txt +++ b/io/CMakeLists.txt @@ -31,9 +31,15 @@ set_target_properties(io PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BIN target_compile_definitions(io PRIVATE "${_io_defs_private}") target_include_directories(io PUBLIC $) -target_link_libraries(io PRIVATE fms - gfsphysics - ccppdriver) +if(32BIT) + target_link_libraries(io PRIVATE FMS::fms_r4 + gfsphysics + ccppdriver) +else() + target_link_libraries(io PRIVATE FMS::fms_r8 + gfsphysics + ccppdriver) +endif() if(INLINE_POST) target_link_libraries(io PRIVATE upp::upp) diff --git a/stochastic_physics/CMakeLists.txt b/stochastic_physics/CMakeLists.txt index aed983669..6e7dfc40e 100644 --- a/stochastic_physics/CMakeLists.txt +++ b/stochastic_physics/CMakeLists.txt @@ -4,10 +4,17 @@ target_include_directories(stochastic_physics_wrapper PRIVATE ${CMAKE_BINARY_DIR target_include_directories(stochastic_physics_wrapper PRIVATE ${CMAKE_BINARY_DIR}/FV3/ccpp/framework/src ${CMAKE_BINARY_DIR}/FV3/ccpp/physics) target_include_directories(stochastic_physics_wrapper PUBLIC $) -target_link_libraries(stochastic_physics_wrapper PUBLIC fms - stochastic_physics - gfsphysics - fv3dycore) +if(32BIT) + target_link_libraries(stochastic_physics_wrapper PUBLIC FMS::fms_r4 + stochastic_physics + gfsphysics + fv3dycore) +else() + target_link_libraries(stochastic_physics_wrapper PUBLIC FMS::fms_r8 + stochastic_physics + gfsphysics + fv3dycore) +endif() if(OpenMP_Fortran_FOUND) target_link_libraries(stochastic_physics_wrapper PUBLIC OpenMP::OpenMP_Fortran)