Closed mer-a-o closed 4 years ago
I agree with @wdeconinck that this should use full URL's instead of NAMES and DIRHOST
I don't see the need for 2 macros. I would only provide externally the ecbuild_check_multiurls that would use a list as input. And then rename to ecbuild_check_urls() (note the plural).
@wdeconinck and @tlmquintino thanks for reviewing these changes. I address your comments and all tests pass for me.
@oiffrig, thanks for your review. I addressed them in my latest commit.
Thanks @mer-a-o for the changes. In the current state this does not work if neither curl nor wget is found, and despite being working CMake code, I would prefer not having to use interleaved if / foreach. What I would suggest doing is:
find_program( CURL_PROGRAM curl )
if( NOT CURL_PROGRAM )
find_program( WGET_PROGRAM wget )
if( NOT WGET_PROGRAM )
# warn and exit
endif()
endif()
foreach( NAME ${_p_NAMES} )
if( CURL_PROGRAM )
# download with curl
else()
# download with wget
endif()
endforeach()
@benjaminmenetrier, can you please check the new changes in ecbuild_check_urls.cmake
?
This PR adds more capabilities to
cmake/ecbuild_get_test_data.cmake
. It also addscmake/ecbuild_check_url.cmake
which will check whether a given URL is available.