mirror of https://github.com/ecmwf/eccodes.git
GRIB-838: Make ifs_samples in build-dir symlinks
This commit is contained in:
parent
c2fc690c66
commit
ac172007ce
|
@ -1,3 +1,19 @@
|
|||
function( install_samples samples destination_install destination_build )
|
||||
set( _samples ${${samples}} )
|
||||
# To install the samples
|
||||
install( FILES ${_samples}
|
||||
DESTINATION ${destination_install}
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
|
||||
|
||||
# To symlink the samples to the build-dir for developers
|
||||
execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${destination_build} )
|
||||
foreach( _file ${_samples} )
|
||||
get_filename_component(_filename ${_file} NAME)
|
||||
execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
${_file} ${destination_build}/${_filename} )
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
add_subdirectory( grib1 )
|
||||
|
||||
add_subdirectory( grib1_mlgrib2 )
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
set( _basedir grib1 )
|
||||
set( _destination_install ${CMAKE_INSTALL_PREFIX}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
set( _destination_build ${CMAKE_BINARY_DIR}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
|
||||
list( APPEND ifs_samples_${_basedir}
|
||||
gg_ml.tmpl
|
||||
gg_sfc.tmpl
|
||||
sh_ml.tmpl
|
||||
sh_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl
|
||||
${ECCODES_SAMPLES_FILES}
|
||||
)
|
||||
|
||||
install( FILES ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir}
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
|
||||
|
||||
file( COPY ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
|
||||
# Also copy the ifs sample files to the build dir (for developer mode)
|
||||
file( COPY ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} )
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
set( _basedir grib1_mlgrib2 )
|
||||
set( _destination_install ${CMAKE_INSTALL_PREFIX}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
set( _destination_build ${CMAKE_BINARY_DIR}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
|
||||
list( APPEND ifs_samples_${_basedir}
|
||||
gg_ml.tmpl
|
||||
gg_sfc.tmpl
|
||||
sh_ml.tmpl
|
||||
sh_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl
|
||||
${ECCODES_SAMPLES_FILES}
|
||||
)
|
||||
|
||||
install( FILES ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir}
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
|
||||
|
||||
file( COPY ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
|
||||
# Also copy the ifs sample files to the build dir (for developer mode)
|
||||
file( COPY ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} )
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
set( _basedir grib1_mlgrib2_ieee32 )
|
||||
set( _destination_install ${CMAKE_INSTALL_PREFIX}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
set( _destination_build ${CMAKE_BINARY_DIR}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
|
||||
list( APPEND ifs_samples_${_basedir}
|
||||
gg_ml.tmpl
|
||||
gg_sfc.tmpl
|
||||
sh_ml.tmpl
|
||||
sh_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl
|
||||
${ECCODES_SAMPLES_FILES}
|
||||
)
|
||||
|
||||
install( FILES ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${ECCODES_IFS_SAMPLES_PATH}/${_basedir}
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
|
||||
|
||||
file( COPY ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/ifs_samples/${_basedir} )
|
||||
|
||||
# Also copy the ifs sample files to the build dir (for developer mode)
|
||||
file( COPY ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} )
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
set( _basedir grib1_mlgrib2_ieee64 )
|
||||
set( _destination_install ${CMAKE_INSTALL_PREFIX}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
set( _destination_build ${CMAKE_BINARY_DIR}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
|
||||
list( APPEND ifs_samples_${_basedir}
|
||||
gg_ml.tmpl
|
||||
gg_sfc.tmpl
|
||||
sh_ml.tmpl
|
||||
sh_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gg_sfc.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_ml.tmpl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sh_sfc.tmpl
|
||||
${ECCODES_SAMPLES_FILES}
|
||||
)
|
||||
|
||||
install( FILES ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir}
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ )
|
||||
|
||||
file( COPY ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_BINARY_DIR}/${ECCODES_IFS_SAMPLES_SUFF}/${_basedir} )
|
||||
|
||||
# Also copy the ifs sample files to the build dir (for developer mode)
|
||||
file( COPY ${ECCODES_SAMPLES_FILES} ${ifs_samples_${_basedir}}
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
install_samples( ifs_samples_${_basedir} ${_destination_install} ${_destination_build} )
|
||||
|
|
Loading…
Reference in New Issue