eccodes/examples/python/CMakeLists.txt

94 lines
2.7 KiB
CMake
Raw Normal View History

2014-04-01 08:54:03 +00:00
# examples/python/CMakeLists.txt
# Configure the file which all CMake tests will include
configure_file( include.ctest.sh.in include.ctest.sh @ONLY )
2015-07-02 12:02:54 +00:00
execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include.sh ${CMAKE_CURRENT_BINARY_DIR} )
2014-04-01 08:54:03 +00:00
# Build the executables used by test scripts
################################################
list( APPEND test_bins
grib_keys_iterator
grib_print_data
grib_iterator
grib_count_messages
2014-04-01 08:54:03 +00:00
)
2015-07-02 12:02:54 +00:00
2014-04-01 08:54:03 +00:00
foreach( tool ${test_bins} )
ecbuild_add_executable( TARGET p_${tool}
NOINSTALL
SOURCES ${tool}.c
CONDITION HAVE_PYTHON
2015-02-13 18:04:42 +00:00
LIBS eccodes
2014-04-01 08:54:03 +00:00
)
2014-07-10 11:49:35 +00:00
list( APPEND ptools p_${tool} )
2014-04-01 08:54:03 +00:00
endforeach()
2015-07-02 12:02:54 +00:00
2014-04-01 08:54:03 +00:00
# Now add each test
#################################################
list( APPEND tests
grib_clone
grib_count_messages
grib_get_message_offset
grib_get_keys
grib_index
grib_iterator
grib_keys_iterator
grib_multi_write
grib_nearest
grib_print_data
2016-08-25 17:25:36 +00:00
grib_samples
grib_set_keys
2016-08-25 17:25:36 +00:00
grib_set_missing
2014-04-01 08:54:03 +00:00
binary_message
grib_set_bitmap
bufr_attributes
2015-02-09 15:41:15 +00:00
bufr_clone
2016-10-18 16:59:04 +00:00
bufr_copy_data
2015-02-09 15:41:15 +00:00
bufr_expanded
bufr_get_keys
bufr_keys_iterator
bufr_read_header
bufr_read_scatterometer
2016-02-11 16:39:01 +00:00
bufr_read_tropical_cyclone
bufr_read_synop
bufr_read_temp
2015-02-09 15:41:15 +00:00
bufr_set_keys
bufr_subset
2015-03-12 18:04:42 +00:00
get_product_kind
gts_get_keys
2015-04-22 17:11:56 +00:00
metar_get_keys
2014-04-01 08:54:03 +00:00
)
2014-07-28 09:27:13 +00:00
foreach( test ${tests} )
2015-07-14 16:11:57 +00:00
ecbuild_add_test( TARGET eccodes_p_${test}_test
2015-08-25 10:22:19 +00:00
TYPE SCRIPT
DEPENDS ${ptools}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
CONDITION HAVE_PYTHON
ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE}
2016-03-29 10:16:29 +00:00
TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs eccodes_download_bufrs
2014-04-01 08:54:03 +00:00
)
endforeach()
2015-11-11 10:30:40 +00:00
# Add test which requires input CSV file
ecbuild_add_test( TARGET eccodes_p_bufr_encode_flight_test
TYPE SCRIPT
DEPENDS ${ptools}
2015-11-11 10:30:40 +00:00
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_encode_flight.sh
CONDITION HAVE_PYTHON
ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE}
RESOURCES flight_data.csv
2016-03-29 10:16:29 +00:00
TEST_DEPENDS eccodes_download_bufrs
)
2016-07-18 13:58:18 +00:00
# Conditional tests
ecbuild_add_test( TARGET eccodes_p_grib_ccsds_test
TYPE SCRIPT
DEPENDS ${ptools}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ccsds.sh
CONDITION HAVE_PYTHON AND HAVE_AEC
ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE}
TEST_DEPENDS eccodes_download_gribs
)