diff --git a/examples/C/grib_set_missing.sh b/examples/C/grib_set_missing.sh index 1be3f5a8f..baef5d073 100755 --- a/examples/C/grib_set_missing.sh +++ b/examples/C/grib_set_missing.sh @@ -15,9 +15,11 @@ tempGrib="out_surface_level.grib2" ${examples_dir}/c_grib_set_missing # Check the keys have been set to MISSING -sf=`${tools_dir}/grib_get -p scaleFactorOfFirstFixedSurface $tempGrib` -[ "$sf" = "MISSING" ] -sf=`${tools_dir}/grib_get -p scaledValueOfFirstFixedSurface $tempGrib` -[ "$sf" = "MISSING" ] +if [ -f "${tools_dir}/grib_get" ]; then + sf=`${tools_dir}/grib_get -p scaleFactorOfFirstFixedSurface $tempGrib` + [ "$sf" = "MISSING" ] + sf=`${tools_dir}/grib_get -p scaledValueOfFirstFixedSurface $tempGrib` + [ "$sf" = "MISSING" ] +fi rm -f $tempGrib diff --git a/examples/F90/CMakeLists.txt b/examples/F90/CMakeLists.txt index 5734358db..11087151c 100644 --- a/examples/F90/CMakeLists.txt +++ b/examples/F90/CMakeLists.txt @@ -123,7 +123,7 @@ ecbuild_add_test( TARGET eccodes_f_grib_set_packing SOURCES grib_set_packing.f90 LINKER_LANGUAGE Fortran LIBS eccodes_f90 eccodes - CONDITION HAVE_AEC AND HAVE_FORTRAN + CONDITION HAVE_BUILD_TOOLS AND HAVE_AEC AND HAVE_FORTRAN COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_set_packing.sh ) # Executables without a shell script