From 83b5bed5d437e8a09d1c94038b3ada966947c2b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 29 Feb 2016 15:47:35 -0500 Subject: [svn-r29231] Check if szip is enabled before attempting to run example with szip. --- java/examples/datasets/CMakeLists.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 2338325..077c6bb 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -83,6 +83,16 @@ MACRO (ADD_H5_TEST resultfile resultcode) ENDMACRO (ADD_H5_TEST file) if (BUILD_TESTING) + +# detect whether the encoder is present. + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) + foreach (example ${HDF_JAVA_EXAMPLES}) if (${example} STREQUAL "H5Ex_D_External") add_test ( @@ -116,6 +126,13 @@ if (BUILD_TESTING) ) set_tests_properties (JAVA_datasets-${example}-copy-objects PROPERTIES DEPENDS JAVA_datasets-${example}-clearall-objects) set (last_test "JAVA_datasets-${example}-copy-objects") - ADD_H5_TEST (${example} 0) + if (${example} STREQUAL "H5Ex_D_Szip") + if (USE_FILTER_SZIP) + ADD_H5_TEST (${example} 0) + endif (USE_FILTER_SZIP) + else (${example} STREQUAL "H5Ex_D_Szip") + ADD_H5_TEST (${example} 0) + endif (${example} STREQUAL "H5Ex_D_Szip") + endforeach (example ${HDF_JAVA_EXAMPLES}) endif (BUILD_TESTING) -- cgit v0.12