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} )