2015-03-16 11:02:13 +00:00
|
|
|
# data/bufr/CMakeLists.txt
|
2015-03-13 17:51:03 +00:00
|
|
|
# Download all the BUFR data and reference files from website
|
2014-07-04 14:33:32 +00:00
|
|
|
#
|
|
|
|
|
2020-03-30 13:07:31 +00:00
|
|
|
file(READ "bufr_data_files.txt" bufr_files_to_download)
|
2015-03-13 17:51:03 +00:00
|
|
|
# Convert file contents into a CMake list (where each element in the list
|
|
|
|
# is one line of the file)
|
2020-03-30 13:07:31 +00:00
|
|
|
string(REGEX REPLACE "\n" ";" bufr_files_to_download "${bufr_files_to_download}")
|
2015-03-13 17:51:03 +00:00
|
|
|
|
|
|
|
|
2020-03-30 13:07:31 +00:00
|
|
|
file(READ "bufr_ref_files.txt" bufr_refs_to_download)
|
|
|
|
string(REGEX REPLACE "\n" ";" bufr_refs_to_download "${bufr_refs_to_download}")
|
2015-01-23 16:51:32 +00:00
|
|
|
|
2015-12-22 16:53:02 +00:00
|
|
|
# Exceptional case: download bufr files which have to be treated specially
|
2023-02-26 15:07:26 +00:00
|
|
|
list(APPEND bufr_files_to_download "vos308014_v3_26.bufr") # See test ecc-197
|
2024-11-09 11:36:01 +00:00
|
|
|
list(APPEND bufr_files_to_download "bad.bufr") # See ECC-1938
|
2014-08-07 14:41:22 +00:00
|
|
|
|
2018-10-23 15:33:07 +00:00
|
|
|
if( ENABLE_EXTRA_TESTS )
|
|
|
|
ecbuild_get_test_multidata(
|
2023-02-26 15:07:26 +00:00
|
|
|
TARGET eccodes_download_bufrs
|
|
|
|
NOCHECK
|
|
|
|
NAMES ${bufr_files_to_download}
|
|
|
|
)
|
|
|
|
ecbuild_get_test_multidata(
|
|
|
|
TARGET eccodes_download_bufr_refs
|
|
|
|
NOCHECK
|
|
|
|
NAMES ${bufr_refs_to_download}
|
2018-10-23 15:33:07 +00:00
|
|
|
)
|
|
|
|
endif()
|
2015-03-13 17:51:03 +00:00
|
|
|
|
|
|
|
# Copy other files - e.g. text files etc from the source data/bufr dir
|
2020-03-30 13:07:31 +00:00
|
|
|
list(APPEND other_files
|
2015-03-13 17:51:03 +00:00
|
|
|
bufr_data_files.txt
|
|
|
|
bufr_ref_files.txt
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach( file ${other_files} )
|
|
|
|
execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} )
|
|
|
|
endforeach()
|