# PCRaster Raster Format library is available at
# https://sourceforge.net/projects/pcraster/
#
# This module defines the following variables:
#  PCRASTER_RASTER_FORMAT_FOUND
#  PCRASTER_RASTER_FORMAT_INCLUDE_DIRS
#  PCRASTER_RASTER_FORMAT_LIBRARIES

# TODO Support PCRASTER_RASTER_FORMAT_ROOT CMake variable. Root of
#      location where raster format is installed.

FIND_PATH(PCRASTER_RASTER_FORMAT_INCLUDE_DIRS
    NAMES csf.h
)


FIND_LIBRARY(PCRASTER_RASTER_FORMAT_LIBRARIES
    NAMES pcraster_raster_format
)
IF(WIN32)
    FIND_LIBRARY(PCRASTER_RASTER_FORMAT_DEBUG_LIBRARY
        NAMES pcraster_raster_formatd
    )
    SET(PCRASTER_RASTER_FORMAT_LIBRARIES
        optimized ${PCRASTER_RASTER_FORMAT_LIBRARIES}
        debug ${PCRASTER_RASTER_FORMAT_DEBUG_LIBRARY}
    )
ENDIF()


INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRASTER_RASTER_FORMAT
    REQUIRED_VARS
        PCRASTER_RASTER_FORMAT_LIBRARIES
        PCRASTER_RASTER_FORMAT_INCLUDE_DIRS
)


MARK_AS_ADVANCED(
    PCRASTER_RASTER_FORMAT_LIBRARIES
    PCRASTER_RASTER_FORMAT_INCLUDE_DIRS
)
