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 ecbuild_add_option( FEATURE GEOGRAPHY
DESCRIPTION "Support for Geoiterator and nearest neighbour" DESCRIPTION "Support for Geoiterator and nearest neighbour"
REQUIRED_PACKAGES eckit
DEFAULT ON ) DEFAULT ON )
if(HAVE_GEOGRAPHY)
find_library(ECKIT_GEO_LIB NAMES eckit_geo REQUIRED)
endif()
ecbuild_add_option( FEATURE JPG ecbuild_add_option( FEATURE JPG
DESCRIPTION "Support for JPG decoding/encoding" DESCRIPTION "Support for JPG decoding/encoding"
DEFAULT ON ) DEFAULT ON )

View File

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

View File

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