Skip to content

Commit

Permalink
Ensure NetCDF and OpenMP are included when building shared lib
Browse files Browse the repository at this point in the history
  • Loading branch information
stackjohn authored Oct 17, 2024
1 parent f03f544 commit a4c8a43
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wgrib2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ set_target_properties(wgrib2_exe PROPERTIES OUTPUT_NAME wgrib2)

if(USE_NETCDF)
target_link_libraries(obj_lib PUBLIC NetCDF::NetCDF_C)
if(BUILD_SHARED_LIB)
target_link_libraries(wgrib2_lib PUBLIC NetCDF::NetCDF_C)
target_link_libraries(wgrib2_exe PUBLIC NetCDF::NetCDF_C)
endif()
endif()

if(USE_PNG)
Expand All @@ -94,6 +98,9 @@ endif()

if(OpenMP_C_FOUND)
target_link_libraries(obj_lib PUBLIC OpenMP::OpenMP_C)
if(BUILD_SHARED_LIB)
target_link_libraries(wgrib2_lib PUBLIC OpenMP::OpenMP_C)
endif()
endif()

if(USE_IPOLATES)
Expand Down

0 comments on commit a4c8a43

Please sign in to comment.