From d1886a552438b8f6ebdd1256ea3d6b36b518bd86 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 22 Nov 2013 15:45:53 -0700 Subject: [PATCH] =?UTF-8?q?CMake:=20Added=20option=20to=20run=20HDF4=20fil?= =?UTF-8?q?e=20tests,=20as=20well=20as=20a=20check=20for=20=E2=80=98wget?= =?UTF-8?q?=E2=80=99;=20without=20wget,=20these=20tests=20cannot=20be=20ru?= =?UTF-8?q?n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d6435b57..85a88f895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,22 +454,18 @@ IF (ENABLE_HDF4) FIND_LIBRARY(HDF4_DF_LIB NAMES df libdf) IF(NOT HDF4_DF_LIB) - MESSAGE(FATAL_ERROR "HDF4 Support enabled, but cannot find df lib.") + MESSAGE(FATAL_ERROR "Can't find or link to the hdf4 df library.") ENDIF() FIND_LIBRARY(HDF4_MFHDF_LIB NAMES mfhdf libmfhdf) IF(NOT HDF4_MFHDF_LIB) - MESSAGE(FATAL_ERROR "HDF4 Support enabled, but cannot find mfhdf lib.") + MESSAGE(FATAL_ERROR "Can't find or link to the hdf4 mfhdf library.") ENDIF() SET(HDF4_LIBRARIES ${HDF4_MFHDF_LIB} ${HDF4_DF_LIB}) # End include files, libraries. MESSAGE(STATUS "HDF4 libraries: ${HDF4_DF_LIB}, ${HDF4_MFHDF_LIB}") - OPTION(ENABLE_HDF4_FILE_TESTS "Run HDF4 File Tests." OFF) - IF(ENABLE_HDF4_FILE_TESTS) - SET(USE_HDF4_FILE_TESTS ON) - ENDIF() - + MESSAGE(STATUS "Seeking HDF4 jpeg dependency.") # Look for the jpeglib.h header file. @@ -488,7 +484,20 @@ IF (ENABLE_HDF4) SET(HDF4_LIBRARIES ${JPEG_LIB} ${HDF4_LIBRARIES}) MESSAGE(STATUS "Found JPEG libraries: ${JPEG_LIB}") -ENDIF () + # Option to enable HDF4 file tests. + OPTION(ENABLE_HDF4_FILE_TESTS "Run HDF4 file tests. This fetches sample HDF4 files from the Unidata ftp site to test with (requires wget)." ON) + IF(ENABLE_HDF4_FILE_TESTS) + FIND_PROGRAM(PROG_WGET NAMES wget) + IF(PROG_WGET) + SET(USE_HDF4_FILE_TESTS ON) + ELSE() + MESSAGE(STATUS "Unable to locate 'wget'. Disabling hdf4 file tests.") + SET(USE_HDF4_FILE_TESTS OFF) + ENDIF() + + ENDIF() + + ENDIF () # Option to Build DLL IF(WIN32)