#-----------------------------------------------------------------------------
# HDF4 Config file for compiling against hdf4 install directory
#-----------------------------------------------------------------------------
GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${SELF_DIR}" PATH)
GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if (NOT WIN32)
  GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
endif (NOT WIN32)

#-----------------------------------------------------------------------------
# User Options
#-----------------------------------------------------------------------------
set (HDF4_ENABLE_PARALLEL @HDF4_ENABLE_PARALLEL@)
set (HDF4_BUILD_FORTRAN   @HDF4_BUILD_FORTRAN@)
set (HDF4_BUILD_XDR_LIB   @HDF4_BUILD_XDR_LIB@)
set (HDF4_BUILD_TOOLS     @HDF4_BUILD_TOOLS@)
set (HDF4_BUILD_UTILS     @HDF4_BUILD_UTILS@)
set (HDF4_ENABLE_JPEG_LIB_SUPPORT @HDF4_ENABLE_JPEG_LIB_SUPPORT@)
set (HDF4_ENABLE_Z_LIB_SUPPORT @HDF4_ENABLE_Z_LIB_SUPPORT@)
set (HDF4_ENABLE_SZIP_SUPPORT  @HDF4_ENABLE_SZIP_SUPPORT@)
set (HDF4_ENABLE_SZIP_ENCODING @HDF4_ENABLE_SZIP_ENCODING@)
set (HDF4_BUILD_SHARED_LIBS    @BUILD_SHARED_LIBS@)
set (HDF4_PACKAGE_EXTLIBS @HDF4_PACKAGE_EXTLIBS@)

#-----------------------------------------------------------------------------
# Directories
#-----------------------------------------------------------------------------
set (HDF4_INCLUDE_DIR "${_IMPORT_PREFIX}/include")

if (HDF4_BUILD_FORTRAN)
  set (HDF4_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include")
endif (HDF4_BUILD_FORTRAN)
  
if (HDF4_BUILD_XDR_LIB)
  set (HDF4_INCLUDE_DIR_XDR "${_IMPORT_PREFIX}/include")
endif (HDF4_BUILD_XDR_LIB)

if (HDF4_BUILD_TOOLS)
  set (HDF4_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include")
endif (HDF4_BUILD_TOOLS)

if (HDF4_BUILD_UTILS)
  set (HDF4_INCLUDE_DIR_UTILS "${_IMPORT_PREFIX}/include")
  set (HDF4_TOOLS_DIR "${_IMPORT_PREFIX}/bin" )
endif (HDF4_BUILD_UTILS)

#-----------------------------------------------------------------------------
# Version Strings
#-----------------------------------------------------------------------------
set (HDF4_VERSION_STRING @HDF4_VERSION_STRING@)
set (HDF4_VERSION_MAJOR  @HDF4_VERSION_MAJOR@)
set (HDF4_VERSION_MINOR  @HDF4_VERSION_MINOR@)

#-----------------------------------------------------------------------------
# Don't include targets if this file is being picked up by another
# project which has already built hdf4 as a subproject
#-----------------------------------------------------------------------------
if (NOT TARGET "@HDF4_PACKAGE@")
  if (HDF4_ENABLE_JPEG_LIB_SUPPORT AND HDF4_PACKAGE_EXTLIBS AND NOT TARGET "jpeg")
    include (${SELF_DIR}/../JPEG/@JPEG_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
  endif (HDF4_ENABLE_JPEG_LIB_SUPPORT AND HDF4_PACKAGE_EXTLIBS AND NOT TARGET "jpeg")
  if (HDF4_ENABLE_Z_LIB_SUPPORT AND HDF4_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
    include (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
  endif (HDF4_ENABLE_Z_LIB_SUPPORT AND HDF4_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
  if (HDF4_ENABLE_SZIP_SUPPORT AND HDF4_PACKAGE_EXTLIBS AND NOT TARGET "szip")
    include (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
  endif (HDF4_ENABLE_SZIP_SUPPORT AND HDF4_PACKAGE_EXTLIBS AND NOT TARGET "szip")
  include (${SELF_DIR}/@HDF4_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake)
  set (HDF4_LIBRARIES "@HDF4_LIBRARIES_TO_EXPORT@")
endif (NOT TARGET "@HDF4_PACKAGE@")
