eccodes/data/metar/CMakeLists.txt

30 lines
997 B
CMake
Raw Permalink Normal View History

2015-04-10 12:39:03 +00:00
# data/metar/CMakeLists.txt
# Download all the METAR data and reference files from website
#
2020-03-30 13:07:31 +00:00
file(READ "metar_data_files.txt" metar_files_to_download)
2015-04-10 12:39: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" ";" metar_files_to_download "${metar_files_to_download}")
2015-04-10 12:39:03 +00:00
2020-03-30 13:07:31 +00:00
file(READ "metar_ref_files.txt" metar_refs_to_download)
string(REGEX REPLACE "\n" ";" metar_refs_to_download "${metar_refs_to_download}")
2015-04-10 12:39:03 +00:00
2018-10-23 15:33:07 +00:00
if( ENABLE_EXTRA_TESTS )
ecbuild_get_test_multidata(
TARGET eccodes_download_metars
NOCHECK
NAMES ${metar_files_to_download} ${metar_refs_to_download}
)
endif()
2015-04-10 12:39:03 +00:00
# Copy other files - e.g. text files etc from the source data/metar dir
2020-03-30 13:07:31 +00:00
list(APPEND other_files
2015-04-10 12:39:03 +00:00
metar_data_files.txt
metar_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()