GRIB-711: CMake build: should not need to download data to compile

This commit is contained in:
Shahram Najm 2015-03-10 15:52:33 +00:00
parent fd2531c7cf
commit 549fc7fa3a
7 changed files with 24 additions and 45 deletions

View File

@ -95,15 +95,10 @@ if( HAVE_AEC )
LIST(APPEND files_to_download ccsds.grib2)
endif()
foreach( f ${files_to_download} )
set(tgt data_${f})
# Download the file and create a dummy target for it
ecbuild_get_test_data(TARGET "${tgt}" NAME "${f}" DIRNAME ${PROJECT_NAME}/data NOCHECK)
# Add to list of targets
LIST(APPEND tgts "${tgt}")
endforeach()
ecbuild_get_test_multidata( TARGET get_gribs
NOCHECK
NAMES ${files_to_download}
)
# Copy other files - e.g. reference data, text files etc from the source data dir
LIST(APPEND other_files
@ -151,7 +146,3 @@ foreach( file ${other_files} )
execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} )
endforeach()
# debug_var(tgts)
# Another dummy target which depends on all previous targets
#add_custom_target( get_gribs ALL DEPENDS ${tgts} )
add_custom_target( get_gribs DEPENDS ${tgts} )

View File

@ -412,17 +412,8 @@ set(bufr_refs_to_download
syno_multi.bufr
)
foreach( f ${bufr_files_to_download} ${bufr_refs_to_download} )
set(tgt bufr_data_${f})
# Download the file and create a dummy target for it
ecbuild_get_test_data(TARGET "${tgt}"
NAME "${f}"
DIRNAME ${PROJECT_NAME}/data/bufr
NOCHECK)
# Add to list of targets
LIST(APPEND tgts "${tgt}")
endforeach()
add_custom_target( get_bufrs DEPENDS ${tgts} )
ecbuild_get_test_multidata(
TARGET get_bufrs
NOCHECK
NAMES ${bufr_files_to_download} ${bufr_refs_to_download}
)

View File

@ -244,17 +244,7 @@ set(tigge_files_to_download
tiggelam_cnmc_sfc.grib
)
foreach( f ${tigge_files_to_download} )
set(tgt tigge_data_${f})
# Download the file and create a dummy target for it
ecbuild_get_test_data(TARGET "${tgt}"
NAME "${f}"
DIRNAME ${PROJECT_NAME}/data/tigge
NOCHECK)
# Add to list of targets
LIST(APPEND tgts "${tgt}")
endforeach()
add_custom_target( get_tigge_gribs DEPENDS ${tgts} )
ecbuild_get_test_multidata( TARGET get_tigge_gribs
NOCHECK
NAMES ${tigge_files_to_download}
)

View File

@ -88,6 +88,7 @@ foreach( test ${tests} )
TYPE SCRIPT
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
RESOURCES include.sh
TEST_DEPENDS get_gribs get_bufrs
)
endforeach()

View File

@ -67,6 +67,7 @@ foreach( tool ${tests} )
CONDITION EC_HAVE_FORTRAN
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${tool}.sh
RESOURCES include.sh
TEST_DEPENDS get_gribs get_bufrs
)
endforeach()

View File

@ -57,5 +57,6 @@ foreach( test ${tests} )
CONDITION HAVE_PYTHON
RESOURCES include.sh ${test}.py
ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE}
TEST_DEPENDS get_gribs get_tigge_gribs get_bufrs
)
endforeach()

View File

@ -76,15 +76,15 @@ list( APPEND tests
unit_tests
)
# Note: making the test dependent on the grib files (with DEPENDS)
# means they will be downloaded at "make" time
# rather than when you do "make test". Use TEST_DEPENDS instead
foreach( test ${tests} )
# Note: making the test dependent on the grib data files
# means they will be downloaded at "make" time
# rather than when you do "make test"
ecbuild_add_test( TARGET t_${test}
TYPE SCRIPT
DEPENDS get_gribs get_tigge_gribs get_bufrs
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
RESOURCES include.sh number_compare.pl
TEST_DEPENDS get_gribs get_tigge_gribs get_bufrs
)
endforeach()
@ -94,6 +94,7 @@ ecbuild_add_test( TARGET t_lamb_az_eq_area
TYPE SCRIPT
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lamb_az_eq_area.sh
RESOURCES include.sh lamb_az_eq_area.ref
TEST_DEPENDS get_gribs
)
# These ones are conditional
@ -102,6 +103,7 @@ ecbuild_add_test( TARGET t_grib_to_netcdf
CONDITION HAVE_NETCDF
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh
RESOURCES include.sh
TEST_DEPENDS get_gribs
)
ecbuild_add_test( TARGET t_jpeg
@ -109,6 +111,7 @@ ecbuild_add_test( TARGET t_jpeg
CONDITION HAVE_JPEG
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jpeg.sh
RESOURCES include.sh
TEST_DEPENDS get_gribs
)
ecbuild_add_test( TARGET t_ccsds
@ -116,5 +119,6 @@ ecbuild_add_test( TARGET t_ccsds
CONDITION HAVE_AEC
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ccsds.sh
RESOURCES include.sh
TEST_DEPENDS get_gribs
)