Skip to content

Commit

Permalink
fix modern Netcdf import (TriBITSPub/TriBITS#533)
Browse files Browse the repository at this point in the history
1. don't expect HDF5 target to be set.
   in the general case, Netcdf may not use HDF5,
   but also HDF5 has no predictable catch-all target
2. TPL_Netcdf_NOT_FOUND still has to be manually set
   to FALSE
  • Loading branch information
ibaned committed Oct 24, 2022
1 parent 2665240 commit 1312a36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/tribits/common_tpls/FindTPLNetcdf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif()

set(Netcdf_ALLOW_MODERN FALSE CACHE BOOL "Allow finding Netcdf as a modern CMake config file with exported targets (and only this way)")

if (Netcdf_ALLOW_MODERN AND TARGET HDF5::HDF5)
if (Netcdf_ALLOW_MODERN)

set(minimum_modern_netCDF_version 4.7.4)
print_var(Netcdf_ALLOW_MODERN)
Expand All @@ -56,6 +56,7 @@ if (Netcdf_ALLOW_MODERN AND TARGET HDF5::HDF5)
Netcdf
INNER_FIND_PACKAGE_NAME netCDF
IMPORTED_TARGETS_FOR_ALL_LIBS netCDF::netcdf)
set(TPL_Netcdf_NOT_FOUND FALSE)
endif()

endif()
Expand Down

0 comments on commit 1312a36

Please sign in to comment.