Skip to content

Commit

Permalink
Merge pull request #9 from JCSDA-internal/bugfix/link-pnetcdf
Browse files Browse the repository at this point in the history
properly link pnetcdf library
  • Loading branch information
Mark Miesch authored Jul 19, 2021
2 parents d53912f + 0240f0a commit 2150b19
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/Modules/FindPnetCDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ if(PnetCDF_Fortran_FOUND AND NOT TARGET PnetCDF::PnetCDF_Fortran)
set_property(TARGET PnetCDF::PnetCDF_Fortran APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PnetCDF_MODULE_DIR})
endif()
set(_new_components 1)
target_link_libraries(PnetCDF::PnetCDF_Fortran INTERFACE -lpnetcdf)
endif()

# PnetCDF::PnetCDF_C imported interface target
Expand All @@ -146,6 +147,7 @@ if(PnetCDF_C_FOUND AND NOT TARGET PnetCDF::PnetCDF_C)
set_target_properties(PnetCDF::PnetCDF_C PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${PnetCDF_INCLUDE_DIR}
INTERFACE_LINK_DIRECTORIES ${PnetCDF_LIB_DIR})
set(_new_components 1)
target_link_libraries(PnetCDF::PnetCDF_C INTERFACE -lpnetcdf)
endif()

# PnetCDF::PnetCDF_CXX imported interface target
Expand All @@ -154,6 +156,7 @@ if(PnetCDF_CXX_FOUND AND NOT TARGET PnetCDF::PnetCDF_CXX)
set_target_properties(PnetCDF::PnetCDF_CXX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${PnetCDF_INCLUDE_DIR}
INTERFACE_LINK_DIRECTORIES ${PnetCDF_LIB_DIR})
set(_new_components 1)
target_link_libraries(PnetCDF::PnetCDF_CXX INTERFACE -lpnetcdf)
endif()

## Print status
Expand Down

0 comments on commit 2150b19

Please sign in to comment.