#------------------------------------------------------------
# GIFTI C library
#------------------------------------------------------------

OPTION(USE_GIFTI "Build the project using GIFTI IO support" OFF)
MARK_AS_ADVANCED(USE_GIFTI)

IF (USE_GIFTI)
    FIND_PACKAGE(EXPAT)
    FIND_PACKAGE(ZLIB)
    FIND_LIBRARY(NIFTI_LIBRARY niftiio)
    FIND_LIBRARY(GIFTI_LIBRARY giftiio)
    FIND_LIBRARY(ZNZ_LIBRARY znz)
    SET(NIFTI_LIBRARIES ${EXPAT_LIBRARIES} ${ZLIB_LIBRARIES} ${NIFTI_LIBRARY} ${ZNZ_LIBRARY} m)
    FIND_PATH(GIFTI_INCLUDE_PATH gifti_io.h PATHS /usr/include/gifti)
    INCLUDE_DIRECTORIES(${GIFTI_INCLUDE_PATH})
    FIND_PATH(NIFTI_INCLUDE_PATH nifti1_io.h PATHS /usr/include/nifti)
    INCLUDE_DIRECTORIES(${NIFTI_INCLUDE_PATH})
    SET(OPENMEEG_OTHER_INCLUDE_DIRECTORIES
        ${OPENMEEG_OTHER_INCLUDE_DIRECTORIES}
        ${GIFTI_INCLUDE_PATH}
        ${NIFTI_INCLUDE_PATH})
    SET(OPENMEEG_LIBRARIES 
        ${OPENMEEG_LIBRARIES} 
        ${GIFTI_LIBRARY} 
        ${NIFTI_LIBRARIES})
ENDIF()
