eckit::geo

This commit is contained in:
Pedro Maciel 2024-10-10 15:09:24 +01:00
parent ce9f551eee
commit d6026065e7
3 changed files with 21 additions and 13 deletions

View File

@ -110,8 +110,13 @@ ecbuild_add_option( FEATURE BUILD_TOOLS
ecbuild_add_option( FEATURE GEOGRAPHY
DESCRIPTION "Support for Geoiterator and nearest neighbour"
REQUIRED_PACKAGES eckit
DEFAULT ON )
if(HAVE_GEOGRAPHY)
find_library(ECKIT_GEO_LIB NAMES eckit_geo REQUIRED)
endif()
ecbuild_add_option( FEATURE JPG
DESCRIPTION "Support for JPG decoding/encoding"
DEFAULT ON )

View File

@ -407,9 +407,10 @@ if( HAVE_MEMFS )
list(APPEND ECCODES_EXTRA_LIBRARIES eccodes_memfs)
endif()
list( APPEND eccodes_src_files
eccodes/geo/GribSpec.cc
eccodes/geo/GribSpec.h )
if(HAVE_GEOGRAPHY)
list(APPEND eccodes_src_files eccodes/geo/GribSpec.cc eccodes/geo/GribSpec.h)
list(APPEND ECCODES_EXTRA_LIBRARIES eckit_geo)
endif()
ecbuild_add_library( TARGET eccodes
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/grib_api_version.cc
@ -418,7 +419,7 @@ ecbuild_add_library( TARGET eccodes
#PRIVATE_LIBS ${ECCODES_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMATH_LIBRARIES}
PRIVATE_INCLUDES "${AEC_INCLUDE_DIRS}" "${PNG_INCLUDE_DIRS}"
PRIVATE_LIBS ${ECCODES_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${AEC_LIBRARIES} ${PNG_LIBRARIES}
PUBLIC_LIBS ${CMATH_LIBRARIES} ${THREADS_LIBRARIES} eckit_geo
PUBLIC_LIBS ${CMATH_LIBRARIES} ${THREADS_LIBRARIES}
TEMPLATES ${eccodes_extra_src_files}
INSTALL_HEADERS_LIST
grib_api.h

View File

@ -1,10 +1,12 @@
foreach( _test
grid_healpix
grid_lambert
grid_polar_stereographic )
ecbuild_add_test(
TARGET eccodes_tests_unit_${_test}
SOURCES ${_test}.cc
LIBS eccodes )
endforeach()
if(HAVE_GEOGRAPY)
foreach( _test
grid_healpix
grid_lambert
grid_polar_stereographic )
ecbuild_add_test(
TARGET eccodes_tests_unit_${_test}
SOURCES ${_test}.cc
LIBS eccodes eckit_geo )
endforeach()
endif()