CMake style

This commit is contained in:
Shahram Najm 2020-03-25 18:13:32 +00:00
parent 79677592cb
commit a45df08da7
2 changed files with 19 additions and 24 deletions

View File

@ -399,8 +399,7 @@ list( APPEND grib_api_srcs
grib_accessor_class_data_g2bifourier_packing.c grib_accessor_class_data_g2bifourier_packing.c
eccodes_windef.h eccodes_windef.h
# We ship our own generated lex/yacc C files # We ship our own generated lex/yacc C files
grib_yacc.c grib_lex.c grib_yacc.c grib_lex.c )
)
list( APPEND grib_api_extra_srcs list( APPEND grib_api_extra_srcs
grib_bits_fast_big_endian.c grib_bits_any_endian.c grib_bits_fast_big_endian.c grib_bits_any_endian.c
@ -410,8 +409,7 @@ list( APPEND grib_api_extra_srcs
encode_double_array.c encode_double_array.c
grib_bits_ibmpow.c grib_bits_ibmpow.c
grib_bits_ibmpow_opt.c grib_bits_ibmpow_opt.c
minmax_val.c minmax_val.c )
)
configure_file( grib_api_version.c.in grib_api_version.c @ONLY ) configure_file( grib_api_version.c.in grib_api_version.c @ONLY )
configure_file( eccodes_version.h.in eccodes_version.h @ONLY ) configure_file( eccodes_version.h.in eccodes_version.h @ONLY )
@ -426,19 +424,19 @@ configure_file( eccodes_version.h.in eccodes_version.h @ONLY )
# YACC_FLAGS "-y" # YACC_FLAGS "-y"
# DEPENDANT action.c ) # DEPENDANT action.c )
if(HAVE_MEMFS) if( HAVE_MEMFS )
list(APPEND ECCODES_EXTRA_LIBRARIES eccodes_memfs) list(APPEND ECCODES_EXTRA_LIBRARIES eccodes_memfs)
endif() endif()
ecbuild_add_library(TARGET eccodes ecbuild_add_library( TARGET eccodes
SOURCES grib_api_version.c SOURCES grib_api_version.c
# griby.c gribl.c # griby.c gribl.c
${grib_api_srcs} ${grib_api_srcs}
GENERATED grib_api_version.c GENERATED grib_api_version.c
LIBS ${ECCODES_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMATH_LIBRARIES} LIBS ${ECCODES_EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMATH_LIBRARIES}
TEMPLATES ${grib_api_extra_srcs} TEMPLATES ${grib_api_extra_srcs}
INSTALL_HEADERS_LIST INSTALL_HEADERS_LIST
grib_api.h grib_api.h
eccodes.h eccodes.h
eccodes_windef.h eccodes_windef.h

View File

@ -12,8 +12,7 @@
list( APPEND grib_tools_sources list( APPEND grib_tools_sources
grib_tools.c grib_tools.c
grib_options.c grib_options.c
grib_tools.h grib_tools.h )
)
if( EC_OS_NAME MATCHES "windows" ) if( EC_OS_NAME MATCHES "windows" )
list( APPEND grib_tools_sources wingetopt.c ) list( APPEND grib_tools_sources wingetopt.c )
@ -35,8 +34,7 @@ list( APPEND ecc_tools_binaries
bufr_ls bufr_dump bufr_set bufr_get bufr_ls bufr_dump bufr_set bufr_get
bufr_copy bufr_compare bufr_copy bufr_compare
gts_get gts_compare gts_copy gts_dump gts_filter gts_ls gts_get gts_compare gts_copy gts_dump gts_filter gts_ls
metar_dump metar_ls metar_compare metar_get metar_filter metar_copy metar_dump metar_ls metar_compare metar_get metar_filter metar_copy )
)
list( APPEND ecc_tools_binaries_extra list( APPEND ecc_tools_binaries_extra
big2gribex big2gribex
@ -44,8 +42,7 @@ list( APPEND ecc_tools_binaries_extra
grib_repair grib_repair
grib_to_json grib_to_json
grib_check_gaussian_grid grib_check_gaussian_grid
bufr_split_by_rdbSubtype bufr_split_by_rdbSubtype )
)
# Install generic tools # Install generic tools
foreach( tool ${ecc_tools_binaries} ) foreach( tool ${ecc_tools_binaries} )
@ -67,34 +64,34 @@ endforeach()
# grib_count/bufr_count etc. Same source code, different executable names # grib_count/bufr_count etc. Same source code, different executable names
ecbuild_add_executable( TARGET grib_count ecbuild_add_executable( TARGET grib_count
SOURCES codes_count.c SOURCES codes_count.c
LIBS grib_tools ) LIBS grib_tools )
ecbuild_add_executable( TARGET bufr_count ecbuild_add_executable( TARGET bufr_count
SOURCES codes_count.c SOURCES codes_count.c
LIBS grib_tools ) LIBS grib_tools )
ecbuild_add_executable( TARGET gts_count ecbuild_add_executable( TARGET gts_count
SOURCES codes_count.c SOURCES codes_count.c
LIBS grib_tools ) LIBS grib_tools )
# grib to netcdf is optional # grib to netcdf is optional
ecbuild_add_executable( TARGET grib_to_netcdf ecbuild_add_executable( TARGET grib_to_netcdf
SOURCES grib_to_netcdf.c SOURCES grib_to_netcdf.c
INCLUDES ${NETCDF_INCLUDE_DIRS} INCLUDES ${NETCDF_INCLUDE_DIRS}
CONDITION HAVE_NETCDF CONDITION HAVE_NETCDF
LIBS grib_tools ${NETCDF_LIBRARIES}) LIBS grib_tools ${NETCDF_LIBRARIES} )
ecbuild_add_executable( TARGET grib_list_keys ecbuild_add_executable( TARGET grib_list_keys
SOURCES list_keys.c SOURCES list_keys.c
CONDITION ECCODES_INSTALL_EXTRA_TOOLS CONDITION ECCODES_INSTALL_EXTRA_TOOLS
LIBS grib_tools ) LIBS grib_tools )
ecbuild_add_executable( TARGET codes_bufr_filter ecbuild_add_executable( TARGET codes_bufr_filter
SOURCES bufr_filter.c SOURCES bufr_filter.c
LIBS grib_tools ) LIBS grib_tools )
# grib1to2 script needs to be generated before installation # grib1to2 script needs to be generated before installation
if (ECCODES_INSTALL_EXTRA_TOOLS) if( ECCODES_INSTALL_EXTRA_TOOLS )
ecbuild_info("ECCODES_INSTALL_EXTRA_TOOLS enabled") ecbuild_info("ECCODES_INSTALL_EXTRA_TOOLS enabled")
configure_file( grib1to2.in grib1to2 ) configure_file( grib1to2.in grib1to2 )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/grib1to2 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/grib1to2