Skip to content
Snippets Groups Projects
Commit aadde2aa authored by Mathieu Westphal's avatar Mathieu Westphal
Browse files

CMake: Fix HAVE_LIBGRIB_API and HAVE_LIBGRIB compile definition

parent b9a7b1f0
No related branches found
No related tags found
2 merge requests!143CMake: Fix HAVE_LIBGRIB_API and HAVE_LIBGRIB compile definition,!138CMake: Fix HAVE_LIBGRIB_API and HAVE_LIBGRIB compile definition
Pipeline #99449 passed
......@@ -22,7 +22,9 @@ endif()
# enable default internal libs
option(CDI_LIBGRIB "GRIB support [default=ON]" ON)
if(${CDI_LIBGRIB})
list(APPEND cdi_compile_defs HAVE_LIBGRIB=1)
list(APPEND cdi_compile_defs
HAVE_LIBGRIB=1
HAVE_LIBGRIB_API=1)
endif()
option(CDI_LIBGRIBEX "Use the CGRIBEX library [default=ON]" ON)
......@@ -50,8 +52,6 @@ option(CDI_ECCODES "Use the eccodes library [default=ON]" ON)
if(${CDI_ECCODES} OR eccodes_ROOT)
find_package(eccodes)
if (${eccodes_FOUND})
list(APPEND cdi_compile_defs HAVE_LIBGRIB_API=${eccodes_FOUND})
message(VERBOSE "added compile definition HAVE_LIBGRIB_API=${eccodes_FOUND}")
list(APPEND cdi_linked_libs eccodes)
else()
message(WARNING "eccodes not found, compiling without eccodes")
......@@ -67,8 +67,6 @@ if(${CDI_NETCDF} OR netCDF_ROOT )
HAVE_LIBNETCDF=${netCDF_FOUND}
HAVE_LIBNC_DAP=${netCDF_FOUND}
HAVE_NETCDF4=${netCDF_FOUND}
HAVE_LIBGRIB_API=${netCDF_FOUND}
HAVE_LIBGRIB=${netCDF_FOUND}
)
list(APPEND cdi_linked_libs netCDF::netcdf)
else()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment