Commit 561d7d34 authored by Rashad Kanavath's avatar Rashad Kanavath

COMP: enable HDF5 tests only if GDAL has its driver

parent b1b52480
......@@ -170,12 +170,17 @@ otb_add_test(NAME ioTuGDALImageIOCanRead_SPOT5TIF COMMAND otbIOGDALTestDriver ot
otb_add_test(NAME ioTuGDALImageIOCanRead_PCI COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
${INPUTDATA}/QB_Toulouse_Ortho_PAN.pix)
if (GDAL_HAS_HDF5)
otb_add_test(NAME ioTuGDALImageIOCanRead_COSMOSKYMED2 COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
LARGEINPUT{COSMOSKYMED/Toulouse_spotlight/CSKS3_SCS_B_S2_08_HH_RD_SF_20110418180325_20110418180332.h5})
otb_add_test(NAME ioTuGDALImageIOCanRead_COSMOSKYMED3 COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
LARGEINPUT{COSMOSKYMED/Toulouse_spotlight/CSKS2_GTC_B_S2_08_HH_RD_SF_20110417180326_20110417180333.h5})
otb_add_test(NAME ioTuGDALImageIOCanRead_COSMOSKYMED COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
LARGEINPUT{COSMOSKYMED/Toulouse_spotlight/CSKS3_GTC_B_S2_08_HH_RD_SF_20110418180325_20110418180332.h5})
endif()
otb_add_test(NAME ioTuGDALImageIOCanRead_WV2_PSH COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
LARGEINPUT{WORLDVIEW2/ROME/WV-2_standard_pansharpened_natural_color_8bit/052298834010_01_P001_PSH/09DEC10103019-S2AS-052298834010_01_P001.TIF} )
......@@ -188,8 +193,6 @@ otb_add_test(NAME ioTuGDALImageIOCanRead_QUICK_XS COMMAND otbIOGDALTestDriver ot
otb_add_test(NAME ioTuGDALImageIOCanRead_IKONOS_NIR COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
LARGEINPUT{IKONOS/PARIS/po_79039_nir_0000000.tif})
otb_add_test(NAME ioTuGDALImageIOCanRead_COSMOSKYMED COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
LARGEINPUT{COSMOSKYMED/Toulouse_spotlight/CSKS3_GTC_B_S2_08_HH_RD_SF_20110418180325_20110418180332.h5})
otb_add_test(NAME ioTuGDALImageIOCanRead_PDS COMMAND otbIOGDALTestDriver otbGDALImageIOTestCanRead
${INPUTDATA}/pdsImage.img )
......
......@@ -36,7 +36,7 @@ if(GDAL_CONFIG_CHECKING)
try_run(GDAL_HAS_J2K_JG2000 COMPILE_RESULT_FORMATS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/gdalFormatsTest.cxx CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}" ARGS JPEG2000 )
try_run(GDAL_HAS_JPEG COMPILE_RESULT_FORMATS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/gdalFormatsTest.cxx CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}" ARGS JPEG )
try_run(GDAL_HAS_GTIF COMPILE_RESULT_FORMATS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/gdalFormatsTest.cxx CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}" ARGS GTiff )
try_run(GDAL_HAS_HDF5 COMPILE_RESULT_FORMATS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/gdalFormatsTest.cxx CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}" ARGS HDF5 )
# Can create geotiff file
if (GDAL_HAS_GTIF)
......@@ -114,7 +114,10 @@ if(GDAL_CONFIG_CHECKING)
endif()
if (NOT GDAL_HAS_HDF5)
message(STATUS "GDAL doesn't have HDF5 drivers. (HDF5 tests will be deactivated)")
endif()
if (NOT COMPILE_RESULT_CREATE)
message(WARNING "Modules/ThirdParty/GDAL/gdalCreateTest.cxx did not compile.")
set(COMPILE_ERRORS TRUE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment