From 9ede6e4109ba664b835a73ddac4eeb9beadf1ff5 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Tue, 18 Aug 2020 13:57:08 -0500 Subject: [PATCH] Fortran an CXX NetCDF targets should depend on NetCDF_C --- Modules/FindNetCDF.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/FindNetCDF.cmake b/Modules/FindNetCDF.cmake index 1439ae8..64d0395 100644 --- a/Modules/FindNetCDF.cmake +++ b/Modules/FindNetCDF.cmake @@ -228,6 +228,9 @@ foreach( _comp IN LISTS _search_components ) IMPORTED_LOCATION ${NetCDF_${_comp}_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES "${NetCDF_${_comp}_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES ${NetCDF_${_comp}_LIBRARIES} ) + if( NOT _comp MATCHES "^(C)$" ) + target_link_libraries(NetCDF::NetCDF_${_comp} INTERFACE NetCDF::NetCDF_C) + endif() endif() endif() endforeach()