Skip to content

Commit

Permalink
Link netCDF-C via pkgconfig (#78)
Browse files Browse the repository at this point in the history
* Add verbose fetchcontent output when FETCHCONTENT_QUIET is set to false

* Added a call to look for the netCDF-C library, to avoid unresolved references when linking against a static libnetcdf-fortran.

* Reverse linking order to address/fix failure on Ubuntu linux, ARM64
  • Loading branch information
WardF authored May 21, 2024
1 parent c8e2ef6 commit 9900942
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ endif()
# NetCDF library

find_package(PkgConfig REQUIRED)



pkg_check_modules(netcdff IMPORTED_TARGET REQUIRED netcdf-fortran)
pkg_check_modules(netcdfc IMPORTED_TARGET REQUIRED netcdf)



################################################################################
# yaml-cpp
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ message(STATUS "lapack libraries: ${LAPACK_LIBRARIES}")
target_link_libraries(tuvx_object
PRIVATE
PkgConfig::netcdff
PkgConfig::netcdfc
yaml-cpp::yaml-cpp
)

Expand Down

0 comments on commit 9900942

Please sign in to comment.