CMake target set_latest_tables_version added

This commit is contained in:
Robert Osinski 2023-03-08 16:07:05 +00:00 committed by shahramn
parent c85e5cb124
commit 68c74bd807
1 changed files with 14 additions and 0 deletions

View File

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