From c4b2a8687bce4d325aa580618642c4dce732c009 Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Thu, 9 Mar 2023 08:33:32 +0000 Subject: [PATCH] grib2 ifs_samples added to set latest version target --- samples/CMakeLists.txt | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index d1d3fc607..f35ae6fd1 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -4,18 +4,35 @@ if(HAVE_INSTALL_ECCODES_SAMPLES) install( FILES ${samples_files} DESTINATION ${ECCODES_SAMPLES_SUFF} PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) - -# # copy script installSamples.sh to samples folder -# install( PROGRAMS installSamples.sh DESTINATION ${ECCODES_SAMPLES_SUFF} ) - + # set to the newest GRIB2 tablesVersion if(NOT HAVE_MEMFS) - add_custom_target(set_latest_tables_version) - add_custom_command(TARGET set_latest_tables_version + add_custom_target(set_grib2_latest_tables_version) + add_custom_command(TARGET set_grib2_latest_tables_version POST_BUILD COMMAND bash -c "cd ${CMAKE_INSTALL_PREFIX}/${ECCODES_SAMPLES_SUFF}; for F in GRIB2.tmpl *_grib2.tmpl ; do grib_set -s tablesVersion=30 $F tmp; mv tmp $F; done" VERBATIM WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${ECCODES_SAMPLES_SUFF} ) + add_custom_command(TARGET set_grib2_latest_tables_version + POST_BUILD + COMMAND bash -c "cd ${CMAKE_INSTALL_PREFIX}/share/eccodes/ifs_samples/grib1_mlgrib2; for F in *_ml.tmpl ; do grib_set -s tablesVersion=30 $F tmp; mv tmp $F; done" + VERBATIM + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${ECCODES_SAMPLES_SUFF} + ) + add_custom_command(TARGET set_grib2_latest_tables_version + POST_BUILD + COMMAND bash -c "cd ${CMAKE_INSTALL_PREFIX}/share/eccodes/ifs_samples/grib1_mlgrib2_ieee64; for F in *_ml.tmpl ; do grib_set -s tablesVersion=30 $F tmp; mv tmp $F; done" + VERBATIM + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${ECCODES_SAMPLES_SUFF} + ) + if(HAVE_AEC) + add_custom_command(TARGET set_grib2_latest_tables_version + POST_BUILD + COMMAND bash -c "cd ${CMAKE_INSTALL_PREFIX}/share/eccodes/ifs_samples/grib1_mlgrib2_ccsds; for F in *_ml.tmpl gg_sfc_grib2.tmpl ; do grib_set -s tablesVersion=30 $F tmp; mv tmp $F; done" + VERBATIM + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${ECCODES_SAMPLES_SUFF} + ) + endif() endif() endif()