From 68c74bd807ebde3f96b627a322ced2e5a5affa30 Mon Sep 17 00:00:00 2001 From: Robert Osinski Date: Wed, 8 Mar 2023 16:07:05 +0000 Subject: [PATCH] CMake target set_latest_tables_version added --- samples/CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 2dbf37b46..d1d3fc607 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -4,6 +4,20 @@ 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} ) + + if(NOT HAVE_MEMFS) + add_custom_target(set_latest_tables_version) + add_custom_command(TARGET set_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} + ) + endif() + endif() foreach( tmpl ${samples_files} )